From 86ea9f12e27ce48f99154b151c3663eae8ee4c4c Mon Sep 17 00:00:00 2001 From: matthieu Date: Wed, 16 Sep 2015 19:10:19 +0000 Subject: [PATCH] Update to xserver 1.17.2. tested by dcoppa@, jsg@, jasper@ & naddy@ --- xserver/COPYING | 24 + xserver/ChangeLog | 8991 ++++++++++++++++- xserver/Makefile.in | 5 +- xserver/TODO | 68 + xserver/Xext/Makefile.in | 1 + xserver/Xext/dpms.c | 10 +- xserver/Xext/dpmsstubs.c | 10 +- xserver/Xext/panoramiX.c | 2 +- xserver/Xext/panoramiX.h | 2 +- xserver/Xext/panoramiXprocs.c | 16 +- xserver/Xext/saver.c | 16 +- xserver/Xext/security.c | 5 +- xserver/Xext/shm.c | 16 +- xserver/Xext/sync.c | 2 +- xserver/Xext/syncsrv.h | 8 +- xserver/Xext/xres.c | 12 +- xserver/Xext/xvdisp.c | 106 +- xserver/Xext/xvdix.h | 45 +- xserver/Xext/xvmain.c | 164 +- xserver/Xi/Makefile.in | 1 + xserver/Xi/exevents.c | 5 +- xserver/composite/Makefile.in | 1 + xserver/composite/compalloc.c | 8 +- xserver/composite/compext.c | 7 +- xserver/composite/compinit.c | 25 +- xserver/composite/compint.h | 3 +- xserver/composite/compoverlay.c | 4 +- xserver/composite/compwindow.c | 7 +- xserver/config/Makefile.in | 1 + xserver/config/config.c | 161 +- xserver/config/udev.c | 17 +- xserver/configure | 295 +- xserver/configure.ac | 103 +- xserver/damageext/Makefile.in | 1 + xserver/dbe/Makefile.in | 1 + xserver/dbe/dbe.c | 16 +- xserver/dbe/dbestruct.h | 12 +- xserver/dbe/midbe.c | 14 +- xserver/dbe/midbe.h | 8 +- xserver/devbook.am | 10 +- xserver/dix/Makefile.in | 1 + xserver/dix/atom.c | 8 +- xserver/dix/colormap.c | 34 +- xserver/dix/cursor.c | 8 +- xserver/dix/devices.c | 64 +- xserver/dix/dispatch.c | 72 +- xserver/dix/dispatch.h | 2 +- xserver/dix/dixfonts.c | 6 +- xserver/dix/dixutils.c | 12 +- xserver/dix/events.c | 1 + xserver/dix/extension.c | 10 +- xserver/dix/gc.c | 25 +- xserver/dix/getevents.c | 28 +- xserver/dix/globals.c | 8 +- xserver/dix/glyphcurs.c | 8 +- xserver/dix/grabs.c | 16 +- xserver/dix/inpututils.c | 2 + xserver/dix/main.c | 10 +- xserver/dix/pixmap.c | 18 +- xserver/dix/property.c | 8 +- xserver/dix/protocol.txt | 30 - xserver/dix/region.c | 22 +- xserver/dix/registry.c | 96 +- xserver/dix/resource.c | 18 +- xserver/dix/selection.c | 10 +- xserver/dix/swaprep.c | 8 +- xserver/dix/swapreq.c | 8 +- xserver/dix/tables.c | 8 +- xserver/dix/window.c | 111 +- xserver/doc/Makefile.am | 2 +- xserver/doc/Makefile.in | 12 +- xserver/doc/Xserver-spec.xml | 6 +- xserver/doc/dtrace/Makefile.in | 1 + xserver/doc/filter-xmlto.sh | 21 + xserver/dri3/Makefile.in | 1 + xserver/dri3/dri3.c | 10 + xserver/dri3/dri3.h | 2 - xserver/exa/Makefile.in | 1 + xserver/exa/exa.c | 2 +- xserver/exa/exa.h | 8 +- xserver/exa/exa_accel.c | 20 +- xserver/exa/exa_glyphs.c | 8 +- xserver/exa/exa_priv.h | 19 +- xserver/exa/exa_render.c | 4 +- xserver/exa/exa_unaccel.c | 11 +- xserver/fb/Makefile.am | 2 - xserver/fb/Makefile.in | 43 +- xserver/fb/fb.h | 342 +- xserver/fb/fb24_32.c | 2 +- xserver/fb/fb24_32.h | 2 +- xserver/fb/fbbits.c | 12 - xserver/fb/fbblt.c | 271 +- xserver/fb/fbbltone.c | 320 +- xserver/fb/fbcopy.c | 2 +- xserver/fb/fbfill.c | 84 +- xserver/fb/fbfillrect.c | 2 +- xserver/fb/fbgc.c | 85 +- xserver/fb/fbglyph.c | 10 +- xserver/fb/fbline.c | 4 +- xserver/fb/fboverlay.c | 7 +- xserver/fb/fboverlay.h | 6 +- xserver/fb/fbpict.c | 18 +- xserver/fb/fbpict.h | 4 - xserver/fb/fbpixmap.c | 6 +- xserver/fb/fbpoint.c | 2 +- xserver/fb/fbpush.c | 4 +- xserver/fb/fbrop.h | 12 +- xserver/fb/fbscreen.c | 4 +- xserver/fb/fbseg.c | 22 +- xserver/fb/fbstipple.c | 264 - xserver/fb/fbtile.c | 163 - xserver/fb/fbutil.c | 308 - xserver/fb/fbwindow.c | 4 +- xserver/fb/wfbrename.h | 25 +- xserver/glamor/Makefile.am | 16 +- xserver/glamor/Makefile.in | 55 +- xserver/glamor/glamor.c | 161 +- xserver/glamor/glamor.h | 27 +- xserver/glamor/glamor_copy.c | 747 ++ xserver/glamor/glamor_copyarea.c | 626 -- xserver/glamor/glamor_copyplane.c | 75 - xserver/glamor/glamor_copywindow.c | 56 - xserver/glamor/glamor_core.c | 204 +- xserver/glamor/glamor_dash.c | 370 + xserver/glamor/glamor_egl.c | 96 +- xserver/glamor/glamor_egl_stubs.c | 2 +- xserver/glamor/glamor_eglmodule.c | 1 - xserver/glamor/glamor_fbo.c | 8 +- xserver/glamor/glamor_fill.c | 356 - xserver/glamor/glamor_font.c | 8 +- xserver/glamor/glamor_glyphblt.c | 154 +- xserver/glamor/glamor_glyphs.c | 96 +- xserver/glamor/glamor_gradient.c | 19 +- xserver/glamor/glamor_largepixmap.c | 118 +- xserver/glamor/glamor_lines.c | 187 + xserver/glamor/glamor_picture.c | 20 +- xserver/glamor/glamor_pixmap.c | 572 +- xserver/glamor/glamor_points.c | 3 - xserver/glamor/glamor_polylines.c | 136 - xserver/glamor/glamor_prepare.c | 271 + .../{glamor_segment.c => glamor_prepare.h} | 42 +- xserver/glamor/glamor_priv.h | 328 +- xserver/glamor/glamor_program.c | 59 +- xserver/glamor/glamor_program.h | 6 + xserver/glamor/glamor_render.c | 99 +- xserver/glamor/glamor_segs.c | 188 + xserver/glamor/glamor_spans.c | 5 +- xserver/glamor/glamor_sync.c | 119 + xserver/glamor/glamor_text.c | 6 - xserver/glamor/glamor_tile.c | 293 - xserver/glamor/glamor_transfer.c | 105 +- xserver/glamor/glamor_transform.c | 74 +- xserver/glamor/glamor_trapezoid.c | 1720 +--- xserver/glamor/glamor_utils.c | 79 + xserver/glamor/glamor_utils.h | 218 +- xserver/glamor/glamor_xv.c | 311 +- xserver/glx/Makefile.in | 1 + xserver/glx/glxbyteorder.h | 8 +- xserver/glx/glxcmds.c | 103 +- xserver/glx/glxdri2.c | 6 +- xserver/glx/glxdriswrast.c | 2 +- xserver/glx/glxext.c | 8 +- xserver/glx/glxext.h | 1 - xserver/glx/glxscreens.c | 2 +- xserver/glx/glxscreens.h | 2 +- xserver/glx/indirect_dispatch.c | 6 +- xserver/glx/indirect_dispatch.h | 6 +- xserver/glx/indirect_dispatch_swap.c | 6 +- xserver/glx/indirect_program.c | 6 +- xserver/glx/indirect_reqsize.c | 6 +- xserver/glx/indirect_reqsize.h | 6 +- xserver/glx/indirect_size.h | 6 +- xserver/glx/indirect_size_get.c | 6 +- xserver/glx/indirect_size_get.h | 6 +- xserver/glx/indirect_table.c | 6 +- xserver/glx/indirect_table.h | 6 +- xserver/glx/indirect_texture_compression.c | 6 +- xserver/glx/indirect_util.c | 8 +- xserver/glx/indirect_util.h | 6 +- xserver/glx/rensize.c | 4 +- xserver/hw/Makefile.in | 1 + xserver/hw/dmx/Makefile.in | 1 + xserver/hw/dmx/config/Canvas.c | 2 +- xserver/hw/dmx/config/Makefile.in | 1 + xserver/hw/dmx/config/dmxprint.c | 2 +- xserver/hw/dmx/config/man/Makefile.in | 1 + xserver/hw/dmx/dmxgc.c | 12 +- xserver/hw/dmx/dmxgcops.c | 8 +- xserver/hw/dmx/dmxpict.h | 2 +- xserver/hw/dmx/dmxwindow.c | 4 +- xserver/hw/dmx/dmxwindow.h | 3 +- xserver/hw/dmx/doc/Makefile.in | 10 +- xserver/hw/dmx/doxygen/Makefile.in | 1 + xserver/hw/dmx/examples/Makefile.in | 1 + xserver/hw/dmx/glxProxy/Makefile.in | 1 + xserver/hw/dmx/glxProxy/glxcmds.c | 16 +- xserver/hw/dmx/glxProxy/glxsingle.c | 4 +- xserver/hw/dmx/glxProxy/glxvendor.c | 4 +- xserver/hw/dmx/input/ChkNotMaskEv.c | 2 +- xserver/hw/dmx/input/Makefile.in | 1 + xserver/hw/dmx/input/lnx-keyboard.c | 20 +- xserver/hw/dmx/input/lnx-ms.c | 2 +- xserver/hw/dmx/man/Makefile.in | 1 + xserver/hw/kdrive/Makefile.in | 1 + xserver/hw/kdrive/ephyr/Makefile.am | 6 + xserver/hw/kdrive/ephyr/Makefile.in | 22 +- xserver/hw/kdrive/ephyr/ephyr.c | 56 +- xserver/hw/kdrive/ephyr/ephyr.h | 23 +- xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c | 24 +- xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c | 161 + xserver/hw/kdrive/ephyr/ephyrcursor.c | 262 + xserver/hw/kdrive/ephyr/ephyrdri.c | 4 +- xserver/hw/kdrive/ephyr/ephyrdri.h | 4 +- xserver/hw/kdrive/ephyr/ephyrdriext.c | 4 +- xserver/hw/kdrive/ephyr/ephyrdriext.h | 4 +- xserver/hw/kdrive/ephyr/ephyrglxext.c | 4 +- xserver/hw/kdrive/ephyr/ephyrglxext.h | 4 +- xserver/hw/kdrive/ephyr/ephyrhostglx.c | 4 +- xserver/hw/kdrive/ephyr/ephyrhostglx.h | 4 +- xserver/hw/kdrive/ephyr/ephyrinit.c | 133 +- xserver/hw/kdrive/ephyr/ephyrlog.h | 4 +- xserver/hw/kdrive/ephyr/ephyrvideo.c | 38 +- xserver/hw/kdrive/ephyr/hostx.c | 275 +- xserver/hw/kdrive/ephyr/hostx.h | 20 +- xserver/hw/kdrive/ephyr/man/Makefile.in | 1 + xserver/hw/kdrive/ephyr/man/Xephyr.man | 3 + xserver/hw/kdrive/ephyr/os.c | 4 +- xserver/hw/kdrive/fake/Makefile.am | 1 + xserver/hw/kdrive/fake/Makefile.in | 2 + xserver/hw/kdrive/fbdev/Makefile.am | 1 + xserver/hw/kdrive/fbdev/Makefile.in | 2 + xserver/hw/kdrive/linux/Makefile.in | 1 + xserver/hw/kdrive/src/Makefile.in | 1 + xserver/hw/kdrive/src/kdrive.c | 31 +- xserver/hw/kdrive/src/kdrive.h | 16 +- xserver/hw/kdrive/src/kxv.c | 359 +- xserver/hw/kdrive/src/kxv.h | 39 +- xserver/hw/vfb/InitOutput.c | 55 +- xserver/hw/vfb/Makefile.in | 1 + xserver/hw/vfb/man/Makefile.in | 1 + xserver/hw/xfree86/Makefile.am | 6 +- xserver/hw/xfree86/Makefile.in | 7 +- xserver/hw/xfree86/Xorg.sh.in | 4 +- xserver/hw/xfree86/common/Makefile.am | 4 + xserver/hw/xfree86/common/Makefile.in | 4 +- xserver/hw/xfree86/common/compiler.h | 671 +- xserver/hw/xfree86/common/xf86.h | 8 - xserver/hw/xfree86/common/xf86AutoConfig.c | 9 +- xserver/hw/xfree86/common/xf86Bus.c | 2 +- xserver/hw/xfree86/common/xf86Config.c | 69 +- xserver/hw/xfree86/common/xf86Configure.c | 5 +- xserver/hw/xfree86/common/xf86Cursor.c | 19 +- xserver/hw/xfree86/common/xf86Events.c | 8 +- xserver/hw/xfree86/common/xf86Globals.c | 1 - xserver/hw/xfree86/common/xf86Init.c | 25 +- xserver/hw/xfree86/common/xf86Mode.c | 8 +- xserver/hw/xfree86/common/xf86Module.h | 4 +- xserver/hw/xfree86/common/xf86PciInfo.h | 2 +- xserver/hw/xfree86/common/xf86Privstr.h | 8 - xserver/hw/xfree86/common/xf86RandR.c | 32 - .../hw/xfree86/common/xf86VGAarbiterPriv.h | 10 +- xserver/hw/xfree86/common/xf86Xinput.c | 16 +- xserver/hw/xfree86/common/xf86Xinput.h | 7 +- xserver/hw/xfree86/common/xf86cmap.c | 48 +- xserver/hw/xfree86/common/xf86fbman.c | 6 +- xserver/hw/xfree86/common/xf86pciBus.c | 39 - xserver/hw/xfree86/common/xf86platformBus.c | 85 +- xserver/hw/xfree86/common/xf86platformBus.h | 104 +- xserver/hw/xfree86/common/xf86str.h | 4 +- xserver/hw/xfree86/common/xf86vmode.c | 8 +- xserver/hw/xfree86/common/xf86xv.c | 302 +- xserver/hw/xfree86/common/xf86xv.h | 41 +- xserver/hw/xfree86/common/xf86xvmc.h | 10 +- xserver/hw/xfree86/common/xf86xvpriv.h | 2 +- xserver/hw/xfree86/ddc/Makefile.in | 1 + xserver/hw/xfree86/ddc/ddc.c | 68 +- xserver/hw/xfree86/ddc/edid.h | 8 +- xserver/hw/xfree86/ddc/print_edid.c | 2 +- xserver/hw/xfree86/ddc/xf86DDC.h | 11 +- xserver/hw/xfree86/dixmods/Makefile.in | 1 + xserver/hw/xfree86/dixmods/xkbKillSrv.c | 16 +- xserver/hw/xfree86/dixmods/xkbVT.c | 16 +- xserver/hw/xfree86/doc/Makefile.in | 10 +- xserver/hw/xfree86/doc/README.DRIcomp | 3 - xserver/hw/xfree86/doc/Registry | 1 - xserver/hw/xfree86/doc/ddxDesign.xml | 35 +- xserver/hw/xfree86/dri/Makefile.in | 1 + xserver/hw/xfree86/dri/dri.c | 81 +- xserver/hw/xfree86/dri/dri.h | 11 +- xserver/hw/xfree86/dri/sarea.h | 10 +- xserver/hw/xfree86/dri2/Makefile.am | 2 + xserver/hw/xfree86/dri2/Makefile.in | 196 +- xserver/hw/xfree86/dri2/dri2.c | 66 +- xserver/hw/xfree86/dri2/pci_ids/Makefile.am | 11 + xserver/hw/xfree86/dri2/pci_ids/Makefile.in | 645 ++ .../hw/xfree86/dri2/pci_ids/i810_pci_ids.h | 4 + .../hw/xfree86/dri2/pci_ids/i915_pci_ids.h | 15 + .../hw/xfree86/dri2/pci_ids/i965_pci_ids.h | 115 + .../xfree86/dri2/pci_ids/pci_id_driver_map.h | 80 + .../hw/xfree86/dri2/pci_ids/r200_pci_ids.h | 24 + .../hw/xfree86/dri2/pci_ids/r300_pci_ids.h | 227 + .../hw/xfree86/dri2/pci_ids/r600_pci_ids.h | 327 + .../hw/xfree86/dri2/pci_ids/radeon_pci_ids.h | 23 + .../xfree86/dri2/pci_ids/radeonsi_pci_ids.h | 157 + .../hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h | 1 + xserver/hw/xfree86/drivers/Makefile.am | 5 + xserver/hw/xfree86/drivers/Makefile.in | 824 ++ .../xfree86/drivers/modesetting/Makefile.am | 69 + .../xfree86/drivers/modesetting/Makefile.in | 935 ++ xserver/hw/xfree86/drivers/modesetting/dri2.c | 861 ++ .../hw/xfree86/drivers/modesetting/driver.c | 1251 +++ .../hw/xfree86/drivers/modesetting/driver.h | 137 + .../drivers/modesetting/drmmode_display.c | 1822 ++++ .../drivers/modesetting/drmmode_display.h | 174 + .../hw/xfree86/drivers/modesetting/dumb_bo.c | 138 + .../hw/xfree86/drivers/modesetting/dumb_bo.h | 45 + .../drivers/modesetting/modesetting.man | 57 + .../hw/xfree86/drivers/modesetting/present.c | 228 + .../hw/xfree86/drivers/modesetting/vblank.c | 402 + xserver/hw/xfree86/exa/Makefile.in | 1 + xserver/hw/xfree86/exa/man/Makefile.in | 1 + xserver/hw/xfree86/fbdevhw/Makefile.in | 1 + xserver/hw/xfree86/fbdevhw/fbdevhw.c | 2 +- xserver/hw/xfree86/fbdevhw/man/Makefile.in | 1 + xserver/hw/xfree86/glamor_egl/Makefile.am | 3 +- xserver/hw/xfree86/glamor_egl/Makefile.in | 15 +- .../hw/xfree86/glamor_egl/glamor_xf86_xv.c | 185 + xserver/hw/xfree86/i2c/Makefile.am | 36 +- xserver/hw/xfree86/i2c/Makefile.in | 242 +- xserver/hw/xfree86/i2c/bt829.c | 822 -- xserver/hw/xfree86/i2c/bt829.h | 103 - xserver/hw/xfree86/i2c/bt829_module.c | 20 - xserver/hw/xfree86/i2c/fi1236.c | 686 -- xserver/hw/xfree86/i2c/fi1236.h | 113 - xserver/hw/xfree86/i2c/fi1236_module.c | 24 - xserver/hw/xfree86/i2c/msp3430.c | 779 -- xserver/hw/xfree86/i2c/msp3430.h | 116 - xserver/hw/xfree86/i2c/msp3430_module.c | 24 - xserver/hw/xfree86/i2c/tda8425.c | 83 - xserver/hw/xfree86/i2c/tda8425.h | 44 - xserver/hw/xfree86/i2c/tda8425_module.c | 24 - xserver/hw/xfree86/i2c/tda9850.c | 136 - xserver/hw/xfree86/i2c/tda9850.h | 43 - xserver/hw/xfree86/i2c/tda9850_module.c | 24 - xserver/hw/xfree86/i2c/tda9885.c | 100 - xserver/hw/xfree86/i2c/tda9885.h | 63 - xserver/hw/xfree86/i2c/tda9885_module.c | 24 - xserver/hw/xfree86/i2c/uda1380.c | 196 - xserver/hw/xfree86/i2c/uda1380.h | 81 - xserver/hw/xfree86/i2c/uda1380_module.c | 24 - xserver/hw/xfree86/i2c/xf86i2c.c | 40 +- xserver/hw/xfree86/i2c/xf86i2c.h | 2 +- xserver/hw/xfree86/int10/Makefile.in | 1 + xserver/hw/xfree86/int10/generic.c | 52 +- xserver/hw/xfree86/loader/Makefile.in | 1 + xserver/hw/xfree86/loader/loader.c | 23 +- xserver/hw/xfree86/loader/loadmod.c | 164 +- xserver/hw/xfree86/man/Makefile.in | 1 + xserver/hw/xfree86/man/Xorg.wrap.man | 2 +- xserver/hw/xfree86/man/xorg.conf.man | 22 +- xserver/hw/xfree86/modes/Makefile.am | 1 - xserver/hw/xfree86/modes/Makefile.in | 12 +- xserver/hw/xfree86/modes/xf86Crtc.c | 4 +- xserver/hw/xfree86/modes/xf86Crtc.h | 12 +- xserver/hw/xfree86/modes/xf86DisplayIDModes.c | 444 - xserver/hw/xfree86/modes/xf86RandR12.c | 4 +- xserver/hw/xfree86/modes/xf86Rotate.c | 21 +- xserver/hw/xfree86/modes/xf86cvt.c | 4 +- xserver/hw/xfree86/modes/xf86gtf.c | 10 +- xserver/hw/xfree86/os-support/Makefile.in | 1 + xserver/hw/xfree86/os-support/bsd/Makefile.am | 4 +- xserver/hw/xfree86/os-support/bsd/Makefile.in | 26 +- .../hw/xfree86/os-support/bsd/alpha_video.c | 333 +- xserver/hw/xfree86/os-support/bsd/arm_video.c | 43 +- xserver/hw/xfree86/os-support/bsd/bsd_apm.c | 2 +- xserver/hw/xfree86/os-support/bsd/bsd_axp.c | 71 - xserver/hw/xfree86/os-support/bsd/bsd_bell.c | 20 +- xserver/hw/xfree86/os-support/bsd/bsd_ev56.c | 24 - xserver/hw/xfree86/os-support/bsd/bsd_init.c | 2 +- .../xfree86/os-support/bsd/bsd_kqueue_apm.c | 16 +- xserver/hw/xfree86/os-support/bsd/bsd_sbus.c | 7 +- .../hw/xfree86/os-support/bsd/i386_video.c | 563 +- xserver/hw/xfree86/os-support/bsd/ppc_video.c | 55 +- xserver/hw/xfree86/os-support/bsd/sgi_video.c | 36 - .../hw/xfree86/os-support/bsd/sparc64_video.c | 58 +- xserver/hw/xfree86/os-support/bus/Makefile.in | 1 + xserver/hw/xfree86/os-support/bus/xf86Pci.h | 21 - .../hw/xfree86/os-support/hurd/Makefile.am | 2 +- .../hw/xfree86/os-support/hurd/Makefile.in | 10 +- .../hw/xfree86/os-support/hurd/hurd_mmap.c | 94 - .../hw/xfree86/os-support/hurd/hurd_video.c | 69 +- .../hw/xfree86/os-support/linux/Makefile.am | 10 +- .../hw/xfree86/os-support/linux/Makefile.in | 51 +- .../hw/xfree86/os-support/linux/int10/linux.c | 19 +- xserver/hw/xfree86/os-support/linux/lnx_agp.c | 4 +- xserver/hw/xfree86/os-support/linux/lnx_axp.c | 103 - .../hw/xfree86/os-support/linux/lnx_ev56.c | 24 - .../hw/xfree86/os-support/linux/lnx_init.c | 6 +- .../hw/xfree86/os-support/linux/lnx_kmod.c | 2 +- .../xfree86/os-support/linux/lnx_platform.c | 52 +- .../hw/xfree86/os-support/linux/lnx_video.c | 688 -- .../xfree86/os-support/linux/systemd-logind.c | 19 +- .../hw/xfree86/os-support/misc/Makefile.in | 1 + .../hw/xfree86/os-support/misc/SlowBcopy.c | 8 +- .../hw/xfree86/os-support/shared/bios_mmap.c | 135 - .../xfree86/os-support/shared/ioperm_noop.c | 2 +- xserver/hw/xfree86/os-support/shared/sigio.c | 6 +- xserver/hw/xfree86/os-support/shared/vidmem.c | 205 - .../hw/xfree86/os-support/shared/xf86Axp.c | 60 - .../hw/xfree86/os-support/shared/xf86Axp.h | 33 - .../hw/xfree86/os-support/solaris/Makefile.in | 1 + .../hw/xfree86/os-support/solaris/sun_apm.c | 2 +- .../hw/xfree86/os-support/solaris/sun_init.c | 33 - .../hw/xfree86/os-support/solaris/sun_vid.c | 140 - .../hw/xfree86/os-support/stub/Makefile.am | 1 - .../hw/xfree86/os-support/stub/Makefile.in | 5 +- .../hw/xfree86/os-support/stub/stub_bios.c | 12 - xserver/hw/xfree86/os-support/xf86OSpriv.h | 13 - xserver/hw/xfree86/os-support/xf86_OSlib.h | 39 +- xserver/hw/xfree86/os-support/xf86_OSproc.h | 54 +- xserver/hw/xfree86/parser/Configint.h | 18 +- xserver/hw/xfree86/parser/DRI.c | 8 +- xserver/hw/xfree86/parser/Device.c | 26 +- xserver/hw/xfree86/parser/Files.c | 14 +- xserver/hw/xfree86/parser/Flags.c | 16 +- xserver/hw/xfree86/parser/Input.c | 16 +- xserver/hw/xfree86/parser/Layout.c | 16 +- xserver/hw/xfree86/parser/Makefile.in | 1 + xserver/hw/xfree86/parser/Module.c | 16 +- xserver/hw/xfree86/parser/Monitor.c | 18 +- xserver/hw/xfree86/parser/Pointer.c | 16 +- xserver/hw/xfree86/parser/Screen.c | 16 +- xserver/hw/xfree86/parser/Vendor.c | 16 +- xserver/hw/xfree86/parser/Video.c | 16 +- xserver/hw/xfree86/parser/read.c | 22 +- xserver/hw/xfree86/parser/scan.c | 36 +- xserver/hw/xfree86/parser/write.c | 14 +- xserver/hw/xfree86/parser/xf86Optrec.h | 18 +- xserver/hw/xfree86/parser/xf86Parser.h | 19 +- xserver/hw/xfree86/parser/xf86tokens.h | 19 +- xserver/hw/xfree86/ramdac/IBM.c | 4 +- xserver/hw/xfree86/ramdac/Makefile.in | 1 + xserver/hw/xfree86/ramdac/TI.c | 2 +- xserver/hw/xfree86/ramdac/xf86Cursor.c | 6 +- xserver/hw/xfree86/ramdac/xf86HWCurs.c | 2 +- xserver/hw/xfree86/ramdac/xf86RamDac.h | 4 +- xserver/hw/xfree86/ramdac/xf86RamDacCmap.c | 1 - xserver/hw/xfree86/sdksyms.sh | 28 +- xserver/hw/xfree86/shadowfb/Makefile.in | 1 + xserver/hw/xfree86/shadowfb/shadowfb.h | 2 +- xserver/hw/xfree86/utils/Makefile.in | 1 + xserver/hw/xfree86/utils/cvt/Makefile.in | 1 + xserver/hw/xfree86/utils/gtf/Makefile.in | 1 + xserver/hw/xfree86/utils/gtf/gtf.c | 26 +- xserver/hw/xfree86/utils/man/Makefile.in | 1 + xserver/hw/xfree86/vbe/Makefile.in | 1 + xserver/hw/xfree86/vbe/vbe.c | 4 +- xserver/hw/xfree86/vbe/vbe.h | 4 +- xserver/hw/xfree86/vgahw/Makefile.am | 2 - xserver/hw/xfree86/vgahw/Makefile.in | 2 +- xserver/hw/xfree86/vgahw/vgaCmap.c | 276 - xserver/hw/xfree86/vgahw/vgaHW.c | 8 +- xserver/hw/xfree86/vgahw/vgaHW.h | 2 +- xserver/hw/xfree86/x86emu/Makefile.in | 1 + xserver/hw/xfree86/x86emu/debug.c | 4 +- xserver/hw/xfree86/x86emu/ops.c | 22 +- xserver/hw/xfree86/x86emu/prim_ops.c | 70 +- xserver/hw/xfree86/x86emu/sys.c | 6 +- xserver/hw/xfree86/x86emu/x86emu/regs.h | 10 +- xserver/hw/xfree86/x86emu/x86emu/x86emui.h | 2 +- xserver/hw/xfree86/xorg-wrapper.c | 10 +- xserver/hw/xnest/Color.c | 2 +- xserver/hw/xnest/GC.c | 56 +- xserver/hw/xnest/Keyboard.c | 13 +- xserver/hw/xnest/Makefile.in | 1 + xserver/hw/xnest/Window.c | 4 +- xserver/hw/xnest/XNGC.h | 1 - xserver/hw/xnest/XNWindow.h | 3 +- xserver/hw/xnest/Xnest.h | 2 +- xserver/hw/xnest/man/Makefile.in | 1 + xserver/hw/xquartz/GL/Makefile.in | 1 + xserver/hw/xquartz/Makefile.in | 1 + xserver/hw/xquartz/bundle/Makefile.in | 1 + xserver/hw/xquartz/darwin.c | 8 +- xserver/hw/xquartz/darwinEvents.c | 4 +- xserver/hw/xquartz/mach-startup/Makefile.in | 1 + xserver/hw/xquartz/man/Makefile.in | 1 + xserver/hw/xquartz/pbproxy/Makefile.in | 1 + xserver/hw/xquartz/xpr/Makefile.in | 1 + xserver/hw/xquartz/xpr/dri.c | 72 - xserver/hw/xquartz/xpr/dri.h | 12 - xserver/hw/xwayland/Makefile.am | 2 +- xserver/hw/xwayland/Makefile.in | 6 +- xserver/hw/xwayland/xwayland-cursor.c | 26 + xserver/hw/xwayland/xwayland-glamor.c | 10 +- xserver/hw/xwayland/xwayland-input.c | 115 +- xserver/hw/xwayland/xwayland-output.c | 4 +- xserver/hw/xwayland/xwayland.c | 55 +- xserver/hw/xwayland/xwayland.h | 10 +- xserver/hw/xwin/InitInput.c | 3 +- xserver/hw/xwin/InitOutput.c | 58 +- xserver/hw/xwin/Makefile.am | 69 +- xserver/hw/xwin/Makefile.in | 123 +- xserver/hw/xwin/XWin.rc | 1 + xserver/hw/xwin/ddraw.h | 6 +- xserver/hw/xwin/glx/Makefile.in | 1 + xserver/hw/xwin/glx/gen_gl_wrappers.py | 109 +- xserver/hw/xwin/glx/glshim.c | 3 + xserver/hw/xwin/glx/glwindows.h | 5 + xserver/hw/xwin/glx/indirect.c | 19 +- xserver/hw/xwin/glx/winpriv.c | 2 +- xserver/hw/xwin/man/Makefile.in | 1 + xserver/hw/xwin/man/XWin.man | 10 +- xserver/hw/xwin/win.h | 186 +- xserver/hw/xwin/winSetAppUserModelID.c | 2 +- xserver/hw/xwin/winclip.c | 42 - xserver/hw/xwin/winclipboard.h | 126 - xserver/hw/xwin/winclipboard/Makefile.am | 25 + xserver/hw/xwin/winclipboard/Makefile.in | 1063 ++ xserver/hw/xwin/winclipboard/debug.c | 52 + .../textconv.c} | 18 +- .../thread.c} | 351 +- xserver/hw/xwin/winclipboard/winclipboard.h | 38 + .../wndproc.c} | 325 +- .../xevents.c} | 365 +- xserver/hw/xwin/winclipboard/xwinclip.c | 134 + xserver/hw/xwin/winclipboard/xwinclip.man | 64 + xserver/hw/xwin/winclipboardinit.c | 150 +- xserver/hw/xwin/winclipboardwrappers.c | 232 +- xserver/hw/xwin/wincmap.c | 2 +- xserver/hw/xwin/winconfig.c | 10 +- xserver/hw/xwin/winconfig.h | 1 - xserver/hw/xwin/wincreatewnd.c | 26 +- xserver/hw/xwin/wincursor.c | 10 +- xserver/hw/xwin/windialogs.c | 19 +- xserver/hw/xwin/windisplay.c | 64 + xserver/hw/xwin/windisplay.h | 34 + xserver/hw/xwin/winengine.c | 23 - xserver/hw/xwin/winfillsp.c | 842 -- xserver/hw/xwin/winfont.c | 82 - xserver/hw/xwin/wingc.c | 235 - xserver/hw/xwin/wingetsp.c | 171 - xserver/hw/xwin/winglobals.c | 13 - xserver/hw/xwin/winglobals.h | 4 +- xserver/hw/xwin/winlayouts.h | 2 +- xserver/hw/xwin/winmisc.c | 63 - xserver/hw/xwin/winmsg.h | 2 + xserver/hw/xwin/winmsgwindow.c | 5 +- xserver/hw/xwin/winmultiwindowicons.c | 4 +- xserver/hw/xwin/winmultiwindowshape.c | 2 +- xserver/hw/xwin/winmultiwindowwindow.c | 20 +- xserver/hw/xwin/winmultiwindowwm.c | 9 +- xserver/hw/xwin/winmultiwindowwndproc.c | 4 +- xserver/hw/xwin/winnativegdi.c | 491 - xserver/hw/xwin/winpfbdd.c | 620 -- xserver/hw/xwin/winpixmap.c | 223 - xserver/hw/xwin/winpolyline.c | 53 - xserver/hw/xwin/winprefs.c | 10 +- xserver/hw/xwin/winprefslex.l | 2 - xserver/hw/xwin/winprefsyacc.y | 11 +- xserver/hw/xwin/winprocarg.c | 41 +- xserver/hw/xwin/winresource.h | 1 + xserver/hw/xwin/winrop.c | 142 - xserver/hw/xwin/winscrinit.c | 143 +- xserver/hw/xwin/winsetsp.c | 175 - xserver/hw/xwin/winshaddd.c | 8 +- xserver/hw/xwin/winshadddnl.c | 10 +- xserver/hw/xwin/winshadgdi.c | 10 +- xserver/hw/xwin/wintrayicon.c | 19 + xserver/hw/xwin/winwin32rootlesswndproc.c | 2 +- xserver/hw/xwin/winwindow.c | 219 - xserver/hw/xwin/winwindowswm.c | 2 +- xserver/hw/xwin/winwndproc.c | 29 +- xserver/include/Makefile.in | 1 + xserver/include/callback.h | 18 +- xserver/include/closure.h | 8 +- xserver/include/colormap.h | 24 +- xserver/include/colormapst.h | 8 +- xserver/include/cursor.h | 12 +- xserver/include/cursorstr.h | 10 +- xserver/include/dbus-core.h | 2 +- xserver/include/dix-config.h.in | 28 +- xserver/include/dix.h | 83 +- xserver/include/dixfont.h | 10 +- xserver/include/dixgrabs.h | 4 +- xserver/include/do-not-use-config.h.in | 35 +- xserver/include/extension.h | 8 +- xserver/include/extnsionst.h | 10 +- xserver/include/gc.h | 12 +- xserver/include/gcstruct.h | 61 +- xserver/include/hotplug.h | 73 +- xserver/include/input.h | 21 +- xserver/include/inputstr.h | 14 +- xserver/include/list.h | 2 +- xserver/include/misc.h | 18 +- xserver/include/miscstruct.h | 8 +- xserver/include/os.h | 117 +- xserver/include/pixmap.h | 28 +- xserver/include/pixmapstr.h | 11 +- xserver/include/property.h | 42 +- xserver/include/propertyst.h | 10 +- xserver/include/region.h | 8 +- xserver/include/regionstr.h | 2 +- xserver/include/registry.h | 40 +- xserver/include/resource.h | 84 +- xserver/include/rgb.h | 8 +- xserver/include/screenint.h | 8 +- xserver/include/scrnintstr.h | 134 +- xserver/include/selection.h | 10 +- xserver/include/servermd.h | 341 +- xserver/include/site.h | 14 +- xserver/include/window.h | 28 +- xserver/include/windowstr.h | 11 +- xserver/include/xkbfile.h | 18 +- xserver/include/xkbsrv.h | 34 +- xserver/include/xkbstr.h | 24 +- xserver/include/xorg-config.h.in | 6 - xserver/include/xorg-server.h.in | 7 + xserver/include/xsha1.h | 2 +- xserver/man/Makefile.in | 1 + xserver/man/Xserver.man | 2 +- xserver/mi/Makefile.am | 11 +- xserver/mi/Makefile.in | 30 +- xserver/mi/mi.h | 149 +- xserver/mi/miarc.c | 255 +- xserver/mi/mibitblt.c | 48 +- xserver/mi/micmap.c | 44 - xserver/mi/micoord.h | 20 - xserver/mi/micopy.c | 8 +- xserver/mi/micursor.c | 68 - xserver/mi/midash.c | 9 +- xserver/mi/midispcur.c | 4 +- xserver/mi/miexpose.c | 127 +- xserver/mi/mifillarc.c | 154 +- xserver/mi/mifillarc.h | 9 - xserver/mi/mifillrct.c | 10 +- xserver/mi/mifpoly.h | 50 +- xserver/mi/mifpolycon.c | 249 - xserver/mi/migc.c | 45 +- xserver/mi/miglblt.c | 8 +- xserver/mi/miinitext.c | 8 +- xserver/mi/mioverlay.c | 72 +- xserver/mi/mipointer.c | 23 +- xserver/mi/mipoly.c | 627 +- xserver/mi/mipoly.h | 22 +- xserver/mi/mipolycon.c | 235 - xserver/mi/mipolygen.c | 213 - xserver/mi/mipolypnt.c | 8 +- xserver/mi/mipolyrect.c | 8 +- xserver/mi/mipolyseg.c | 10 +- xserver/mi/mipolytext.c | 8 +- xserver/mi/mipolyutil.c | 369 - xserver/mi/mipushpxl.c | 8 +- xserver/mi/miscrinit.c | 5 +- xserver/mi/mispans.c | 526 - xserver/mi/mispans.h | 87 - xserver/mi/misprite.c | 4 +- xserver/mi/mistruct.h | 8 +- xserver/mi/mivaltree.c | 72 +- xserver/mi/miwideline.c | 546 +- xserver/mi/miwideline.h | 26 - xserver/mi/miwindow.c | 63 +- xserver/mi/mizerarc.c | 2 +- xserver/mi/mizerclip.c | 8 +- xserver/mi/mizerline.c | 28 +- xserver/miext/Makefile.in | 1 + xserver/miext/damage/Makefile.in | 1 + xserver/miext/damage/damage.c | 2 +- xserver/miext/rootless/Makefile.in | 1 + xserver/miext/rootless/rootless.h | 2 +- xserver/miext/rootless/rootlessGC.c | 2 +- xserver/miext/rootless/rootlessValTree.c | 97 +- xserver/miext/rootless/rootlessWindow.c | 6 +- xserver/miext/shadow/Makefile.in | 1 + xserver/miext/shadow/shadow.c | 54 - xserver/miext/shadow/shadow.h | 6 - xserver/miext/shadow/shrotate.c | 2 +- xserver/miext/sync/Makefile.in | 1 + xserver/miext/sync/misyncfd.c | 4 +- xserver/os/Makefile.in | 1 + xserver/os/WaitFor.c | 18 +- xserver/os/access.c | 198 +- xserver/os/auth.c | 8 +- xserver/os/backtrace.c | 4 +- xserver/os/busfault.c | 2 +- xserver/os/connection.c | 27 +- xserver/os/io.c | 17 +- xserver/os/log.c | 47 +- xserver/os/oscolor.c | 1562 +-- xserver/os/osdep.h | 8 +- xserver/os/osinit.c | 20 +- xserver/os/utils.c | 57 +- xserver/os/xdmcp.c | 23 +- xserver/os/xsha1.c | 25 + xserver/present/Makefile.in | 1 + xserver/present/present.c | 55 +- xserver/present/present.h | 1 + xserver/present/present_event.c | 4 +- xserver/present/present_priv.h | 2 + xserver/present/present_screen.c | 1 + xserver/pseudoramiX/Makefile.in | 1 + xserver/randr/Makefile.in | 1 + xserver/randr/randrstr.h | 20 +- xserver/randr/rrcrtc.c | 6 +- xserver/randr/rroutput.c | 1 + xserver/randr/rrpointer.c | 11 +- xserver/randr/rrprovider.c | 2 +- xserver/randr/rrscreen.c | 2 - xserver/randr/rrtransform.c | 2 +- xserver/randr/rrtransform.h | 2 +- xserver/randr/rrxinerama.c | 2 +- xserver/record/Makefile.in | 1 + xserver/record/record.c | 20 +- xserver/render/Makefile.in | 1 + xserver/render/animcur.c | 2 +- xserver/render/glyph.c | 2 +- xserver/render/glyphstr.h | 2 +- xserver/render/mipict.c | 34 +- xserver/render/mipict.h | 2 +- xserver/render/mirect.c | 2 +- xserver/render/picture.c | 129 +- xserver/render/picture.h | 8 +- xserver/render/picturestr.h | 6 +- xserver/render/render.c | 4 +- xserver/test-driver | 15 +- xserver/test/Makefile.am | 5 +- xserver/test/Makefile.in | 57 +- xserver/test/list.c | 24 +- xserver/test/signal-logging.c | 7 +- xserver/test/xi1/Makefile.in | 1 + xserver/test/xi2/Makefile.in | 1 + xserver/test/xi2/protocol-common.c | 26 +- xserver/xfixes/Makefile.in | 1 + xserver/xfixes/cursor.c | 22 +- xserver/xfixes/region.c | 27 +- xserver/xkb/Makefile.in | 1 + xserver/xkb/XKBAlloc.c | 16 +- xserver/xkb/XKBGAlloc.c | 16 +- xserver/xkb/XKBMAlloc.c | 18 +- xserver/xkb/XKBMisc.c | 16 +- xserver/xkb/ddxBeep.c | 16 +- xserver/xkb/ddxCtrls.c | 16 +- xserver/xkb/ddxKillSrv.c | 16 +- xserver/xkb/ddxLEDs.c | 16 +- xserver/xkb/ddxLoad.c | 16 +- xserver/xkb/ddxVT.c | 16 +- xserver/xkb/maprules.c | 18 +- xserver/xkb/xkb.c | 18 +- xserver/xkb/xkbAccessX.c | 18 +- xserver/xkb/xkbActions.c | 16 +- xserver/xkb/xkbEvents.c | 25 +- xserver/xkb/xkbInit.c | 22 +- xserver/xkb/xkbLEDs.c | 44 +- xserver/xkb/xkbPrKeyEv.c | 16 +- xserver/xkb/xkbSwap.c | 16 +- xserver/xkb/xkbUtils.c | 16 +- xserver/xkb/xkbfmisc.c | 18 +- xserver/xkb/xkbgeom.h | 16 +- xserver/xkb/xkbout.c | 18 +- xserver/xkb/xkbtext.c | 18 +- xserver/xkb/xkmread.c | 18 +- 761 files changed, 30813 insertions(+), 28465 deletions(-) create mode 100644 xserver/TODO create mode 100644 xserver/doc/filter-xmlto.sh delete mode 100644 xserver/fb/fbstipple.c delete mode 100644 xserver/fb/fbtile.c create mode 100644 xserver/glamor/glamor_copy.c delete mode 100644 xserver/glamor/glamor_copyarea.c delete mode 100644 xserver/glamor/glamor_copyplane.c delete mode 100644 xserver/glamor/glamor_copywindow.c create mode 100644 xserver/glamor/glamor_dash.c delete mode 100644 xserver/glamor/glamor_fill.c create mode 100644 xserver/glamor/glamor_lines.c delete mode 100644 xserver/glamor/glamor_polylines.c create mode 100644 xserver/glamor/glamor_prepare.c rename xserver/glamor/{glamor_segment.c => glamor_prepare.h} (63%) create mode 100644 xserver/glamor/glamor_segs.c create mode 100644 xserver/glamor/glamor_sync.c delete mode 100644 xserver/glamor/glamor_tile.c create mode 100644 xserver/glamor/glamor_utils.c create mode 100644 xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c create mode 100644 xserver/hw/kdrive/ephyr/ephyrcursor.c create mode 100644 xserver/hw/xfree86/dri2/pci_ids/Makefile.am create mode 100644 xserver/hw/xfree86/dri2/pci_ids/Makefile.in create mode 100644 xserver/hw/xfree86/dri2/pci_ids/i810_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/r200_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/r300_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/r600_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h create mode 100644 xserver/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h create mode 100644 xserver/hw/xfree86/drivers/Makefile.am create mode 100644 xserver/hw/xfree86/drivers/Makefile.in create mode 100644 xserver/hw/xfree86/drivers/modesetting/Makefile.am create mode 100644 xserver/hw/xfree86/drivers/modesetting/Makefile.in create mode 100644 xserver/hw/xfree86/drivers/modesetting/dri2.c create mode 100644 xserver/hw/xfree86/drivers/modesetting/driver.c create mode 100644 xserver/hw/xfree86/drivers/modesetting/driver.h create mode 100644 xserver/hw/xfree86/drivers/modesetting/drmmode_display.c create mode 100644 xserver/hw/xfree86/drivers/modesetting/drmmode_display.h create mode 100644 xserver/hw/xfree86/drivers/modesetting/dumb_bo.c create mode 100644 xserver/hw/xfree86/drivers/modesetting/dumb_bo.h create mode 100644 xserver/hw/xfree86/drivers/modesetting/modesetting.man create mode 100644 xserver/hw/xfree86/drivers/modesetting/present.c create mode 100644 xserver/hw/xfree86/drivers/modesetting/vblank.c create mode 100644 xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c delete mode 100644 xserver/hw/xfree86/i2c/bt829.c delete mode 100644 xserver/hw/xfree86/i2c/bt829.h delete mode 100644 xserver/hw/xfree86/i2c/bt829_module.c delete mode 100644 xserver/hw/xfree86/i2c/fi1236.c delete mode 100644 xserver/hw/xfree86/i2c/fi1236.h delete mode 100644 xserver/hw/xfree86/i2c/fi1236_module.c delete mode 100644 xserver/hw/xfree86/i2c/msp3430.c delete mode 100644 xserver/hw/xfree86/i2c/msp3430.h delete mode 100644 xserver/hw/xfree86/i2c/msp3430_module.c delete mode 100644 xserver/hw/xfree86/i2c/tda8425.c delete mode 100644 xserver/hw/xfree86/i2c/tda8425.h delete mode 100644 xserver/hw/xfree86/i2c/tda8425_module.c delete mode 100644 xserver/hw/xfree86/i2c/tda9850.c delete mode 100644 xserver/hw/xfree86/i2c/tda9850.h delete mode 100644 xserver/hw/xfree86/i2c/tda9850_module.c delete mode 100644 xserver/hw/xfree86/i2c/tda9885.c delete mode 100644 xserver/hw/xfree86/i2c/tda9885.h delete mode 100644 xserver/hw/xfree86/i2c/tda9885_module.c delete mode 100644 xserver/hw/xfree86/i2c/uda1380.c delete mode 100644 xserver/hw/xfree86/i2c/uda1380.h delete mode 100644 xserver/hw/xfree86/i2c/uda1380_module.c delete mode 100644 xserver/hw/xfree86/modes/xf86DisplayIDModes.c delete mode 100644 xserver/hw/xfree86/os-support/bsd/bsd_axp.c delete mode 100644 xserver/hw/xfree86/os-support/hurd/hurd_mmap.c delete mode 100644 xserver/hw/xfree86/os-support/linux/lnx_axp.c delete mode 100644 xserver/hw/xfree86/os-support/shared/bios_mmap.c delete mode 100644 xserver/hw/xfree86/os-support/shared/xf86Axp.c delete mode 100644 xserver/hw/xfree86/os-support/shared/xf86Axp.h delete mode 100644 xserver/hw/xfree86/os-support/stub/stub_bios.c delete mode 100644 xserver/hw/xfree86/vgahw/vgaCmap.c delete mode 100644 xserver/hw/xwin/winclip.c delete mode 100644 xserver/hw/xwin/winclipboard.h create mode 100644 xserver/hw/xwin/winclipboard/Makefile.am create mode 100644 xserver/hw/xwin/winclipboard/Makefile.in create mode 100644 xserver/hw/xwin/winclipboard/debug.c rename xserver/hw/xwin/{winclipboardtextconv.c => winclipboard/textconv.c} (93%) rename xserver/hw/xwin/{winclipboardthread.c => winclipboard/thread.c} (56%) create mode 100644 xserver/hw/xwin/winclipboard/winclipboard.h rename xserver/hw/xwin/{winclipboardwndproc.c => winclipboard/wndproc.c} (65%) rename xserver/hw/xwin/{winclipboardxevents.c => winclipboard/xevents.c} (71%) create mode 100644 xserver/hw/xwin/winclipboard/xwinclip.c create mode 100644 xserver/hw/xwin/winclipboard/xwinclip.man create mode 100644 xserver/hw/xwin/windisplay.c create mode 100644 xserver/hw/xwin/windisplay.h delete mode 100644 xserver/hw/xwin/winfillsp.c delete mode 100644 xserver/hw/xwin/winfont.c delete mode 100644 xserver/hw/xwin/wingc.c delete mode 100644 xserver/hw/xwin/wingetsp.c delete mode 100644 xserver/hw/xwin/winnativegdi.c delete mode 100644 xserver/hw/xwin/winpfbdd.c delete mode 100644 xserver/hw/xwin/winpixmap.c delete mode 100644 xserver/hw/xwin/winpolyline.c delete mode 100644 xserver/hw/xwin/winrop.c delete mode 100644 xserver/hw/xwin/winsetsp.c delete mode 100644 xserver/mi/micursor.c delete mode 100644 xserver/mi/mifpolycon.c delete mode 100644 xserver/mi/mipolycon.c delete mode 100644 xserver/mi/mipolygen.c delete mode 100644 xserver/mi/mipolyutil.c delete mode 100644 xserver/mi/mispans.c delete mode 100644 xserver/mi/mispans.h diff --git a/xserver/COPYING b/xserver/COPYING index cc52a3282..abf13c2e3 100644 --- a/xserver/COPYING +++ b/xserver/COPYING @@ -8,6 +8,7 @@ possible, and insert their name to this list. Please sort by surname for people, and by the full name for other entities (e.g. Juliusz Chroboczek sorts before Intel Corporation sorts before Daniel Stone). +Copyright © 2011 Dave Airlie Copyright © 2000-2001 Juliusz Chroboczek Copyright © 1998 Egbert Eich Copyright © 2006-2007 Intel Corporation @@ -145,6 +146,29 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. +Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + +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, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Copyright © 1999-2000 SuSE, Inc. Copyright © 2007 Red Hat, Inc. diff --git a/xserver/ChangeLog b/xserver/ChangeLog index d625f18f3..7dcfb7cca 100644 --- a/xserver/ChangeLog +++ b/xserver/ChangeLog @@ -1,12 +1,982 @@ -commit ff76b219f6513b5ef63105165c301f7d69da0e05 -Author: Julien Cristau -Date: Wed Feb 11 00:33:17 2015 +0100 +commit 2123f7682d522619f101b05fb75efa75dabbe371 +Author: Adam Jackson +Date: Tue Jun 16 11:42:47 2015 -0400 - Bump to 1.16.4 + xserver 1.17.2 - Signed-off-by: Julien Cristau + Signed-off-by: Adam Jackson -commit 8f61533b16635a0a13f4048235246edb138fa40b +commit 8a5fb096d43577a061f7769d9257cbedaac998ef +Author: Dave Airlie +Date: Thu May 28 05:30:01 2015 +0000 + + glamor: don't do render ops with matching source/dest (v2) + + XRender defines this, GL really doesn't like it. + + kwin 4.x and qt 4.x seem to make this happen for the + gradient in the titlebar, and on radeonsi/r600 hw + this draws all kinds of wrong. + + v2: bump this up a level, and check it earlier. + (I assume the XXXX was for this case.) + + [This corresponds to fa12f2c150b2f50de9dac4a2b09265f13af353af in master, + fixed up for 1.17 branch. - ajax] + + Signed-off-by: Dave Airlie + +commit ea9e02184399e9979654544dde8926912a8aa2c8 +Author: Rui Matos +Date: Wed May 27 12:08:45 2015 +0200 + + xwayland: Throttle our cursor surface updates with a frame callback + + In some extreme cases with animated cursors at a high frame rate we + could end up filling the wl_display outgoing buffer and end up with + wl_display_flush() failing. + + In any case, using the frame callback to throttle ourselves is the + right thing to do. + + Signed-off-by: Rui Matos + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + (cherry picked from commit cbb7eb73b5399e31a7afb800363504d539df0ecf) + +commit 6cc61df989c7764097c9b21d71386e230fa13cd4 +Author: Chris Wilson +Date: Fri Feb 6 08:25:42 2015 +0000 + + present: Copy unflip contents back to the Screen Pixmap + + As we unflip after the flip Window no longer passes the pixel ownership + test for the full Screen Pixmap, we can no longer utilize that Window to + copy the contents back to the backing pixmap. To first flip means that + the Window was originally backed by the Screen Pixmap and wholly covered + the Pixmap, thus we need to copy the last frame contents to the Screen + Pixmap when the flip chain is complete. + + Signed-off-by: Chris Wilson + Reviewed-and-Tested-by: Michel Dänzer + (cherry picked from commit 806470b9f623089dc81b985f250f0c3a4e8edbe8) + +commit 8b7e1f362bf6940eb863fd02395bf8155d10604b +Author: Vicente Olivert Riera +Date: Mon Jan 12 17:10:02 2015 +0000 + + backtrace.c: Fix word cast to a pointer + + backtrace.c uses a word size provided by libunwind. In some + architectures like MIPS, libunwind makes that word size 64-bit for all + variants of the architecture. + + In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, + which fails in all MIPS variants with 32-bit pointers, like MIPS32 or + MIPS64 n32, because it's trying to do a cast from a 64-bit wide variable + to a 32-bit pointer: + + Making all in os + make[2]: Entering directory + `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' + CC WaitFor.lo + CC access.lo + CC auth.lo + CC backtrace.lo + backtrace.c: In function 'xorg_backtrace': + backtrace.c:90:20: error: cast to pointer from integer of different size + [-Werror=int-to-pointer-cast] + if (dladdr((void *)(pip.start_ip + off), &dlinfo) && + dlinfo.dli_fname && + ^ + backtrace.c:98:13: error: cast to pointer from integer of different size + [-Werror=int-to-pointer-cast] + (void *)(pip.start_ip + off)); + ^ + cc1: some warnings being treated as errors + make[2]: *** [backtrace.lo] Error 1 + make[2]: *** Waiting for unfinished jobs.... + + Making the cast to a pointer-sized integer, and then to a pointer fixes + the problem. + + Related: + https://bugs.freedesktop.org/show_bug.cgi?id=79939 + + Signed-off-by: Vicente Olivert Riera + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit baa50f60acd9e9f4293107435645ab072b6110e1) + +commit c424458c93cb36708c6074ecaf6566d6b5818c87 +Author: Ray Strode +Date: Tue May 5 16:43:44 2015 -0400 + + xwayland: default to local user if no xauth file given. [CVE-2015-3164 3/3] + + Right now if "-auth" isn't passed on the command line, we let + any user on the system connect to the Xwayland server. + + That's clearly suboptimal, given Xwayland is generally designed + to be used by one user at a time. + + This commit changes the behavior, so only the user who started the + X server can connect clients to it. + + Signed-off-by: Ray Strode + Reviewed-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + (cherry picked from commit 76636ac12f2d1dbdf7be08222f80e7505d53c451) + +commit 01b4f5bc89820cf8cbe01777871834411074d683 +Author: Ray Strode +Date: Tue May 5 16:43:43 2015 -0400 + + os: support new implicit local user access mode [CVE-2015-3164 2/3] + + If the X server is started without a '-auth' argument, then + it gets started wide open to all local users on the system. + + This isn't a great default access model, but changing it in + Xorg at this point would break backward compatibility. + + Xwayland, on the other hand is new, and much more targeted + in scope. It could, in theory, be changed to allow the much + more secure default of a "user who started X server can connect + clients to that server." + + This commit paves the way for that change, by adding a mechanism + for DDXs to opt-in to that behavior. They merely need to call + + LocalAccessScopeUser() + + in their init functions. + + A subsequent commit will add that call for Xwayland. + + Signed-off-by: Ray Strode + Reviewed-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + (cherry picked from commit 4b4b9086d02b80549981d205fb1f495edc373538) + +commit bebaaa2216026bd6b649a8123e67a7f5172b120f +Author: Ray Strode +Date: Tue May 5 16:43:42 2015 -0400 + + xwayland: Enable access control on open sockets [CVE-2015-3164 1/3] + + Xwayland currently allows wide-open access to the X sockets + it listens on, ignoring Xauth access control. + + This commit makes sure to enable access control on the sockets, + so one user can't snoop on another user's X-over-wayland + applications. + + Signed-off-by: Ray Strode + Reviewed-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + (cherry picked from commit c4534a38b68aa07fb82318040dc8154fb48a9588) + +commit 761be9cceb6f5a2ca883c940d6e1f277ce529ea8 +Author: Egbert Eich +Date: Tue May 12 09:52:48 2015 -0700 + + Xephyr: Fix broken image when endianess of client machine and host-Xserver differ + + The image is created in the native byte order of the machine Xephyr is + rendered on however drawn in the image byte order of the Xephyr server. + Correct byte order in the xcb_image_t structure and convert to native + before updating the window. + If depths of Xephyr and host server differ this is already taken care of + by the depth conversion routine. + It is a terrible wase to always convert and transmit the entire image + no matter of the size of the damaged area. One should probably use + sub-images here. For now we leave this as an exercise. + + Signed-off-by: Egbert Eich + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit 910ddf85219f114744e8996a4ac044c4eafc62ac) + +commit f775f247731d368c76d9bda3672fbdda7ba21223 +Author: Egbert Eich +Date: Tue Mar 31 09:14:28 2015 +0200 + + Xephyr: Fix screen image draw for the non-Glamor & non-XHSM case + + xcb_image_put() prints the entire image, therefore don't use an offset. + + Signed-off-by: Egbert Eich + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit c65eda5e6676d942e80eaf2650a670174c8bd84a) + +commit 6395873ea9a9ccc4ddb840e295a025a3cb931a62 +Author: Egbert Eich +Date: Tue Mar 31 09:14:27 2015 +0200 + + Xephyr: Fix compile when debugging is enabled + + Signed-off-by: Egbert Eich + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit 66212ca0d2f194fd16db65e863f0a2d613e180ea) + +commit 70ce5753071a71d8f7c7a11a2d91599251bdb845 +Author: Egbert Eich +Date: Tue Mar 31 09:14:26 2015 +0200 + + Xephyr: Print default server display number if none is specified + + Signed-off-by: Egbert Eich + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit b536d56aef21739b6da44693bbf19d0e7541392d) + +commit a4882ac7927b3efb0fd352cd0b7f5ceeebc1250a +Author: Egbert Eich +Date: Tue Mar 31 09:14:25 2015 +0200 + + Xephyr: Don't crash when no command line argument is specified + + The DDX specific command line parsing function only gets called + if command line arguments are present. Therefore this function + is not suitable to initialize mandatory global variables. + Replace main() instead. + + Signed-off-by: Egbert Eich + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit 5af73f490870da9265eeb9b3ce59a2be026be0c8) + +commit 0dc9da5ce94ba9fe47a992f99ff137dba4810118 +Author: Jonathan Gray +Date: Wed Apr 15 21:29:58 2015 +1000 + + glamor: fix build when DRI3 is not defined + + Signed-off-by: Jonathan Gray + Reviewed-by: Kenneth Graunke + Signed-off-by: Keith Packard + (cherry picked from commit 00f79416b19f0cde68291aced44ab07b9b76f7b8) + +commit 828a1e38030bde19ffc98ee655df5d590faf30dc +Author: Jonathan Gray +Date: Wed Apr 15 21:29:07 2015 +1000 + + glamor: remove const from the return type of glamor_get_drawable_location() + + Fixes a build error with gcc 4.2.1 on OpenBSD due to + -Werror=return-type from xorg-macros. + + error: type qualifiers ignored on function return type + + Signed-off-by: Jonathan Gray + Reviewed-by: Kenneth Graunke + Signed-off-by: Keith Packard + (cherry picked from commit 7c609c911a3a33b7e4ddad46b8fc42878a073ee7) + +commit 68eb9afb204790b586c96caa4e840a78f8bda8b6 +Author: Michel Dänzer +Date: Tue Mar 17 10:21:13 2015 +0900 + + modesetting: Include dix-config.h from dumb_bo.c + + Fixes mmap failures with 32-bit builds. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + (cherry picked from commit 145ae03814cb3b700b6fe1fd19f8fb15da84d1c8) + +commit 554cb404a5cf146316bff6757acfa693463d141e +Author: Michel Dänzer +Date: Tue Mar 17 10:21:12 2015 +0900 + + Add AC_SYS_LARGEFILE defines to dix-config.h + + Without this, AC_SYS_LARGEFILE doesn't actually have any effect. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + (cherry picked from commit 4962c8c08842d9d3ca66d254b1ce4cacc4fb3756) + +commit ae3aa32688e4818979c7c59e12286365825eab53 +Author: Adel Gadllah +Date: Fri May 1 17:43:41 2015 +0200 + + modesetting: Fix software cursor fallback + + The code in drmmode_set_cursor does not properly handle the case where + drmModeSetCursor2 returns any other error than EINVAL and silently fails to set + a cursor. + + So only return when the drmModeSetCursor2 succeeds (i.e returns 0) and disable + the cursor2 usage on EINVAL. + + References: https://bugzilla.redhat.com/show_bug.cgi?id=1205725 + Signed-off-by: Adel Gadllah + Reviewed-by: Michel Dänzer + Reviewed-by: Rob Clark + Signed-off-by: Keith Packard + (cherry picked from commit c3ce9d8fd404ca1d4697a104ce4899525dd43c51) + +commit d8a39245d6cff6accf5eaeae7a1ac15eb1eb048a +Author: Dima Ryazanov +Date: Wed Apr 29 22:39:18 2015 -0700 + + xwayland: Implement smooth scrolling + + We don't even need to simulate button clicks; it's done automatically. + This also fixes scrolling in Qt5 apps. + + Signed-off-by: Dima Ryazanov + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + (cherry picked from commit 81a51a6cace6fdb54999ccdf1533dc28a2222bb9) + +commit 5b23104d58eeb86e16282cdfb0553c2ffdaad169 +Author: Jason Gerecke +Date: Wed Apr 29 15:08:58 2015 +1000 + + dix: Do not allow device transform to be set on valuatorless devices + + If a device does not have any valuators, it makes no sense to set the + device transformation. Return a BadMatch error to let the caller know + that they're trying something stupid. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + (cherry picked from commit 9ff89a2e469ab0ac5af57d0fc115127feb1c0d99) + +commit 6f7a3366a24a351ee49185500410811099a5eb1c +Author: Rui Matos +Date: Sat Apr 25 21:19:25 2015 +0200 + + dix/events: Set currentTime to the given time stamp in NoticeTime + + The refactoring in commit efc1035ca958f2c9d266338a308518a0834b1773 + removed the actual update of currentTime. + + Signed-off-by: Rui Matos + Acked-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + (cherry picked from commit fa62ca68ef8be7f63cd0b899dfae3366ca9350cf) + +commit 1a87dbc2ce5e6f8a7d111ef22736360fe803ba0e +Author: Brent Collins +Date: Thu May 7 15:10:19 2015 -0400 + + shm: Fix xselinux resource initialization for xinerama pixmaps + + This is necessary to avoid a NULL pointer deference when the pixmap is + used later. + + [ajax: massaged commit message, fixed it to compile] + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89748 + Reviewed-by: Adam Jackson + Signed-off-by: Brent Collins + (cherry picked from commit 7470578520e90b6402b2509cd0c51fd4fd84849f) + +commit 4f3df05728dd1ace88013e83347cebb64be99c03 +Author: Chris Wilson +Date: Sat Feb 14 10:36:44 2015 +0000 + + shm: Fix use-after-free in ShmDestroyPixmap + + We pass the pPixmap->drawable.id to the ShmDetachSegment function after + the pPixmap is freed. Fortunately, we don't use the value inside + ShmDetachSegment and can simply pass zero instead. + + Signed-off-by: Chris Wilson + Reviewed-by: Michel Dänzer + (cherry picked from commit bcec9f867d19e954a46c2654a79782bff6c65fce) + +commit 40f35e448892e58780ff25f29df808aa68f60be3 +Author: Olivier Fourdan +Date: Fri Apr 10 10:07:38 2015 +0200 + + dix: Fix image byte order on big endian hardware + + Make sure X_BIG_ENDIAN/X_LITTLE_ENDIAN are defined before actually using + them. + + Otherwise, image byte order could be wrong on big endian hardware even + though endianess detection is correct. + + Reported-by: Tim Waugh + Signed-off-by: Olivier Fourdan + Reviewed-by: Adam Jackson + (cherry picked from commit 1af15aaf278edcf6f6de94774350e34a80883c24) + +commit 5497f56b8790e68c653ea4c7f36fcb4868a84b50 +Author: Jason Gerecke +Date: Thu Apr 30 18:06:14 2015 -0700 + + xfree86: Return NULL from xf86CompatOutput if no compat_output is defined + + If no compat_output is defined, we inadvertently (attempt to) return + whatever data is at index -1. Instead, return NULL since that's what + callers are expecting. + + Reviewed-by: Adam Jackson + Signed-off-by: Jason Gerecke + (cherry picked from commit 28159eff6badf6181b255f26d1f444abe81c05b7) + +commit 9e39ba30f145f61c333ccf9280577d3afedfb5fb +Author: Robert Ancell +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 + Reviewed-by: Daniel Stone + (cherry picked from commit cad831f39861435cb94f4c90a73f7f0b62d1a4a1) + +commit 953520ef98f98ab0ca2029d9047b0ac81ad8e096 +Author: Colin Harrison +Date: Fri Mar 20 14:25:53 2015 +0000 + + os/utils.c: Don't try to build os_move_fd() for WIN32 + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + (cherry picked from commit a9b4b7b79682dd367ce26c29aa5dc85807201851) + +commit cc88bb64adda0e967c5ea0efa34aca015fa9c346 +Author: Jon TURNEY +Date: Fri Mar 20 14:29:58 2015 +0000 + + hw/xnest: Fix build for MinGW + + Include the wrapped windows.h via X11/Xwindows.h before xcb_keysyms.h to avoid + type clashes caused by the unwrapped windows.h that includes. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit 2b114d6a516ee584ff89b96b12acf91799b6d677) + +commit 36bba39db1d4b5b47bc7db5724a4370a4bcb1ecd +Author: Jon TURNEY +Date: Wed Mar 18 13:29:22 2015 +0000 + + hw/xwin/winclipboard: Link xwinclip with -lpthread + + Link xwinclip with -lpthread to fix build for MinGW + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit 5bf3e5c8326fb81655827dbd4c527f1a2ba09511) + +commit 5ea517fd3991e9e7c4925e5fb5660fcc597e1898 +Author: Colin Harrison +Date: Fri Mar 20 14:06:49 2015 +0000 + + os/xdmcp.c: Include Xtrans.h when building for WIN32 + + Xtrans.h must be included on WIN32 to prototype _XSERVTransWSAStartup() + + xserver/os/xdmcp.c: In function ‘get_addr_by_name’: + xserver/os/xdmcp.c:1483:5: error: implicit declaration of function ‘_XSERVTransWSAStartup’ [-Werror=implicit-function-declaration] + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + (cherry picked from commit 8363ef2764fe9c6877d1cb21d3ce7b6cf869f00d) + +commit 2a2f676dcefbc26a9cc0c3323f62c82d92e48679 +Author: Alan Coopersmith +Date: Fri Apr 3 19:01:40 2015 -0700 + + Accept x86_64 as well as i*86 for $host_cpu in Solaris on x86 + + Needed when using a compiler that defaults to 64-bit output when + configure is checking for $host_cpu. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Thomas Klausner + (cherry picked from commit d4e85afac6578d5babc8bf97e00e85b00746fca9) + +commit 9b9d621f1158dc78bae3cb686c6a79db69f54425 +Author: Ray Strode +Date: Thu Apr 16 11:28:16 2015 -0400 + + systemd-logind: don't second guess D-Bus default timeout + + At the moment, the X server uses a non-default timeout for D-Bus + messages to systemd-logind. The only timeouts normally used with + D-Bus are: + + 1) Infinite + 2) Default + + Anything else is just as arbitrary as Default, and so rarely makes + sense to use instead of Default. + + Put another way, there's little reason to be fault tolerant against + a local root running daemon (logind), that in some configurations, the + X server already depends on for proper functionality. + + This commit changes systemd-logind to just use the default timeouts. + + Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347 + Signed-off-by: Ray Strode + Reviewed-by: Hans de Goede + Signed-off-by: Keith Packard + (cherry picked from commit b1029716e41e252f149b82124a149da180607c96) + +commit bb5a8da756b70ea6625a3f7ec6cf9b75a558bfb4 +Author: Ray Strode +Date: Thu Apr 16 11:28:15 2015 -0400 + + systemd-logind: filter out non-signal messages from message filter + + It's possible to receive a message reply in the message filter if a + previous message call timed out locally before the reply arrived. + + The message_filter function only handles signals, at the moment, and + does not properly handle message replies. + + This commit changes the message_filter function to filter out all + non-signal messages, including spurious message replies. + + Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347 + Signed-off-by: Ray Strode + Reviewed-by: Hans de Goede + Signed-off-by: Keith Packard + (cherry picked from commit 792e9251670ce94210df5c6d354059bbb97f4478) + +commit 2c818e7b5db92598962f50e42b8367d7724459fb +Author: Keith Packard +Date: Wed Apr 8 07:45:28 2015 -0700 + + mi: Partial pie-slice filled arcs may need more space for spans + + The mi filled arc code estimates that a filled arc will produce no + more spans than the arc is tall. This is true for most arcs except + for pie-slice arcs strictly between 180 and 360 degrees where the missing + portion of the arc faces up or down such that we get two spans on some + scanlines. + + For those, we need to reserve room for another height/2 spans. This + patch just does it for all partial pie-sliced arcs to make the test + easier to understand; it's just over-allocating a bit of memory, so + that's safe. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + (cherry picked from commit 41932dfbc841a1adc6512d41085ea3f8ebecb42c) + +commit 72b66d508acb1d5f0361b06f426ee6fc0d6ad575 +Author: Hans de Goede +Date: Wed Apr 8 14:07:52 2015 +0200 + + Re-enable non serverfd input devices immediately on vtenter + + Non serverfd input devices will never get a systemd-logind dbus resume signal, + causing them to never get re-enabled. + + This commit changes xf86VTEnter() to enable them immediately, fixing this. + + BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89756 + Signed-off-by: Hans de Goede + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + (cherry picked from commit 21e7d2bb5cd810688bb905b6ed092497ca8a2c59) + +commit 2ce54b81391d36856641c2691bcae8bd13daba4c +Author: Aaron Plattner +Date: Tue Dec 30 09:13:16 2014 -0800 + + xfree86: Add GPU screens even if there are no active GDevs + + xf86platformProbeDev creates GPU screens for any platform devices that were not + matched by a GDev in the loop above, but only if there was at least one device. + This means that it's impossible to configure a device as a GPU screen if there + is only one platform device that matches that driver. + + Instead, create a GPU screen (if possible) for any platform device that was not + claimed by the GDev loop. + + Signed-off-by: Aaron Plattner + Reviewed-by: Maarten Lankhorst + Acked-by: Alex Deucher + (cherry picked from commit e36236eade412dd3894f75f78a7b3d7c1037e6c3) + +commit 905126c66c45a150932a532de14a4a10595526dc +Author: Aaron Plattner +Date: Tue Dec 30 09:13:15 2014 -0800 + + xfree86: Fix xf86_check_platform_slot's handling of PCI + + If a PCI entity is found, xf86_check_platform_slot performs a device ID check + against the xf86_platform_device passed in. However, it just returns + immediately without checking the rest of the entities first. This leads to this + situation happening: + + 1. The nvidia driver creates an entity 0 with bus.type == BUS_PCI + 2. The intel driver creates entity 1 for its platform device, opening + /dev/dri/card0 + 3. xf86platformProbeDev calls probeSingleDevice on the Intel platform device, + which calls doPlatformProbe, which calls xf86_check_platform_slot. + 4. xf86_check_platform_slot compares the Intel platform device against the + NVIDIA PCI entity. Since they don't have the same device ID, it returns + TRUE. + 5. doPlatformProbe calls xf86ClaimPlatformSlot, which creates a duplicate entity + for the Intel one. + + Fix this by only returning FALSE if the PCI ID matches, and continuing the loop + otherwise. In the scenario above, this allows it to continue on to find the + Intel platform device that matches the second entity. + + Signed-off-by: Aaron Plattner + Reviewed-by: Maarten Lankhorst + Acked-by: Alex Deucher + (cherry picked from commit 4ecda362594d771f401de467c2d58c0f552227a8) + +commit d8153d1767ccb60a92693c390d12f1f157e24da9 +Author: Jon TURNEY +Date: Thu Feb 5 12:52:02 2015 +0000 + + glamor: Fix build when configured --enable-glamor --disable-xshmfence + + Signed-off-by: Jon TURNEY + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit 8102927282d5134493e5009a876a6b01a68d1f97) + +commit e0bb4a1ec7a720207831732230535fc8d86fc409 +Author: Olivier Fourdan +Date: Thu Feb 5 11:59:22 2015 +0100 + + glamor: check max native ALU instructions + + When using glamor (either in Xephyr or Xwayland) on hardware with too + low instructions limit, glamor fallbacks to sw due to large shaders. + + This makes glamor unbearably slow on such hardware. + + Check reported value for GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB + and fail in glamor_init() if the limit is lower than 128. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88316 + Signed-off-by: Olivier Fourdan + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit 4218a1e066cf39bb980ebbc9f69536c85232da5c) + +commit 9d4c8ff6736e737a98586e29d02c0afadbd35b5f +Author: Maarten Lankhorst +Date: Mon Jan 19 12:37:55 2015 +0100 + + glamor: GL_TEXTURE_MAX_LEVEL is not available on GLES2 + + Remove the calls to GL_TEXTURE_MAX_LEVEL. Setting the filtering is + a sufficient hint to the driver about texture mipmap allocation. + + Signed-off-by: Maarten Lankhorst + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + Reviewed-by: Ian Romanick + (cherry picked from commit 0e1372e1bd8f79fa295738bc1e983cb3648ba4be) + +commit 3bfeccf88a3e9904bd52aa98e39c35f75320d163 +Author: Maarten Lankhorst +Date: Mon Jan 12 15:29:34 2015 +0100 + + glamor: Use GL_FRAMEBUFFER instead of GL_READ_FRAMEBUFFER + + The latter might not be available on GLES2. + + Signed-off-by: Maarten Lankhorst + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit c1f35c3d862f77cbd2fb871be5613fb0ca7e508b) + +commit 6a37a33e4cbd0d971c30cda3ada6fc13e8414196 +Author: Maarten Lankhorst +Date: Mon Jan 19 12:36:52 2015 +0100 + + glamor: do not check for gl errors in glamor_build_program + + According to Eric Anholt the check for glGetError is not needed here. + Because a opengl error might be set before this function is called + keeping the check could result in glamor_build_program returning + failure when building the shader succeeded. + + Signed-off-by: Maarten Lankhorst + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit b66501b4fd9c392e0f971ea356b27eb71c9c9e79) + +commit 1ec335ca157b1ca73306950e90ee85a93a791229 +Author: Maarten Lankhorst +Date: Mon Jan 19 12:32:54 2015 +0100 + + glamor: only use (un)pack_subimage when available + + Check for GL_EXT_unpack_subimage and GL_NV_pack_subimage to + check if GL_(UN)PACK_ROW_LENGTH is available. Set the offsets + manually to prevent calls to GL_(UN)PACK_SKIP_*. + + v2: Check support for GL_NV_pack_subimage as suggested by Matt Turner. + + Signed-off-by: Maarten Lankhorst + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit 7c6f483670770e4e534cafd4e70d0b1490f4cca6) + +commit 5df6982a14442e029948b704f5f6d96913e43aae +Author: Olivier Fourdan +Date: Wed Jan 28 16:08:26 2015 +0100 + + xwayland: Add dependency on glamor libs + + So that Xwayland gets re-linked each time glamor is modified. + + Signed-off-by: Olivier Fourdan + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + (cherry picked from commit 4f534c26c64cc1edd33b04d30e4df818b7ae55d9) + +commit e2bddc36af1b848974b67964b4fe4deaa79b786c +Author: Olivier Fourdan +Date: Mon Feb 2 10:41:06 2015 +0100 + + ephyr: Fail if glamor is requested but not usable + + Signed-off-by: Olivier Fourdan + Signed-off-by: Eric Anholt + Reviewed-by: Ian Romanick + Reviewed-by: Eric Anholt + (cherry picked from commit 251a067993658fd02f158fef36476f898c238e3c) + +commit e2c6135179ef0fa1b9db33f2d78e138fae233b56 +Author: Emil Velikov +Date: Thu Mar 19 12:40:06 2015 +0000 + + randr: use randr: prefix in ErrorF() + + To provide some information about the origin of the message. + + Cc: Dave Airlie + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + (cherry picked from commit 93ef0e580e9cdbe739046a0873971d402525ef00) + +commit 8c3a0a1904386b4630726d6be7e6dc56a50c7aa7 +Author: Emil Velikov +Date: Thu Mar 19 12:36:50 2015 +0000 + + randr: remove chatty error messages + + All of these seem like left over from developments stage. Remove them as + they can cause excessive flood in the logs. + + Cc: Dave Airlie + Signed-off-by: Emil Velikov + Reviewed-by: Alex Deucher + (cherry picked from commit a08ee773983c44ebb893f10a1dcfa443f2734277) + +commit 660b4469f2947a1511248468d095a327f251795d +Author: Jon TURNEY +Date: Thu Jun 28 14:22:07 2012 +0100 + + hw/xwin: Report Cygwin version information in log + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit b2aaf69e62f4109ffb8aaf39e9bd2571abb29dfb) + +commit c3db722ffebfa20b3cedf1a29201442bc4b8b92f +Author: Jon TURNEY +Date: Mon Mar 16 16:29:29 2015 +0000 + + hw/xwin/glx: Improve code generator to deal with latest Khronos OpenGL registry XML + + Improve the parsing of the XML element + + Include all text from the param element, in the order it appears in the xml + document, as part of the formal parameter declaration + + This is needed to correctly handle the XML description added in svn r27498 of + glPathGlyphIndexRangeNV()'s baseAndCount parameter of type GLuint[2] + + This fixes the way the parameter declaration is generated so it is in the + correct form 'GLuint baseAndCount_[2]' and not 'GLuint baseAndCount[2]_' + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit d02f9611c8d3bafca4be17c65efca3c5527f71e2) + +commit 6fa7510e6af8a06bf58a5a5195ab42b2d1f4aba0 +Author: Jon TURNEY +Date: Mon Mar 16 16:14:10 2015 +0000 + + hw/xwin/glx: Refactor parsing of the XML element + + Factor out duplicated code used in parsing of the XML element in the + code generator + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit 5071cb7e0ac5f17c48ed7f3f3b6f242dec802f66) + +commit 1de38b588ecbc1a78f41a56e00ddda0e76828f77 +Author: Jon TURNEY +Date: Thu Feb 5 20:29:48 2015 +0000 + + os: Teach vpnprintf() how to handle "%*.*s" + + XdmcpFatal uses the format specifier %*.*s, which vpnprintf() doesn't + understand, which causes a backtrace and prevents the reason for the XDMCP + failure being logged. + + See also: + https://bugs.freedesktop.org/show_bug.cgi?id=66862 + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758574 + + "%*.*s" is also currently used in a few other places, so teach vpnprintf() how + to handle it + + $ fgrep -r "%*.*s" * + hw/dmx/config/scanner.l: fprintf(stderr, "parse error on line %d at token \"%*.*s\"\n", + hw/dmx/dmxlog.c: ErrorF("(%s) dmx[i%d/%*.*s]: ", type, + hw/dmx/input/dmxinputinit.c: dmxLogCont(dmxInfo, "\t[i%d/%*.*s", + os/access.c: ErrorF("Xserver: siAddrMatch(): type = %s, value = %*.*s -- %s\n", + os/access.c: ("Xserver: siCheckAddr(): type = %s, value = %*.*s, len = %d -- %s\n", + os/xdmcp.c: FatalError("XDMCP fatal error: %s %*.*s\n", type, + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + (cherry picked from commit d3080d421bf0d91daea2e39bfc391c43d7fdad75) + +commit 44930264eb200ea5cf43b9827e637b736b236f92 +Author: Jon TURNEY +Date: Tue Feb 10 14:37:26 2015 +0000 + + os: XDMCP options like -query etc. should imply -listen tcp + + In X server 1.17, the default configuration is now -nolisten tcp. In this + configuration, XDMCP options don't work usefully, as the X server is not + listening on the port for the display that it tells the display manager to + connect to. + + Signed-off-by: Jon TURNEY + Reviewed-by: Alan Coopersmith + Reviewed-by: Colin Harrison + (cherry picked from commit 491cf02e191e70c5ce24c19da880bb79bebfc03c) + +commit 74ab42c85b783443e67edc510307785de653a81c +Author: Jon TURNEY +Date: Wed Feb 4 17:04:45 2015 +0000 + + ephyr: Avoid a segfault with 'DISPLAY= Xephy -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 + Reviewed-by: Daniel Martin + Reviewed-by: Colin Harrison + (cherry picked from commit f42520c5f151bda25e52ae8b0408a421c3fba7e5) + +commit dee92c7805e0cc646feb9b7e57451848ce48be37 +Author: Jürg Billeter +Date: Sat Feb 7 18:13:21 2015 +0100 + + int10: Fix error check for pci_device_map_legacy + + pci_device_map_legacy returns 0 on success. + + Signed-off-by: Jürg Billeter + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + (cherry picked from commit 0a78b599b34cc8b5fe6fe82f90e90234e8ab7a56) + +commit 19da4355ee975c714f0f11d31c8b41c3fdabd913 +Author: Alan Coopersmith +Date: Mon Mar 9 09:55:57 2015 -0700 + + Clear ListenTransConns entries in CloseWellKnownConnections + + Since _XSERVTransClose frees the connection pointer passed to it, + remove that pointer from the array, so we don't try to double free it + if we come back into CloseWellKnownConnections again. + + Should fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=6665 in which + the shutdown section of the main() loop called CloseWellKnownConnections() + and then moved on to ddxGiveUp(), which failed to release the VT and thus + called AbortServer(), which called CloseWellKnownConnections() again. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + (cherry picked from commit 7ea64fb4374504bd3d524fc08c90efdab9f253ea) + +commit a4132357c26b2140162f73d42d0b196be60373ef +Author: Michal Srb +Date: Thu Feb 19 14:57:27 2015 +0200 + + Expose GetMaster to modules. + + Add _X_EXPORT to GetMaster function. It is required by tigervnc's VNC module. + + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 5c4202ea85aaea2a4dc7eb29776357a2ba13e191) + +commit 650a1fd274f191e77a2e8b4cb7dac67b6ff596c6 +Author: Dave Airlie +Date: Tue Feb 17 14:40:27 2015 +1000 + + os/access: fix regression in server interpreted auth + + This was reported on irc on Fedora when rawhide went to 1.17.1. + + regression occured in: 2566835b4374edb3e5a8353d4f7c9e7ec4851c57 + os: Eliminate uninitialized value warnings from access.c + + siAddrMatch doesn't need addr to be a useful value, it checks + some things like localuser without having an address at all. + + Signed-off-by: Dave Airlie + Tested-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 9d9bd38fe1454590c303dc936ddac913808bf881) + +commit 7a45d1684f626f3045305328c3aab85eed0673ea +Author: Egbert Eich +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 + Tested-by: Daniel Stone + Signed-off-by: Peter Hutterer + (cherry picked from commit 21b896939c5bb242f3aacc37baf12379e43254b6) + +commit 3b0d1ba2266d2780bfc111bab74885b90458eca4 +Author: Keith Packard +Date: Tue Feb 10 14:43:34 2015 -0800 + + Release 1.17.1 + + Signed-off-by: Keith Packard + +commit f160e722672dbb2b5215870b47bcc51461d96ff1 Author: Olivier Fourdan Date: Fri Jan 16 08:44:45 2015 +0100 @@ -19,10 +989,8 @@ Date: Fri Jan 16 08:44:45 2015 +0100 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer (cherry picked from commit 20079c36cf7d377938ca5478447d8b9045cb7d43) - (cherry picked from commit f160e722672dbb2b5215870b47bcc51461d96ff1) - Signed-off-by: Julien Cristau -commit 747cea16c4de1f48e838e1388301a2e24a3da6c4 +commit 29be310c303914090298ddda93a5bd5d00a94945 Author: Olivier Fourdan Date: Fri Jan 16 20:08:59 2015 +0100 @@ -45,55 +1013,16 @@ Date: Fri Jan 16 20:08:59 2015 +0100 Signed-off-by: Olivier Fourdan Signed-off-by: Peter Hutterer (cherry picked from commit 81c90dc8f0aae3b65730409b1b615b5fa7280ebd) - (cherry picked from commit 29be310c303914090298ddda93a5bd5d00a94945) - Signed-off-by: Julien Cristau -commit 0722a8043c89e7224c398eef270611cc65c1e219 -Author: Chris Wilson -Date: Sat Jan 17 10:09:54 2015 +0000 +commit 28f6427aec1f5a1982e1c01eff45af0d401bf659 +Author: Keith Packard +Date: Mon Feb 2 07:41:06 2015 +0100 - dri2: SourceOffloads may be for DRI3 only + Update to version 1.17.0 - As a DDX may declare offload support without supporting DRI2 - (because it is using an alternative acceleration mechanism like DRI3), - when iterating the list of offload_source Screens to find a matching - DRI2 provider we need to check before assuming it is DRI2 capable. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514 - Signed-off-by: Chris Wilson - Reviewed-by: Dave Airlie Signed-off-by: Keith Packard - (cherry picked from commit 082931014811e587a9734cbf4d88fd948979b641) -commit f7e3478fe7817457017f31eb51803c4d03c69249 -Author: Adam Jackson -Date: Mon Jan 5 16:48:11 2015 -0500 - - dix: make RegionInit legal C++ - - The CVE fix in: - - commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb - Author: Alan Coopersmith - Date: Wed Jan 22 22:37:15 2014 -0800 - - dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4] - - offended the C++ demons: - - ../../include/regionstr.h:147:45: error: invalid conversion from 'void*' to - 'pixman_region16_data_t* {aka pixman_region16_data*}' [-fpermissive] - - Normally this isn't a problem, because around here we have the sense and - common decency to not use C++, but this does make tigervnc fail to build, - which is a little rude of us. - - Signed-off-by: Adam Jackson - Reviewed-by: Alan Coopersmith - Signed-off-by: Keith Packard - (cherry picked from commit bb23fbf5bb278113c9c481875423b4d128180972) - -commit 645ae07fac78dd2444fd744d3bf9b27e27d06e41 +commit 697b696e5e24d0679f133183a3bb0852025377c2 Author: Dave Airlie Date: Fri Jan 30 09:59:49 2015 +1000 @@ -110,9 +1039,8 @@ Date: Fri Jan 30 09:59:49 2015 +1000 Tested-by: Jonathan Dieter Signed-off-by: Dave Airlie Signed-off-by: Keith Packard - (cherry picked from commit 697b696e5e24d0679f133183a3bb0852025377c2) -commit cdcf9e95108853e5ea2ed825a25e8f3b4d527535 +commit df1b401f57ad4b4925bad66684445b476562f26f Author: Dave Airlie Date: Wed Jan 7 09:19:27 2015 +1000 @@ -134,9 +1062,27 @@ Date: Wed Jan 7 09:19:27 2015 +1000 Signed-off-by: Dave Airlie Reviewed-by: Aaron Plattner Signed-off-by: Keith Packard - (cherry picked from commit df1b401f57ad4b4925bad66684445b476562f26f) -commit 5c4da5634505556c8249ba6da0adee9fb2621096 +commit 62fcd364ac8c71a2db1db84b17b17cade6832492 +Author: Adel Gadllah +Date: Sat Jan 3 21:12:25 2015 +0100 + + dri2: Set vdpau driver name if ddx does not provide any driver name + + Currently when the ddx does not set any driver name we set DRI2 driver but + not the VDPAU driver name. The result is that VDPAU drivers will not get found + by libvdpau when the modesetting driver is being used. + + Just assume that the VDPAU driver matches the DRI2 driver name, this is true + for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported + by mesa. + + Signed-off-by: Adel Gadllah + Reviewed-by: Alex Deucher + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit fe4c774c572e3f55a7417f0ca336ae1479a966ad Author: Nikhil Mahale Date: Sat Jan 24 17:06:59 2015 -0800 @@ -170,9 +1116,355 @@ Date: Sat Jan 24 17:06:59 2015 -0800 Reviewed-by: Aaron Plattner Signed-off-by: Aaron Plattner Signed-off-by: Keith Packard - (cherry picked from commit fe4c774c572e3f55a7417f0ca336ae1479a966ad) -commit f39ac527baab8a38d023e3a8416757ccfcead42a +commit 58f28b0427f0a0c0c445f314bd42721ca8e1e844 +Author: Keith Packard +Date: Fri Jan 23 10:59:39 2015 -0800 + + Update to version 1.16.99.902 + + Signed-off-by: Keith Packard + +commit fef2f6357b40b238ae01c4c80b0d29b17b839686 +Author: Jason Ekstrand +Date: Tue Jan 13 15:08:38 2015 -0800 + + modesetting: Return the crtc for a drawable even if it's rotated + + All of our checks for what crtc we are on take rotation into account so we + select the correct crtc. The only problem is that we weren't returning it + we were rotated. This caused X to think DRI3 apps were not on any crtc and + limit them to 1 FPS. + + Signed-off-by: Jason Ekstrand + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 3dcd591fa9b71a3dce58d612ca5970209d8386eb +Author: Jason Ekstrand +Date: Tue Jan 13 15:08:37 2015 -0800 + + modesetting: Add support for using RandR shadow buffers + + This replaces the stubs for shadow buffer creation/allocation with actual + functions and adds a shadow_destroy function. With this, we actually get + shadow buffers and RandR now works properly. Most of this is copied from + the xf86-video-intel driver and modified for modesetting. + + v2 Jason Ekstrand : + - Fix build with --disable-glamor + - Set the pixel data pointer in the pixmap header for dumb shadow bo's + - Call drmmode_create_bo with the right bpp + + v2 Jason Ekstrand : + - Make shadow buffers per-crtc and leave shadow_enable alone + + Signed-off-by: Jason Ekstrand + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 7c656bfcae1d68aeffd5e202b3c1569885f5d13d +Author: Jason Ekstrand +Date: Tue Jan 13 15:08:36 2015 -0800 + + modesetting: Add drmmode_bo_has_bo and drmmode_bo_map helper function + + Signed-off-by: Jason Ekstrand + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit b4703a5a6e529b78810db8d8782317f0b4e2f265 +Author: Jason Ekstrand +Date: Tue Jan 13 15:08:35 2015 -0800 + + modesetting: Refactor drmmode_glamor_new_screen_pixmap + + The original drmmode_glamor_new_screen_pixmap function was specific to the + primary screen pixmap. This commit pulls the guts out into a new, more + general, drmmode_set_pixmap_bo function for setting a buffer on a pixmap. + The new function also properly tears down the glamor bits if the buffer + being set is NULL. The drmmode_glamor_new_screen_pixmap function is now + just a 3-line wrapper around drmmode_set_pixmap_bo. + + v2 Jason Ekstrand : + - Re-arranged code in drmmode_set_pixmap_bo and + drmmode_glamor_handle_new_screen_pixmap so that glamor_set_screen_pixmap + only gets called for the screen pixmap + - Guard the call to glamor_set_screen_pixmapa with a drmmode->glamor check + + Signed-off-by: Jason Ekstrand + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit bb23fbf5bb278113c9c481875423b4d128180972 +Author: Adam Jackson +Date: Mon Jan 5 16:48:11 2015 -0500 + + dix: make RegionInit legal C++ + + The CVE fix in: + + commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb + Author: Alan Coopersmith + Date: Wed Jan 22 22:37:15 2014 -0800 + + dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4] + + offended the C++ demons: + + ../../include/regionstr.h:147:45: error: invalid conversion from 'void*' to + 'pixman_region16_data_t* {aka pixman_region16_data*}' [-fpermissive] + + Normally this isn't a problem, because around here we have the sense and + common decency to not use C++, but this does make tigervnc fail to build, + which is a little rude of us. + + Signed-off-by: Adam Jackson + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit 082931014811e587a9734cbf4d88fd948979b641 +Author: Chris Wilson +Date: Sat Jan 17 10:09:54 2015 +0000 + + dri2: SourceOffloads may be for DRI3 only + + As a DDX may declare offload support without supporting DRI2 + (because it is using an alternative acceleration mechanism like DRI3), + when iterating the list of offload_source Screens to find a matching + DRI2 provider we need to check before assuming it is DRI2 capable. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514 + Signed-off-by: Chris Wilson + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit f27d743c1899f307ec8063febbb3198c8945d372 +Author: Carlos Olmedo Escobar +Date: Wed Jan 21 01:44:54 2015 +0100 + + Avoid possible null pointer dereference. + + Signed-off-by: Carlos Olmedo Escobar + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit 437d2ec5f250f8ab4b44cbae56f938719802e1cc +Author: Carlos Sánchez de La Lama +Date: Wed Jan 21 10:22:05 2015 +0100 + + randr: swap num-preferred field on RRGetOutputInfo reply + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88614 + Signed-off-by: Carlos Sánchez de La Lama + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 3d12941b408de7a3bdc579e34e119f8aa81ea926 +Author: Keith Packard +Date: Thu Jan 22 22:28:34 2015 -0800 + + drivers/modesetting: Save current BlockHandler on return in msBlockHandler + + If the BlockHandler chain is modified while it is active, we need to + re-fetch the current value and store it in our private for use the + next time through. + + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit b3e496c6d21058147de9a11b78860e73c74db3cb +Author: Dave Airlie +Date: Fri Jan 23 16:28:28 2015 +1000 + + glamor: use screen blockhandler rather than dix one (v3) + + This adds glamor into the block handler call chain + in the correct place. + + This should fix interactions between glamor and drivers + requiring damage from glamor. + + v2: okay don't consolidate, just leave things wierd for now + remove blcokhandler in screen close. + + v3: block handler wrapping the right way. + + Signed-off-by: Dave Airlie + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 5af2f5b7d2f955586d0cb40eb30812f1893db22e +Author: Markus Wick +Date: Thu Jan 15 22:03:18 2015 +0100 + + xwayland: Set glamor filter to nearest + + glEGLImageTargetTexture2DOES only set the first level. + Mesa handles this new texture as incomplete and renders a black screen. + We also want to prevent linear filtering. + + https://bugs.freedesktop.org/show_bug.cgi?id=81800 + + Signed-off-by: Markus Wick + Reviewed-and-Tested-by: Michel Dänzer + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 5f2e8ac51ccbf7c02f25c8cb7617df0238418cd1 +Merge: 4e12d7b 4301479 +Author: Keith Packard +Date: Sat Jan 10 14:51:57 2015 +1300 + + Merge remote-tracking branch 'whot/for-keith' + +commit 4e12d7b6f4489fa06475465993a3e1e1d896390b +Author: Jasper St. Pierre +Date: Sun Jan 4 23:27:32 2015 -0800 + + modesetting: Update the cursor without hiding it + + In the new KMS APIs, the legacy drmModeSetCursor ioctl actually waits + for a vblank after changing the cursor image before returning, meaning + that the X server, in attempting to hide the cursor before updating + its image, actually makes that hide *visible* for a full vblank. + + It's unknown why the X server does this by default, but turn it off. + + If we're with a legacy driver that doesn't support the modern + drmModeSetCursor by waiting for a vblank before returning, we're going + to get a tiny bit of tearing on the cursor plane. But between tearing + with a new cursor image and tearing with a blank cursor image, I'd + rather the former. + + The only proper solution to this is an atomic ioctl that page flips + all planes, including the cursor plane, at vblank time and at the same + time. + + Signed-off-by: Keith Packard + Reviewed-by: Keith Packard + +commit 43014795087a0a8774dd9687f5967329b15f06a2 +Author: Olivier Fourdan +Date: Mon Jan 5 16:44:22 2015 +0100 + + Synchronize capslock in Xnest and Xephyr + + In Xnest or Xephyr, pressing CapsLock when focus is on another + window does not update the state in the nested X server. + + This is because when synchronizing the lock modifier, sending a + keypress or a key release only is not sufficient to toggle the state, + unlike regular modifiers, one has to emulate a full press/release + to lock or unlock the modifier. + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 24b943132f90bc72ce8b5dc954fe9ee8484edfc2 +Author: Olivier Fourdan +Date: Fri Jan 2 18:50:17 2015 +0100 + + Fix subwindow in Xi emulated events + + Bug: 70790 + + Signed-off-by: Olivier Fourdan + +commit b058dec281568d6a9c5b5e230c20eed096cbdc6d +Author: Peter Hutterer +Date: Mon Jan 5 11:19:46 2015 +1000 + + mi: fix accidental x/y coordinate swap + + Reported-by: Adam Greenblatt + Signed-off-by: Peter Hutterer + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 23a11fd85e12e94d29ee6d33715ac49684867b16 +Author: Keith Packard +Date: Sun Jan 4 19:13:35 2015 -0800 + + doc: Create a script to filter xmlto output + + This reduces the build log spam while still preserving the xmlto + status to catch build failures correctly. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 1c01633877caa4239f901f02fbe113926318d030 +Merge: 3573855 e774663 +Author: Keith Packard +Date: Sun Jan 4 17:02:25 2015 -0800 + + Merge remote-tracking branch 'ajax/xserver-next' + +commit 3573855514557a518de40a93b3c578f28c7d9c2b +Author: Olivier Fourdan +Date: Wed Dec 3 13:49:37 2014 +0100 + + Remove explicit dependency on $(WAYLAND_LIBS) + + Xwayland Makefile explicitely set its dependencies on + WAYLAND_LIBS. If the ibrairies are installed in a non-standard + path, WAYLAND_LIBS contains '-L/path/to/the/lib' which will fail + at build time with: + + "No rule to make target '-L/path/to/the/lib', needed by 'Xwayland'. + Stop" + + Remove that explicit dependency to avoid the problem (LDADD ought + to be enough to get the right libraries linked). + + Signed-off-by: Olivier Fourdan + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit de89c6b8c6e81bad131c7f432e355cb42d233e87 +Author: Peter Hutterer +Date: Tue Dec 16 13:59:45 2014 +1000 + + xfree86: rename Xorg.bin to Xorg + + If the suid wrapper is enabled, /usr/bin/Xorg is just a shell script that + execs either /usr/libexec/Xorg.bin directly or the Xorg.wrap binary which then + execve's /usr/libexec/Xorg.bin. + + Either way, we end up with Xorg.bin, which is problematic for two reasons: + * ps shows the command as Xorg.bin + * _COMM and _EXE in systemd's journal will both show Xorg.bin as well + + There's not much we can do about the path, but having the actual command stay + as Xorg means better compatibility to existing scripts. And, the reason for + this path: the command + journalctl _COMM=Xorg + works universally, regardless of whether the wrapper is used or not. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + Acked-by: Hans de Goede + +commit ee21be1324de1d6ef14e529fed7b75992e971beb +Author: Peter Hutterer +Date: Thu Dec 11 10:32:45 2014 +1000 + + dix: offset touch root coordinates by ScreenRec origins (#86655) + + For two ScreenRecs abs pointer positioning was working fine, but touch events + stuck to the lower/right edge on any screen but the one with a 0/0 origin. + Cause is a missing offset by the screen coordinates, causing the root + coordinates in the event to desktop-wide, not screen-wide. + + Offset properly, just like we do for pointer events. + + X.Org Bug 86655 + + Signed-off-by: Peter Hutterer + +commit dc777c346d5d452a53b13b917c45f6a1bad2f20b Author: Keith Packard Date: Sat Jan 3 08:46:45 2015 -0800 @@ -185,26 +1477,675 @@ Date: Sat Jan 3 08:46:45 2015 -0800 Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith - (cherry picked from commit dc777c346d5d452a53b13b917c45f6a1bad2f20b) - Signed-off-by: Julien Cristau -commit 16f157cbf6b9c3193b4e622b9c4552e83a343e9d -Author: Julien Cristau -Date: Sat Dec 20 12:38:41 2014 +0100 +commit 924996c41c419dda0f02a96aafdf52f7670ff4ea +Author: Michele Baldessari +Date: Wed Dec 3 11:53:10 2014 -0500 - Bump to 1.16.3 + ephyr: Implement per-screen colormaps - Signed-off-by: Julien Cristau - -commit 9b037af0410bb1f63d370d8b8be06135de7af600 -Author: Julien Cristau -Date: Tue Dec 9 20:55:02 2014 +0100 - - Bump to 1.16.2.901 + Xephyr's pseudocolor emulation added in: - Signed-off-by: Julien Cristau + commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 + Author: Matthew Allum + Date: Mon Nov 8 22:39:47 2004 +0000 + + Add support to Xephyr for lower depths than hosts + + only tracks one global colormap for the whole (Xephyr) display. Move + this to per-screen state so each screen's colormap can be correct. + + [ajax: rebased to 1.17, cleaned up commit message] + Reviewed-by: Adam Jackson + Signed-off-by: Michele Baldessari + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard -commit f7ff55a374d91f8b513159809ed41c3e029a6074 +commit 7b076fdfc0e7a98430b6cb1c43079c137d7d3a6c +Author: Carl Worth +Date: Thu Dec 11 19:09:48 2014 -0800 + + os/xsha1.c: Add license and copyright attribution. + + I'm interested in copying this code to the mesa project, but before + doing that it seems prudent to have the license and copyright + attributions in place before copying that. To get this list of names I + went through: + + git log -- os/xsha1.c + and: + git log -- render/glyph.c + + Signed-off-by: Keith Packard + +commit 66726064204b869a24e5a8dc6e24daa5acb92bab +Author: Kenneth Graunke +Date: Tue Dec 30 11:51:43 2014 -0800 + + modesetting: Fix build with --disable-glamor. + + present.c: In function 'ms_present_flush': + present.c:204:9: error: implicit declaration of function + 'glamor_block_handler' + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87858 + Signed-off-by: Kenneth Graunke + Reviewed-by: Eric Anholt + Reviewed-by: Jasper St. Pierre + Reviewed-by: Rob Clark + Signed-off-by: Keith Packard + +commit d723928870eea9fc2554abe137d6e57f7ad29e98 +Author: Keith Packard +Date: Sat Dec 27 09:11:33 2014 -0800 + + glamor: Fix nlines in glamor_xv_put_image when src_y is odd + + The number of lines of video to update in the texture needs to be + computed from the height of the updated source, not the full height of + the source. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 09230a2d435aa7f893ad5022220e3eb39ffb6db5 +Author: Kenneth Graunke +Date: Thu Dec 11 13:37:14 2014 -0800 + + modesetting: Add vblank synchronization support when using Present. + + modesetting hooked up vblank support for DRI2, but was missing support + for vblanks in Present. + + This is mostly copy and pasted from Keith's code in the intel driver. + + v2: Use ms_crtc_msc_to_kernel_msc in ms_present_queue_vblank to hook + up the vblank_offset workaround for bogus MSC values (which the + DRI2 code already did). + + Also simplify the ms_present_get_crtc function. vblank.c already + implements the functionality; we just need to convert types. + + v3: Fix ms_flush_drm_events return code. I'd copied code where 0 meant + success into a function that returned a boolean, so the return code + was always backwards. + + Also add DebugPresent calls in ms_present_vblank_{handler,abort}. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Keith Packard + Tested-by: Jason Ekstrand + Signed-off-by: Keith Packard + +commit 3b5be33fc55b3090d996014fa56603edb9c1d411 +Author: Kenneth Graunke +Date: Thu Dec 11 13:48:04 2014 -0800 + + modesetting: Include glamor.h from driver.h. + + We basically want it throughout the driver. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Keith Packard + Tested-by: Jason Ekstrand + Signed-off-by: Keith Packard + +commit 7d1fc04d27857c999bd732d54a0b36f5079449b8 +Author: Kenneth Graunke +Date: Thu Dec 18 17:58:18 2014 -0800 + + modesetting: Check DPMS mode in ms_covering_crtc(). + + crtc->enabled is insufficient; we should also make sure DPMS is on. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Keith Packard + Tested-by: Jason Ekstrand + Signed-off-by: Keith Packard + +commit 8affaade2c127ea08989c86e7d71cc9da3db1824 +Author: Kenneth Graunke +Date: Thu Dec 18 17:55:29 2014 -0800 + + modesetting: Track the CRTC's DPMS mode. + + We don't want to try to vblank synchronize to monitors which are off. + + In order to handle that properly, we need to know the CRTC's DPMS mode. + + Signed-off-by: Kenneth Graunke + Reviewed-by: Keith Packard + Tested-by: Jason Ekstrand + Signed-off-by: Keith Packard + +commit b51f804b1ca826699296aff9de27d19257d78dae +Author: Kenneth Graunke +Date: Thu Dec 18 17:22:00 2014 -0800 + + present: If present_queue_vblank() fails, do present_execute(). + + Previously, if present_queue_vblank() failed, we simply dropped the + present request on the floor, and returned an error. This was rather + mean to clients - after presenting, they wait for a PresentComplete + event to come back. But since the present never happens, they end up + waiting forever, and lock up in poll(). + + This patch falls back to present_execute if present_queue_vblank fails. + We still print a debugging message to warn when queueing fails, which + allows us to continue debugging problems, but makes Present robust + enough to not lock up people's compositing manager when vblank bugs + happen. + + v2: Don't do present_queue_vblank() /and/ present_execute() (a bug that + snuck in during last minute tidying). + + Signed-off-by: Kenneth Graunke + Reviewed-by: Keith Packard + Tested-by: Jason Ekstrand + Signed-off-by: Keith Packard + +commit f9e22cefcb9684bf495ada3ec4b0231ab2dc6cff +Author: Dima Ryazanov +Date: Mon Dec 22 11:35:29 2014 -0800 + + Fix "Back", "Forward", and other special mouse buttons in XWayland. + + Currently, the indexes are off by 4 because of the scroll buttons. + + Signed-off-by: Dima Ryazanov + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 70a6f65f9e2b26ef7539dcacfcfea927bc1f13fd +Author: Michel Dänzer +Date: Thu Dec 25 11:42:03 2014 +0900 + + glamor: Make sure Xvideo source image data is properly aligned + + _glamor_upload_bits_to_pixmap_texture currently ignores the stride + parameter, but __glamor_upload_pixmap_to_texture uses 4-byte alignment + via glPixelStorei(GL_UNPACK_ALIGNMENT, 4). + + Also fix up the stride argument passed in though, in case it starts + being used properly in the future. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87455 + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 11b85ab2fc944c0645df43180a6c7e2d6a06483a +Author: Michel Dänzer +Date: Wed Dec 24 11:46:46 2014 +0900 + + glamor: Make glamor_purge_fbo static + + Only called from glamor_fbo.c now. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 8323d2e90150bb86a12d00a16269c69a24efc896 +Author: Michel Dänzer +Date: Wed Dec 24 11:46:18 2014 +0900 + + glamor: Call glamor_pixmap_destroy_fbo from glamor_set_pixmap_private + + Calling glamor_purge_fbo directly was incorrect for large pixmaps. + + Fixes use-after free with large pixmaps: + + ==2029== Invalid write of size 8 ~ + ==2029== at 0x85F93AD: __xorg_list_del (list.h:184) + ==2029== by 0x85F93AD: xorg_list_del (list.h:204) + ==2029== by 0x85F93AD: glamor_fbo_expire (glamor_fbo.c:280) + ==2029== by 0x85F95CA: glamor_pixmap_fbo_cache_put (glamor_fbo.c:159) + ==2029== by 0x85D7AB5: glamor_destroy_textured_pixmap (glamor.c:228) + ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) + ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) + ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) + ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) + ==2029== by 0x5098F6: FreePicture (picture.c:1425) + ==2029== by 0x85E678E: glamor_composite_clipped_region (glamor_render.c:1558) + ==2029== by 0x85F763A: glamor_composite_largepixmap_region (glamor_largepixmap.c:1347) + ==2029== by 0x85E7964: _glamor_composite (glamor_render.c:1679) + ==2029== by 0x85E7A38: glamor_composite (glamor_render.c:1758) + ==2029== Address 0x1141d3c0 is 0 bytes inside a block of size 64 free'd + ==2029== at 0x4C29E90: free (vg_replace_malloc.c:473) + ==2029== by 0x85D7167: glamor_set_pixmap_private (glamor.c:570) + ==2029== by 0xC1BDDC4: radeon_glamor_destroy_pixmap (radeon_glamor.c:272) + ==2029== by 0x519D00: damageDestroyPixmap (damage.c:1473) + ==2029== by 0x4DD307: XvDestroyPixmap (xvmain.c:370) + ==2029== by 0x4DB975: ShmDestroyPixmap (shm.c:258) + ==2029== by 0x45B246: doFreeResource (resource.c:875) + ==2029== by 0x45BD5E: FreeResource (resource.c:905) + ==2029== by 0x43444B: ProcFreePixmap (dispatch.c:1422) + ==2029== by 0x43856E: Dispatch (dispatch.c:432) + ==2029== by 0x43C96F: dix_main (main.c:298) + ==2029== by 0x6CFAB44: (below main) (libc-start.c:287) + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 0d37c7e4b5d63308a60ca59c9de981b380af8689 +Author: Keith Packard +Date: Fri Dec 19 18:40:19 2014 -0800 + + modesetting: Detect whether damage tracking is needed + + Call drmModeDirtyFB and check the return value to detect whether the + driver support for damage tracking is present, only initialize it in + that case. + + Signed-off-by: Keith Packard + Reviewed-by: Jason Ekstrand + +commit 7804305673ca63720e8736c0c88afa711ebe208a +Author: Keith Packard +Date: Fri Dec 19 19:34:34 2014 -0800 + + modesetting: Fix damage tracking auto-disable code + + dispatch_dirty_region was only returning -EINVAL error codes, + otherwise it would return 0. The kernel returns -ENOSYS when the + driver doesn't support damage tracking, so dispatch_dirty would never + see the error and never disable damage tracking. + + Pass all errors back from dispatch_dirty_region and let dispatch_dirty + deal with them. + + Signed-off-by: Keith Packard + Reviewed-by: Jason Ekstrand + +commit 826e7c2b36f192fbbe7ddff37eb559f4d6301146 +Author: Alan Coopersmith +Date: Wed Dec 17 20:50:02 2014 -0800 + + Solaris: Move shared declarations to xf86_OSlib.h + + Gets rid of gcc 4.8 warnings: + xf86AutoConfig.c:211:9: warning: nested extern declaration of + 'xf86SolarisFbDev' [-Wnested-externs] + sun_VTsw.c:44:1: warning: no previous prototype for 'xf86VTRelease' + [-Wmissing-prototypes] + sun_VTsw.c:59:1: warning: no previous prototype for 'xf86VTAcquire' + [-Wmissing-prototypes] + + and ensures caller & definition stay in sync. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit bebcac0cf790b220e849e8905139d0744a606928 +Author: Alan Coopersmith +Date: Wed Dec 17 20:50:01 2014 -0800 + + Move RTLD_DI_SETSIGNAL code into a separate block to quiet warning + + Gets rid of gcc 4.8 warning: + osinit.c:211:9: warning: ISO C90 forbids mixed declarations and code + [-Wdeclaration-after-statement] + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 2c7111235ca5c3bd23cd824589dfbc0ebd477585 +Author: Keith Packard +Date: Sat Dec 13 22:22:30 2014 -0800 + + modesetting: Enable Xv when using glamor + + This just calls the existing function to create the relevant Xv + adaptor and hook it up. + + Signed-off-by: Keith Packard + Reviewed-by: Alex Deucher + +commit 5a541bd5e7adc9fdcc1883558be9218f82a284e0 +Author: Keith Packard +Date: Tue Dec 16 23:14:34 2014 -0800 + + modesetting: [v2] Don't re-enable the cursor when loading the image + + Hidden cursors also have their image updated; re-enabling the cursor + each time the image is set will cause it to re-appear. + + * Unifies the code that was in drmmode_load_cursor_argb and + drm_mode_show_cursor and moves it to a new drmmode_set_cursor + + * Add a new boolean, 'cursor_up', to the per-crtc + private data to track whether the cursor should be displayed. + + * Call drmmode_set_cursor from drm_mode_show_cursor and, if + the cursor should be displayed, from drm_mode_load_cursor_argb. + + v2: Call drmModeSetCursor2 when loading a new cursor image if the + cursor should be displayed. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit 0f5fdaf600bfeada966aea942cb3e347d4efee30 +Author: Michel Dänzer +Date: Thu Dec 11 16:50:40 2014 +0900 + + glamor: Make sure glamor_egl_close_screen wraps glamor_close_screen + + The other way around fails to destroy the screen pixmap EGL image: + + ==1782== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 981 of 2,171 + ==1782== at 0x4C28C20: malloc (vg_replace_malloc.c:296) + ==1782== by 0xF9D4BD2: dri2_create_image_from_dri (egl_dri2.c:1264) + ==1782== by 0xF9D4BD2: dri2_create_image_dma_buf (egl_dri2.c:1764) + ==1782== by 0xF9D4BD2: dri2_create_image_khr (egl_dri2.c:1798) + ==1782== by 0xF9C7937: eglCreateImageKHR (eglapi.c:1494) + ==1782== by 0x85D5655: _glamor_egl_create_image (glamor_egl.c:134) + ==1782== by 0x85D5655: glamor_egl_create_textured_pixmap (glamor_egl.c:302) + ==1782== by 0x85D579B: glamor_egl_create_textured_screen (glamor_egl.c:225) + ==1782== by 0xC1BE05D: radeon_glamor_create_screen_resources (radeon_glamor.c:67) + ==1782== by 0xC1B6153: RADEONCreateScreenResources_KMS (radeon_kms.c:258) + ==1782== by 0x4B2105: xf86CrtcCreateScreenResources (xf86Crtc.c:709) + ==1782== by 0x43C823: dix_main (main.c:223) + ==1782== by 0x6CFAB44: (below main) (libc-start.c:287) + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit c8d4c0a25dba49d1486761438b96374672b29645 +Author: Michel Dänzer +Date: Thu Dec 11 16:50:39 2014 +0900 + + glamor: Make glamor_destroy_textured_pixmap idempotent + + For robustness against drivers which may call both + glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 0355e280a39dee68981b2cbebfa2573cfde2f5bd +Author: Michel Dänzer +Date: Thu Dec 11 16:50:38 2014 +0900 + + glamor: Make glamor_set_pixmap_private not crash if the pixmap has no fbo + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 45b333525e4626523f2b3b7bb360404b6366750d +Author: Michel Dänzer +Date: Thu Dec 11 16:50:37 2014 +0900 + + glamor: Fix use-after-free in glamor_destroy_textured_pixmap + + ==25551== Invalid read of size 8 + ==25551== at 0x85D5F2C: glamor_egl_destroy_pixmap_image (glamor_egl.c:527) + ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) + ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) + ==25551== by 0x5098F6: FreePicture (picture.c:1425) + ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) + ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) + ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) + ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) + ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) + ==25551== by 0x51529B: present_close_screen (present_screen.c:64) + ==25551== by 0x43CA83: dix_main (main.c:351) + ==25551== by 0x6CFAB44: (below main) (libc-start.c:287) + ==25551== Address 0x83dafa0 is 96 bytes inside a block of size 152 free'd + ==25551== at 0x4C29E90: free (vg_replace_malloc.c:473) + ==25551== by 0x85D76B4: glamor_destroy_textured_pixmap (glamor.c:225) + ==25551== by 0x85D7750: glamor_destroy_pixmap (glamor.c:235) + ==25551== by 0xC1BDD9B: radeon_glamor_destroy_pixmap (radeon_glamor.c:278) + ==25551== by 0x5098F6: FreePicture (picture.c:1425) + ==25551== by 0x85DD7A9: glamor_unrealize_glyph_caches (glamor_glyphs.c:257) + ==25551== by 0x85D7B50: glamor_close_screen (glamor.c:586) + ==25551== by 0x4B1A82: xf86CrtcCloseScreen (xf86Crtc.c:734) + ==25551== by 0x4CFFC7: CursorCloseScreen (cursor.c:187) + ==25551== by 0x513A44: AnimCurCloseScreen (animcur.c:106) + ==25551== by 0x51529B: present_close_screen (present_screen.c:64) + ==25551== by 0x43CA83: dix_main (main.c:351) + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 913416b718e73e7416c2128a82d2e5e5cd962d28 +Author: Alan Coopersmith +Date: Tue Dec 9 10:15:08 2014 -0800 + + Solaris: delete undocumented, unuseful -protect0 flag + + Solaris already makes the page at address 0 inaccessible by default to + catch NULL pointer bugs, we don't need a double secret undocumented flag + to try to make our own hacky attempt at it. + + As a bonus, deleting this code removes gcc warning of: + + sun_init.c: In function 'xf86OpenConsole': + sun_init.c:103:17: warning: declaration of 'fd' shadows a previous local [-Wshadow] + int fd = -1; + ^ + sun_init.c:89:9: warning: shadowed declaration is here [-Wshadow] + int fd; + ^ + + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis + Signed-off-by: Keith Packard + +commit 7b784df51bd6be38238d7101b1f5e320eb4aa5b8 +Author: Kenneth Graunke +Date: Tue Dec 9 12:43:57 2014 -0800 + + modesetting: Use GBM for buffer allocations if Glamor supports it. + + For performance, Glamor wants to render to tiled buffers, not linear + ones. Using GBM allows us to pick the 3D driver's preferred tiling + modes. + + v2: Declare drmmode->gbm as void * if !GLAMOR_HAS_GBM. + v3: Just use a forward declaration of struct gbm_device. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit cfef64b0cabe7677c7584a72d7432c20343d9361 +Author: Dave Airlie +Date: Tue Dec 9 12:28:38 2014 -0800 + + glamor: Add an accessor for the GBM device. + + (Originally written by Dave Airlie; split into a separate patch by + Kenneth Graunke.) + + Signed-off-by: Dave Airlie + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit 980535757d38db5c812c8afa32726d8cc36abfa4 +Author: Kenneth Graunke +Date: Tue Dec 9 15:20:44 2014 -0800 + + modesetting: Create a drmmode_bo wrapper; use it for front_bo. + + This code is going to be extended to support GBM BOs soon. This small + abstraction removes a lot of direct dumb_bo access, so we can add that + support in one place, rather than putting conditionals at every + pitch/handle/etc access. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit c6388964b079b3828c0b64951ff03008dda8f44a +Author: Kenneth Graunke +Date: Tue Dec 9 11:26:39 2014 -0800 + + modesetting: Drop dumb_bo::map_count field and dead unmap code. + + The drm kernel API for dumb BOs apparently doesn't include an unmap + ioctl, so we can't do much here. It looks like this code was copied + from libkms, which was also unfinished. + + We may as well delete the dead variable that simply gets incremented + and never read. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit 87cc0c0d317c5eac4fcf9bf4a7ad36454c05f6b8 +Author: Kenneth Graunke +Date: Tue Dec 9 11:17:30 2014 -0800 + + modesetting: Move dumb_bo into its own source files. + + Eventually, drmmode_display will be able to use GBM for handling + buffers, and won't need dumb_bo. Keeping the display related logic + and buffer object abstraction in separate files seems a bit tidier. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit af4f94b08eb8e5961799a8a74a06449fd3fe8ad9 +Author: Kenneth Graunke +Date: Tue Dec 9 15:18:39 2014 -0800 + + modesetting: Create helper for glamor_egl_create_textured_screen call. + + This will need to change when we add GBM support; by pulling it into a + helper function, we should only have to edit one place. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit b4324c6a2382dc96295bdb061316f699e4ffabb9 +Author: Kenneth Graunke +Date: Tue Dec 9 14:38:39 2014 -0800 + + modesetting: Move ModifyPixmapHeader calls out of if/else branches. + + Both branches called ModifyPixmapHeader with essentially the same + parameters. By using new_pixels in the shadowfb case, we can make + them completely the same, and move them out a level, for simplicity. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit 35e9924484ec7bafb749c88ed7f78e6a71f8dfb3 +Author: Kenneth Graunke +Date: Tue Dec 9 13:01:09 2014 -0800 + + modesetting: Stop using glamor_egl_create_textured_screen_ext(). + + The _ext variant takes an additional pointer argument, which it now + ignores, thanks to Keith's recent patches. + + Signed-off-by: Kenneth Graunke + Tested-by: Jason Ekstrand + Reviewed-by: Keith Packard + +commit 91651e7c15892aa846fc406fbb13b37f094dd3f0 +Author: Michel Dänzer +Date: Wed Dec 10 16:21:44 2014 +0900 + + glamor: Reinstate glamor_(egl_)destroy_textured_pixmap + + They are part of the ABI. + + Signed-off-by: Michel Dänzer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit e774663fa5209ff469d920821934bb1f5964a72f +Author: Michele Baldessari +Date: Wed Dec 3 11:30:29 2014 -0500 + + ephyr: Implement per-screen colormaps + + Xephyr's pseudocolor emulation added in: + + commit 81a3b6fe27567b4f91033ece69996aa6bf8d01a3 + Author: Matthew Allum + Date: Mon Nov 8 22:39:47 2004 +0000 + + Add support to Xephyr for lower depths than hosts + + only tracks one global colormap for the whole (Xephyr) display. Move + this to per-screen state so each screen's colormap can be correct. + + [ajax: rebased to 1.17, cleaned up commit message] + Reviewed-by: Adam Jackson + Reviewed-by: Eric Anholt + Signed-off-by: Michele Baldessari + +commit cadd70c809232c9a6601fb8baab665a7ab10045d +Author: Adam Jackson +Date: Tue Dec 2 14:52:35 2014 -0500 + + glx: Add hack for GLX-1.2-style naked windows to GetDrawableAttributes + + Some people like to call this on bare Window XIDs and expect reasonable + results. I sure wish they wouldn't, but since they do, if we're given + a window without any glx decoration just fill in as much as we can. This + means you won't actually get an answer for GLX_FBCONFIG_ID and friends, + but there's not much to be done about that, and it matches what NVIDIA's + driver seems to do. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54080 + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit f452b4a47b3bebf883e84df804e8d54830ccfe83 +Author: Adam Jackson +Date: Tue Dec 2 14:47:45 2014 -0500 + + glx: Dynamically compute attribute slot in GetDrawableAttributes + + No functional change. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit c1455f76c6b1aa4ecaacb2221a687244285aa44b +Author: Neil Roberts +Date: Mon Dec 1 16:06:17 2014 -0500 + + glx: Add implementation of __GLXContext->loseCurrent for direct ctxts + + This adds a dummy implementation for the loseCurrent function in + __GLXContext for direct contexts which just returns GL_TRUE. Without + this then the X server can crash if receives a MakeCurrent message for + a direct context because it will attempt to call loseCurrent when + cleaning up the client in the callback for ClientStateGone. + + [ajax: added assumed s-o-b line] + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86531 + Reviewed-by: Adam Jackson + Signed-off-by: Neil Roberts + Signed-off-by: Keith Packard + +commit 6704bb0ed7a10dabe8ef3bb3adf8b8a7f29a78f0 +Merge: 8aa23f2 1559a94 +Author: Keith Packard +Date: Tue Dec 9 11:47:11 2014 -0800 + + Merge remote-tracking branch 'alanc/master' + +commit 1559a94395258fd73e369f1a2c98a44bfe21a486 Author: Keith Packard Date: Tue Dec 9 09:31:00 2014 -0800 @@ -219,10 +2160,8 @@ Date: Tue Dec 9 09:31:00 2014 -0800 Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith - (cherry picked from commit 1559a94395258fd73e369f1a2c98a44bfe21a486) - Signed-off-by: Julien Cristau -commit 8e7c4380a56ab05412f630e9b6e02580cb04a804 +commit 9802a0162f738de03585ca3f3b8a8266494f7d45 Author: Keith Packard Date: Tue Dec 9 09:30:59 2014 -0800 @@ -234,10 +2173,8 @@ Date: Tue Dec 9 09:30:59 2014 -0800 Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith - (cherry picked from commit 9802a0162f738de03585ca3f3b8a8266494f7d45) - Signed-off-by: Julien Cristau -commit 1069ca99298bf1e85e001bfde90b00a42afdb5d8 +commit 61b17c0f10307e25e51e30e6fb1d3e3127f82d86 Author: Keith Packard Date: Tue Dec 9 09:30:58 2014 -0800 @@ -249,10 +2186,8 @@ Date: Tue Dec 9 09:30:58 2014 -0800 Signed-off-by: Keith Packard Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith - (cherry picked from commit 61b17c0f10307e25e51e30e6fb1d3e3127f82d86) - Signed-off-by: Julien Cristau -commit 044764b5c627d1a6e8ea1dd8cf741a26aeb4b2e7 +commit b20912c3d45cbbde3c443e6c3d9e189092fe65e1 Author: Keith Packard Date: Tue Dec 9 09:30:57 2014 -0800 @@ -270,10 +2205,56 @@ Date: Tue Dec 9 09:30:57 2014 -0800 Signed-off-by: Keith Packard Signed-off-by: Alan Coopersmith - (cherry picked from commit b20912c3d45cbbde3c443e6c3d9e189092fe65e1) - Signed-off-by: Julien Cristau -commit 73b1880eb37bd8ffbc3e36739e94f9b56b8323b9 +commit 8aa23f27c7e29c62d23867440b0bb00fc288b5ba +Author: Keith Packard +Date: Mon Dec 8 12:59:31 2014 -0800 + + glamor: Free existing EGL image when assigning new one + + When reallocating the framebuffer on screen resize, the old EGL image + was getting leaked. Check for an existing EGL image and free it in + this case. + + Signed-off-by: Keith Packard + Revewied-by: Zhigang Gong + +commit c22433d55ea16e4879b092ee28d284fc895c9956 +Author: Keith Packard +Date: Fri Dec 5 11:02:11 2014 -0800 + + glamor: Remove redundant reference to screen pixmap EGL image + + There's no reason to store this in the egl screen private as the + screen pixmap will always hold a reference to it anyways. + + Signed-off-by: Keith Packard + Revewied-by: Zhigang Gong + +commit 5064ffab631dcbc4265079fb32a02d3e2f1c4cd8 +Author: Keith Packard +Date: Fri Dec 5 10:58:28 2014 -0800 + + glamor: Always destroy EGL image associated with destroyed pixmap + + There were three paths that called eglDestroyImageKHR: + + * The front buffer + * The intel driver's flip buffer + * pixmaps under DRI3 + + This patch unifies the second two by having glamor_destroy_pixmap + always destroy any associaged EGL image. This allows us to stop + storing the back_pixmap pointer in glamor as that was only used to + make sure that buffer was freed at server reset time. + + v2: check for valid pixmap_priv before using it in + glamor_egl_destroy_pixmap_image + + Signed-off-by: Keith Packard + Reviewed-by: Zhigang Gong + +commit 7e7630bbb775573eea2a2335adb9d190c3e1e971 Author: Robert Morell Date: Wed Nov 12 18:51:43 2014 -0800 @@ -287,10 +2268,8 @@ Date: Wed Nov 12 18:51:43 2014 -0800 Signed-off-by: Robert Morell Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith - (cherry picked from commit 7e7630bbb775573eea2a2335adb9d190c3e1e971) - Signed-off-by: Julien Cristau -commit 912df16404b80ea143bd75cdacc0d0976bae4c96 +commit e883c170c15493ab3637c0a01890f5a7ca4e16a5 Author: Adam Jackson Date: Mon Nov 10 12:13:48 2014 -0500 @@ -303,10 +2282,8 @@ Date: Mon Nov 10 12:13:48 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit e883c170c15493ab3637c0a01890f5a7ca4e16a5) - Signed-off-by: Julien Cristau -commit 92de7a90a1f48b7fd37b8c78f6a2b8dfa13714a6 +commit 984583a497c813df5827ae22483133e704fee79c Author: Adam Jackson Date: Mon Nov 10 12:13:47 2014 -0500 @@ -325,10 +2302,8 @@ Date: Mon Nov 10 12:13:47 2014 -0500 Signed-off-by: Adam Jackson Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith - (cherry picked from commit 984583a497c813df5827ae22483133e704fee79c) - Signed-off-by: Julien Cristau -commit 44ed4a6547136a0945cd85f93b83392cf53f58f2 +commit 44ba149f28ece93c2fbfc9cc980588de5322dd4b Author: Adam Jackson Date: Mon Nov 10 12:13:46 2014 -0500 @@ -339,10 +2314,8 @@ Date: Mon Nov 10 12:13:46 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 44ba149f28ece93c2fbfc9cc980588de5322dd4b) - Signed-off-by: Julien Cristau -commit fe9672204ad9edc09c4ae6ba1b9e9de09ec98287 +commit afe177020d1fb776c6163f21eddc82cb185b95ca Author: Adam Jackson Date: Mon Nov 10 12:13:45 2014 -0500 @@ -354,10 +2327,8 @@ Date: Mon Nov 10 12:13:45 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit afe177020d1fb776c6163f21eddc82cb185b95ca) - Signed-off-by: Julien Cristau -commit 525db4433b042ad5a116ca0366498f5bc36e1640 +commit c91e4abc3b892f42802efa20fef7ada442c2d3f5 Author: Adam Jackson Date: Mon Nov 10 12:13:44 2014 -0500 @@ -369,10 +2340,8 @@ Date: Mon Nov 10 12:13:44 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit c91e4abc3b892f42802efa20fef7ada442c2d3f5) - Signed-off-by: Julien Cristau -commit cbf197e1c97ae0402abfc35514ef62120baee3a6 +commit a33a939e6abb255b14d8dbc85fcbd2c55b958bae Author: Adam Jackson Date: Mon Nov 10 12:13:43 2014 -0500 @@ -388,13 +2357,8 @@ Date: Mon Nov 10 12:13:43 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit a33a939e6abb255b14d8dbc85fcbd2c55b958bae) - Signed-off-by: Julien Cristau - - Conflicts: - glx/glxcmds.c -commit 7590915c9d76ff7efdc6398a37351df9fab2ce7d +commit 698888e6671d54c7ae41e9d456f7f5483a3459d2 Author: Adam Jackson Date: Mon Nov 10 12:13:42 2014 -0500 @@ -412,10 +2376,8 @@ Date: Mon Nov 10 12:13:42 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 698888e6671d54c7ae41e9d456f7f5483a3459d2) - Signed-off-by: Julien Cristau -commit 20bc891f767a398bff3301369f8a78f9e65b7eda +commit be09e0c988ffdb0371293af49fb4ea8f49ed324a Author: Julien Cristau Date: Mon Nov 10 12:13:41 2014 -0500 @@ -429,10 +2391,8 @@ Date: Mon Nov 10 12:13:41 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith - (cherry picked from commit be09e0c988ffdb0371293af49fb4ea8f49ed324a) - Signed-off-by: Julien Cristau -commit 233429c1d8c1183bead2d6f3726c92a7fc557ca9 +commit 2a5cbc17fc72185bf0fa06fef26d1f782de72595 Author: Adam Jackson Date: Mon Nov 10 12:13:40 2014 -0500 @@ -456,10 +2416,8 @@ Date: Mon Nov 10 12:13:40 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 2a5cbc17fc72185bf0fa06fef26d1f782de72595) - Signed-off-by: Julien Cristau -commit e7dc700de969242983ca0964e38e87a79675f7fa +commit 13d36923e0ddb077f4854e354c3d5c80590b5d9d Author: Adam Jackson Date: Mon Nov 10 12:13:39 2014 -0500 @@ -475,10 +2433,8 @@ Date: Mon Nov 10 12:13:39 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 13d36923e0ddb077f4854e354c3d5c80590b5d9d) - Signed-off-by: Julien Cristau -commit 25e0fe2b59189be91a84626bc45278c7596ac438 +commit 717a1b37767b41e14859e5022ae9e679152821a9 Author: Adam Jackson Date: Mon Nov 10 12:13:38 2014 -0500 @@ -495,10 +2451,8 @@ Date: Mon Nov 10 12:13:38 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 717a1b37767b41e14859e5022ae9e679152821a9) - Signed-off-by: Julien Cristau -commit de17ad13eb38af4bd5c8f085200bdab88496062f +commit ab2ba9338aa5e85b4487bc7fbe69985c76483e01 Author: Adam Jackson Date: Mon Nov 10 12:13:37 2014 -0500 @@ -515,10 +2469,8 @@ Date: Mon Nov 10 12:13:37 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit ab2ba9338aa5e85b4487bc7fbe69985c76483e01) - Signed-off-by: Julien Cristau -commit 1d496e046e398cd9d6d77edf8958967c86983bf0 +commit 23fe7718bb171e71db2d1a30505c2ca2988799d9 Author: Adam Jackson Date: Mon Nov 10 12:13:36 2014 -0500 @@ -536,10 +2488,8 @@ Date: Mon Nov 10 12:13:36 2014 -0500 Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith - (cherry picked from commit 23fe7718bb171e71db2d1a30505c2ca2988799d9) - Signed-off-by: Julien Cristau -commit 5a4760babdfeb114d1e89df735496f042df352fe +commit f4afd53f2aeaddf509bf9f71d1716dd273fd6e14 Author: Alan Coopersmith Date: Sun Feb 9 22:42:47 2014 -0800 @@ -547,10 +2497,8 @@ Date: Sun Feb 9 22:42:47 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit f4afd53f2aeaddf509bf9f71d1716dd273fd6e14) - Signed-off-by: Julien Cristau -commit efacb60e01513e9a96f2630159727835e2a8af0b +commit 2df83bb122debc3c20cfc3d3b0edc85cd0270f79 Author: Alan Coopersmith Date: Sun Feb 9 21:28:05 2014 -0800 @@ -558,10 +2506,8 @@ Date: Sun Feb 9 21:28:05 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 2df83bb122debc3c20cfc3d3b0edc85cd0270f79) - Signed-off-by: Julien Cristau -commit 3b4aa58d565ea4542586cfc8be3f88d5616f77ed +commit d153a85f7478a7a67ccb02fbca6390b0ab1732ee Author: Alan Coopersmith Date: Sun Feb 9 21:27:27 2014 -0800 @@ -569,13 +2515,8 @@ Date: Sun Feb 9 21:27:27 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit d153a85f7478a7a67ccb02fbca6390b0ab1732ee) - Signed-off-by: Julien Cristau - - Conflicts: - test/Makefile.am -commit 4f30f4dd47df6dfd363a15a12fd30b727c0bbaa8 +commit a0ece23a8bd300c8be10812d368dc8058c97c63e Author: Alan Coopersmith Date: Sun Jan 26 20:02:20 2014 -0800 @@ -583,10 +2524,8 @@ Date: Sun Jan 26 20:02:20 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit a0ece23a8bd300c8be10812d368dc8058c97c63e) - Signed-off-by: Julien Cristau -commit 18c7f1e49b16ce9264e77f9c244495ceb24e3f5a +commit 5d3a788aeb2fbd3ca2812747dc18c94a8b981c63 Author: Alan Coopersmith Date: Sun Jan 26 19:51:29 2014 -0800 @@ -594,10 +2533,8 @@ Date: Sun Jan 26 19:51:29 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 5d3a788aeb2fbd3ca2812747dc18c94a8b981c63) - Signed-off-by: Julien Cristau -commit 0ad9121071adf1425623170c9d3bc19333d0f1a2 +commit b5f9ef03df6a650571b29d3d1c1d2b67c6e84336 Author: Julien Cristau Date: Tue Oct 28 10:30:04 2014 +0100 @@ -608,10 +2545,8 @@ Date: Tue Oct 28 10:30:04 2014 +0100 Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith - (cherry picked from commit b5f9ef03df6a650571b29d3d1c1d2b67c6e84336) - Signed-off-by: Julien Cristau -commit df64ac720642c86efcc47b64621e8a0f1e705f16 +commit 3df2fcf12499ebdb26b9b67419ea485a42041f33 Author: Alan Coopersmith Date: Sun Jan 26 19:38:09 2014 -0800 @@ -619,10 +2554,8 @@ Date: Sun Jan 26 19:38:09 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 3df2fcf12499ebdb26b9b67419ea485a42041f33) - Signed-off-by: Julien Cristau -commit ea45001614b771933590a77fdd281b910c637c1b +commit d155b7a8e38e74aee96bf52c20c8b6a330d7d462 Author: Alan Coopersmith Date: Sun Jan 26 19:33:34 2014 -0800 @@ -631,10 +2564,8 @@ Date: Sun Jan 26 19:33:34 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau - (cherry picked from commit d155b7a8e38e74aee96bf52c20c8b6a330d7d462) - Signed-off-by: Julien Cristau -commit e3a1255a727518332c4a8d2af30c357aee0d50f0 +commit 0a6085aaf3581cca558d960ea176ddf3a41a2213 Author: Alan Coopersmith Date: Sun Jan 26 19:28:05 2014 -0800 @@ -642,10 +2573,8 @@ Date: Sun Jan 26 19:28:05 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 0a6085aaf3581cca558d960ea176ddf3a41a2213) - Signed-off-by: Julien Cristau -commit c092c31c83706cc449787d2378b7d4970e9eba8f +commit 32a95fb7c7dbe22c9441c62762dfa4a8ec54d6c3 Author: Alan Coopersmith Date: Sun Jan 26 19:23:17 2014 -0800 @@ -653,10 +2582,8 @@ Date: Sun Jan 26 19:23:17 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 32a95fb7c7dbe22c9441c62762dfa4a8ec54d6c3) - Signed-off-by: Julien Cristau -commit 3d8e2731b5dae431fe68e79ff21d067aed65a077 +commit 7553082b9b883b5f130044f3d53bce2f0b660e52 Author: Alan Coopersmith Date: Sun Jan 26 17:18:54 2014 -0800 @@ -664,10 +2591,8 @@ Date: Sun Jan 26 17:18:54 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 7553082b9b883b5f130044f3d53bce2f0b660e52) - Signed-off-by: Julien Cristau -commit 4d3d93c68b0af02f4bc4e75b0395bbbfb8a2f15c +commit 73c63afb93c0af1bfd1969bf6e71c9edca586c77 Author: Alan Coopersmith Date: Sun Jan 26 10:54:41 2014 -0800 @@ -686,10 +2611,8 @@ Date: Sun Jan 26 10:54:41 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 73c63afb93c0af1bfd1969bf6e71c9edca586c77) - Signed-off-by: Julien Cristau -commit d88c66541e4653bcccd083894657b45443d09970 +commit 2ef42519c41e793579c9cea699c866fee3d9321f Author: Alan Coopersmith Date: Wed Jan 22 23:12:04 2014 -0800 @@ -710,10 +2633,8 @@ Date: Wed Jan 22 23:12:04 2014 -0800 Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 2ef42519c41e793579c9cea699c866fee3d9321f) - Signed-off-by: Julien Cristau -commit db386cd6a1ccf62d3be9fc88994d48ef9f8375cf +commit 6692670fde081bbfe9313f17d84037ae9116702a Author: Alan Coopersmith Date: Wed Jan 22 23:40:18 2014 -0800 @@ -727,10 +2648,8 @@ Date: Wed Jan 22 23:40:18 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau - (cherry picked from commit 6692670fde081bbfe9313f17d84037ae9116702a) - Signed-off-by: Julien Cristau -commit 2883994f9f2d5cae63816db6945dfea618e4a2ee +commit e0e11644622a589129a01e11e5d105dc74a098de Author: Alan Coopersmith Date: Wed Jan 22 23:44:46 2014 -0800 @@ -743,10 +2662,8 @@ Date: Wed Jan 22 23:44:46 2014 -0800 Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit e0e11644622a589129a01e11e5d105dc74a098de) - Signed-off-by: Julien Cristau -commit c2515e9dfd5642e90f2b2526db02afc4ad217a53 +commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb Author: Alan Coopersmith Date: Wed Jan 22 22:37:15 2014 -0800 @@ -762,10 +2679,8 @@ Date: Wed Jan 22 22:37:15 2014 -0800 Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Reviewed-by: Julien Cristau - (cherry picked from commit 97015a07b9e15d8ec5608b95d95ec0eb51202acb) - Signed-off-by: Julien Cristau -commit cbfdb284c943c202c1fd47e560bd980a74dd662b +commit bc8e20430b6f6378daf6ce4329029248a88af08b Author: Alan Coopersmith Date: Mon Jan 6 23:30:14 2014 -0800 @@ -784,10 +2699,8 @@ Date: Mon Jan 6 23:30:14 2014 -0800 Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit bc8e20430b6f6378daf6ce4329029248a88af08b) - Signed-off-by: Julien Cristau -commit b022d4ef9d89c806024bd0cd367da1b249cc2b2d +commit eeae42d60bf3d5663ea088581f6c28a82cd17829 Author: Alan Coopersmith Date: Wed Jan 22 21:11:16 2014 -0800 @@ -803,10 +2716,8 @@ Date: Wed Jan 22 21:11:16 2014 -0800 Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit eeae42d60bf3d5663ea088581f6c28a82cd17829) - Signed-off-by: Julien Cristau -commit f1365eb0ec50bee7d99d4659319c4d93eb21642a +commit 90cc925c5991fcb203f72d00b04419cd754a9b2c Author: Alan Coopersmith Date: Fri Jan 17 18:54:03 2014 -0800 @@ -824,23 +2735,22 @@ Date: Fri Jan 17 18:54:03 2014 -0800 Reported-by: Ilja Van Sprundel Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer - (cherry picked from commit 90cc925c5991fcb203f72d00b04419cd754a9b2c) - Signed-off-by: Julien Cristau -commit 07b01bb5bd3587cd14d9dd2c8f4b145cf1757fe5 +commit 3e7218a6c23354d66f508b18164cac98a346b3ee +Merge: 6f4c398 bc71081 Author: Keith Packard -Date: Thu Oct 9 15:17:17 2014 +0200 +Date: Mon Dec 8 18:07:55 2014 -0800 - glx: check return from __glXGetAnswerBuffer - - This function can return NULL; make sure every caller tests for that. - - Reviewed-by: Adam Jackson - Signed-off-by: Keith Packard - (cherry picked from commit 61a292adf45405641de1c522a04c148e0a152acd) - Signed-off-by: Julien Cristau + Merge remote-tracking branch 'jturney/indirect-glx-fixes' -commit d1bd02fb6746a4393e2538bf605b610e1764a413 +commit 6f4c398a0e632b0c92e3cb8ee03ca7f5b5cc018e +Merge: aae6460 5920433 +Author: Keith Packard +Date: Mon Dec 8 18:04:08 2014 -0800 + + Merge remote-tracking branch 'jturney/master' + +commit aae6460694ac3667abb8c34fdf3a7dae524827a4 Author: Mario Kleiner Date: Sat Dec 6 05:40:08 2014 +0100 @@ -873,10 +2783,8 @@ Date: Sat Dec 6 05:40:08 2014 +0100 Signed-off-by: Mario Kleiner Reviewed-by: Eric Anholt Signed-off-by: Keith Packard - (cherry picked from commit aae6460694ac3667abb8c34fdf3a7dae524827a4) - Signed-off-by: Julien Cristau -commit 77ef968c86b4ed1accd6f04ef7bc3d9700c22ed2 +commit 32d3100bd78efe41d468f7d66861296aee468b6f Author: Mario Kleiner Date: Sat Dec 6 05:40:07 2014 +0100 @@ -911,27 +2819,210 @@ Date: Sat Dec 6 05:40:07 2014 +0100 Signed-off-by: Mario Kleiner Reviewed-by: Eric Anholt Signed-off-by: Keith Packard - (cherry picked from commit 32d3100bd78efe41d468f7d66861296aee468b6f) - Signed-off-by: Julien Cristau -commit f1fc86d61ed97f21579d2125c26de858c1d3ee43 -Author: Keith Packard -Date: Wed Sep 10 14:02:13 2014 -0700 +commit 32ca85c9e075e40b8a4712a79a51702facba0332 +Author: Daniel Martin +Date: Fri Nov 28 11:20:50 2014 +0100 - present: Support PresentOptionCopy + modesetting: Remove unused params from drmmode_output_init() - We added this option to the present protocol before 1.0 but somehow - never implemented it in the server. It's pretty simple; just don't - ever do flips if the application specifies Copy. + drmmode_output_init() doesn't touch (the int*) num_dvi and num_hdmi. + Remove both parameters. + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt Signed-off-by: Keith Packard - Reviewed-by: Adam Jackson - (cherry picked from commit 2051514652481a83bd7cf22e57cb0fcd40333f33) - Signed-off-by: Julien Cristau -commit 386329ec7238edfd1b680c4a7acd39947a161ab5 +commit c0ea476b9bb91f03061b891ffb897c438fa03879 +Author: Daniel Martin +Date: Fri Nov 28 11:20:49 2014 +0100 + + modesetting: Fix ifdefs s/HAVE_UDEV/CONFIG_UDEV_KMS/ + + We don't define HAVE_UDEV, that's a remnant from xf86-video-modesetting. + But, we have CONFIG_UDEV_KMS. + + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 8a16620dcd7a22fd9b38876ffc711629c4fbda0a +Author: Daniel Martin +Date: Fri Nov 28 11:20:48 2014 +0100 + + modesetting: Create new EGL screen in drmmode_xf86crtc_resize + + If we don't glamor_egl_create_textured_screen_ext() in + drmmode_xf86crtc_resize() we end up with a black screen and no client + window(s) visible. + + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 0d63fa5850fe9d8b045b8f1a83e72b75f9065a7a +Author: Daniel Martin +Date: Fri Nov 28 11:20:47 2014 +0100 + + modesetting: Move Bool glamor into drmmode struct + + Move the boolean glamor from struct modesetting into struct drmmode for + later re-use in drmmode_display. + + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 62a4eeaa25099872682d6c2f9f13a0e73fc5ce1e +Author: Daniel Martin +Date: Fri Nov 28 11:20:46 2014 +0100 + + config/udev: Prefix and shift "removing GPU" message + + The message "removing GPU device ..." appeared even if the removal was + skipped (when path == NULL). Move it below the path check and make it a + LogMessage with config/udev prefix. + + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit bc71081f0e3d8ce3aecf2cb168431dbc9fe6a87b +Author: Jon TURNEY +Date: Fri Apr 18 12:17:06 2014 +0100 + + glx: Fix crash when a client exits without deleting GL contexts + + With the previous patches applied, we now have crash due to use-after-free when + a client exits without deleting all it's GL contexts + + On client exit, CloseDownClient first calls glxClientCallback() with + ClientStateGone, which calls __glXFreeContext() directly. + + Subsequently CloseDownClient() frees all the clients resources, which leads to + ContextGone() being called for a context resource where the context has already + been freed. + + Fix this by modifiying glxClientCallback() to free the context resource. + + Also make __glXFreeContext() static, as calling it directly leads to this + problem, instead the context resource should be released. + + With the previous patches applied, this can be demonstrated with e.g. glxinfo, + which doesn't delete it's context before exit. + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + +commit 5c606c0a89e74fa223a99864be11cc3be60a159b +Author: Jon TURNEY +Date: Fri Apr 18 12:17:05 2014 +0100 + + glx: Flush context which is being made non-current due to drawable going away + + Some sequences of glean tests fail with GLXBadCurrentWindow when using indirect + rendering, e.g. glean -t 'fpexceptions getString'. + + Flush a context which is being made non-current due to the drawable on which is + it is current going away. Waiting until another context is made current is too + late, as the drawable no longer exists. + + v2: Rewrite for direct GL dispatch + + v3: Inline FlushContext(), doesn't need to be a separate function + + e.g. LIBGL_ALWAYS_INDIRECT=1 ./glean -r results -o --quick -t "fpexceptions + getString" fails with a BadContextTag error. + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + +commit 437b27494f127854d75e59b4e2aac264e9f913e9 +Author: Jon TURNEY +Date: Fri Apr 18 12:17:04 2014 +0100 + + Revert "glx: Simplify glXDestroyContext" + + This reverts commit 7f5adf73a0f9a951a6df201532b4031d38054369. + + This seems to miss the whole point of the idExists flag, as it makes the + lifetime of that being true the same as the lifetime of the Context resource. + + The previously current context tag is always given in a MakeContextCurrent + request, even if that context tag is no longer valid (for example, the context + has been deleted), so this leads to BadContextTag errors. + + See fd.o bug #30089 for the makecurrenttest.c testcase, and some discussion of + previous manifestations of this bug. + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + +commit 4b0d0df34f10a88c10cb23dd50087b59f5c4fece +Author: Peter Harris +Date: Mon Nov 17 14:31:24 2014 -0500 + + Fix overflow of ConnectionOutput->size and ->count + + When (long) is larger than (int), and when realloc succeeds with sizes + larger than INT_MAX, ConnectionOutput->size and ConnectionOutput->count + overflow and become negative. + + When ConnectionOutput->count is negative, InsertIOV does not actually + insert an IOV, and FlushClient goes into an infinite loop of writev(fd, + iov, 0) [an empty list]. + + Avoid this situation by killing the client when it has more than INT_MAX + unread bytes of data. + + Signed-off-by: Peter Harris + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 802932d112a3f6a09420be9e4a13fa78ac43840b +Author: Adam Jackson +Date: Mon Nov 17 15:28:58 2014 -0500 + + render: fix ChangePicture when Xinerama is active (v2) (#49170) + + ChangePicture takes wire XIDs, but didn't do any Xinerama translation, + which meant setting a clip pixmap or a separate alpha picture would + result in those elements pointing at the instance of the pixmap on + screen 0. Which is, you know, bad. + + v2: This one actually builds. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49170 + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit c2994001680a7dcf9c167886d49b7326c97cd5d1 +Author: Aaron Plattner +Date: Fri Nov 21 08:39:02 2014 -0800 + + os: "Server terminated successfully" is not an error + + ErrorFSigSafe calls LogVMessageVerbSigSafe with the message type set to X_ERROR. + That generates this in the log: + + (EE) Server terminated successfully (0). Closing log file. + + People periodically report this as an error, sometimes quoting this "error" + rather than an earlier error that actually caused a problem. + + v2: Use X_INFO instead of X_NOTICE + + Signed-off-by: Aaron Plattner + Reviewed-by: Keith Packard + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit b09d59342804db7dbb8056dca43dd39f54e290aa Author: Alan Coopersmith -Date: Mon Dec 1 14:26:11 2014 -0800 +Date: Wed Nov 26 13:01:29 2014 -0800 Add -iglx & +iglx to Xserver.man @@ -942,13 +3033,547 @@ Date: Mon Dec 1 14:26:11 2014 -0800 Reviewed-by: James Jones Reviewed-by: Robert Morell Signed-off-by: Keith Packard - (cherry picked from commit b09d59342804db7dbb8056dca43dd39f54e290aa) - - [alanc: Modified for server-1.16-branch to show +iglx as default instead of - -iglx, to match code in os/utils.c in server-1.16-branch.] - Signed-off-by: Julien Cristau -commit a471a15c779377073fd5d6bb8cff40dff917eca9 +commit c52a2b1ebad56820af932dfbc871701a8b04fd9c +Author: Adam Jackson +Date: Tue Nov 11 12:30:07 2014 -0500 + + mi: Fix regression in arc drawing + + xts' XDrawArcs/15 regressed (turning into a server-side infinite loop) + after: + + commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a + Author: Adam Jackson + Date: Fri Sep 26 12:01:37 2014 -0400 + + mi: Fold mifpolycon.c into miarc.c + + The reason is miarc.c provided its own definitions (sigh) of min/max, + that both accept int arguments and return an int. Since miFillSppPoly + uses a double (sigh) and some min-involving math for its loop index + variable, things do not go well. + + Since the integer versions of min/max are redundant, nuke 'em. + + Signed-off-by: Adam Jackson + Reviewed-by: Aaron Plattner + Tested-by: Keith Packard + Signed-off-by: Keith Packard + +commit ec0ac8970b508adcbc3d104b14a127118e4979d0 +Merge: 65cc098 0f88d4e +Author: Keith Packard +Date: Mon Nov 24 15:39:51 2014 -0800 + + Merge remote-tracking branch 'whot/for-keith' + +commit 65cc0982afb1d47d17e655efaef40d4a82e7574a +Author: Keith Packard +Date: Mon Oct 13 10:31:52 2014 -0700 + + glamor: Don't insert fbos from external objects into fbo cache + + Mark fbos created from external buffers so that when the associated + pixmap is destroyed, they aren't put into the fbo cache for later + re-use and are instead freed immediately. + + Signed-off-by: Keith Packard + Reviewed-by: Alex Deucher + +commit 0f88d4e7937116dbc438f98ddf1f3d94cfc5bead +Author: Peter Hutterer +Date: Wed Nov 12 10:29:36 2014 +1000 + + mi: fix documentation for miPointerSetPosition + + Changed when we added barriers, documentation didn't get updated. + + Reported-by: Dave Airlie + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit 6a117af7e7ef6eac796ff0680a915c866fce4019 +Author: John Hunter +Date: Mon Nov 3 15:45:38 2014 +0800 + + fix an annotation mistake + + Signed-off-by: John Hunter + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 732fd7e571b81d63aa44d6e4cf55883479e88f2f +Author: Peter Hutterer +Date: Fri Oct 31 09:45:12 2014 +1000 + + Drop trailing whitespaces + + sed -i "s/[ ]\+$//g" **/*.(c|h) + + happy reviewing... + git diff -w is an empty diff. + + Signed-off-by: Peter Hutterer + +commit 96143d6dc35c98cb6b4e409dd89687e4ced3c1f0 +Author: Peter Hutterer +Date: Fri Oct 31 09:32:35 2014 +1000 + + dix: silence compiler warning comparing CARD32 to -1 + + window.c:3246:36: warning: comparison of constant -1 with expression of type + 'CARD32' (aka 'unsigned int') is always true + [-Wtautological-constant-out-of-range-compare] + if (optional->backingBitPlanes != ~0L) + ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~ + + Signed-off-by: Peter Hutterer + Reviewed-by: Michel Dänzer + +commit 04ca16997994c7561ed8948b89fc1c922233da13 +Author: Peter Hutterer +Date: Fri Oct 31 09:29:33 2014 +1000 + + dix: silence compiler warning + + inpututils.c:243:26: warning: comparison of constant 256 with expression of + type 'KeyCode' (aka 'unsigned char') is always false + [-Wtautological-constant-out-of-range-compare] + if (modkeymap[i] >= MAP_LENGTH) + ~~~~~~~~~~~~ ^ ~~~~~~~~~~ + + MAP_LENGTH depends on MAX_BUTTONS which is somewhat arbitrarily chosen. We + don't expect this to ever change, but just in case leave the condition there + so the code is correct if we drop the number down. + + Signed-off-by: Peter Hutterer + +commit 79b9d33545034f2952ebc7e444c201693b45f44b +Author: Peter Hutterer +Date: Fri Oct 31 09:26:28 2014 +1000 + + xwayland: declare fatal log handler as noreturn + + xwayland.c:661:1: warning: function 'xwl_log_handler' could be declared with + attribute 'noreturn' [-Wmissing-noreturn] + + Signed-off-by: Peter Hutterer + +commit adee4f239b5074d318dfc48beb0ec4e91973b449 +Author: Peter Hutterer +Date: Fri Oct 31 09:24:50 2014 +1000 + + xfree86: drop double-typedef of DBusConnection + + Just include dbus.h, it's been typedef'd there since 2003. + + Signed-off-by: Peter Hutterer + +commit 25315ee555dfeb96d9ed83064b1022ed852b612e +Author: Peter Hutterer +Date: Fri Oct 31 09:16:28 2014 +1000 + + Xext: fix clang compiler warning + + shm.c:1150:24: warning: equality comparison with extraneous parentheses + [-Wparentheses-equality] + if ((shmdesc->addr == ((char *) -1))) { + + Signed-off-by: Peter Hutterer + +commit 995ecfb51d4ab8197e4591d5c0957e08a0bd6a59 +Author: Peter Hutterer +Date: Thu Oct 30 09:00:21 2014 +1000 + + include: change RegionSize() to take a size_t + + /usr/include/xorg/regionstr.h:130:36: warning: implicit conversion changes + signedness: 'int' to 'unsigned long' [-Wsign-conversion] + return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); + ^ ~ + + Really only just pushes the problem to the caller, but maybe that motivates + someone to fix it. + + Signed-off-by: Peter Hutterer + +commit 3ccec1b5ba6a26a30f82ba3aa9c5218dfa336869 +Author: Peter Hutterer +Date: Thu Oct 30 08:56:55 2014 +1000 + + include: fix documentation for list.h + + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + +commit 5920433c3a30f5f1c0ba1ab39a0c2ff388df6b23 +Author: Colin Harrison +Date: Sat Sep 27 11:50:11 2014 +0100 + + hw/xwin: Don't allocate one wchar_t too much for unicode text placed on the Windows clipboard + + The count of wchar_t returned by MultiByteToWideChar() includes the terminating + null character, so don't add one to it. + + Also, reduce the scope of various length variables + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit d172cd630dae9c991b84b4c367a4caf8199266ac +Author: Jon TURNEY +Date: Mon Apr 28 12:48:15 2014 +0100 + + hw/xwin: Fix hang on shutdown when we own the clipboard. + + If we are the clipboard owner when we are shutdown, we recieve a + WM_RENDERALLFORMATS, to render the clipboard, so it's contents will remain + available to other applications. Unfortunately, this is far too late to do + anything useful with, as the server is waiting for the clipboard thread to exit, + and so can't process requests to convert clipboard contents. + + Change so we just do nothing on WM_RENDERALLFORMATS. (I'm not convinced that + WM_RENDERALLFORMATS has ever worked usefully, in any case). + + (To make this work, I guess we would need to rearrange the way shutdown works + completely: first synchronously stop the clipboard, then stop the X server) + + We also then receive a WM_DRAWCLIPBOARD, perhaps telling us that the available + clipboard formats have changed (as ones which haven't been rendered are now + removed), but the clipboard owner is now the system, not us, which we have to + arrange to ignore. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 94d433c8cb64c9167050d02473176f888decf1d8 +Author: Jon TURNEY +Date: Fri Feb 21 23:20:00 2014 +0000 + + hw/xwin: Fix clipboard thread restart + + It seems that the clipboard thread restart mechanism has been broken for a + while, which can be demonstrated using XDMCP with KDM (e.g. to a Kubutunu 12.04 + host) + + KDM kills all attached clients, including the clipboard integration client, + which restarts, but then exits on WM_QUIT. + + Using PostQuitMessage() in WM_DESTROY is unhelpful, as we may not actually be + quitting the thread, if we just destroyed the window because the clipboard + thread is about to retry, because he WM_QUIT message sticks around, and is + noticed the next time we look at the window message queue and confuses us into + thinking we need to quit. + + Sending a WM_DESTROY is apparently never correct anyhow, see [1] + + So: + + 1/ Use DestroyWindow() to destroy the clipboard messaging window when cleaning + up for retry or exit in winClipboardProc (the clipboard thread main proc) + + 2/ Send a special WM_WM_QUIT message in winClipboardWindowDestroy() from the X + server thread when the X server is resetting. + + 3/ When processing that WM_WM_QUIT message in the clipboard thread, cause the + clipboard window to PostQuitMessage(), which causes the clipboard thread to + exit. + + [1] http://blogs.msdn.com/b/oldnewthing/archive/2011/09/26/10216420.aspx + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit b4a08e642b977b4bbc892ff1d96ecc0cf6e2ca54 +Author: Jon TURNEY +Date: Thu Nov 21 15:18:48 2013 +0000 + + hw/xwin: Improve reliability of clipboard X->Windows pastes + + Sometimes, particularly with large clipboard pastes to Windows, we could end up + waiting for the timeout to expire, rather than pasting the data. + + Various changes to improve reliability: + + 1. Use XFlush() not XSync() in winProcessXEventsTimeout(). + + It makes no sense to ensure we have received replies to outstanding requests if + we are going to wait for them using select() + + 2. Add XFlush() to winClipboardProc() + + Make sure we have sent any requests before we wait using select() + + 3. Don't use FD_ISSET() to check which fd is ready + + This looks like a Cygwin select() bug in that it sometimes returns 0 with an + empty fd set before the timeout expires, but a fd appears to be ready. + + Add select() return value to debug output when we are warning that this has + happened. + + 4. Drain event queues before entering select() + + Unconditionally drain event queues before entering select(). This seems to be + the recommended way of writing select() and X event processing loops. + + winClipboardFlushXEvents() checks using XPending(), and + winClipboardFlushWindowsMessageQueue() checks using PeekMessage() so this is + safe against blocking, but means that may not need to enter select() at all + sometimes. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c03f9e23c2b75af410b2fc76ca3f1aa9e979dcc4 +Author: Jon TURNEY +Date: Tue Sep 24 15:09:22 2013 +0100 + + hw/xwin: Add controls for enabling/disabling monitoring of PRIMARY selection + + xwinclip: Add -noprimary option + Xwin: Add -primary and -noprimary options and tray-menu control + + v2: + Use Bool type for fPrimarySelection + Add -noprimary to usage message + Fix indentation in hw/xwin/winwndproc.c + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 851b50419907276fdc781b6be2d42b38849bbd77 +Author: Jon TURNEY +Date: Tue Sep 24 16:02:37 2013 +0100 + + hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts + + See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html + + It looks like the change in a9aca218f557c723e637287272819a7c17174e1e had some + unforseen consequences. + + If the X11 selection contents are not convertable to COMPOUND_TEXT, UTF8_STRING + or STRING format (for example, if it is an image), after those conversion + attempts have failed, we sit in winProcessXEventsTimeout() until the timeout + expires. + + It also seems that maybe gnuplot doesn't respond correctly to this sequence of + conversion requests and doesn't reply to some of them, which also causes us to + sit in winProcessXEventsTimeout() until the timeout expires. + + The Windows application which has requested the clipboard contents via + GetClipboardContents() is blocked until we return from WM_RENDERFORMAT, so + sitting waiting for this timeout to expire should be avoided. + + So instead, explicitly request conversion to the TARGETS target, choose + the most preferred format, and request conversion to that. + + Also: if there is no owned selection, there is nothing to paste, so don't bother + trying to convert it. + + v2: Fix compilation with -Werror=declaration-after-statement + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 4db1241037e3fe8f0a46888377b8fef40bae9065 +Author: Jon TURNEY +Date: Tue Sep 24 13:30:32 2013 +0100 + + hw/xwin: In SelectionNotify, don't pointlessly retrieve just the size of the property + + Don't pointlessly retrieve just the size of the property, if we are then going + to assume we can retrieve the whole property in one request anyhow... + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c5ad92077e7eb32590fafa92d697cc4173f7e57b +Author: Jon TURNEY +Date: Tue Sep 24 12:23:42 2013 +0100 + + hw/xwin: In SelectionNotify, delete the property containing returned data after we have retrieved it + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit ff018d88b9f0fe23ba96c81b53d58532baf4df42 +Author: Jon TURNEY +Date: Thu Oct 2 14:10:50 2014 +0100 + + hw/xwin: Remove some redundant clipboard externs, now defined in winglobals.h + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 63bb5c5ef16edf652179770294dcca4fc07dc992 +Author: Thierry Reding +Date: Wed Oct 29 16:59:27 2014 +0100 + + xv: Add missing gcstruct.h include + + Commit ea3f3b0786d5 (xv: Move xf86 XV color key helper to core.) added + code that uses internals of struct _GC. This structure is defined in the + include/gcstruct.h header which wasn't included by the source file, only + gc.h was. That caused the following build failure: + + CC xvmain.lo + Xext/xvmain.c: In function 'XvFillColorKey': + Xext/xvmain.c:1114:13: error: dereferencing pointer to incomplete type + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + ^ + + Fix this by including the correct header file. + + Signed-off-by: Thierry Reding + Tested-by: Keith Packard + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 882f2d10d99a04a96afc0ce0c8937e16bec3afb5 +Author: Axel Davy +Date: Wed Oct 29 13:31:42 2014 +0100 + + Fix present_notify to return right away when querying current or past msc. + + When the target msc is past or is the current one, we want to get immediate + feedback. This patch fixes this behaviour. + + Signed-off-by: Axel Davy + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 72a0754f4605493fd60471557422f88a97eb356a +Author: Aaron Plattner +Date: Wed Oct 29 19:19:18 2014 -0700 + + xfree86: Bump ABI versions (video: 19, extension: 9) + + Among other things, commit b851ca968b7cce6d1a6438c05d3d5c8832249704 added a + NameWindowPixmap function pointer to ScreenRec, shifting some of the fields + around. + + Signed-off-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit b227d974569b4c315a72b85fe839c5f455396678 +Author: Peter Hutterer +Date: Thu Oct 30 08:54:11 2014 +1000 + + include: fix compiler warning about casting int to uint16_t + + /usr/include/xorg/misc.h:141:30: warning: implicit conversion loses integer + precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion] + return ((x & 0xff) << 8) | ((x >> 8) & 0xff); + ~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ + + Function sig is a uint16_t, so just force the cast. + + Signed-off-by: Peter Hutterer + +commit e9db7682028bb0464c211c1f7bb6983fcfb6f37b +Author: Keith Packard +Date: Tue Oct 28 21:32:24 2014 -0700 + + Update to version 1.16.99.901 + + 1.17 RC1 + + Signed-off-by: Keith Packard + +commit 5ff74d68b0cce85e041251efdc76595eac3c89e4 +Author: Keith Packard +Date: Tue Oct 28 21:31:40 2014 -0700 + + xfree86: Include 'drivers' directory with distribution + + Even if we don't build it locally, make sure it gets included with the release. + + Signed-off-by: Keith Packard + +commit f36f16f0551aa091c1ff154875aebe3d29cf51e7 +Author: Keith Packard +Date: Tue Oct 28 21:30:23 2014 -0700 + + dri2: Distribute new pci_ids headers + + Create hw/xfree86/dri2/pci_ids/Makefile.am which includes all of the new + pci id files in the tarballs. Build that from configure.ac, and run it + from dri2/Makefile.am + + Signed-off-by: Keith Packard + +commit 65dd1ba7b3e00243a76ec691e566ef7c8dd94855 +Author: Keith Packard +Date: Wed Oct 22 14:48:10 2014 -0700 + + dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings + + tranformAbsolute has a pretty simple job, that of running the X/Y + values from a device through the transformation matrix. The tricky bit + comes when the current device state doesn't include one of the + values. In that case, the last delivered value is back-converted to + device space and used instead. + + The logic was twisted though, confusing GCC's uninitialized value + detection logic and emitting warnings. + + This has been fixed by changing the code to: + + 1) Detect whether the ValuatorMask includes X/Y values + 2) If either are missing, back-convert the current values into ox/oy + 3) When X/Y are present, set ox/oy to the current value + 4) Transform + 5) Store X/Y values if changed or if they were set before. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 0fbbdb37c87b5824729f65c7fbac05223024fd27 +Author: Adam Jackson +Date: Wed Oct 22 13:19:18 2014 -0400 + + composite: Wrap GetSpans + + GetSpans should flush composition from children to parent, just like + GetImage and SourceValidate. Fortunately no one is likely to have + noticed, since to hit this you're already deep into failure town. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit da70c7d556bbf21ad495c26e982e2e0f2d7de6c1 +Author: Keith Packard +Date: Wed Oct 22 14:27:26 2014 -0700 + + xkb: Initialize 'bad' Atom in _XkbSetNamesCheck + + When _XkbCheckAtoms returns NULL for an error, it always sets the + error return code, but GCC can't figure that out, so just initialize + the local variable, 'bad', in _XkbSetNamesCheck to eliminate the warning. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 2566835b4374edb3e5a8353d4f7c9e7ec4851c57 +Author: Keith Packard +Date: Wed Oct 22 14:24:55 2014 -0700 + + os: Eliminate uninitialized value warnings from access.c + + The ConvertAddr function doesn't reliably set the 'addr' return value, + and so callers are getting flagged for using potentially uninitialized + values. Initialize the value in the callers to NULL and then go ahead + and check for NULL values before using them. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit 1b94fd77792310c80b0a2bcf4bf6d4e4c4c23bca Author: Alex Orange Date: Fri Oct 3 15:41:38 2014 -0600 @@ -967,23 +3592,34 @@ Date: Fri Oct 3 15:41:38 2014 -0600 Reviewed-by: Peter Harris Tested-by: Peter Harris Signed-off-by: Keith Packard - (cherry picked from commit 1b94fd77792310c80b0a2bcf4bf6d4e4c4c23bca) -commit 4393c7f1ba6140a02232f04fbb434a80d663a99d -Author: Julien Cristau -Date: Mon Nov 10 16:38:52 2014 +0100 +commit ea5b2b0a2e2143ad1414fcbdc081b5d584588346 +Author: Jon TURNEY +Date: Tue Oct 21 15:03:55 2014 +0100 - Bump to 1.16.2 + os: -displayfd should check ports up to 65535 - Signed-off-by: Julien Cristau + -displayfd should check ports up to 65535 + + Noticed during https://cygwin.com/ml/cygwin-xfree/2014-07/msg00024.html + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard -commit 151ec89574c0d1b4566137d0f2d965ef48f04ec5 -Author: Julien Cristau -Date: Sun Nov 2 11:21:33 2014 +0100 +commit 3a123fbdda56b24dc01a2308137144dc960e0d61 +Merge: 9b29fa9 7ea4a21 +Author: Keith Packard +Date: Mon Oct 27 15:39:26 2014 -0700 - Bump to 1.16.1.901 + Merge remote-tracking branch 'jturney/master' + + Conflicts: + hw/xwin/winpixmap.c + + Adam removed a pile of windows code, including this file. -commit a4d9637504ea4c97ca22d86c9f2e275f5253470d +commit 9b29fa957a397664463c7c78fbcc2f34d1993271 Author: Chris Wilson Date: Thu Oct 16 14:09:08 2014 +0100 @@ -999,25 +3635,1138 @@ Date: Thu Oct 16 14:09:08 2014 +0100 Reported-and-tested-by: gedgon@gmail.com Reviewed-by: Adam Jackson Signed-off-by: Keith Packard - (cherry picked from commit 9b29fa957a397664463c7c78fbcc2f34d1993271) - Signed-off-by: Julien Cristau -commit a7c207cc8e713092c51401baddbb3a30de398a34 -Author: Axel Davy -Date: Wed Oct 29 13:31:42 2014 +0100 +commit 5adc20179e9818d51e1cd79bfc8a8271786c3949 +Author: Keith Packard +Date: Mon Oct 27 15:28:14 2014 -0700 - Fix present_notify to return right away when querying current or past msc. + modesetting: Skip kernel work-around on error in crtc to kernel msc - When the target msc is past or is the current one, we want to get immediate - feedback. This patch fixes this behaviour. + ms_crtc_msc_to_kernel_msc attempts to work around kernel + inconsistencies in reporting msc values by comparing the expected + value with the reported value. If the kernel fails to + actually provide its current values, then just skip the work around + steps as there's really nothing better we can do. - Signed-off-by: Axel Davy + Signed-off-by: Keith Packard + +commit 59b12c454d9c4b5a26c6ad87c53abc671b15ce37 +Merge: 5574a0a cac4b06 +Author: Keith Packard +Date: Mon Oct 27 14:48:55 2014 -0700 + + Merge remote-tracking branch 'anholt/modesetting-dri2-no-pageflip' + +commit 5574a0a07e83ff989c074c44d3ea9db0a819f472 +Author: Keith Packard +Date: Mon Oct 27 13:38:21 2014 -0700 + + composite: Skip SetWindowPixmap when pixmap isn't changing + + Check the current window pixmap to see if it matches the new pixmap + and avoid calling SetWindowPixmap in that case. + + x11perf -ucreate highlights an instance where compCreateWindow reassigns + the same Pixmap to the Window. Currently this triggers an expensive + invalidation of the entire window hierachy, making sure that DRI2 + clients are kept informed of the handle changes. However, as the backing + Pixmap for the Window is actually unchanged, there is no need to + do anything in this case. + + Signed-off-by: Keith Packard + Reviewed-by: Chris Wilson + Tested-by: Chris Wilson + +commit df6a3a07f60c40bab2b59b9b3ba0c20c8fb7e95d +Author: Yogish Kulkarni +Date: Wed Oct 22 12:55:28 2014 +0530 + + Skip SetCursor when vtSema is FALSE. + + Consider below sequence - + 1) Cursor is removed : isUp will be FALSE if HW cursor is set. + 2) VT switched away from X : vtSema becomes FALSE. + 3) xf86CursorSetCursor is called with non-null CursorPtr : + Saves the passed in CursorPtr, fallbacks to SW cursor and invokes + spriteFuncs->SetCursor which saves the area under cursor and restores + the cursor. This sets isUp to TRUE and as vtSema is FALSE saved data + is garbage. + 4) VT switched to X : vtSema becomes TRUE. xf86Cursor enable fb access + is called which will remove the SW cursor, i.e copies saved data in #3 + to screen. + + This results to momentary garbage data on screen. Hence when !vtSema + skip spriteFuncs->SetCursor. + + X.Org Bug 85313 + + Signed-off-by: Yogish Kulkarni + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit cac4b064f9f66435430f61568c6a516c54bf3c40 +Author: Eric Anholt +Date: Mon Dec 30 17:23:38 2013 -0800 + + modesetting: Add support for DRI2 with glamor. + + This is derived from the intel driver DRI2 code, with swapchain and + pageflipping dropped, functions renamed, and vblank event management + shared code moved to a vblank.c for reuse by Present. + + This allows AIGLX to load, which means that you get appropriate + visuals exposed in GL, along with many extensions under + direct-rendering that require presence in GLX (which aren't supported + in glxdriswrast.c). + + v2: Drop unused header includes in pageflip.c, wrap in #ifdef GLAMOR. + Drop triple-buffering, which was totally broken in practice (I'll + try to fix this later). Fix up some style nits. Document the + general flow of pageflipping and why, rename the DRI2 frame event + type enums to reflect what they're for, and handle them in a + single switch statement so you can understand the state machine + more easily. + v3: Drop pageflipping entirely -- it's unstable on my Intel laptop + (not that the normal 2D driver is stable with pageflipping for + me), and I won't get it fixed before the merge window. It now + passes all of the OML_sync_control tests from Jamey and Theo + (except for occasional warns in timing -fullscreen -divisor 2). + v4: Fix doxygen at the top of vblank.c + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 7064b00d478646cb428e427df2d3f91d7022c582 +Author: Eric Anholt +Date: Mon Dec 30 00:25:37 2013 -0800 + + modesetting: Export two functions I want to reuse from DRI2/Present. + + This renames dumb_get_bo_from_handle(), since it wasn't using a handle + (GEM terminology) but a dmabuf fd. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + Reviewed-by: Alex Deucher + +commit 34a98c8103a6f725283d0d1ee4084bf387b93019 +Author: Eric Anholt +Date: Wed Oct 8 04:12:49 2014 -0700 + + dri2: Automatically fill in the driver name if the DDX doesn't provide it. + + This will be used by the modesetting driver to support DRI2 across all + hardware that can support glamor, and could potentially be used by + other drivers that have to support DRI2 on sets of hardware with + multiple Mesa drivers. + + This logic is the same as what's present in the Mesa driver loader, + except for the lack of nouveau_vieux support (which requires a + predicate on the device). + + v2: Fix duplicated assignment of info->driverName. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 470d97e1d176981dbd8087c621e54caab0d6c73c +Author: Eric Anholt +Date: Tue Dec 31 13:52:49 2013 -0800 + + dri2: Import a copy of Mesa's PCI ID -> driver name mappings. + + This comes from Mesa commit acdcef6788beaa2a1532e13ff84c3e246b8025ed + + Previously, each driver had to tell DRI2 what GL driver object should + be loaded. Originally for a 2D driver that was a matter of giving the + constant string for the vendor name, same as the driver's name. For a + driver that's trying to handle multiple generations of hardware with + different Mesa driver filenames, the driver had to bake in a mapping + from PCI ID to the appropriate driver name in Mesa, which seems like a + pretty awful layering violation (and one that was fixed with DRI3) + + As of January, Mesa now handles the mapping from a DRI fd to the + driver name on its own, but the AIGLX loader still relies on DRI2 for + choosing the filename. Instead of propagating the PCI ID list from + each 2D driver to the modesetting driver, import a central copy of the + PCI ID list so that drivers can stop handling this themselves. (Some + day, when AIGLX transitions to EGL, we can drop the DRI2 filename + setup entirely). + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 839f05329ddb6f9b5b988edf3a2c3a1f856727f7 +Author: Adam Jackson +Date: Fri Feb 28 16:35:10 2014 -0500 + + dix: Retype and repack GC + + LP64: 160 bytes before, 128 after. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + +commit 73e2383b7350723256894c5076d0c731aec5cd1f +Author: Adam Jackson +Date: Fri Jun 20 13:31:20 2014 -0400 + + dix: Always store GC client clip as a region (v2) + + Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a + GC with no client clip. + + v2: Fix Xnest and some variable names (Keith) + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit e7b9295551d55b42b416ba70cce11dae79ece5e7 +Author: Adam Jackson +Date: Fri Sep 26 13:41:59 2014 -0400 + + fb: Hide fbPush{Pattern,Fill} + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit e31d16a82d83738740f67743b759c006d9845e79 +Author: Adam Jackson +Date: Fri Sep 26 13:32:37 2014 -0400 + + fb: Hide fbDots + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 5db0f067ed4ff24c48cdb7998e4a52ad80037cb7 +Author: Adam Jackson +Date: Fri Sep 26 13:30:06 2014 -0400 + + fb: Hide Bresenham line details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit b184a863c111834e28564d963c0733a30833f128 +Author: Adam Jackson +Date: Tue Jul 8 12:23:48 2014 -0400 + + fb: Hide some zero-width line details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 266cd552bd54fd3e7a83ae7178a303285857631e +Author: Adam Jackson +Date: Tue Jul 8 12:13:13 2014 -0400 + + fb: Hide glyph implementation details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit e572bcc7f4236b7e0f23ab762f225b3bce37db59 +Author: Adam Jackson +Date: Mon Jun 23 15:24:35 2014 -0400 + + fb: Remove even/odd tile slow-pathing + + Again, clearly meant to be a fast path, but this turns out not to be the + case. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 836bb27726441e048bb300664343a136bc596a5b +Author: Adam Jackson +Date: Tue Jun 17 12:25:42 2014 -0400 + + fb: Remove unused fbReduceRasterOp + + Appears to have been cargo-culted in from cfb and then never used. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 167ccd33e0d2c4bd68aebcdba5a512d24c5eb49a +Author: Adam Jackson +Date: Tue Jun 17 12:21:19 2014 -0400 + + fb: Move fbStipple*Bits near their only consumer + + And remove fbStippleTable since gcc can't figure that out itself. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 7430fdb689678b98ac63f5a8dad13719bac777e0 +Author: Adam Jackson +Date: Tue Dec 17 14:46:38 2013 -0500 + + fb: Remove even/odd stipple slow-pathing + + This is clearly meant to be a fast path, but it appears to be a net + loss at this point. + + If you really wanted to ricer-tune here, note that the inner loop of + fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't + specialize the loop for the handful of legal values of bitsPerDst, which + means computing at runtime what could have been const-propped. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a1983736853814d34450c0a0de1c4f6ee308423d +Author: Adam Jackson +Date: Tue Jun 17 11:24:06 2014 -0400 + + fb: FB_SHIFT is 5 (and FB_UNIT is 32) + + The other paths don't build or work, PCI and other buses are almost + always 32 bit data paths, and X doesn't really support pixels bigger + than that anyway. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 3d35bd6b79957a3441abd87a377f0beb058997ed +Author: Adam Jackson +Date: Mon Mar 24 12:01:54 2014 -0400 + + fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane + + gcc doesn't appear to be smart enough to fold away the indirection here, + even if you make fbLaneTable const. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 86ce6262975a7d53d9331723beb49cbe7bd02b48 +Author: Adam Jackson +Date: Fri Sep 26 12:39:38 2014 -0400 + + mi: Fold micursor.c into mipointer.c + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 3b63900e90f44cf85a4d3391d23407b3bb6db52b +Author: Adam Jackson +Date: Fri Sep 26 12:34:15 2014 -0400 + + mi: Fold mipolyutil.c into mipoly.c + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 21b041ef48c49ff6fc06f6e4482ffe54cb763493 +Author: Adam Jackson +Date: Fri Sep 26 12:27:22 2014 -0400 + + mi: Fold mipoly{con,gen}.c into mipoly.c + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a +Author: Adam Jackson +Date: Fri Sep 26 12:01:37 2014 -0400 + + mi: Fold mifpolycon.c into miarc.c + + Also put mifpoly.h on a diet, and stop including it from places that + don't need it. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit f307ef10f4c33da4b5ae59800931741b0a431d75 +Author: Adam Jackson +Date: Mon Jul 21 17:22:07 2014 -0400 + + mi: Fold mispans.c into miwideline.c + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 707965407a3c907058b89610e73e02989fd0b552 +Author: Adam Jackson +Date: Fri May 23 12:10:29 2014 -0400 + + mi: Unexport arc fill implementation details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit ce8fff5cd681523088c14b97ce4fb6e4fb658321 +Author: Adam Jackson +Date: Fri May 23 12:06:03 2014 -0400 + + mi: Unexport subpixel polygon implementation details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a085ba82bde375b5c884a40b410b563815c58a9e +Author: Adam Jackson +Date: Fri May 23 11:55:05 2014 -0400 + + mi: Unexport span group implementation details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit c15c886ee70f9144bc4603b918310f229312aadc +Author: Adam Jackson +Date: Fri May 23 11:50:07 2014 -0400 + + mi: Unexport polygon edge table implementation details + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 9bdc9b0113915de3d536b2b3f025915379c2126f +Author: Adam Jackson +Date: Fri May 23 11:21:28 2014 -0400 + + mi: Unexport wide line details + + XAA wanted these, once upon a time, but that's gone now. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit d181e52ceb9ae44e1faa8d5af8805f43328da6c2 +Author: Keith Packard +Date: Fri Oct 24 11:56:23 2014 -0700 + + glamor: Free converted bits in _glamor_upload_bits_to_pixmap_texture fast path + + When uploading bits to a texture which need reformatting to match a + supported GL format, a temporary buffer is allocated to hold the + reformatted bits. This gets freed in the general path, but is not + freed in the fast path because that includes an early return before + the call to free. + + This patch removes the early return and places the general case under + an 'else' block, so that both paths reach the call to free. + + Signed-off-by: Keith Packard + Reviewed-by: Alex Deucher + +commit 55b27ed70cf9dfa9b9dffe46e9a3191bfda38f7c +Author: Andreas Hartmetz +Date: Sat Oct 4 18:13:04 2014 +0200 + + glamor: Don't free memory we are going to use. + + glamor_color_convert_to_bits() returns its second argument on + success, NULL on error, and need_free_bits already makes sure that + "bits" aliasing converted_bits is freed in the success case. + Looks like the memory leak that was supposed to be fixed in + 6e50bfa706cd3ab884c933bf1f17c221a6208aa4 only occurred in the error + case. + + Reviewed-by: Michel Dänzer + Signed-off-by: Keith Packard + +commit 16a32c53f6e9ad1f3284d4596edfa33e9efb740e +Author: Alan Coopersmith +Date: Thu Oct 9 05:42:09 2014 -0700 + + If fork fails in System(), don't fallthrough to exec() + + In the unlikely event of a failure in creating processes, signal + masks will fall from the panels above you. Secure your mask before + telling your child what to do, since it won't exist, and you will + instead cause the server itself to be replaced by a shell running + the target program. + + Found by Coverity #53397: Missing break in switch + Execution falls through to the next case statement or default; + this might indicate a common typo. + In System: Missing break statement between cases in switch statement (CWE-484) + + Signed-off-by: Alan Coopersmith + Reviewed-by: Matthieu Herrb + Signed-off-by: Keith Packard + +commit 7e5bc49d1ed2c78c321da79bdbc99b90c5f95b38 +Author: Alan Coopersmith +Date: Thu Oct 9 05:42:08 2014 -0700 + + Allocate enough room for both reset & flags attributes + + ctx_attribs had room for 3 pairs of attributes, but if both flags & reset + attributes were being returned it was storing 4 pairs in the array. + + Found by Coverity #53442: Out-of-bounds write + This could cause an immediate crash or incorrect computations. + In create_driver_context: Out-of-bounds write to a buffer (CWE-119) + + Signed-off-by: Alan Coopersmith + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit cffd4e4a4ee615d8583eae78b35017e0d1bfa4f0 +Author: Adam Jackson +Date: Thu Oct 9 09:58:06 2014 +0200 + + mi: Mark the span blit routines as _X_COLD + + On gcc, __attribute__((cold)) means: + + - consider calls to the function to be unlikely for branch prediction + - optimize the function for size + - emit the function in a dedicated cold text section + + It's not worth deleting these routines even though there are no longer + in-tree consumers, but we can at least keep them out of i$ at runtime. + + Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard - (cherry picked from commit 882f2d10d99a04a96afc0ce0c8937e16bec3afb5) - Signed-off-by: Julien Cristau -commit 27600a6b2056b8cf6af8b6b0f078164ef36c0767 +commit de55aafa8f6a9e0dec364bec920d6f91ef2b39f0 +Merge: 462bf87 c79f824 +Author: Keith Packard +Date: Thu Oct 23 17:28:24 2014 -0700 + + Merge remote-tracking branch 'ajax/xwin' + +commit 462bf87c4d1c2211dd49a5ce62d01ff84ff33970 +Author: Adam Jackson +Date: Wed Oct 8 17:20:33 2014 +0200 + + render: Always store client clip as a region + + This does have one semantic change. FixesCreateRegionFromPicture used to + throw BadImplementation if you tried to create a region from a picture + with no client clip. I changed that to BadMatch here since that more + honestly describes what's going on. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 3f4edd2e3ff84c38df563b09c2e8c32404db38f7 +Author: Adam Jackson +Date: Wed Oct 8 17:18:32 2014 +0200 + + xinerama: Fix access mode in GetImage's drawable lookup + + Signed-off-by: Adam Jackson + Reviewed-by: Julien Cristau + Signed-off-by: Keith Packard + +commit 942e18e17e334d7a25f8c1dcc6f5c3711eeb6a7d +Author: William ML Leslie +Date: Wed May 21 10:28:52 2014 +1000 + + Xephyr: option to disable grabbing the host + + This patch makes it possible to use C-S key combinations + within Xephyr without losing access to the host window manager's + commands. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 7ea4a21feed5ac5e71cc6d8141c97d6362402c5d +Author: Jon TURNEY +Date: Fri Sep 19 13:37:50 2014 +0100 + + configure.ac: Force --disable-libdrm on Cygwin + + This is now needed to avoid trying to build the modesetting driver by default + when building the Xorg DDX on Cygwin. + + http://tinderbox.x.org/builds/2014-09-18-0011/logs/xserver/#build + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + +commit 883927d2e8733f4070b2a8bcc5ec8cc2d7a661b3 +Author: Jon TURNEY +Date: Tue Sep 30 13:55:59 2014 +0100 + + configure.ac: Avoid "Your OS is unknown" warning when configuring for Cygwin + + Don't emit "Your OS is unknown" warning when configuring with --enable-xorg to + build the XOrg DDX for Cygwin. + + The list of supported OSes is getting a bit unwieldy, so just remove it. + + Signed-off-by: Jon TURNEY + Reviewed-by: Adam Jackson + +commit 549b3175afc46cee6e1b61841f854a5272eaf1f7 +Author: Jon TURNEY +Date: Thu Oct 2 15:37:50 2014 +0100 + + hw/xwin: Fix unused variable warning in winCreateMsgWindow() + + winmsgwindow.c:99:11: warning: variable ‘winClass’ set but not used [-Wunused-but-set-variable] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5adfb566fe05bcf5f40b4adc1457862936d6d038 +Author: Jon TURNEY +Date: Fri Oct 3 14:22:30 2014 +0100 + + hw/xwin: Fix redundant declaration warning in winprefslex.l + + winprefslex.l:40:12: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] + winprefsyacc.h:130:5: note: previous declaration of ‘yyparse’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 8f062f73805765f5769dfd7b738c8dd10062fba6 +Author: Jon TURNEY +Date: Fri Oct 3 14:12:57 2014 +0100 + + hw/xwin: Fix warning in yyerror() + + winprefsyacc.y:257:3: warning: nested extern declaration of ‘yylineno’ [-Wnested-externs] + + Promote yylineno declaration to file scope + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit f0f0c92a08f0ccf5a7ac447d117eb0341fe136d6 +Author: Jon TURNEY +Date: Fri Oct 3 14:00:06 2014 +0100 + + hw/xwin: Fix const warning in winPrefsLoadPreferences() + + winprefs.c:643:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 593c6b19349538ec3b89bc48eb3f0bb4c0cebb23 +Author: Jon TURNEY +Date: Thu Oct 2 15:35:54 2014 +0100 + + hw/xwin: Fix const warnings in winprefsyacc.y + + winprefsyacc.y:174:5: warning: passing argument 1 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] + winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ + winprefsyacc.y:174:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] + winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ + winprefsyacc.y:175:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] + winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ + winprefsyacc.y:178:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] + winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ + winprefsyacc.c:1737:9: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] + winprefsyacc.y:82:12: note: expected ‘char *’ but argument is of type ‘const char *’ + winprefsyacc.c:1854:3: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 394ad259596801860d32d531408a07b63e469427 +Author: Jon TURNEY +Date: Thu Oct 2 14:31:35 2014 +0100 + + hw/xwin: Fix const warning in winCheckDisplayNumber() + + InitOutput.c:1032:19: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 701492e5d9487545afeb5ebfcebccc0408ca7bc4 +Author: Jon TURNEY +Date: Thu Oct 2 14:30:56 2014 +0100 + + hw/xwin: Fix warning in winXIconToHICON() + + winmultiwindowicons.c:403:29: warning: passing argument 8 of ‘XGetWindowProperty’ from incompatible pointer type [enabled by default] + /usr/include/X11/Xlib.h:2688:12: note: expected ‘Atom *’ but argument is of type ‘long unsigned int *’ + + Looks like this has been wrong since I added it in 527cf131 :-( + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a14f1d94d5bb87055f7e4812e9ef75771ea65bc5 +Author: Jon TURNEY +Date: Thu Oct 2 14:09:40 2014 +0100 + + hw/xwin: Fix format warnings with debug printing of pointers on 64-bit + + Fix various pieces of debug output, mainly under --enable-debug, which use a + "%08x" printf format for a pointer type. Use "%p" format for 64-bit portability. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 03d462ddd2cacce92dc9e6bad00710d899509387 +Author: Jon TURNEY +Date: Thu Oct 2 12:04:20 2014 +0100 + + hw/xwin: Fix warnings in glx/glshim.c + + glext.h currently requires GL_GLEXT_PROTOTYPES in order to prototype + glCompressedTexImmage* functions + + generated_gl_shim.c:2859:6: warning: no previous prototype for 'glCompressedTexImage3DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2866:6: warning: no previous prototype for 'glCompressedTexImage2DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2873:6: warning: no previous prototype for 'glCompressedTexImage1DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2880:6: warning: no previous prototype for 'glCompressedTexSubImage3DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2887:6: warning: no previous prototype for 'glCompressedTexSubImage2DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2894:6: warning: no previous prototype for 'glCompressedTexSubImage1DARB' [-Wmissing-prototypes] + generated_gl_shim.c:2901:6: warning: no previous prototype for 'glGetCompressedTexImageARB' [-Wmissing-prototypes] + + Also, explicitly prototype glXGetProcAddressARB(), as glx/glxdri*.c does, as + it's not practical to include glx.h here... + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 329e8125aa3b4c83121f8290a5436c2cb4c1cf96 +Author: Jon TURNEY +Date: Wed Oct 1 12:14:43 2014 +0100 + + hw/xwin: Fix compilation with -Werror=declaration-after-statement + + xevents.c: In function 'winClipboardInitMonitoredSelections': + xevents.c:129:5: error: 'for' loop initial declarations are only allowed in C99 mode + for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 97c3298caab7c5a5396fcbde02d862e5380d7d2e +Author: Jon TURNEY +Date: Wed Oct 1 12:02:04 2014 +0100 + + hw/xwin: Fix compilation with -Werror=return-type + + winshadddnl.c: In function ‘winRedrawScreenShadowDDNL’: + winshadddnl.c:991:9: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] + + Just wrong in 1c34e774 + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 61a292adf45405641de1c522a04c148e0a152acd +Author: Keith Packard +Date: Thu Oct 9 15:17:17 2014 +0200 + + glx: check return from __glXGetAnswerBuffer + + This function can return NULL; make sure every caller tests for that. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit d634ecdf82f244ff8ce75d351fc175792d254e5c +Merge: 6622f0c 7ebf480 +Author: Keith Packard +Date: Thu Oct 9 15:08:31 2014 +0200 + + Merge remote-tracking branch 'ajax/dead-code' + +commit 6622f0cb1761501f3287ffa8d3cbca3fd30f9f0c +Merge: f12e7f4 5ecd786 +Author: Keith Packard +Date: Thu Oct 9 15:05:26 2014 +0200 + + Merge remote-tracking branch 'ajax/mi-cleanup' + +commit f12e7f4980416b74988052a04d0f2487b2c4a7e9 +Merge: da88772 aaf5e2d +Author: Keith Packard +Date: Thu Oct 9 14:21:19 2014 +0200 + + Merge remote-tracking branch 'anholt/modesetting-glamor' + +commit da887726eeaece0396962dd3912578d3372881b1 +Author: Alan Coopersmith +Date: Sun Sep 21 09:49:06 2014 -0700 + + Use unique display name for each xi2 test program [v3] + + make -j 8 check was sporadically failing in different xi2 tests. + After adding the asserts in the previous commit to catch xkb failure + it became easier to catch the failures and see that multiple tests + were running at once trying to write to /tmp/server-(null).xkm and + then delete it, and interfering with each other. + + Putting a unique string into the display variable let them each write + to their own file and not interfere with others. + + v2: Fix Linux bits: + + Add #include to get a declaration of + program_invocation_name on Linux. + + Use only the last portion of the pathname so that the resulting + display name doesn't contain any slashes. + + v3: use program_invocation_short_name on Linux + + This is the same as program_invocation_name, except is has + stripped off any path prefix. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 5ecd7866f7587d620f000e802a262c7cd4b9df33 +Author: Adam Jackson +Date: Thu Sep 11 10:11:39 2014 -0400 + + misc: Fold together some redundant conditionals + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 5b07f1db6de9f08f757206454da03ee0ae872bfc +Author: Adam Jackson +Date: Thu Sep 18 16:05:40 2014 -0400 + + fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window + + Make the function names match the screen slot name. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 9ed83a694b6492c9db226b115ed282cb127e798e +Author: Adam Jackson +Date: Thu Sep 18 15:36:57 2014 -0400 + + mi: miSlideAndSizeWindow -> miResizeWindow + + Make the function name match the screen slot name. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 939ca767c7603923a91fd37901175a42e802d40e +Author: Adam Jackson +Date: Thu Sep 18 14:50:28 2014 -0400 + + dix: Remove an obfuscatory macro + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit d138d9ccc62a9472925574089f346bf9aa3dab1f +Author: Adam Jackson +Date: Mon Sep 15 13:05:24 2014 -0400 + + dix: Remove some pointless casting of NULL + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 277330075bfbd4343c4efdd136e0be716e1a491f +Author: Adam Jackson +Date: Mon Sep 15 12:30:44 2014 -0400 + + dix: Remove an empty if + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 81d76a835b2f647e3051b1d93606e59db7998d76 +Author: Adam Jackson +Date: Mon Sep 15 12:10:55 2014 -0400 + + dix: Lower backStorage to a bit instead of a pointer + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 322ba42c23a3a107f7a62fb1c449792b616e5eba +Author: Adam Jackson +Date: Mon Sep 15 12:05:26 2014 -0400 + + dix: Remove DIXsaveUnder bit from the Window + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 1e56b2dfc6377234ffdcdf206528d476b04d13af +Author: Adam Jackson +Date: Fri Sep 12 12:51:13 2014 -0400 + + mi: Move pScreen->SendGraphicsExpose up to dix + + No DDX is overriding this and it's fairly absurd to expose it as a + screen operation anyway. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 5d3bd8a3dc6456ea1ccf7b5f71b972379d7565ec +Author: Adam Jackson +Date: Fri Sep 12 11:56:28 2014 -0400 + + mi: Drop plane argument from miHandleExposures + + This existed to be passed to the bs recovery routine; since we back all + planes, we don't care. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 7eddc80bc4a6c1902746a9fbe79ab553f9fd5821 +Author: Adam Jackson +Date: Tue Aug 5 14:07:17 2014 -0400 + + mi: Simplify composite border clip redirection interface + + There's not really a good reason for mi to not just call the composite + code directly. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 7b35dc9b1533d4b99a3f84f460ac66354a6fe347 +Author: Adam Jackson +Date: Tue Sep 23 10:35:37 2014 -0400 + + mi: Deobfuscate miOverlayWindowExposures + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit fb34f273481b90a90a988f0f5c5a2d642a5661b8 +Author: Adam Jackson +Date: Tue Sep 23 10:30:56 2014 -0400 + + mi: Deobfuscate miWindowExposures + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 0d30d44a8cdacfbc99d8193f76c133b803464622 +Author: Adam Jackson +Date: Thu Sep 11 12:44:54 2014 -0400 + + dix: Drop the third argument from WindowExposuresProcPtr + + A careful read shows that it was always NULL. It hasn't always been; as + the DDX spec indicates, it was the "occluded region that has backing + store", but since that backing store code is long gone, we can nuke it. + + mi{,Overlay}WindowExposures get slightly simpler here, and will get even + simpler in just a moment. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit aaf5e2d643af590366b2d02ad1c2db05d1fc4131 +Author: Eric Anholt +Date: Sat Dec 28 11:32:10 2013 -0800 + + modesetting: Add support for rendering using glamor. + + By default modesetting now tries to enable X acceleration using + glamor, but falls back to normal shadowfb if GL fails to initialize. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 6d41bdb23ca92803e3a51dc317d2b80cdb92f43a +Author: Eric Anholt +Date: Tue Aug 26 16:59:37 2014 -0700 + + modesetting: Deduplicate some scrn setup. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 20a3b482191711bc15be0410ccc3651924271349 +Author: Eric Anholt +Date: Wed Oct 8 00:41:13 2014 -0700 + + modesetting: Fix some weird formatting after x-indent-all.sh. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 3119acdab9eecff90b8fd9a265e2a456e7bc8779 +Author: Eric Anholt +Date: Wed Oct 8 00:39:15 2014 -0700 + + modesetting: Run x-indent-all.sh. + + As I was editing code, the top-level .dir-locals.el was making my new + stuff conflict with the existing style. Make it consistently use the + xorg style, instead. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit c79f824bf6617816aaf10393beec8dddfa591f7b +Author: Adam Jackson +Date: Thu Sep 25 15:49:26 2014 -0400 + + xwin: Remove primary DirectDraw engine + + Again, as the documentation says, "unsupported, obsolete". + + Reviewed-by: Jon TURNEY + Signed-off-by: Adam Jackson + +commit 8465ee788fd541fa37681aa0a44103c7f944d437 +Author: Adam Jackson +Date: Thu Sep 25 15:37:33 2014 -0400 + + xwin: Remove native GDI engine (v2) + + As the man page says, "unsupported, experimental, and barely + functional". The last even minor updates to any of this were back in + 2004, presumably it's not getting better any time soon. + + This is also the only GC ops implementation in the tree that actually + falls all the way down to the spans routines for everything, so that's + pretty nice to be rid of. + + v2: Fix stray break statement (Jon) + + Reviewed-by: Jon TURNEY + Signed-off-by: Adam Jackson + +commit e2a3e91a56cb598f2c8257614d92ccd46b7fc094 +Author: Adam Jackson +Date: Fri Jul 25 11:01:22 2014 -0400 + + rootless: remove redundant RootlessShapedWindowIn + + miShapedWindowIn is identical. Which you would expect, since neither + one takes an actual WindowPtr argument, so they couldn't possibly make + reference to rootlessness. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + +commit 7e8ac6dcd24d56e384ad09c7c23259cb3f4f8dc6 +Author: Adam Jackson +Date: Thu Sep 11 12:30:15 2014 -0400 + + xquartz: Remove useless DRIWindowExposures + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a8c6fc46c088bedb36c6441b78c98ca4cb9761b4 +Author: Adam Jackson +Date: Thu Sep 11 10:24:27 2014 -0400 + + kdrive: Remove vestigial reference to fbInitValidateTree + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 7ebf480f5eb75e06271ec924769e51bdcbbdc69c +Author: Adam Jackson +Date: Fri Feb 28 12:34:49 2014 -0500 + + xfree86: Remove some can't-happen printf from xf86CreateRootWindow + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 3689be96ac125c9bfca9d37de4878f05f4e2f584 +Author: Adam Jackson +Date: Tue Jun 10 12:54:41 2014 -0400 + + vfb: Don't reimplement micmap so much + + We know we're atop fb which is atop micmap, the only thing we need to + hook is InstallColormap to handle the xwd colormap change. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 692676debbc2227054d67078c6442f1ab1811192 +Author: Adam Jackson +Date: Mon Jun 16 12:35:28 2014 -0400 + + loader: Remove some baklava code + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit c695a1430b80bac0b95e4d7f559e1bd223ecb1ef +Author: Adam Jackson +Date: Tue Jul 8 14:38:34 2014 -0400 + + input: Remove unused SetKeySymsMap + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit 645063cd9384a26353775e92a79ed8710c6ca66c +Author: Adam Jackson +Date: Tue Mar 4 12:51:49 2014 -0500 + + exa, kdrive: Remove redundant BitsPerPixel macros + + We already get this from servermd.h + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit cccba52d152a7d233c0b762a54844ecef831483e +Author: Alan Coopersmith +Date: Sun Sep 21 09:49:05 2014 -0700 + + Abort xi2 tests if ActivateDevice() fails + + I was getting segfaults in xi2 tests from trying to copy XKB keyboard + state to NULL pointers with a stack of: + key=key@entry=0) at xkbActions.c:1189 + sendevent=sendevent@entry=0 '\000') at devices.c:420 + at protocol-xiquerydevice.c:338 + + which turned out to be due to xkbcomp failure, which was logged in the + test logs as: + XKB: Failed to compile keymap + Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config. + + but which was overlooked because the ActivateDevice() return code wasn't + checked and the tests went forward assuming the structures were all + correctly initialized. This catches the failure closer to the point of + failure, to save debugging time. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 95a5b92e37f73f497d547fd91c543c16d2cc73de +Author: Keith Packard +Date: Thu Oct 2 10:26:53 2014 -0700 + + xfree86: Remove remaining return FALSE from configServerFlags + + Remove the error return path from the FLAG_PIXMAP path and leave the + default value in place. There's no point skipping the rest of this + function. + + Signed-off-by: Keith Packard + +commit e9651e3dbc32650fcaf90888b4cbef81da77cfcd +Merge: 9bc01df 4433bc6 +Author: Keith Packard +Date: Thu Oct 2 10:24:33 2014 -0700 + + Merge remote-tracking branch 'ajax/dead-code' + +commit 9bc01dfc7070a40f5948588895b3a11dd1636d0e Author: Axel Davy Date: Sat Sep 27 23:17:13 2014 +0200 @@ -1028,29 +4777,1595 @@ Date: Sat Sep 27 23:17:13 2014 +0200 Signed-off-by: Axel Davy Reviewed-by: Keith Packard Signed-off-by: Keith Packard - (cherry picked from commit 9bc01dfc7070a40f5948588895b3a11dd1636d0e) - Signed-off-by: Julien Cristau -commit 0e62f275aa02c5694fd714f3bbd5271836142755 -Author: Peter Hutterer -Date: Mon Aug 4 10:47:03 2014 +1000 +commit b3e9791fd375eb71b6150a77b8009b046b213004 +Author: Daniel Martin +Date: Sat Sep 20 09:07:41 2014 +0200 - xkb: ignore floating slave devices when updating from master (#81885) + xfree86: Delete file modinit.h - Introduced in 45fb3a934dc0db51584aba37c2f9d73deff9191d. When a device is - enabled, the master's locked state is pushed to the slave. If the device is - floating, no master exists and we triggered a NULL-pointer dereference - in XkbPushLockedStateToSlaves. + All references to modinit.h have been remove with: - X.Org Bug 81885 + a1d41e3 Move extension initialisation prototypes into extinit.h - Signed-off-by: Peter Hutterer - Reviewed-by: Daniel Stone + Signed-off-by: Daniel Martin + Reviewed-by: Eric Anholt Signed-off-by: Keith Packard - (cherry picked from commit 1e30fc1b99bda040038e4fd56d1b27c686b44c75) - Signed-off-by: Julien Cristau -commit f7ca20cacfd4e0304d01f29491ae8363fd482279 +commit 2aeb9d8f8b22ceb1de883c231a0a75d4c75d3f4a +Author: Daniel Martin +Date: Sat Sep 20 09:07:40 2014 +0200 + + security: Remove XpExtension from SecurityTrustedExtensions + + There's no XPrint extension (anymore). + + Signed-off-by: Daniel Martin + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 12c19bbff4b7b2d0b350a7b93b38ebbf69748534 +Author: Daniel Martin +Date: Sat Sep 20 09:07:39 2014 +0200 + + dix: Remove XpExtension leftovers from protocol.txt + + There's no XPrint extension (anymore). + + Signed-off-by: Daniel Martin + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit d3d845ca9e92f0a2ccde93f4242d7769cfe14164 +Author: Michel Dänzer +Date: Thu Sep 25 15:27:22 2014 +0900 + + glamor: Use GL_STREAM_READ also for read/write access to a PBO + + Otherwise the CPU may end up reading from non-cacheable memory, which is + very slow. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178 + Signed-off-by: Michel Dänzer + Reviewed-by: Markus Wick + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 78c27d12e1f4857bfcfc92afbb69d5dd989232b9 +Merge: 6e50bfa 1d6334d +Author: Keith Packard +Date: Mon Sep 29 13:04:49 2014 -0700 + + Merge remote-tracking branch 'jturney/xwin-clipboard-refactoring' + +commit 6e50bfa706cd3ab884c933bf1f17c221a6208aa4 +Author: Michel Dänzer +Date: Wed Sep 24 16:48:10 2014 +0900 + + glamor: Fix leak of converted_bits in _glamor_upload_bits_to_pixmap_texture + + ==9530== 808,575,600 bytes in 5,904 blocks are definitely lost in loss record 4,602 of 4,602 + ==9530== at 0x4C28C20: malloc (vg_replace_malloc.c:296) + ==9530== by 0xAD29C98: _glamor_upload_bits_to_pixmap_texture (glamor_pixmap.c:771) + ==9530== by 0xAD2AE95: glamor_upload_sub_pixmap_to_texture (glamor_pixmap.c:1031) + ==9530== by 0xAD2BD55: glamor_upload_pixmap_to_texture (glamor_pixmap.c:1057) + ==9530== by 0xAD1C2E6: glamor_composite_choose_shader (glamor_render.c:1025) + ==9530== by 0xAD1C629: glamor_composite_with_shader (glamor_render.c:1174) + ==9530== by 0xAD1DA77: glamor_composite_clipped_region (glamor_render.c:1542) + ==9530== by 0xAD1E849: _glamor_composite (glamor_render.c:1689) + ==9530== by 0xAD1ED90: glamor_composite (glamor_render.c:1758) + ==9530== by 0x519FD6: damageComposite (damage.c:502) + ==9530== by 0xAD27AA3: glamor_trapezoids (glamor_trapezoid.c:147) + ==9530== by 0xAD27B51: glamor_trapezoids (glamor_trapezoid.c:101) + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84176 + Signed-off-by: Michel Dänzer + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 4433bc6d53e651b3dc4112099a153c2574f30797 +Author: Adam Jackson +Date: Thu May 1 12:48:15 2014 -0400 + + x86emu: Undefine _NO_INLINE + + Never defined by the server. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 1c3cb68d0cd15d29fd3aaa9eedbfa772ec8e3a47 +Author: Adam Jackson +Date: Tue Jul 29 14:15:24 2014 -0400 + + xfree86: Remove pointless xf86PrintMarkers + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 30fa6da6f140d713041942a81f5d6da6736e4f7f +Author: Adam Jackson +Date: Tue Jul 29 14:07:39 2014 -0400 + + xfree86: configServerFlags never fails, make it return void + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 2bf9db1930528255a37f9787aeb82e2851f814c2 +Author: Adam Jackson +Date: Tue Jul 29 14:02:01 2014 -0400 + + xfree86: Remove unused xf86Info.useDefaultFontPathFrom + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit fffea07b4cb0992fed2cca33be08440ea94090d9 +Author: Adam Jackson +Date: Tue Jul 29 13:48:10 2014 -0400 + + xfree86: Remove xf86Info.log (v2) + + SUBCLASS ALL THE THINGS + + v2: Remove the enum too (anholt) + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 2f5cfbee5409b088156d4cd84a3376499e291631 +Author: Adam Jackson +Date: Tue Jul 8 14:50:22 2014 -0400 + + xfree86: Remove DisplayID support + + Not actually wired up so it's fairly useless. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit b56fcce761534d3e28b7ea19e2a13213c3157a1f +Author: Adam Jackson +Date: Tue Jun 17 10:36:44 2014 -0400 + + xfree86: Remove useless back-pointer to pScrn from colormap code + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit ef22655311efa0d5a5395ba2f19aa20d71a05a4f +Author: Adam Jackson +Date: Fri May 2 13:36:13 2014 -0400 + + xfree86: Remove spurious xf86ConfigError + + READABLE. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 35f0257360fa6e11b9ecc08e467163718e012bb1 +Author: Adam Jackson +Date: Tue Mar 4 11:12:16 2014 -0500 + + xfree86: Remove Option "TextClockFreq" + + No modern driver pays attention to this. Presumably there existed + hardware once where you couldn't just read the right values out of the + CRTC. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 6755aa2c1244fee11846c1e0b274bd34900e3299 +Author: Adam Jackson +Date: Fri Jul 25 12:31:54 2014 -0400 + + xfree86: Remove xv clip notify driver hook + + Nothing's using it. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit e89ccacea9a1e4bc3693bb78e717343addd517e5 +Author: Adam Jackson +Date: Thu Jan 23 10:27:58 2014 -0500 + + mi: Remove Windows 8-bpp colormap compatibility + + Nice, but not something our Windows servers build, and not something + that belongs in mi anyway. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 7cd192edc195c089c6df32e9f22e57da7467b6fd +Author: Adam Jackson +Date: Mon Jun 16 11:55:30 2014 -0400 + + loader: Deobfuscate RTLD_* macro stuff + + POSIX requires that these be named correctly, no need to be clever. + + Reviewed-by: Mark Kettenis + Signed-off-by: Adam Jackson + +commit cc59be38b7eff52a1d003b390f2994c73ee0b3e9 +Author: Keith Packard +Date: Fri Sep 12 11:33:48 2014 -0700 + + os: Don't listen to 'tcp' by default. Add '-listen' option. [v2] + + This disables the tcp listen socket by default. Then, it + uses a new xtrans interface, TRANS(Listen), to provide a command line + option to re-enable those if desired. + + v2: Leave unix socket enabled by default. Add configure options. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 8ada3fb32cd7dd8948eb55620de18ba03df6131d +Author: Keith Packard +Date: Sat Sep 20 10:04:11 2014 -0700 + + Require xtrans 1.3.5 or newer + + This version of xtrans offers the TRANS(Listen) function. + + Signed-off-by: Keith Packard + +commit 18935b41e13b34571ffda84bde5257b8e84e6d1f +Author: Keith Packard +Date: Sat Sep 20 04:04:43 2014 -0700 + + XSERVER_DTRACE needs request names from registry too + + The dtrace code in the server wants to log the name of each executed + request, which it gets from the registry. Use that as an additional + indication of when that portion of the registry should be included in + the server build. + + See: + + http://tinderbox.x.org/builds/2014-09-19-0003/logs/xserver/#build + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 28337cb14e4347e1dd7936c5393a22e042866687 +Author: Jon TURNEY +Date: Fri Sep 19 14:22:13 2014 +1000 + + xserver: Move 'pragma GCC diagnostic' outside functions + + $ gcc --version + gcc (Gentoo 4.4.3-r2 p1.2) 4.4.3 + + /jhbuild/checkout/xorg/xserver/os/log.c: In function ‘LogInit’: + /jhbuild/checkout/xorg/xserver/os/log.c:199: error: #pragma GCC diagnostic not allowed inside functions + /jhbuild/checkout/xorg/xserver/os/log.c:201: warning: format not a string literal, argument types not checked + /jhbuild/checkout/xorg/xserver/os/log.c:212: error: #pragma GCC diagnostic not allowed inside functions + /jhbuild/checkout/xorg/xserver/os/log.c:214: warning: format not a string literal, argument types not checked + + etc. + + Reviewed-by: Dave Airlie + Signed-off-by: Jon TURNEY + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 7e6bd546846964fd9b8c2a06dea4782a552b62d7 +Author: Keith Packard +Date: Wed Aug 6 12:58:38 2014 -0700 + + glamor: Remove shader-based trapezoid implementation. Fixes Bug 76213. + + I can't find any performance benefit to using the GL path and the code + renders this trapezoid incorrectly: + + top: FIXED 29.50 + bottom: FIXED 30.00 + left top: POINT 0.00, 29.50 + left bottom: POINT 0.00, 30.50 + right top: POINT -127.50, 29.50 + right bottom: POINT 52.50, 30.00 + + This should render a solid line from 0,30 to 52,30 but draws nothing. + + The code also uses an area computation for trapezoid coverage which + does not conform to the Render specification which requires a specific + point sampling technique. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit b2452311bd1d67b4d78612570d4a25c685c78a0c +Author: Keith Packard +Date: Tue Aug 19 12:52:05 2014 -0700 + + glamor: Check large pixmap users in glamor_largepixmap.c + + This enables the assertion that all users of the large pixmap member + are restricted to pixmaps which are actually large. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 5fc3e99f537b10dd9c2adfd37cf2c4ba5ed4bd44 +Author: Keith Packard +Date: Tue Aug 19 12:44:41 2014 -0700 + + glamor: Handle compositing from large to small pixmaps + + glamor_composite_largepixmap_region is given the job of dealing with + compositing between a mixture of large and small pixmaps. However, it + was assuming that the destination pixmap was large and fetching + members of the large structure even for small pixmaps. + + This manifested with assertion failures when compositing from a large + pixmap to a small pixmap. + + Fixed by using the pixmap size for the destination block size for + small pixmaps. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 6e78d7f5e6edf56180e2ecfd25300bb2523876ab +Author: Keith Packard +Date: Tue Aug 19 12:41:45 2014 -0700 + + glamor: Don't abuse large_pixmap members for regular pixmaps + + glamor_compute_clipped_regions_ext wants to treat small and large + pixmaps uniformly and did that by writing into the large pixmap + union member in small pixmaps to construct something that looks like a + one texture large pixmap. + + Instead of doing that, simply allocate the necessary elements locally + on the stack and use them from there. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit bab319763c9734da3cff7b91a582f54989dc4cbe +Author: Keith Packard +Date: Tue Aug 19 12:39:07 2014 -0700 + + glamor: Add macro __glamor_large in glamor_largepixmap.c + + For now, this simply fetches the large member of the pixmap private. + It will be changed to assert that the pixmap is large once bugs + related to that have been fixed. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 16e429f1f96f984b1ff575875a7a4d7d29b482e2 +Author: Keith Packard +Date: Tue Aug 19 12:34:41 2014 -0700 + + glamor: Change SET_PIXMAP_FBO_CURRENT from macro to static inline + + This is the last function-like macro in glamor_priv.h; change to + static inline like all of the other functions there. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit ea7357de90792cbceca6d8d9fdc144e7df8a0fba +Author: Keith Packard +Date: Wed Sep 10 14:01:59 2014 -0700 + + present: Clear pending flip pixmaps at CloseScreen + + If a flip is active at server reset time, the associated window will + get destroyed which will queue an unflip operation. If that isn't + synchronous, then it won't have finished by the time CloseScreen is + called. + + Calling present_flip_idle will signal the fence and remove the + reference to the fence and pixmap, freeing these in the X server and + allowing a DRM client to clean up as well. + + This also rewords other comments in present_flip_destroy, removing + scary words about needing synchronous operation (everything in this + function is synchronous now) and describing what effect we actually + need from present_set_abort_flip. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 2051514652481a83bd7cf22e57cb0fcd40333f33 +Author: Keith Packard +Date: Wed Sep 10 14:02:13 2014 -0700 + + present: Support PresentOptionCopy + + We added this option to the present protocol before 1.0 but somehow + never implemented it in the server. It's pretty simple; just don't + ever do flips if the application specifies Copy. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 69d8572ae4cd1bce17223ea8aff87916a974c861 +Author: Keith Packard +Date: Wed Sep 10 15:21:32 2014 -0700 + + Build required portions of registry.c automatically [v2] + + Instead of making the inclusion of the registry code a global + conditional, split the registry into two pieces; the bits required by + the X-Resource extension (the resource names) and the bits required by + the XCSECURITY extension (the protocol names). Build each set of code + if the related extension is being built. + + v2: Check for both XCSECURITY and XSELINUX. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a11fc2493e85e4a532f4954805a7c6d1c601b08f +Author: Keith Packard +Date: Wed Sep 10 15:04:00 2014 -0700 + + dix: Close protocol.txt after we're done loading extension names + + Don't leave this file open during the whole server execution process; + close it once all of the extensions are initialized. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 9e07f3a3d28b01402beecb3280c94fc525bd8075 +Author: Keith Packard +Date: Wed Sep 10 15:41:08 2014 -0700 + + test: Only build hashtable tests if building X-Resource extension + + The hash table functions are only included in the server when the + X-Resource extension is built, so don't try to build and test them + unless the X-Resource extension is being built. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 670ee0757febfb965d718fce2d5688717def667d +Author: Adam Jackson +Date: Tue Sep 16 11:10:58 2014 -0400 + + ephyr: Properly implement hardware cursors (v3) + + When dix hands us a new cursor we proxy it through to the host server; + since we keep the host XID on the cursor bits private we can switch + among them with just ChangeWindowAttributes. + + v2: + Use xcb-renderutil for argb format lookup (Uli, Keith) + Fall back to core cursors for host RENDER < 0.5 (Keith) + Drop useless ephyrEnableCursor + Consistently create/destroy the cursor image GC on both paths + Treat null cursor from dix as invisible + + v3: + Initialize the invisible cursor's image (Keith) + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit f839caadd4e567bf89f893aa7e5ba1327b712b4b +Author: Adam Jackson +Date: Wed Sep 17 11:07:22 2014 -0400 + + loader: Remove compatibility with ancient XFree86 version numbering + + Pretty sure I'm guilty of adding this. I think I was thinking of trying + to be compatible with some really old binary-only driver that I had + vague aspirations of reverse-engineering, but since I haven't gotten + around to it in the intervening decade... + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit af40913797e6595fb5466c2ff3110e9526a37b9f +Author: Julien Cristau +Date: Wed Sep 17 07:41:27 2014 +0200 + + xwayland: always include drm.xml in tarballs + + Move drm.xml out of the automake conditional so make dist includes it + even if glamor-egl is disabled. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83960 + + Signed-off-by: Julien Cristau + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit eaee6572beefca240c42791f9a3a6e547bedd410 +Merge: e3aa13b b84d25f +Author: Keith Packard +Date: Wed Sep 17 15:49:24 2014 -0700 + + Merge remote-tracking branch 'anholt/modesetting-import' + +commit e3aa13b8d63ea2fba6eb47ddd0a7dde5a6d2b661 +Author: Jon TURNEY +Date: Wed Sep 17 15:38:39 2014 -0700 + + Update help text since -iglx is now the default + + This should have been part of d0da0e9c3bb8fe0cd4879ecb24d21715bfaa209b + + Signed-off-by: Jon TURNEY + Signed-off-by: Eric Anholt + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit b84d25fd53e97105b99495af84abaacc4c901967 +Author: Eric Anholt +Date: Tue Aug 26 11:22:02 2014 -0700 + + modesetting: Drop remaining old-xserver compatibility. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 7b0965a826612988dd721ddbd67cfbec392b67b5 +Author: Eric Anholt +Date: Tue Aug 26 11:37:46 2014 -0700 + + modesetting: Drop use of compat-api.h + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 2feda3b6b58f46cef91ea41312aac9021a703777 +Author: Eric Anholt +Date: Tue Aug 26 11:06:23 2014 -0700 + + modesetting: Connect the driver to the build. + + v2: Fix libdrm version check, and use XORG_VERSION_* instead of a + static 1.0.0 version for the driver module. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 30dcc10f6c9c4bacbc0e3652917c298ca9fb3898 +Author: Adam Jackson +Date: Mon May 5 11:18:33 2014 -0400 + + xfree86: Clean up some more alpha awareness + + Since the sparse stuff is gone none of these variables get used for + anything, they're just dead side-effect-less execution. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 2e21c081d34d52ee49ac00a294d2e74caf529818 +Author: Adam Jackson +Date: Fri May 2 13:00:21 2014 -0400 + + xfree86: Remove the memory of MTRR awareness + + pciaccess does this for us, and none of our internal hooks really + remain. This does remove a cleanup pass from the BSD code, but the case + it's covering (a previous server leaving MTRRs around) can't happen + anymore. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit c42712ab4d8eec56704ad5422d8f54befeb1e886 +Author: Adam Jackson +Date: Fri May 2 12:58:23 2014 -0400 + + xfree86: Remove xf86CheckMTRR + + Die die die die die. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 8686463de7e1ef9814824d46526d8177a7a492a0 +Author: Adam Jackson +Date: Fri May 2 12:55:37 2014 -0400 + + xfree86: Remove xf86ReadBIOS + + Not being used externally or internally anymore. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 21b216ad6ce2e9c89359b95e4196e42d91bf9420 +Author: Adam Jackson +Date: Fri May 2 12:46:45 2014 -0400 + + int10: Port off xf86ReadBIOS + + If the linux vm86 backend changes look somewhat horrifying to you, + that's because you have taste. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 96c0da812a563d8229dc1396ac801329b3bcba91 +Author: Adam Jackson +Date: Fri May 2 12:39:01 2014 -0400 + + xfree86: Remove xf86LinearVidMem + + The only driver even pretending to check the result is mach64 anyway. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit ec0e29ed5bc71516de7feb226b548ce45cb9ffdf +Author: Adam Jackson +Date: Fri May 2 12:32:02 2014 -0400 + + xfree86: Remove {set,undo}WC from VidMemInfo + + Now that mapMem is gone this can never actually get called. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 9db2af6f757ef9680c70eb731698b7c9f9aca203 +Author: Adam Jackson +Date: Fri May 2 12:14:10 2014 -0400 + + xfree86: Remove xf86{Map,Unmap}VidMem + + This API sucks. Fortunately it's mostly unused at this point. geode, + sis, and xgi need minor patches to use the corresponding pciaccess code, + neomagic will (more explicitly) lose its non-PCI support, and newport + will need to be ported to /dev/mem or the platform bus or something. + + This should also make it pretty clear that alpha's sparse memory support + was basically not a thing anymore, very few tears shed. + + Reviewed-by: Eric Anholt + Signed-off-by: Adam Jackson + +commit 6d6aa8ab6b6d62d65f1354b4cd9af0bf4f2e81d7 +Author: Eric Anholt +Date: Tue Aug 26 11:43:54 2014 -0700 + + modesetting: Update for the platform device API change. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 9c080f44960d2338c7a59eee132a02d45186bfb0 +Author: Eric Anholt +Date: Tue Aug 26 11:41:46 2014 -0700 + + modesetting: Drop use of "pointer" for "void *" + + The xserver doesn't have that typedef. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit a10ea01475c6d0795b1a00cfd8be9912f4b54235 +Author: Eric Anholt +Date: Tue Aug 26 11:24:31 2014 -0700 + + modesetting: xserver already checks XEXTPROTO >= 7.2.99.901. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit c7e8d4a6ee9542f56cd241cf7a960fb8223a6b22 +Author: Eric Anholt +Date: Tue Aug 26 11:21:24 2014 -0700 + + modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT + + The server will always have it. + + v2: Clean up some weird formatting from the unifdeffing. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 0c07bfb38e61a8a6ad511dc8827e2dd20d68665d +Author: Eric Anholt +Date: Mon Aug 25 15:42:45 2014 -0700 + + modesetting: Merge modesetting's COPYING into the xserver's. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 1d6334dd0ca99923b6b55c5c047ef6b5c325f66c +Author: Jon TURNEY +Date: Wed Jun 19 13:09:35 2013 +0100 + + hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboard + + Including any server header might define the macro _XSERVER64 on 64 bit + machines. That macro must _NOT_ be defined for Xlib client code, otherwise bad + things happen. So let's undef that macro if necessary. + + Remove server directories from include path to ensure no server includes are + included + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 7ca93301940647219dbed2d14fcd3f37e49fb477 +Author: Jon TURNEY +Date: Tue Jun 18 19:53:52 2013 +0100 + + hw/xwin: Only add to XSetIOErrorHandler() handler chain once + + Only use XSetIOErrorHandler() to add to the global XSetIOErrorHandler() chain + once. If we do it every restart, then we make a loop in the handler chain, and + we end up with a thread spinning in that loop when the server shuts down... + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5819a02d461349dbfc86317c742406d2217f7f0c +Author: Jon TURNEY +Date: Tue Jun 18 19:35:20 2013 +0100 + + hw/xwin: Add a basic manpage for xwinclip + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 492c924c8531b013d50637e29213da287b9a7fa2 +Author: Jon TURNEY +Date: Tue Jun 18 19:28:53 2013 +0100 + + hw/xwin: In clipboard function prototypes, use Window type, not int type + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 4a38c3bda2b0a868d7611f9423d8a0f304b435aa +Author: Jon TURNEY +Date: Tue Jun 18 19:18:08 2013 +0100 + + hw/xwin: Remove XOpenDisplay() retry code + + Remove XOpenDisplay() retry code. This isn't a sensible thing for the + application to be doing, and XWin server needs to retry much more than just + XOpenDisplay(). + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 4fc62aef8079266f8878cb355e6eb894000d8b8b +Author: Jon TURNEY +Date: Wed Jun 19 14:00:28 2013 +0100 + + hw/xwin: Improve comment about why we can't XCloseDisplay() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 89eb7bdcad092821b61a48832e1db82975a2252b +Author: Jon TURNEY +Date: Wed Jun 19 13:59:40 2013 +0100 + + hw/xwin: Remove setjmp()/longjmp() error constants + + Check specially that setjmp() returned a value which we don't pass to longjmp() + seems a bit over-complex. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit d0353bbe57aab910a6ef7da8778023a9d39c37df +Author: Jon TURNEY +Date: Thu Jun 20 00:04:16 2013 +0100 + + hw/xwin: Move WIN_MSG_QUEUE_FNAME to where it's used + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit fa0da5a020c2ea9366568375b7f35d3f2ddad680 +Author: Jon TURNEY +Date: Thu Jun 20 13:04:35 2013 +0100 + + hw/xwin: Use header for prototypes in textconv.c + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit cbe133752d1e817246b532a274fda3f7d74ebca1 +Author: Jon TURNEY +Date: Thu Jun 20 12:50:18 2013 +0100 + + hw/xwin: Remove unused X includes from internal.h and add them where needed + + Also removing server headers we might clash with and no longer need. Make + a few adjustments to allow for this change: + + - provide a prototype of ErrorF() + - use the MAX() macro provided by sys/param.h, not the max() macro provided by misc.h + - use the X 'Bool' type rather than the unwrapped Windows 'BOOL' type + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 52f3cf3c612b2f33e39fd6f985b840a0d7192a50 +Author: Jon TURNEY +Date: Wed Jun 19 18:09:07 2013 +0100 + + hw/xwin: Remove standard includes from internal.h and add them where needed + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5992550c4cf8818d1c47c1e474c3d8c3383983fa +Author: Jon TURNEY +Date: Mon Jun 17 19:01:19 2013 +0100 + + hw/xwin: Add xwinclip test client + + Add xwinclip test client, which includes stubs for winDebug(), ErrorF() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5ae674ae6d6c0b02fd86c5e7b23b8c38b19f180a +Author: Jon TURNEY +Date: Mon Jun 17 20:03:04 2013 +0100 + + hw/xwin: Changes in error logging to make libwinclipboard more useful as a library + + Consistently use ErrorF() rather than winErrorFVerb() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit e1cf2b47bea9ff3e64c0ef1e4d0744d9df4bc1b7 +Author: Jon TURNEY +Date: Mon Jun 17 19:58:20 2013 +0100 + + hw/xwin: Look up atoms in winClipboardProc() + + Look up all atoms of interest in clipboard code in winClipboardProc() and pass + them down. + + This avoids the need to check serverGeneration to notice when we need to + invalidate cached atom values. + + Also consistently use cached atom values everywhere, rather than sometimes just + doing XInternAtom() again. + + Remove WIN_LOCAL_PROPERTY as unused now, as we only refer to CYGX_CUT_BUFFER + once and do that directly. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit be61a1fc7e25a380f8d506e13b22017492a71913 +Author: Jon TURNEY +Date: Mon Jun 17 19:07:05 2013 +0100 + + hw/xwin: Add fUseUnicode as parameter to winClipboardProc() + + Add fUseUnicode as parameter to winClipboardProc() + Access g_fUseUnicode global when calling it + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 126c1cfaa5b5978026d44a1f8b044d367056965b +Author: Jon TURNEY +Date: Mon Jun 17 18:27:56 2013 +0100 + + hw/xwin: Separate libwinclipboard interface and internal header files + + Rename the libwinclipboard internal header from winclipboard.h to internal.h + + Put libwinclipboard's public interface into winclipboard.h + + This lets winclipboardinit.c partake of that public interface, and all X server + headers without clashes + + winInitClipboard() prototype belongs in a server header + + v2: Remove duplicate declaration of winClipboardWindowDestroy() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 30c535219ef2c251d90a1a1d3d07c8a7ec936da9 +Author: Jon TURNEY +Date: Tue Jun 18 00:32:53 2013 +0100 + + hw/xwin: Return a shutdown flag from winClipboardProc() if we should stop trying + + Return a shutdown flag from winClipboardProc(), and use it in + winClipboardThreadProc() to determine if we should stop. + + Currently this is set if the clipboard messaging window received a WM_QUIT. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 88d44597046086953032fec7e035fc036596e255 +Author: Jon TURNEY +Date: Mon Jun 17 00:38:47 2013 +0100 + + hw/xwin: Move clipboard integration code down to a subdirectory + + Move clipboard integration code down to a subdirectory and build as a + convenience library + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit e965001a732a6b573c374f6a3503e172df01e8ec +Author: Jon TURNEY +Date: Mon Jun 17 13:18:16 2013 +0100 + + hw/xwin: Make g_hwndClipboard static + + Move winFixClipboardChain() into winclipboardthread.c + Add winCLipboardWindowDestroy() function to access it for WM_DESTROY + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 03a59e7f787a160c6cc07c7a37df64a793242ef2 +Author: Jon TURNEY +Date: Mon Jun 17 02:01:39 2013 +0100 + + hw/xwin: Add remaining clipboard globals to winglobals.h + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 8f9fba5bc1499804a6c4a3287d99fe7dab8d6b8f +Author: Jon TURNEY +Date: Mon Jun 17 02:01:27 2013 +0100 + + hw/xwin: Hoist use of winSetAuthorization() and winGetDisplayName() up one level + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a3c1e405cb78df9ef18a1158dcaed3c27b3cbffe +Author: Jon TURNEY +Date: Sun Jun 16 22:35:22 2013 +0100 + + hw/xwin: Eliminate g_pClipboardDisplay and g_iClipboardWindow globals + + Eliminate the g_pClipboardDisplay and g_iClipboardWindow globals used to make + those values available to the clipboard wndproc, by passing them in via the + WM_CREATE message instead. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 229a0a83a44c94ce76eb937d58dc1773a38baa3e +Author: Jon TURNEY +Date: Sun Jun 16 22:13:26 2013 +0100 + + hw/xwin: Move winClipboardCreateMessagingWindow() to winclipboardthread.c + + Move winClipboardCreateMessagingWindow() from winclipboardinit.c to + winclipboardthread.c, the only place that uses it, and make it static. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a70c2384a2689cc0346868bb27366c008c01758d +Author: Jon TURNEY +Date: Mon Feb 13 19:58:37 2012 +0000 + + hw/xwin: Remove SetSelectionOwner wrapper, use XFixesSetSelectionOwnerNotify event instead + + Use the XFixesSetSelectionNotify event instead of a SetSelectionOwner wrapper, + the completely equivalent client-side mechanism. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit ab55746c1b179172a82b7a89ec6429b268a1f166 +Author: Jon TURNEY +Date: Mon Jun 17 01:55:46 2013 +0100 + + hw/xwin: Remove g_fClipboardLaunched, it's value is identical to g_fClipboardStarted + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 42d13810822f6b48771d77b09c0ef7cc2356ede5 +Author: Jon TURNEY +Date: Mon Jun 17 01:30:09 2013 +0100 + + hw/xwin: Hoist setting of g_fClipboardStarted flag up one level + + Hoist the setting of g_fClipboardStarted flag up one level. + + Also move up the clearing of the g_fClipboardLaunched at the end of clipboard + function. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 290dbff0753ddf60f04da92d5a408c567a2ee3e0 +Author: Jon TURNEY +Date: Mon Jun 17 01:55:03 2013 +0100 + + hw/xwin: winProcEstablishConnection doesn't need to check if clipboard started + + winProcEstablishConnection doesn't need to check if clipboard has already been + started. + + It should be clear that we start the thread only once when the wrapper tells us + to, as the wrapper unhooks itself thereafter. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 91e55691ef07735bb866c0f4d3c1a6e2ca167992 +Author: Jon TURNEY +Date: Sun Jun 16 23:57:17 2013 +0100 + + hw/xwin: Hoist clipboard thread restart up one level + + Hoist clipboard thread restart up one level. + + Note that currently g_fClipboardLaunched is set the first time in the + winProcEstablishConnection wrapper, and subsequent times when the clipboard + thread restarts itself. + + Try to clarify this and just set g_fClipboardLaunched before starting the + thread. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 0bb6eae4e34634abb2679004ace94504a4d65964 +Author: Jon TURNEY +Date: Mon Jun 17 00:07:01 2013 +0100 + + hw/xwin: Push winClipboardShutdown() into winclipboardinit.c + + Push winClipboardShutdown() into winclipboardinit.c + This lets us make g_ptClipboardProc static + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 6343b531d786dd4a9bb52050c9ef267a04374b57 +Author: Jon TURNEY +Date: Wed Jan 1 17:54:48 2014 +0000 + + hw/xwin: Remove left-over pthread_exit() in clipboard code + + Commit c1bf3baa44fbd8af33a2b3ce045324485b85a7a7 removed all but one of the + pthread_exit() calls which used to call winClipboardThreadExit() + + Fix the final remaining one to exit via done label on IOError instead. + + Also fix a comment and report pre-flush failure to log, but do not exit + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit d3427717f2c6a473dc3d20631dff653e4e37228e +Author: Adam Jackson +Date: Wed Jul 2 12:09:52 2014 -0400 + + xwayland: Snap damage reports to the bounding box + + Instead of sending every little rect. Lets x11perf run to completion, + makes 'while true; do gtkperf -a; done' take longer to crash. + + This is effectively a resend of the same logic against the old + xfree86+xwayland branch: + + http://lists.x.org/archives/xorg-devel/2013-October/038453.html + + Reviewed-by: Daniel Stone + Reviewed-by: Kristian Høgsberg + Signed-off-by: Adam Jackson + +commit 5ecc0315a2b9bea44ace886f5706a7a3f5cbc4f6 +Author: Jasper St. Pierre +Date: Mon Jun 30 13:53:50 2014 -0400 + + xwayland: Implement throttling for surfaces based on the frame event + + This implements simple throttling that keeps us to one attach per + frame. There isn't really an active performance benefit, since the + buffers will be redrawn only once per frame anyway, but it does cut down + on the chatty network traffic. Since the Wayland sockets might fill + up as well, the cut down on the volume of data we send out also provides + us with a big stability benefit. + + Namely, mutter is a lot more stable running gtkperf, a fairly intensive + X11 application, after this change. + + Reviewed-by: Daniel Stone + Signed-off-by: Jasper St. Pierre + +commit 6c442fc4f7d84508665dfdee8a75ec91f50395dc +Author: Jasper St. Pierre +Date: Mon Jun 30 15:28:16 2014 -0400 + + xwayland-input: Fix a crasher for a race with the Wayland compositor + + If something quickly maps and unmaps a window, then we'll immediately + create and destroy the Wayland surface that cooresponds to that + window. If our mouse pointer is over the window when the surface is + created, we'll receive a enter on the window. + + Since resource creation and destruction is not synchronous, that + means that the compositor will queue up an event for a resource that's + eventually destroyed. On the client-side, when we receive this message, + we note that the resource isn't allocated, and get a NULL surface in our + enter handler. We immediately try to dereference this, and then crash. + + This was caused by running gtkperf while moving the window a lot. + + Reviewed-by: Daniel Stone + Signed-off-by: Jasper St. Pierre + +commit 1d32004ed5a3a20b2d5879867e213122dced69d0 +Author: Michel Dänzer +Date: Wed Sep 10 16:20:48 2014 +0900 + + glamor: Make glyph mask cache per-screen + + It references a pixmap, which is a per-screen resource. + + Fixes broken text rendering in xfwm4-tweak-settings in Zaphod mode. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 710d314ad16cf1eaca3b97b1736ff0ca43e598c4 +Author: Michel Dänzer +Date: Wed Sep 10 16:20:47 2014 +0900 + + glamor: Track glyph caching information per screen + + This is necessary because the glyph caches are per screen. + + Fixes broken menu text in gnome-terminal in Zaphod mode. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit a4e8e6dff9a0c26944a325e4017faa68d93ae5b8 +Author: Michel Dänzer +Date: Wed Sep 10 16:20:46 2014 +0900 + + glamor: Move 'glyph caches realized' check to glamor_realize_glyph_caches + + And rename the boolean to reflect what it's about. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 0acff6e4374340dc391014f396f190daf73d579c +Author: Michel Dänzer +Date: Wed Sep 10 16:20:45 2014 +0900 + + glamor: Call glamor_glyphs_init from glamor_create_screen_resources + + The comment above glamor_glyphs_init was already saying so. + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 54a1d4db825be90fb7be138e3267a15922d62f03 +Merge: 8f8dcfe f92df22 +Author: Keith Packard +Date: Thu Sep 11 18:27:41 2014 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 8f8dcfee2085ba82107a8bf3872a0bb241493409 +Author: Alan Coopersmith +Date: Thu Sep 4 23:18:03 2014 -0700 + + Make list tests actually test lists + + Coverity scan detected that asserts were setting values, not checking them: + + CID 53252: Side effect in assertion (ASSERT_SIDE_EFFECT) + assignment_where_comparison_intended: Assignment item->b = i * 2 + has a side effect. This code will work differently in a non-debug build. + Did you intend to use a comparison ("==") instead? + + CID 53259: Side effect in assertion (ASSERT_SIDE_EFFECT) + assignment_where_comparison_intended: Assignment item->a = i + has a side effect. This code will work differently in a non-debug build. + Did you intend to use a comparison ("==") instead? + + CID 53260: Side effect in assertion (ASSERT_SIDE_EFFECT) + assignment_where_comparison_intended: Assignment item->a = i + has a side effect. This code will work differently in a non-debug build. + Did you intend to use a comparison ("==") instead? + + CID 53261: Side effect in assertion (ASSERT_SIDE_EFFECT) + assignment_where_comparison_intended: Assignment item->b = i * 2 + has a side effect. This code will work differently in a non-debug build. + Did you intend to use a comparison ("==") instead? + + Fixing those to be == caused test_nt_list_insert to start failing as + part assumed append order, part assumed insert order, so it had to be + fixed to use consistent ordering. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit d0da0e9c3bb8fe0cd4879ecb24d21715bfaa209b +Author: Eric Anholt +Date: Thu Sep 4 10:59:40 2014 -0700 + + glx: Disable indirect GLX contexts by default. + + Almost every situation of someone running indirect GLX is a mistake + that results in X Server crashes. Indirect GLX is the cause of + regular security vulnerabilities, and rarely provides any capability + to the user. Just disable it unless someone wants to enable it for + their special use case (using +iglx on the command line). + + Signed-off-by: Eric Anholt + Acked-by: Keith Packard + Signed-off-by: Keith Packard + +commit bf338efc678258d2d366dff2ed873752f98f0bfc +Author: Keith Packard +Date: Thu Sep 4 08:36:07 2014 -0700 + + glx/present: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap + + Present didn't provide the 'kind' argument to the + present_complete_notify hook that GLX uses to construct + GLX_BufferSwapComplete events, so GLX was reporting events for + PresentCompleteKindMSC notifications, which resulted in duplicate + GLX_BufferSwapComplete events and crashes in clutter. + + See the gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=733282 + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 7a0c79c8c478bf22ee71c1ea35886a6f555ef2bb +Author: Thomas Petazzoni +Date: Tue Sep 2 22:03:14 2014 +0200 + + os/log: adjust gcc version conditions for #pragma + + In commit e67f2d7e0f9189beb2907fa06cff5ecc7f35f922 ("gcc 4.2.1 doesn't + support #pragma GCC diagnostic ignored"), some compile time + conditionals were added around the #pragma usage. Those conditionals + ensure that the #pragma are not used on gcc <= 4.2. + + However, the usage of #pragma diagnostic inside functions was only + added in gcc 4.6, and a build failure is therefore experienced with + gcc 4.5: + + log.c: In function 'LogInit': + log.c:199:9: error: #pragma GCC diagnostic not allowed inside functions + log.c:201:9: warning: format not a string literal, argument types not checked + log.c:212:9: error: #pragma GCC diagnostic not allowed inside functions + log.c:214:17: warning: format not a string literal, argument types not checked + + $ ./host/usr/bin/powerpc-linux-gnu-gcc -v + [...] + gcc version 4.5.2 (Sourcery G++ Lite 2011.03-38) + + This patch therefore adjusts the compile time conditionals to make + sure the #pragma is not used on gcc <= 4.5, and only used on gcc >= + 4.6. + + Signed-off-by: Thomas Petazzoni + Acked-by: Keith Packard + Signed-off-by: Keith Packard + +commit da4bad620a6f1a58978f5279fda74da3c1c1d443 +Author: Dave Airlie +Date: Tue Jul 30 13:50:48 2013 +1000 + + pixmap: fix reverse optimus support with multiple heads + + For doing reverese optimus to multiple outputs on a secondary GPU + the GPU can store the blits into a large screen pixmap, unfortunately + this means we need a destination offset into the dirty code, so + add a new API that just adds this interface. + + Signed-off-by: Dave Airlie + Reviewed-by: Chris Wilson + Signed-off-by: Keith Packard + +commit e1cc0d3df1fdb6c4393ac455ca038e1e0680bb22 +Author: Maks Naumov +Date: Thu Aug 21 12:58:16 2014 -0700 + + glx: Fix 'y ' value in swrastGetDrawableInfo() + + Signed-off-by: Maks Naumov + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit f92df22a037cb8b672dab2e7aef18a22275f5660 +Author: Jon TURNEY +Date: Fri Jul 18 15:08:17 2014 +0100 + + hw/xwin/glx: Remove an incorrect assertion in glxWinDrawableSwapBuffers + + The piglit test glx_make_current triggers this assertion, by making the context + current on a different drawable before issuing a glXSwapBuffers() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit b21321e515fc778f87077b7ce47922c43a4ba103 +Author: Jon TURNEY +Date: Mon Jul 14 19:41:25 2014 +0100 + + hw/xwin/glx: Downgrade "forcing window to exist" message to debug + + It happens whenever a GLX client uses GL on a window before it's been mapped, so + don't log it like an error. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 31d089633683ea2a2716651c3c48e1456cc595bf +Author: Jon TURNEY +Date: Wed Jul 16 13:44:33 2014 +0100 + + hw/xwin/glx: Fix a couple of typo bugs in indirect.c + + fbConfigToPixelFormatIndex()'s drawableTypeOverride parameter is a drawable + type bitmask, not a drawable type enum value + + WGL_SWAP_COPY_ARB is a value of the WGL_SWAP_METHOD_ARB attribute for + wglChoosePixelFormatARB(), not an attribute itself + + also remove duplicate error reporting for wglChoosePixelFormat() and fix a + comment + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit b1ea714cdce8444c6ad7778dae04e35c6bcc1750 +Author: Jon TURNEY +Date: Sun Apr 27 22:10:31 2014 +0100 + + hw/xwin/glx: Update .gitignore + + Update to align with rewrite of wrapper generation script in commit + 583a1146233f16d861706926706e5feec3baffba + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit d1d3bd359670a8f55c9350fd905af32ba6e67d33 +Author: Jon TURNEY +Date: Sun Mar 30 20:51:36 2014 +0100 + + hw/xwin/glx: Don't override the server supported GL extensions string. + + Don't override the server supported GL extensions string. + + The string reported to the client is the intersection of client, server and GL + implementation extensions. + + Overriding the server supported GL extensions string like this causes extensions + which are supported by the client and implementation, but not by the server, to + be erroneously reported, so don't change it. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c99cd058a89bbfc9ceab3c91b93451f70351ddce +Author: Jon TURNEY +Date: Tue Mar 4 22:37:13 2014 +0000 + + hw/xwin: Add an idempotency guard to glwindows.h + + Add an idempotency guard to glwindows.h + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 1c34e774eff6c5a22501833444a10440cf3f915a +Author: Jon TURNEY +Date: Mon Nov 11 15:09:18 2013 +0000 + + hw/xwin: Fix a potential crash in winRedrawScreenShadowDDNL() + + Seen during shutdown when using '-fullscreen' and '-depth 8' + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 16d9da08861fe504de4be8c31708592e30687156 +Author: Jon TURNEY +Date: Thu Feb 18 23:36:27 2010 -0600 + + hw/xwin: Improve choice of display name used by internal clients + + Choose the display name used to connect to internal clients and exported into + environment of processes started from the traymenu so that it uses a transport + we know is working + + This should mean the server can start correctly with -multiwindow and/or + -clipboard and any two of -nolisten inet6, -nolisten inet and -nolisten unix + (the server will correctly refuse to start if all 3 are used, as it must be + listening on at least one socket) + + v2: + Place prototype for winGetDisplayName() in windisplay.h, and include it where + needed. + + v3: + Include xwin-config.h, so that _XSERVER64 is defined, just in case anything + relies on that. + + v4: + Replace grovelling around in the server's list of listeners with new Xtrans + TransIsListening() interface, added in Xtrans 1.3.3 + + See also [1] + + [1] https://sourceware.org/bugzilla/show_bug.cgi?id=10725 + + Signed-off-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + Reviewed-by: Colin Harrison + +commit 95357539c1178a97d8a167461806a280d2803ec4 +Author: Jon TURNEY +Date: Wed Jan 1 20:34:36 2014 +0000 + + hw/xwin: Makefile.am cleanup + + - Rename XWIN_GLX_LINK_FLAGS -> XWIN_GLX_SYS_LIBS for consistency + - Rename MULTIWINDOW_LIBS -> MULTIWINDOW_SYS_LIBS for consistency + - Don't link with XWin with $(MAIN_LIB), it provides it's own main() + - Put one library per line for more intelligible diffs when one is added + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit aa40d0c07173209a2c13b332f1168e0df499a19e +Author: Jon TURNEY +Date: Fri Jun 13 16:16:51 2014 +0100 + + hw/xwin/glx: When generating shims, limit the considered features to GL version <=1.2 + + This fixes a problem when using Khronos registry data since the change of + 2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to + GL_ARB_imaging. + + If shim generation considers all features, no shims are generated for + glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore as + shims are only generated for GL version <=1.2), then emission for GL_ARB_imaging + is skipped as they have already been emitted. + + Also improve feature name matching so it is exact, not on an initial substring, + so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc' + aren't matched by 'GL_ARB_texture_compression'. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 35dc7c75150733dbcef8a18b6796f49a7c48ebee +Merge: 3a51418 5f3485b +Author: Eric Anholt +Date: Mon Aug 25 15:52:58 2014 -0700 + + Merge branch 'modesetting-import' into master + + This reintroduces a "hardware" driver to the xfree86 directory. + Unlike the drivers that xorg used to include in the source tree, that + needed independent release schedules to get hardware support out the + door, the modesetting driver shouldn't change much as new hardware + gets released. A lot of what this driver needs to do is just keep up + with server ABI changes. + + This import was done by taking xf86-video-modesetting-0.9.0, and + running this script with 'git-filter-branch -f --tree-filter + ~/bin/modesetting-filter': + + mkdir -p hw/xfree86/drivers/modesetting + + rm -f README autogen.sh configure.ac Makefile.am .gitignore + rm -f man/Makefile.am + + mv man/modesetting.man hw/xfree86/drivers/modesetting/ + mv COPYING hw/xfree86/drivers/modesetting/ + mv src/* hw/xfree86/drivers/modesetting/ + +commit 3a51418b2db353519a1779cf3cebbcc9afba2520 +Author: Laércio de Sousa +Date: Mon Aug 18 08:45:43 2014 -0300 + + ephyr: set screen size & origin from host X server output's CRTC geometry + + If a given output is passed via new -output option, Xephyr will query + host X server for its info. If the following conditions are met: + + a. RandR extension is enabled in host X server; + b. supported RandR version in host X server is 1.2 or newer; + c. the given output name is valid; + d. the given output is connected; + + then Xephyr will get output's CRTC geometry and use it to set its own + screen size and origin. It's just like starting Xephyr in fullscreen mode, + but restricted to the given output's CRTC geometry (fake "Zaphod mode"). + + This is the main feature needed for Xephyr-based single-card multiseat + setups where we don't have separate screens to start Xephyr in fullscreen + mode safely. + + Signed-off-by: Laércio de Sousa + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 84b02469ef97e6f85d074d220a517d752180045f +Author: Laércio de Sousa +Date: Mon Aug 18 08:45:42 2014 -0300 + + ephyr: enable screen window placement following kdrive -screen option extended syntax + + With this patch, one can launch Xephyr with option "-screen WxH+X+Y" + to place its window origin at (X,Y). This patch relies on a previous + one that extends kdrive -screen option syntax to parse +X+Y substring + as expected. + + If +X+Y is not passed in -screen argument string, let the WM place + the window for us, as before. + + Signed-off-by: Laércio de Sousa + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 376f4de8ae927748417046390c24afbda24b0583 +Author: Laércio de Sousa +Date: Mon Aug 18 08:45:41 2014 -0300 + + kdrive: add support to +X+Y syntax in -screen option parsing + + This patch enhances current -screen option parsing for kdrive-based + applications. It can parse strings like + x++, storing X and Y offsets + in KdScreenInfo instances. + + For negative values, this patch supports +-X+-Y (not -X-Y) syntax. + + It will allow e.g. proper Xephyr window placement for multiseat + purposes. + + Signed-off-by: Laércio de Sousa + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit fe5018e0564118a7a8198fa286186fdb9ed818c7 Author: Takashi Iwai Date: Tue Aug 19 15:57:22 2014 -0500 @@ -1071,62 +6386,8 @@ Date: Tue Aug 19 15:57:22 2014 -0500 Signed-off-by: Takashi Iwai Reviewed-by: Keith Packard - (cherry picked from commit fe5018e0564118a7a8198fa286186fdb9ed818c7) - Signed-off-by: Julien Cristau -commit 0e0951ce3eb33242934df9b683f8f5ca4fd501af -Author: Julien Cristau -Date: Sun Sep 21 10:56:53 2014 +0200 - - Bump to 1.16.1 - - Signed-off-by: Julien Cristau - -commit b501462e5da776e28a8e16d8573a6d17d7ebe15e -Author: Julien Cristau -Date: Wed Sep 17 07:41:27 2014 +0200 - - xwayland: always include drm.xml in tarballs - - Move drm.xml out of the automake conditional so make dist includes it - even if glamor-egl is disabled. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83960 - - Signed-off-by: Julien Cristau - Reviewed-by: Eric Anholt - Signed-off-by: Keith Packard - (cherry picked from commit af40913797e6595fb5466c2ff3110e9526a37b9f) - -commit 3ce47886c58b0640697f243a5df7060109c8346f -Author: Julien Cristau -Date: Mon Sep 15 22:55:16 2014 +0200 - - Bump to 1.16.0.901 - - Signed-off-by: Julien Cristau - -commit c48d07cf0e6edfc92dcb97de66c2484a8ddba452 -Author: Keith Packard -Date: Thu Sep 4 08:36:07 2014 -0700 - - glx/present: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap - - Present didn't provide the 'kind' argument to the - present_complete_notify hook that GLX uses to construct - GLX_BufferSwapComplete events, so GLX was reporting events for - PresentCompleteKindMSC notifications, which resulted in duplicate - GLX_BufferSwapComplete events and crashes in clutter. - - See the gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=733282 - - Signed-off-by: Keith Packard - Reviewed-by: Eric Anholt - (cherry picked from commit bf338efc678258d2d366dff2ed873752f98f0bfc) - [backport to 1.16: check 'kind' in the caller to avoid ABI change] - Signed-off-by: Julien Cristau - -commit fbe977941abb0a6db19b345652b6106d849899c1 +commit 5d133276de9c50146e80ffc69edd429c2afe98e6 Author: Thierry Reding Date: Thu Feb 13 13:36:12 2014 +0100 @@ -1139,11 +6400,8 @@ Date: Thu Feb 13 13:36:12 2014 +0100 Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard - (cherry picked from commit 5d133276de9c50146e80ffc69edd429c2afe98e6) - Signed-off-by: Hans de Goede - Signed-off-by: Julien Cristau -commit 484b881ecd7fbf5e1aabacfa96acb6f53475e32d +commit 2f0183222b4279266e6ef60b923738ff55f0afba Author: Thierry Reding Date: Thu Feb 13 13:31:31 2014 +0100 @@ -1157,12 +6415,147 @@ Date: Thu Feb 13 13:31:31 2014 +0100 Reviewed-by: Rob Clark Tested-by: Rob Clark Signed-off-by: Keith Packard - (cherry picked from commit 2f0183222b4279266e6ef60b923738ff55f0afba) - [hdegoede: backport to 1.16 which doesn't have syspath directly in OdevAttributes] - Signed-off-by: Hans de Goede - Signed-off-by: Julien Cristau -commit af2e9e3bb173885106f041f89b9f39b57fe3550a +commit 33aeec8a11bc75a06d32956bbdd9efb216790a02 +Author: Keith Packard +Date: Thu Jan 30 16:24:35 2014 -0800 + + dri3: Don't enable the DRI3 extension unless some screen supports it + + There's no reason to advertise this extension unless one of the + hardware drivers actually supports it. Not listing it means it's + slightly easier for users to tell what's going on. + + On the other hand, not listing it means we may have applications that + only check for the extension and not for appropriate per-screen + support. I don't think that's a real risk as DRI3 is only useful for + systems with deep knowledge of the hardware. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 0d7306ffe2e069f0091c4f174f138127100abb43 +Author: Michel Dänzer +Date: Wed Aug 13 17:10:21 2014 +0900 + + glamor: Don't call glamor_copy_fbo_cpu() for GLAMOR_DRM_ONLY pixmaps + + It results in a crash. + + Signed-off-by: Michel Dänzer + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit c2548d71f7a754251d89696ae49aab2fe07446df +Author: Joerg Sonnenberger +Date: Mon Aug 11 10:36:01 2014 +0200 + + Fix format string. + + Reviewed-by: Keith Packard + Signed-off-by: Thomas Klausner + Signed-off-by: Keith Packard + +commit d4111239e698f0126123830429d74da7d24910ed +Author: Keith Packard +Date: Wed Aug 13 11:30:11 2014 -0700 + + glamor: Free Xv put image data immediately after use + + The Xv StopVideo callback is not invoked on textured video ports, so + the temporary pixmaps allocated for the video planes are never freed. + + Freeing the storage immediately after use is a simple solution to this + problem which doesn't appear to have any visible performance impact. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit c47ee880e742e15fdbd5f5ac3eba64db6228c09f +Author: Eric Anholt +Date: Mon Aug 11 15:23:02 2014 -0700 + + glamor: Don't try to set up core fonts textures when we won't use them. + + This happens to avoid GL errors on hardware without + EXT_texture_integer (which implies < GLSL 130, and thus glamor_text.c + programs not compiling anyway). + + Signed-off-by: Eric Anholt + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit d09c9ddb866dea31e2adf82be329d5d3489718f5 +Merge: 606b701 ab32ee3 +Author: Keith Packard +Date: Tue Aug 12 16:34:24 2014 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 606b701c563c10f01dec147e061fa00cda784a9d +Author: Michel Dänzer +Date: Wed Aug 6 10:30:25 2014 +0900 + + glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination + + This provides a speedup e.g. when the destination is an SHM pixmap. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 + Signed-off-by: Michel Dänzer + Reviewed-by: Eric Anholt + Signed-off-by: Keith Packard + +commit 1e30fc1b99bda040038e4fd56d1b27c686b44c75 +Author: Peter Hutterer +Date: Mon Aug 4 10:47:03 2014 +1000 + + xkb: ignore floating slave devices when updating from master (#81885) + + Introduced in 45fb3a934dc0db51584aba37c2f9d73deff9191d. When a device is + enabled, the master's locked state is pushed to the slave. If the device is + floating, no master exists and we triggered a NULL-pointer dereference + in XkbPushLockedStateToSlaves. + + X.Org Bug 81885 + + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 4599a4492ca6a1c87cd9c537c54fbda11f13c15c +Author: Daphne Pfister +Date: Wed Jul 23 21:51:57 2014 -0400 + + os: Regenerate os/oscolor.c from app/rgb #52289 + + Regenerate os/oscolor.c from rgb.txt. This adds the following + colors: aqua, lime, fuchsia, crimson, indigo, olive, rebecca + purple, silver and teal. It also adds versions of gray, grey, + green, maroon and purple prefixed with web and x11 for the + colors that are different between X11 and HTML/CSS web colors. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52289 + Related: https://bugs.freedesktop.org/show_bug.cgi?id=80371 + + Signed-off-by: nobody + Tested-by: Keith Packard + Signed-off-by: Keith Packard + +commit ee9f766abf6fbe0cc36234bfe727aba924e9b5fd +Author: Keith Packard +Date: Mon Jul 28 12:09:51 2014 -0700 + + xfree86: [v2] Remove duplicate InputInfoPtr typedef from xf86Xinput.h + + GCC 4.2 doesn't accept 2 typedef declarations of the same type, so + remove the extra one from xf86Xinput.h and have xf86Xinput.h #include + xf86.h to make sure everyone using just that file gets the typedef. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Reviewed-by: Matthieu Herrb + +commit ab32ee35890be51137b56525826ffe219b63eb88 Author: Jeremy Huddleston Sequoia Date: Mon Aug 11 13:15:24 2014 -0700 @@ -1173,9 +6566,8 @@ Date: Mon Aug 11 13:15:24 2014 -0700 Follow-up to: 1c10b37380d228b35db8a8616a6312ac54f5e59b Signed-off-by: Jeremy Huddleston Sequoia - (cherry picked from commit ab32ee35890be51137b56525826ffe219b63eb88) -commit b7a24467f738bfd9437e8de02ed5e44409054185 +commit dfbc6a1a78ff3192baae6f7f2af98b6e51422f75 Author: Jeremy Huddleston Sequoia Date: Wed Jul 23 11:53:33 2014 -0700 @@ -1188,9 +6580,1082 @@ Date: Wed Jul 23 11:53:33 2014 -0700 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Harris - (cherry picked from commit dfbc6a1a78ff3192baae6f7f2af98b6e51422f75) -commit a793483e38bfb8af19877f69e873c1776de18d1f +commit 3714f5401690b288045090c4bcd9cb01c6e4860e +Author: Eric Anholt +Date: Sun Apr 6 07:57:44 2014 +0100 + + kdrive: Remove a dead struct. + + It's never been used in the history of the tree. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit ef258fa4fd0c215b1327fb3d94b37e75af9fae6b +Author: Eric Anholt +Date: Wed Jul 30 21:11:51 2014 -0700 + + xv: Drop the ClientPtr from the interface to the DDX. + + Nobody was using it. + + v2: Merge the hunk that was accidentally in the previous commit into + this one. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 850b268e2b9e49445a22e041a356d8ff26ae2147 +Author: Eric Anholt +Date: Sat Apr 5 10:55:45 2014 +0100 + + xv: Remove the no-op AllocatePort/FreePort interfaces. + + v2: Fix accidentally squashed-in change for dropping client from the + arguments, which should have been in the next commit. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard (v2) + +commit 41d4a626c6ceb15d5b008dca00c6f5032ddd9556 +Author: Eric Anholt +Date: Sat Apr 5 10:35:52 2014 +0100 + + kdrive: Don't bother explicitly clearing new window privates to NULL. + + Privates are initially cleared to zero by dixInitPrivates(). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e311318b35ef4f82996c6e277137569005893b44 +Author: Eric Anholt +Date: Sat Apr 5 09:11:03 2014 +0100 + + kdrive: Remove dead KXVPaintRegion(). + + It's been unused since mach64 was deleted, and now there's a helper in + core XV. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 7eac142fb6e8abb011ce59feda3c2d7b04f2b225 +Author: Eric Anholt +Date: Sat Apr 5 09:09:17 2014 +0100 + + xv: Fix malloc-failure cases in the fill color key helper. + + Signed-off-by: Eric Anholt + Reviewed-by: Alex Deucher + +commit ea3f3b0786d58b2ba6a9bbf0a32e734670f54b73 +Author: Eric Anholt +Date: Sat Apr 5 09:07:18 2014 +0100 + + xv: Move xf86 XV color key helper to core. + + Color key overlay implementations want to reuse this code, and XF86's + had bugs (to be fixed in the next commit). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit b01cfe5f23766b9c13ed6bd889263d5d7a8a351d +Author: Eric Anholt +Date: Fri Apr 4 22:58:37 2014 +0100 + + xv: Move CloseScreen setup from a DIX hook to normal wrapping. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 6a71ee79aabe6b611cae443a49786824a0322313 +Author: Eric Anholt +Date: Fri Apr 4 18:02:14 2014 +0100 + + xv: Drop unused XvdiVideoStopped(). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 4a095902a37cb98d7954d0873dcf1376cbab54b8 +Author: Eric Anholt +Date: Fri Apr 4 18:01:07 2014 +0100 + + xv: Drop unused XvdiPreemptVideo(). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e7dde86f2343832c52ef74f5c4fe44a72054c79b +Author: Eric Anholt +Date: Fri Apr 4 17:54:58 2014 +0100 + + xv: Move the DDX XV screen private allocation into the DDXes. + + XV was going against convention by having the core infrastructure + allocate the private on behalf of the DDX. I was interested in this + because I was trying to make multiple pieces of DDX be able to + allocate adaptors, and that wasn't going to work if DDX-specific code + was hung off of a single global screen private. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit a146c6d4212ed199002e40419b4aa22da8f49e3a +Author: Eric Anholt +Date: Fri Apr 4 13:12:34 2014 +0100 + + xv: Drop the ddQueryAdaptors() interface. + + The core was passing pointers to pxvs's nAdaptors and pAdaptors, and + the two hardware implementations were copying pxvs's nAdaptors and + pAdaptors into those pointers. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit cb42805c6675bbb9f0b37609fe2ffecc07f46290 +Author: Eric Anholt +Date: Fri Dec 27 21:54:26 2013 -0800 + + xv: Move common code for adaptor cleanup to xvmain.c + + Since any DDX XV screen cleanup would need this same code for freeing + the tree of pointers for xv adaptors, move it to the dix. + + v2: Unconditionalize the pPorts freeing, to match the block above it. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard (v1) + +commit 8cb0da29404d3fed13c1cbedb5c6164e4733ea82 +Author: Eric Anholt +Date: Fri Dec 27 20:59:12 2013 -0800 + + xv: Remove dead VIDEO_NO_CLIPPING from the xorg and kdrive DDXes. + + As far as I can see, nothing has ever used this flag except possibly + the i.mx6 xorg ddx debug during bringup. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit a6ec7d5278405d69e60cca2964006fb7ce32c556 +Author: Eric Anholt +Date: Fri Dec 27 20:53:00 2013 -0800 + + xv: Remove dead VIDEO_INVERT_CLIPLIST from the xorg and kdrive DDXes. + + As far as I can see (looking at trees on my disk, plus googling for + the term), nothing has ever used this flag + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e6c8c7e46c79b2837a7d0b12079a47734eff1eb7 +Author: Egbert Eich +Date: Mon Aug 4 19:16:30 2014 +0200 + + BellProc: Send bell event on core protocol bell when requested + + XKB allows to override the BellProc() ringing the 'keyboard bell': + instead an event is sent to an X client which can perform an + appropriate action. + In most cases this effectively prevents the core protocol bell + from ringing: if no BellProc() is set for the device, no attempt + is made to ring a bell. + This patch ensures that an XKB bell event is sent also when + the core protocol bell is rung end thus an appropriate action + can be taken by a client. + + Signed-off-by: Egbert Eich + Acked-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit e8373e4b6a793b48487b1a82d798d97b5c9a10a3 +Author: Keith Packard +Date: Thu Jul 31 19:57:53 2014 -0700 + + Add X_BYTE_ORDER to xorg-server.h + + Drivers don't get to use dix-config.h, they use xorg-server.h + instead. Add X_BYTE_ORDER to that file so drivers can see the value. + + Signed-off-by: Keith Packard + Reviewed-by: Michel Dänzer + +commit e31564e1a21e73f4d20d6471da4fc7a9b63e4062 +Author: Michel Dänzer +Date: Thu Jul 31 08:35:13 2014 -0700 + + Check for dix-config.h or xorg-server.h before using X_BYTE_ORDER + + Now that servermd.h depends on X_BYTE_ORDER being defined in + dix-config.h or xorg-server.h, check to make sure one of those has + been included before using the value. + + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 61afe950e6a1a640ad9c5368549914ea32b90d48 +Author: Keith Packard +Date: Mon Jul 21 19:27:20 2014 -0700 + + xfree86/modes: rotation damage is automatically destroyed on close + + Don't try to destroy rotation_damage in the xf86RotateCloseScreen; it + will have been destroyed when the screen pixmap was destroyed. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 40dc81154ad38514793f2181447d597b57d39e80 +Author: Keith Packard +Date: Sun Jul 20 18:57:42 2014 -0700 + + present: Avoid crash at server shutdown + + When a present flip operation is still in process during server reset, + the call to present_set_abort_flip may not happen until the screen is + being closed, at which point there is no root window to set pixmaps + for. Check to make sure there's a window before resetting window pixmaps. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 627bce80894647c681b146a709aad4c390b4374e +Author: Keith Packard +Date: Sun Jul 20 18:53:52 2014 -0700 + + present: Make window MSC offset 0 initially + + The MSC offset used by a window is adjusted as the window moves + between screens, and between shown/unshown. The value shouldn't + matter, but it's helpful for debugging to have window MSC values be + the same as the CRTC MSC at first. + + This patch introduces a unique CRTC value so that Present can detect + the first time a window is a PresentPixmap destination and set the MSC + offset to zero, rather than using the fake MSC value as the previous + window MSC. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit bd4198b01f2baf2284e61ea7ebf4600f554800e9 +Author: Keith Packard +Date: Fri Jul 18 11:19:01 2014 -0700 + + xfree86: Avoid compiler warning for unused vars without systemd + + When systemd isn't being used, systemd_logind_release_fd is defined + as an empty macro, leaving the arguments unused. Fix the compiler + warnings by simply removing the local variables and referencing the + structure within the macro call. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit b063a185ab9d2c54669fb6e036fdbae3707c9e4b +Author: David Ung +Date: Tue Jul 29 15:01:39 2014 -0700 + + randr: Fix logic in RRPointerToNearestCrtc + + RRPointerToNearestCrtc is suppose to snap to the nearest Crtc, + but best_x and best_y is always positive, hence when calling + SetCursorPosition it will make the cursor even further away. + Correct delta x/y to allow negative values and also use + "width/height -1" in the calculation. Also choose the closest + Crtc by setting the "best" value. + + Signed-off-by: David Ung + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 90803042bcbb9dc6261b5d112acf5613829d9f70 +Author: Keith Packard +Date: Wed Jul 30 10:13:53 2014 -0700 + + Fix files including xorg-server.h by mistake + + A few files in the server are including xorg-server.h, which is only + for use by Xorg server drivers. This fixes those errors and then adds + a check to make sure it doesn't happen again. + + Signed-off-by: Keith Packard + Reviewed-by: Adam Jackson + +commit a08e7a098aa37351294a25fe62b7ff6e95622e64 +Author: Adam Jackson +Date: Tue Jun 24 14:21:57 2014 -0400 + + dri1: Remove unused DRI{,Post}ValidateTree + + i810, mga, savage, and tdfx do reference these slots, but only to set + them to NULL, so while this does have API impact it's not actually used. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 5486c834fa3eebd79a4811143e513d6a92b7e504 +Author: Adam Jackson +Date: Tue Jun 24 14:16:55 2014 -0400 + + xquartz: Remove unused DRI{,Post}ValidateTree + + Cargo-culted from DRI1, not actually used for anything. + + Reviewed-by: Jeremy Huddleston Sequoia + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a5e7701058c676231d2bc3f9a0c7c0fa9da7ad45 +Author: Adam Jackson +Date: Wed May 28 14:48:14 2014 -0400 + + xkb: Remove some fascinating paranoia from event emission + + XkbInterestPtrs are created by clients that already exist, meaning, + clients that have already had ProcVector installed as something other + than InitialProcVector. + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit ac3af4bd21394291ef6dd9cfcdd8ce6fceefec40 +Author: Adam Jackson +Date: Tue Jun 17 12:58:41 2014 -0400 + + xfree86: Remove unused HardEdges + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 4100687ea667970733c3aa69f704be0e3747f9fd +Author: Adam Jackson +Date: Mon Jun 23 15:42:23 2014 -0400 + + xfree86: Remove useless #include "fb.h" + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 2d451c5cdc7f81ea0c94c3542fab45027f829736 +Author: Adam Jackson +Date: Thu May 22 14:04:16 2014 -0400 + + xfree86: Remove pointless xf86RandRCreateScreenResources + + Given the #if 0 this was wrapping for no effect. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a8cca7bd5ad7ea36a9585f4927ed53cfa6db1daf +Author: Adam Jackson +Date: Fri May 2 11:43:14 2014 -0400 + + xfree86: Remove protectMem from VidMemInfo + + Never filled in. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit e4cf1e58f5745dd39a9dd5eb29acd1cb28710094 +Author: Adam Jackson +Date: Fri May 2 11:11:14 2014 -0400 + + xfree86: Remove unused xf86{Map,Unmap}LegacyIO + + I ported these to pciaccess in: + + commit 858fbbb40d7c69540cd1fb5315cebf811c6e7b3f + Author: Adam Jackson + Date: Fri Sep 16 13:33:04 2011 -0400 + + pci: Port xf86MapLegacyIO to pciaccess + + As of yet there are still no drivers using them, and there's not a lot + of value in having the wrappers when they just trivially call pciaccess + anyway. Nuke 'em. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 96206cf47752af3fc8ca14dc1e03c59ed482167f +Author: Adam Jackson +Date: Tue Jul 8 13:19:08 2014 -0400 + + xfree86: Remove deprecated PCI types + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 46fd5a28ef7191b5ad0244f849c756dd2c5f43b6 +Author: Adam Jackson +Date: Fri May 2 11:09:53 2014 -0400 + + xfree86: Remove some unused pre-pciaccess types + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 3bb9f9862b5bea3720ba7922714af729cab38776 +Author: Adam Jackson +Date: Fri Feb 28 13:31:08 2014 -0500 + + xfree86: Remove xf86ConfigActivePciEntity + + The giant OBSOLETE DO NOT USE comment has been there since 2000, + probably it's safe to nuke by now. + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 51531a67179e342f6ad798de21accf014748a04f +Author: Adam Jackson +Date: Tue Jun 10 13:10:28 2014 -0400 + + vgahw: Nuke unused vgaCmap.c + + Never been built since m12n, can't be needed. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 2db71b232c4756773562182cadb7ccdf5194a62d +Author: Adam Jackson +Date: Tue Jun 10 13:00:11 2014 -0400 + + saver: Don't open-code IsMapInstalled + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit dd0e8491f75afbd72bea17172a042aa45ff7e30b +Author: Adam Jackson +Date: Fri Jun 20 12:36:10 2014 -0400 + + render: Remove unused CopyPicture + + Arguably this would be useful API, but it's never called, and a careful + reading of the CPClipMask path reveals that callers would be fairly + disappointed. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 578026fcd58d12dd0be4c0976ee5ecf95a9d61f0 +Author: Adam Jackson +Date: Tue May 20 12:43:59 2014 -0400 + + os: Remove LocalClientCred + + The comment lies, shm hasn't used this code since: + + commit fdef7be5c8d5989e0aa453d0a5b86d0a6952e960 + Author: Alan Coopersmith + Date: Tue Oct 9 18:44:04 2007 -0700 + + Sun bug 6589829: include zoneid of shm segment in access [...] + + Reviewed-by: Alan Coopersmith + Signed-off-by: Adam Jackson + +commit cad9b053d52f62432dfd70e42e0240de77027cae +Author: Adam Jackson +Date: Tue Jul 8 13:24:25 2014 -0400 + + os: Remove deprecated malloc/free wrappers + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit d5b279977236c4f80a8ba81db1f81a314484facf +Author: Adam Jackson +Date: Thu May 22 13:58:45 2014 -0400 + + miext/shadow: Remove shadowInit + + This code is nonsensical. You end up creating a screen-sized pixmap + that's totally detached from everything else, which you then listen for + damage on, which means you'll never hear any damage, which means your + shadow update hooks will never get called. Any driver using this would + be sorely disappointed. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit cf4793d99ecee4dfd6094e02b1ccb89eb744d313 +Author: Adam Jackson +Date: Fri Feb 28 15:36:31 2014 -0500 + + miext/shadow: Remove ancient backwards-compatibility hack + + Here's a trip down memory lane. Back when we merged kdrive we adopted + kdrive's version of shadow, which used damage directly instead of + hand-rolling it. However a couple of Xorg drivers referred to the + accumulated damage region in the shadow private directly, so I added a + hack to copy the damage region around. + + That was 9148d8700b7c5afc2644e5820c57c509378f93ce, back in early 2006. + Eight years is unusually patient for me. The neomagic and trident drivers + were still relying on this, but they've been modified to ask the damage + code for the region instead. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 35eabf2e5272e17e6765027d4baea43b34c66933 +Author: Adam Jackson +Date: Tue Jul 8 14:11:22 2014 -0400 + + mi: Remove apparently unused miSegregateChildren + + This came in between XFree86 4.3 and 4.4, I'm not entirely sure what it + was meant to do. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 150acef3af9bb43cb60cbcc558ef3ad4a710e624 +Author: Adam Jackson +Date: Mon May 19 13:46:12 2014 -0400 + + kdrive: Remove some dead bits of the man page + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit 71ef49062ee33ac49033fbcd67bab88120882668 +Author: Adam Jackson +Date: Fri Feb 28 14:05:25 2014 -0500 + + dix: Make some LBX-era code more obvious + + isItTimeToYield in the conditional effectively didn't do anything here. + Take it out, and remove the comment since LBX proxies aren't a thing for + us anymore. + + Reviewed-by: Keith Packard + Signed-off-by: Adam Jackson + +commit a317e0a974c1597d55fe05a38b4a495c4e4e8d71 +Author: Adam Jackson +Date: Fri May 2 11:50:17 2014 -0400 + + bsd: Remove some reference arm code behind #if 0 + + git history is reference enough, thanks. + + Reviewed-by: Alex Deucher + Signed-off-by: Adam Jackson + +commit 8a60d1c3f4a62675cad005107f56413f946ecd77 +Author: Keith Packard +Date: Mon Jul 28 11:10:15 2014 -0700 + + glamor: Eliminate diagonal tearing in xv + + This uses a single large triangle and a scissor to draw the video + instead of two triangles. + + Signed-off-by: Keith Packard + Reviewed-by: Alex Deucher + +commit 29eaa61cb210e0c67004bc567af0c15d48aad626 +Author: Adam Jackson +Date: Tue Jul 22 11:05:32 2014 -0400 + + mi: Remove semi-arbitrary arch awareness in packed coordinate macros + + The majority of arches end up on the right-shift path here. I can't + think of any arch where that'd be slower than a divide, and semantically + it makes more sense to think of this as a shift operation anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 6ddd164508f81e9582b66061b385bd34ac1ccb7e +Author: Adam Jackson +Date: Tue Jul 22 10:59:13 2014 -0400 + + xfree86: Unify the ppc/sparc mmio-swap-or-not conditionals + + Map SPARC_MMIO_IS_BE and PPC_MMIO_IS_BE to MMIO_IS_BE and use the same + macros for both since they're identical. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8ffd1c066ab1e993d8964aef12a7c585329c677c +Author: Adam Jackson +Date: Tue Jul 22 10:59:12 2014 -0400 + + xfree86: Clean up some silly __sparc macro usage + + The top of this file already defines __sparc__ if __sparc is defined. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 1c1711b57f2c278c0df03bf9e7e9a1776a546968 +Author: Adam Jackson +Date: Tue Jul 22 10:59:11 2014 -0400 + + xfree86: Pull generic barrier() definition up to top level + + And remove the redundant redecl from the nds32 section. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit c73929bbfc14ba80397c53ca98d3b503c807ae78 +Author: Adam Jackson +Date: Tue Jul 22 10:59:10 2014 -0400 + + xfree86: Remove MMIO_ONB* and friends + + Non-barrier-emitting MMIO writes. They appear to be utterly unused, + burn it all down. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 9b33e31d4160dc484ee569740f883f4d34e10653 +Author: Adam Jackson +Date: Tue Jul 22 10:59:09 2014 -0400 + + xfree86: Clean up powerpc barrier decls + + I think the externs are there for the non-gcc case? And maybe there was + some assembly code to implement that once? Whatever, at this point on + ppc the compiler is either gcc or willing to pretend. The macros below + the decls take care of the actual eieio so the externs can just go. + + Also remove a comment that maybe made sense once upon a time. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit b5141a1fab4d45c1af62db8dc712deb9776668a9 +Author: Adam Jackson +Date: Tue Jul 22 10:59:08 2014 -0400 + + xfree86: Simplify a bunch of OS and arch conditionals + + All of this is inside #ifdef __GNUC__, between that and configure.ac we + can assume there's a unixy thing under us. Given that there's no real + reason to limit the arch paths to particular OSes, so let's not. + + The final #elif here, combined with the ones before it, effectively said + "if not (alpha amd64 sparc* mips* ppc* arm* nds32 m68k sh hppa s390 m32r)", + and as the comment above it hints, it's meant to cover i386 (and happens to + also cover itanic). Flip the conditional around to be sensible. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 6d3ba80f197b04b6e0814190cf5c678c786c14d6 +Author: Adam Jackson +Date: Tue Jul 22 10:59:07 2014 -0400 + + xfree86: Remove pre-2.6 Linux ppc support + + 2.6.0 was December 2003, you've had plenty of time to get your head in + the game. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e242e82eba17414603c8806fffc9ecd235eebabb +Author: Adam Jackson +Date: Tue Jul 22 10:59:06 2014 -0400 + + xfree86: Remove a useless !__SUNPRO_C guard + + You can't tell from context here, but this is all inside #ifdef + __GNUC__, so this conditional can't do squat. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 93745a6c1afc830759219f8632ec565d83c7bc12 +Author: Adam Jackson +Date: Tue Jul 22 10:59:05 2014 -0400 + + xfree86: Undef GCCUSESGAS + + Can't be needed, we've never defined it in modular xserver. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit b1d9bc8d1d828b0dedda46da98628b47915e6a04 +Author: Adam Jackson +Date: Tue Jul 22 10:59:04 2014 -0400 + + xfree86: Remove an unlikely bit of #pragma + + __USLC__ appears to mean the SCO OpenServer compiler, which configure.ac + doesn't think is an OS the xfree86 ddx supports. The conditionals + surrounding these pragmas effectively mean "if not gcc and not Sun C", + and probably arbitrary pragmas aren't supported by arbitrary compilers. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit f7f9ccef1dc251a1b95ca698ac39bd0a47f0c8fa +Author: Adam Jackson +Date: Tue Jul 22 10:59:03 2014 -0400 + + xfree86: Undef __HIGHC__ + + MetaWare High C++ compiler? xfree86 cvs history shows this being added + in a commit whose text is, classically, "updates". metaware.com + redirects to a 404 on synopsys.com, which to me indicates it's not super + important to them, and their order form won't even tell you how much the + thing costs. At any rate if this is worth worrying about it's worth + letting autoconf worry about for us. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 80446086b9cfcc5e23a400d7fa38ec773fae68fc +Author: Adam Jackson +Date: Tue Jul 22 10:59:02 2014 -0400 + + xfree86: Undef FAKEIT + + I guess this is meant to stub out all I/O port calls? Whatever, it's + not been defined by the buildsystem at least as far back as monolith + 6.8.2. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 8002b1a8cb18ecc6526e8ebfd769767f8991ebd6 +Author: Adam Jackson +Date: Tue Jul 22 10:59:01 2014 -0400 + + xfree86: Remove a few random ppc decls + + Whatever these are, they're not something grep can find, they must not + be used. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 5f5af5d6692b625f6231c8bca3ac801f2ac75717 +Author: Adam Jackson +Date: Tue Jul 22 10:59:00 2014 -0400 + + xfree86: Remove remaining unused unaligned accessors + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit d28b788e11182d134bce5a414359841b37b62ac0 +Author: Adam Jackson +Date: Tue Jul 22 10:58:59 2014 -0400 + + xfree86: Move generic unaligned helpers into int10 code + + This is the only place they're actually used (well, aside from some XAA + code in the s3 driver, but one s3 and 2 XAA). + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 956a8d5c92a66ddd8d00e63a95b17cfd376fe424 +Author: Adam Jackson +Date: Tue Jul 22 10:58:58 2014 -0400 + + xfree86: Remove unused unaligned int64 helpers + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit da2b2671863655776d60102ddc7af61470d14022 +Author: Adam Jackson +Date: Tue Jul 22 10:58:57 2014 -0400 + + xfree86: Unspecialize gcc variants of unaligned memory access + + Yes yes, very clever, memmove works fine on gcc too, let's just do the + portable thing since none of this is performance code. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit e03c902e03dea7a6a98ad5fb00580b9404b67c4d +Author: Adam Jackson +Date: Tue Jul 22 10:58:56 2014 -0400 + + xfree86: Undefine NO_INLINE + + Nothing in the server defines this, nor do any drivers. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit f63b8e44ab278dd65be93146790bf150717fc1c8 +Author: Adam Jackson +Date: Tue Jul 22 10:58:55 2014 -0400 + + xfree86: Remove MMIO_MOVE32 + + Only used by mach64's XAA code, which isn't built if XAA isn't + available, and it isn't. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 1100935650cc0032709d095d6d5a5f136bec99b9 +Author: Adam Jackson +Date: Tue Jul 22 10:58:54 2014 -0400 + + xfree86: Remove nds32_flush_icache + + I guess this might have been needed for elfloader, except we didn't + support nds32 back then, so I assume this was cargo-culted from + ppc_flush_icache, which is also dead now. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit eb76228080da6fb28c34c903a9854aebe157d2c7 +Author: Adam Jackson +Date: Tue Jul 22 10:58:53 2014 -0400 + + xfree86: Remove #include "compiler.h" from places that don't need it + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 4afedf545b673282f2e214c0e2c759c9be9b9a2a +Author: Ross Burton +Date: Wed Jul 9 11:33:23 2014 +0100 + + configure.ac: add option for xshmfence + + xshmfence is usable outside of DRI3, and is currently autodetected which isn't + good for distributions where deterministic builds are desired. + + Signed-off-by: Ross Burton + Reviewed-by: Matt Turner + Signed-off-by: Keith Packard + +commit 2172714c67d8701aa54c202e89f246f1dddac80a +Author: Carlos Garnacho +Date: Tue Jul 22 17:55:25 2014 +0200 + + xwayland: Only disable/enable devices on capabilities change + + Anytime a capability is first reported, the device is created, but after + that, it is only disabled/enabled. + + This is a closer behavior to what Xorg does on VT switch, at the expense + of maybe leaving a dangling "physical" device if a capability goes for good. + Otherwise, any DeviceIntPtr (re)created after server initialization will be + left floating, and bad things happen when the wayland enter event handler + tries to update cursor position based on a floating device. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 556cdf8fe870bc23e0393c0eed15c86f49a0b9f8 +Merge: 83701c4 1faa766 +Author: Keith Packard +Date: Thu Jul 24 16:51:00 2014 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 83701c4ee8f79f69f4286ef262cd3ae3922629b9 +Author: Adam Jackson +Date: Mon Jul 21 10:21:07 2014 -0400 + + xfree86: Remove i2c multimedia modules + + These came in with the GATOS merge I think. The only driver using them + was radeon, and then only in UMS mode. The radeon driver dropped UMS + support from the main branch about two years ago, the UMS branch hasn't + been touched in about fifteen months, and does not build against 1.16 in + any case, so this is all dead code. + + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 4302484ef2e67b2e05756c7ee0834dce938f1b44 +Author: Adam Jackson +Date: Mon Jul 21 10:06:53 2014 -0400 + + dix: Remove arch awareness from servermd.h (v2) + + At this point we have no architectures where image byte order is + different from bitmap bit order, or where either of those two are not + also the native word endianness. Hooray, one more place where we don't + have to worry about enabling new CPU architectures. + + v2: Rebase to master to handle the addition of ppc64le, arc, and xtensa, + and use autoconf's endianness detection instead of gcc predefines. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 860cd209679a2e56460977882b3b3826ddcb8710 +Author: Adam Jackson +Date: Mon Jul 21 10:06:52 2014 -0400 + + dix: Remove a weird case of little-endian s390 + + I really don't think this was ever correct, but I'm also not sure what + non-Linux Unix this was meant to enable. The only one I know of was + OS/390 / z/OS / OpenEdition, but I think that was big-endian too. + + At any rate this is all about to go away, so this is just removing an + edge case. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit f593d76de76a645e29af5dd457ad1fd5a30736cc +Author: Adam Jackson +Date: Mon Jul 21 10:06:51 2014 -0400 + + dix: Remove wacky sparc special casing (v2) + + This appears to be defining sparc if ever __sparc or __sparc__ were + defined, which is almost reasonable, but these days we want to be using + the __arch__ style. Why any of this would ever be triggered on m68k is + truly a mystery for the ages. + + v2: Fix commit message, as noted by nix + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 17c3347f14822b9f7da4253c71f6ed51be2b38d1 +Author: Adam Jackson +Date: Mon Jul 21 10:06:50 2014 -0400 + + dix: Default GLYPHPADBYTES to 4 + + This effectively no longer varied across architectures anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 094b76735cb99b9f26e21f32170614454c644653 +Author: Adam Jackson +Date: Mon Jul 21 10:06:49 2014 -0400 + + dix: Remove some cfb leftovers + + These macros meant something in cfb, but not in fb. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit fee9a1536651ace9324b956df809ef22a63938f8 +Author: Adam Jackson +Date: Mon Jul 21 10:06:48 2014 -0400 + + dix: Remove some dead macros + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 634aa310c5130ef4d38f339bb26b01b5a7bad4e9 +Author: Adam Jackson +Date: Mon Jul 21 10:06:47 2014 -0400 + + dix: (Don't) change BITMAP_SCANLINE_UNIT on Linux s390{, x} + + Every other architecture sets this to 32, and I can't think of any + benefit s390 would derive from changing it. It is, at any rate, + something the client already copes with, and the only internal code + impact seems to be some complicated math in miGetPlane, which you never + hit if you're using fb. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit f6469f1910c72add358b7263d69bd116b4450ece +Author: Adam Jackson +Date: Mon Jul 21 10:06:46 2014 -0400 + + dix: Remove some XFree86 3.x leftovers + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 5aaacb501ff26bad391664cc7367bfe5164f72c7 +Author: Adam Jackson +Date: Mon Jul 21 10:06:45 2014 -0400 + + dix: Remove an ancient IBM configuration + + Whatever unix this was meant to be is either no longer in circulation, + or is AIX, which we don't claim to support anyway. + + Signed-off-by: Adam Jackson + Reviewed-by: Daniel Stone + Signed-off-by: Keith Packard + +commit 06268a0c55b7ce2737bdaa39f11cce07efa8bfa3 +Author: Aaron Plattner +Date: Sat Jul 19 09:59:07 2014 -0700 + + xfree86: Remove stale /usr/share/X11/xorg.conf.d hard-code from the xorg.conf man page + + I forgot that the old behavior of searching in /usr/share/X11/xorg.conf.d was + documented in the man page. + + Signed-off-by: Aaron Plattner + Fixes: acc0b5edd1dc ("xfree86: Only support one sysconfigdir") + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 1faa76670572e3478965fd2cd9ab60ab2d865e3a Author: Jeremy Huddleston Sequoia Date: Sat Jul 19 17:08:09 2014 -0700 @@ -1214,9 +7679,211 @@ Date: Sat Jul 19 17:08:09 2014 -0700 Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Peter Hutterer - (cherry picked from commit 1faa76670572e3478965fd2cd9ab60ab2d865e3a) -commit 3c0431b8911241552a15a43e4279c50658b50a18 +commit cff12936275db2f71f6d24f9ea0985a0d14af454 +Author: Keith Packard +Date: Fri Jul 18 21:46:23 2014 -0700 + + glamor: sync_fence_set_triggered should use glFlush, not glFinish + + I intended to use glFlush all along, but somehow managed to type + glFinish instead. glFlush is sufficient (for a single-queue GPU) to + ensure serialization between queued rendering in the X server and + future rendering from the client. + + Signed-off-by: Keith Packard + Reviewed-by: Jasper St. Pierre + +commit cfa302d6224d10860e60491333950544c4fb9b04 +Author: Keith Packard +Date: Fri Jul 18 11:16:27 2014 -0700 + + glamor: Add support for SHM sync fences + + This hooks up SHM sync fences to complete the requirements for DRI3 + running on Glamor. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit ac3acab1311c47cc73e2681e575f0407284c3c66 +Author: Colin Walters +Date: Fri Jul 18 09:13:54 2014 -0400 + + xf86platformBus: Add assertion to avoid (fatal) compiler warning + + Compilation of -video-intel started failing in gnome-continuous, + it's because xserver has -Werror=return-type on, and gcc can't + prove this function always returns a value: + + /usr/include/xorg/xf86platformBus.h:119:1: error: control reaches end of non-void function [-Werror=return-type] + + Let's add assertions to the accessor functions to fix this. + + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 5c2e9fa3d6c4bdf626fededce866056ba8eca502 +Merge: e678b49 6d49548 +Author: Keith Packard +Date: Thu Jul 17 20:06:21 2014 -0700 + + Merge remote-tracking branch 'anholt/glamor-next' + +commit 6d4954884908ea9894fcfe9836db1ba7bb45be61 +Merge: 9ddcb20 55f5bfb +Author: Eric Anholt +Date: Thu Jul 17 18:00:44 2014 -0700 + + Merge remote-tracking branch 'origin/master' into glamor-next + + I've done this merge manually to resolve the minor conflict in glamor.c. + + Signed-off-by: Eric Anholt + +commit 9ddcb20f47b5e199989c8990512b0bca1354af86 +Author: Eric Anholt +Date: Mon Jun 16 07:24:09 2014 +0100 + + glamor: Drop the "are we doing a series of blits or draws" logic. + + It's unused since keithp's copy acceleration code completely replaced + glamor_copyarea.c and removed the blit path. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit b03a581d8cbe3f29140935063b865285e2a00333 +Author: Eric Anholt +Date: Mon Jun 16 07:15:58 2014 +0100 + + glamor: Remove a dead prototype. + + The corresponding code was deleted in + 2ff41008494e6c5909c058f1f80b4f66617dada1 (2012) + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit b5f94df319469ad44b0e88374a0d389414803f7a +Author: Eric Anholt +Date: Mon Jun 16 07:06:30 2014 +0100 + + glamor: Drop dead glamor_restore_pixmap_to_texture(). + + Unused since the glamor_prepare.c replacement of glamor_finish_access(). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 98155bd9d9b2a15a4dbcf80b2b57a7636efb14da +Author: Eric Anholt +Date: Mon Jun 16 07:01:28 2014 +0100 + + glamor: Drop dead glamor_download_pixmap_to_cpu() + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit b6181007de357da58125e022992f165b10eda65d +Author: Eric Anholt +Date: Mon Jun 16 07:04:01 2014 +0100 + + glamor: Drop dead get/pub sub pixmap functions. + + These were replaced by the new glamor_prepare.c code. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e310387f443b6333edf02c8980daa303505382b4 +Author: Eric Anholt +Date: Sun Jan 12 10:19:10 2014 -0800 + + glamor: Remove always-true yInverted flag. + + All users of glamor had the same value set, and it complicated things + for no reason. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit d71ecbb458c15fda608654b78d99683ebeab3c60 +Author: Eric Anholt +Date: Sun Apr 6 07:22:26 2014 -0700 + + glamor: Drop constant arguments to glamor_solid(). + + After keithp's change to drop the old glamor_fill() code, nothing ever + changed these values. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit db9bff5c389f96991df8d6c62df1174e62e937d3 +Author: Eric Anholt +Date: Wed Apr 2 12:09:47 2014 -0700 + + glamor: Drop unnecessary glTexParameteri() in upload of texture data. + + We're not drawing, and we're not initially setting up the texture for + later drawing. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 1140a89d7762540965ff865d154cb0528049066f +Author: Eric Anholt +Date: Wed Apr 2 12:12:06 2014 -0700 + + glamor: Use MIN/MAX macros to clean up glamor_transfer.c + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit 2ab0fba9df695f19f0b43321d01395736f865c69 +Author: Eric Anholt +Date: Wed Apr 2 13:41:09 2014 -0700 + + glamor: Drop unnecessary glTexParameteri() in SetSpans(). + + If this path needed the filters set, so would all the other + glDrawArrays() callers. But they don't. + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + +commit e678b4971b666e65a99c141e0a5f33969aa701b7 +Author: Keith Packard +Date: Tue Jul 15 17:31:59 2014 -0700 + + xfree86: Provide backward-compatibilty API for OdevAttributes + + This allows drivers to compile using the old OdevAttributes API + against a new server. It generates compiler errors if the caller uses + the wrong or undefined attribute types, or if the caller provides an + incorrect default value for an integer attribute. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 60c05ce1ab5d9dc7c034b6b3723f43a42ea637d8 +Author: Keith Packard +Date: Tue Jul 15 17:31:58 2014 -0700 + + config: Replace OdevAttributes linked list with struct + + OdevAttributes are a fixed set of values with known types; instead of + storing them in a linked list and requiring accessor/settor functions, + replace the list header, struct OdevAttributes, with a struct that + directly contains the values. This provides for compile-time + typechecking of the values, eliminates a significant amount of code + and generally simplifies using this datatype. + + Signed-off-by: Keith Packard + Reviewed-by: Hans de Goede + +commit 55f5bfb578e934319d1308cbb56c900c5ac7cfa7 Author: Keith Packard Date: Wed Jul 16 16:03:23 2014 -0700 @@ -1341,8 +8008,135 @@ Date: Wed Jul 16 16:03:23 2014 -0700 Signed-off-by: Keith Packard Reviewed-by: Markus Wick - (cherry picked from commit 55f5bfb578e934319d1308cbb56c900c5ac7cfa7) - Signed-off-by: Julien Cristau + +commit 16fbad3c7a22d2fb33549bcd422de985a60982b8 +Author: Keith Packard +Date: Thu Jul 17 16:17:53 2014 -0700 + + Post 1.16 version bump to 1.16.99.1 + + And we're off towards 1.17; this version bump serves to keep + development versions distinct from stable versions. + + Signed-off-by: Keith Packard + +commit bfa5c73a36230f77fb211f185152212541c9d56d +Author: Keith Packard +Date: Wed Jun 4 22:00:45 2014 -0700 + + ephyr: Free damage structure at server reset time + + The usual mechanism for freeing a damage structure when the pixmap is + destroyed does not work for the screen pixmap as it isn't freed in the + normal way. + + The existing driver cleanup function, scrfini, is called after the + wrapped CloseScreen functions, including damageCloseScreen, are called + and thus ephyr can't free the damage structure at that point. + + Deal with this by providing an early CloseScreen hook in KdCloseScreen + which ephyr can use to free the damage structure before damage itself + shuts down. + + Signed-off-by: Keith Packard + Reviewed-by: Jamey Sharp + +commit 3319e7041ff89bb01b16a1dbbac85e28b1976ae3 +Author: Keith Packard +Date: Fri Apr 18 14:24:29 2014 -0700 + + hw/xfree86: Let xf86Rotate leave the BlockHandler unwrapped when possible + + When no shadow frame buffer is needed, the rotate block handler + doesn't need to be called any more. Remove it from the chain. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 79a2733005202af43821d8fd8e4c9fb77bf8f69e +Author: Keith Packard +Date: Fri Apr 18 14:11:17 2014 -0700 + + hw/xfree86: Fix VGA arbiter screen proc wrapping + + Change the screen proc epilog code to re-fetch the current screen + function in case a nested proc changes how things work. This isn't a + problem with the current code as all of the wrapping layers that are + set up at server init time (like the VGA arbiter) leave themselves in + the screen proc chain forever. But, this makes the code conform with + the expected norms. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit a1189fe322724ab1b524aaad5b700287777252bd +Author: Keith Packard +Date: Fri Apr 18 13:57:55 2014 -0700 + + mi: Fix block handler wrapping in miSprite + + miSpriteBlockHandler was leaving the BlockHandler wrapped until just + before calling any nested block handler. If any code executed before + that added or removed block handlers, the wrapping chain would have + been broken. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 08fc33042c858568e7244eb9ad25a8d0270754f0 +Author: Keith Packard +Date: Fri Apr 18 13:55:50 2014 -0700 + + hw/xfree86: Fix block handler wrapping in xf86Rotate + + xf86Rotate, it was delaying unwrapping the BlockHandler until after + calling xf86RotateRedisplay. If there was a software cursor on the + screen, the redisplay operation would cause cursor to be removed from + the frame buffer and the misprite block handler to be inserted into + the block handler chain with the misprite screen private saved block + handler now set to xf86RotateBlockHandler. + + When xf86RotateRedisplay returned, xf86RotateBlockHandler would then + set screen->BlockHandler to its saved value, call down and then reset + screen->BlockHandler to xf86RotateBlockHandler. miSpriteBlockHandler + would never be called after that, which meant that the software cursor + will now disappear from the screen whenever rendering overlapped and + would only reappear when the cursor was moved. + + To correct this, all that is needed is to move the restoration of + screen->BlockHandler to the top of xf86RotateBlockHandler, before the + call to xf86RotateRedisplay. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit c75fee79ace394f6f51aa6fdda1c0436eb8a2026 +Author: Keith Packard +Date: Fri Apr 18 13:54:11 2014 -0700 + + Document how to correctly wrap screen procedures + + This adds a large comment to include/scrnintstr.h which should serve + to document the correct way to wrap any screen procedure, with a + particular focus on how to dynamically add/remove wrapping layers + while the server is running. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 5eb77697ea35e7dc8cb8af2c3b5d8ffdba0fb632 +Author: Peter Harris +Date: Mon Mar 10 18:31:33 2014 -0400 + + Avoid starting a comment with */* + + Even though -Wcomment doesn't mind it (in gcc or clang), the appearance + of */* confuses the syntax highlighter of some editors (eg. vim), and + causes warnings in MSVC. + + Signed-off-by: Peter Harris + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard commit 8b36e1ec8dd9f53e9f4e10422c2100844e9e549c Author: Keith Packard @@ -1623,6 +8417,12 @@ Date: Sun Apr 6 04:47:15 2014 -0500 Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY +commit 5f3485b06e180674af640e7e9d7d56f67b61735b +Author: Maarten Lankhorst +Date: Thu Jun 26 10:37:19 2014 +0200 + + bump to 0.9.0 + commit a3b44ad8db1fa2f3b81c1ff9498f31c5323edd37 Author: Thierry Reding Date: Wed Jun 25 16:03:29 2014 +0200 @@ -1821,6 +8621,428 @@ Date: Tue Jun 17 15:50:48 2014 -0700 Signed-off-by: Keith Packard +commit 199d9a6a942af9b443616f6ef6d26052ef3f48b9 +Author: Eric Anholt +Date: Fri Dec 27 11:12:27 2013 -0800 + + xephyr: Allow initializing glamor with gles2 (on GLX). + + This should be useful for glamor development, so you can test both + paths (which are significantly different, and apparently + glamor_gradient.c was broken on GLES2 as of the import). + + Signed-off-by: Eric Anholt + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + +commit 98b6158bc1e32aaca375829452266e013a520e14 +Author: Eric Anholt +Date: Sun Apr 6 07:44:20 2014 +0100 + + glamor: Share code for put_image handling. + + The difference between the two is that XF86 has the clip helper that + lets you upload less data when rendering video that's clipped. I + don't think that's really worth the trouble, especially in a world of + compositors, so I've dropped it to get to shared code. + + It turns out the clipping code was broken on xf86-video-intel anyway. + To reproduce, run without a compositor, and use another window to clip + the top half of your XV output on the glamor XV adaptor: the rendering + got confused about which half of the window was being drawn to. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 34884e16bf7c97434e7883d025c6814e083b0def +Author: Eric Anholt +Date: Sat Apr 5 12:30:28 2014 +0100 + + ephyr: Add support for XV using glamor. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 23d303bf905e76a70bda942037bdfbdcd06e55d2 +Author: Eric Anholt +Date: Sat Apr 5 12:57:16 2014 +0100 + + kdrive: Mark XV names const to avoid warnings. + + No code modifies it at runtime, and it's common to store string + literals to it. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 65efc14b6ae1ee73bf6db379d7826b6bc9fd6d33 +Author: Eric Anholt +Date: Sat Apr 5 11:50:51 2014 +0100 + + glamor: Split the XV code into XF86-dependent parts and generic. + + I want to expose this from Xephyr as well, both to be able to test XV + changes rapidly, and beause the XV passthrough to the host's overlay + really doesn't work out well when we glXSwapBuffers() over the + colorkey. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit a5662193f1c3dd63f615d96d1a300f70086ccbc6 +Author: Eric Anholt +Date: Sat Apr 5 12:26:33 2014 +0100 + + kdrive: Simplify the adaptor setup interface. + + Now that we don't have to worry about the generic adaptors code, + there's no need to have a list of pointers to different sets of + adaptors. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 55aad7399d4470bc46c064aafe07d12a6c293982 +Author: Eric Anholt +Date: Fri Apr 4 12:09:01 2014 +0100 + + kdrive: Remove dead generic XV adaptors code. + + I couldn't find any callers in the history of the tree. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 0edc0a78fbfac4578b0f809aef17332c1eb461e3 +Author: Eric Anholt +Date: Sun Apr 6 08:12:35 2014 +0100 + + kdrive: Do a little more cleanup from the XV struct deduplication. + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit 1d90e8811a7d4db328c0c944bec0aa3ed6afb70d +Author: Eric Anholt +Date: Fri Dec 27 21:34:44 2013 -0800 + + xorg: Remove duplicated definitions of some XV-related structs. + + These were field-for-field identical, so we can just typedef them to + be the same, and memcpy their contents. + + v2: Fix missed strdup(). + + Signed-off-by: Eric Anholt + Reviewed-by: Adam Jackson + +commit a6aaa51752f301de24abce264976ba3c3a50863c +Author: Keith Packard +Date: Fri Mar 21 14:55:47 2014 -0700 + + glamor: Remove stubbed-out glamor_stipple function + + This function isn't used anymore. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit ef2bf0e645ed8242a0b637ed6a9d5b8c03b6b481 +Author: Keith Packard +Date: Fri Mar 21 14:30:33 2014 -0700 + + glamor: Remove 'tiling' shader code + + The core rendering paths all use the glamor_program fill functions now + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 18c09e60bf16b28060ade5d24110f2aa6bc19b57 +Author: Keith Packard +Date: Sun Mar 16 20:49:28 2014 -0700 + + glamor: Replace glamor_solid_boxes and glamor_solid with GC using code + + This provides glamor_solid_boxes and glamor_solid using regular GC + operations instead of calling directly to underlying rendering + functions. This will allow the old rendering code to be removed. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit bd3b2c48f69a5169aefb261c041462271c69a07a +Author: Keith Packard +Date: Thu Apr 3 14:22:52 2014 -0700 + + glamor: Add accelerated stipple support + + This copies the stipple to a 8bpp pixmap and uses that to paint the + texture from. + + v2: Create deep stipple pixmap without GLAMOR_CREATE_FBO_NO_FBO + + v3: Fix stipple origin sign (matches tiles now). Track changes + to original stipple with damage. This isn't required by the + X spec, but java appears to depend on it, so we'll just do it. + When Glamor switches to 8bpp bitmaps, we'll be able to render + directly from them and not need this anymore. + + v4: Review comments from Eric: + + * Remove stray whitespace change + * Avoid "large" pixmap for stipple by using GLAMOR_CREATE_NO_LARGE + * Wrap to 80 columns + + v5: Don't crash when stipple damage tracker is destroyed + + The stipple damage tracker is automatically destroyed when the + associated stipple pixmap is destroyed. When this happens, just + clear the pointer from the GC rather than calling + glamor_invalidate_stipple; that function would call + DamageUnregister on the now invalid stipple damage pointer and + crash. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit d18f5801c9a632dd4d9f8b7912491b6623e943d5 +Author: Keith Packard +Date: Wed Apr 2 14:07:20 2014 -0700 + + glamor: Add glamor_program based 0-width dashed lines + + This makes sure the pixelization for dashed lines matches non-dashed + lines, while also speeding them up. + + v2: Switch to glamor_make_current + + v3: Create dash pattern pixmap without GLAMOR_CREATE_FBO_NO_FBO + + v4: Adopt suggestions from Eric's review: + + - Drops power-of-two alignment of our line vertex data, simplifying + the code. + + - Stops reading from the VBO. While on keithp's and my machines the + VBO is mapped cached, on many implementations it will be mapped WC, + making those reads extremely expensive. + + - Style fixes (line wrapping, spaces around operators). + + v5: Adopt suggestions from Markus' review: + + - Use max when computing zero-width dashed line length. + + Don't open code max here. + + - Embed CoordModePrevious into VBO writing for dashed lines + + Instead of pre-computing the coord mode previous results, just + embed this in the loop which fills the vertex buffer. Saves + re-writing the request buffer, and shortens the code a bit + + v6: Export glamor_destroy_gc for UXA + + UXA needs to call glamor_destroy_gc from its GCFuncs, so export + it. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit dc9fa9080a1cb994b4e54a341d2245f442dac576 +Author: Keith Packard +Date: Sun Mar 23 20:59:02 2014 -0700 + + glamor: Use glamor_program and GL_LINES for 0-width lines + + GL lines are nearly X compliant; you just need to fill in the last + pixel when the client hasn't requested CapNotLast. + + v2: switch to glamor_make_current + + v3: use miPolylines instead of custom glamor fallback path. Wrap + code to 80 columns. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 51075ebd37dca8d17c42425fb756ad3090e157c4 +Author: Keith Packard +Date: Fri Mar 21 18:03:07 2014 -0700 + + glamor: Use glamor_program for glamor_push_pixels + + This uses the same shaders as glamor_poly_glyph_blt. + + v2: Wrap some long lines (changes by anholt). + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 45ebc4e3fac7f1a85167d05e2833949b89f02d64 +Author: Keith Packard +Date: Sat Mar 15 13:31:18 2014 -0700 + + glamor: Add glamor_program based copy acceleration + + Paints with textures, using a temporary buffer for overlapping copies + + Performs CPU to GPU transfers for pixmaps in memory. Accelerates copy + plane when both objects are in the GPU. Includes copy_window + acceleration too. + + v2: Use NV_texture_barrier for non-overlapping copies within the same + drawable + + v3: Switch to glamor_make_current + + v4: Do overlap check on the bounding box of the region rather than + on individual boxes + + v5: Use Eric Anholt's re-written comments which provide a more accurate + description of the code + + v6: Use floating point uniform for copy plane bit multiplier. This + avoids an int to float conversion in the copy plane fragment shader. + + Use round() instead of adding 0.5 in copy plane. round() and +0.5 + end up generating equivalent code, and performance measurements + confirm that they are the same speed. Round() is a bit clearer + though, so we'll use it. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + Reviewed-by: Markus Wick + +commit 0e08a79599c773f77c0667d557376a5ccee3f89c +Author: Keith Packard +Date: Wed Apr 2 14:05:35 2014 -0700 + + glamor: Directly reference the private key records + + There's no reason to use a pointer here, it just wastes time. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 15e4d14dfae054c026b7e965ac33985e5cf6a168 +Author: Keith Packard +Date: Sat Mar 15 13:27:14 2014 -0700 + + glamor: Replace fallback preparation code + + These offer a simpler and more efficient means for temporarily + transitioning to CPU-accessible memory for fallback implementations. + + v2: Do not attempt fallbacks with GLAMOR_DRM_ONLY pixmaps + + glamor cannot transfer pixels for GLAMOR_DRM_ONLY pixmaps using + glReadPixels and glTexSubImage2D, and so there's no way to perform + fallback operations with these pixmaps. + + v3: Clear ->pbo field when deleting the PBO. Otherwise, we'd reuse + the old name next time we fall back on the pixmap, which would + potentially conflict with some other pixmap that genned a new + name, or just do a lazy allocation of the name (compat GL context, + like we currently use) or error out (core GL context, like we hope + to use some day). Also, style fixes. Changes by anholt, acked by + keithp. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 3ac481c9dac591ffc33812ab047fc793d8a43d4f +Author: Keith Packard +Date: Wed May 7 10:31:16 2014 -0700 + + mi: Draw multiple lines in one FillSpans call in miZeroLine + + miZeroLine allocates enough space to draw a line spanning the entire + width/height of the target drawable. When drawing multiple shorter + lines, this leaves most of the space in that buffer unfilled. Let + multiple lines be drawn into the buffer if there is plenty of space. + + Speeds up glamor fallback zero-width lines: + + Before + 6000000 trep @ 0.0020 msec (508000.0/sec): 1-pixel line + 6000000 trep @ 0.0020 msec (492000.0/sec): 10-pixel line + 6000000 trep @ 0.0023 msec (427000.0/sec): 100-pixel line + 4000000 trep @ 0.0035 msec (282000.0/sec): 500-pixel line + + After: + 600000000 trep @ 0.0000 msec (43400000.0/sec): 1-pixel line + 140000000 trep @ 0.0001 msec (13000000.0/sec): 10-pixel line + 16000000 trep @ 0.0008 msec (1300000.0/sec): 100-pixel line + 4000000 trep @ 0.0038 msec (261000.0/sec): 500-pixel line + + (500 pixel lines do not change in performance because the buffer can + only one one of them.) + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit ea678a73c5688f73071d5581b6406808b7a0230f +Author: Keith Packard +Date: Fri Apr 25 22:43:51 2014 -0700 + + mi: Fill spans for multiple arcs in miPolyFillArc + + This allocates span data for multiple arcs and draws the + whole set in one call, rather than doing them one at a time. For + modern hardware, this is a significant performance improvement. + + v2: Limit the number of spans per buffer to 4M to avoid + integer overflow in computing the malloc size. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit a7fce36affb8211990e5b4956adea4d75f0e73c9 +Author: Keith Packard +Date: Wed May 7 09:58:26 2014 -0700 + + mi: Make miPolyArc draw fast zero-width when possible + + Instead of forcing drivers to figure out when to call miZeroPolyArc, + have miPolyArc call that when possible. + + This involved renaming the existing miPolyArc call to miWideArc and + creating a new miPolyArc wrapper function as miZeroPolyArc falls back + to miWideArc when the arc is too large to be drawn with the zero-width + code (ellipses larger than 800x800). + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit bf1429b2034a577c994ff16b60d809d05ca99241 +Author: Keith Packard +Date: Wed May 7 09:56:39 2014 -0700 + + mi: Create miPolylines as a general-purpose line drawing function + + Instead of requiring all drivers to figure out which mi function to + call for each of the four cases, create a single wrapper in mi that + handles them correctly. Now drivers can simply use miPolylines in all + cases. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 14d82a2bc3179160803c62c20746630d14e1b7d7 +Author: Keith Packard +Date: Thu Mar 13 23:29:54 2014 -0700 + + ephyr: Deal with non-root visual for window + + glx will sometimes select a non-root visual, deal with that by + creating a suitable colormap and using that instead of attempting to + use the default colormap. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + commit a11bbd875f3f90a3d02d727778cb1d3524cf59fd Author: Eric Anholt Date: Fri May 30 10:39:30 2014 -0700 @@ -2363,6 +9585,16 @@ Date: Thu May 1 15:39:29 2014 +0300 Reviewed-by: Egbert Eich Signed-off-by: Keith Packard +commit 042bae0b49f6192ec3cb8bb51423c90c44638134 +Author: Adam Jackson +Date: Wed May 21 10:16:39 2014 -0400 + + Use own thunk function instead of shadowUpdatePackedWeak + + I plan to remove the Weak functions from a future server. + + Signed-off-by: Adam Jackson + commit d5587cf3acb7ad6f81e1c095f1b88f8fb25ee953 Author: Peter Hutterer Date: Wed May 14 10:32:30 2014 +1000 @@ -2549,6 +9781,22 @@ Date: Fri May 2 14:14:58 2014 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede +commit 219ce9e6c34bfc946005fb8e81ab4fb74ae1d25a +Author: Dave Airlie +Date: Fri May 2 13:16:05 2014 +1000 + + modesetting: fix build regression against older servers. + + Signed-off-by: Dave Airlie + +commit 795af9ff017113788b4bb6d9dbeb5370c5b8165c +Author: Dave Airlie +Date: Fri May 2 13:14:30 2014 +1000 + + modesetting: fix use after free. + + Signed-off-by: Dave Airlie + commit 42a4873cc7fe0c7a729e48f806e877c4dac5c07f Author: Keith Packard Date: Wed Apr 30 09:32:29 2014 -0700 @@ -2702,6 +9950,14 @@ Date: Wed Apr 2 17:14:05 2014 +0300 Signed-off-by: Michal Srb Signed-off-by: Peter Hutterer +commit f073b5e58262d5fcc0102d773091d11d175227ce +Author: Hans de Goede +Date: Tue Mar 18 15:48:22 2014 +0100 + + Add support for server managed fds + + Signed-off-by: Hans de Goede + commit b92a9289fef4831e9af69e5f6f64b5454f550559 Author: Thierry Reding Date: Wed Feb 12 17:11:40 2014 +0100 @@ -6791,6 +14047,24 @@ Date: Thu Jan 16 10:37:28 2014 +0100 Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer +commit 98f59a33dfc2d47a57c68420f226dc0c17992164 +Author: Dave Airlie +Date: Fri Feb 28 12:04:30 2014 +1000 + + modesetting: fix cursor rendering with hotspots. + + older kernels report EINVAL not ENOSYS, doh. + + Signed-off-by: Dave Airlie + +commit 2029c028fcffbe1aa175ab75636ae954a211c82a +Author: Adam Jackson +Date: Tue Feb 25 09:06:55 2014 -0500 + + modesetting: Don't (brokenly) double-track software cursor + + Signed-off-by: Adam Jackson + commit caf1dec2a76fbbd21259fe4cc809e24a55ff79b4 Author: David Sodman Date: Mon Feb 10 09:07:33 2014 -0800 @@ -6876,6 +14150,26 @@ Date: Mon Feb 24 09:40:23 2014 -0800 Merge remote-tracking branch 'anholt/glamor-pull-request' +commit fac2bcf1da09fba8bc8b22631e31f3c5b2737efd +Author: Dave Airlie +Date: Mon Jan 20 11:06:42 2014 +1000 + + modesetting: try and use hotspot cursor support + + Signed-off-by: Dave Airlie + +commit 4aab7aa7c1a15af7211996fa30e17a645f120ff9 +Author: Dave Airlie +Date: Fri Feb 21 12:48:42 2014 +1000 + + modesetting: move closing fd to after we check outputs + + On something like cirrus, start X, then attempt to start a second + X while the first is running, if fbdev is installed it'll fail + hard. + + Signed-off-by: Dave Airlie + commit 0f10cfd4b903d4db293ec47c8a9a0d8b33965803 Author: Peter Hutterer Date: Thu Feb 20 13:18:05 2014 +1000 @@ -7190,6 +14484,17 @@ Date: Thu Feb 13 17:36:34 2014 -0500 Signed-off-by: Gaetan Nadon Signed-off-by: Keith Packard +commit 02fbae85e7aa17b213e1411fe558256998d367c4 +Author: Alex Deucher +Date: Wed Feb 12 13:06:51 2014 -0500 + + modesetting: query cursor size from the kernel + + Use new drm caps. This allows hw cursors to work + correctly on gpus with non-64x64 cursors. + + Signed-off-by: Alex Deucher + commit 30c3852bda7f60b0ffb1bb2f6ed8ba8800001b32 Author: Alan Coopersmith Date: Sun Feb 9 16:56:40 2014 -0800 @@ -13276,6 +20581,36 @@ Date: Tue Nov 26 03:07:55 2013 -0800 Signed-off-by: Keith Packard Reviewed-by: Adam Jackson +commit ae24f5bf6b31c035af50e14727966055ed8767bd +Author: Maarten Lankhorst +Date: Tue Dec 3 17:01:28 2013 +0100 + + bump to 0.8.1 + +commit 59e324abd7cbda5d301b7b67125cd6d96684f000 +Author: Thierry Reding +Date: Tue Nov 26 17:08:03 2013 +0100 + + Properly identify DSI outputs + + Newer Linux kernels support DSI outputs. To be able to identify them + properly, add DSI to the list of output names. + + Reviewed-by: Aaron Plattner + Signed-off-by: Thierry Reding + +commit 190289f6393191bb3c58067ce1df994809475077 +Author: Thierry Reding +Date: Tue Nov 26 17:08:02 2013 +0100 + + Staticise and constify output names + + This array isn't used anywhere outside this file, so it can be made + static. While at it, make the array const as well. + + Signed-off-by: Thierry Reding + Reviewed-by: Aaron Plattner + commit eafba23b34be31c141ddafb8380520ac9a0622ac Author: Keith Packard Date: Thu Nov 21 22:45:18 2013 -0800 @@ -13554,6 +20889,28 @@ Date: Tue Nov 19 08:07:09 2013 +1000 Reviewed-by: Keith Packard Signed-off-by: Keith Packard +commit a307ac27382dd0c377cd1a436cb25cb5aaa54416 +Author: Keith Packard +Date: Fri Nov 15 13:39:52 2013 +0900 + + Handle new DamageUnregister API which has only one argument + + API change in 1.15 + + Signed-off-by: Keith Packard + +commit d6ffce4b0e2376e1f8f04ee70b323a6aea3e517e +Author: Keith Packard +Date: Fri Nov 15 13:26:36 2013 +0900 + + Clean up compiler warnings. + + Add const to any immutable string pointers. + Rename 'range' to 'prop_range' to avoid redefined warning. + Eliminate some unused return values. + + Signed-off-by: Keith Packard + commit 29240e5cbf6e7f875b128fc7bfc4d56b2350835a Merge: 0492deb 8ff7e32 Author: Keith Packard @@ -17172,6 +24529,16 @@ Date: Wed Jul 31 11:35:44 2013 +1000 Reviewed-by: Alex Deucher Signed-off-by: Peter Hutterer +commit 836daf4c7a276108a9f950e524828744aeda0a3c +Author: Dave Airlie +Date: Wed Jul 31 11:24:48 2013 +1000 + + modesetting: change output names for secondary GPUs + + if we are a secondary GPU modify the output name to avoid clashes. + + Signed-off-by: Dave Airlie + commit ff38bbe81ace85bf675bbaa0a9ca5f3b32ede449 Merge: bdd1e22 4360514 Author: Keith Packard @@ -17831,6 +25198,39 @@ Date: Tue Jun 18 10:53:08 2013 -0700 Merge remote-tracking branch 'jturney/master' +commit 951d2f83fc65a136717fb8090510d053e3f3a6c0 +Author: Maarten Lankhorst +Date: Wed Jun 12 14:11:53 2013 +0200 + + bump to 0.8.0 + + Signed-off-by: Maarten Lankhorst + +commit 525ac7fb9a0d639253fc5d6556db3edb7239f932 +Author: Maarten Lankhorst +Date: Wed Jun 12 14:05:19 2013 +0200 + + modesetting: probe only succeeds if connectors are detected + + This will prevent modesetting being used for outputless intel or nvidia cards. + + Signed-off-by: Maarten Lankhorst + +commit d4791dd97b85ddac1295761bf6ab4f10c08346d7 +Author: Dave Airlie +Date: Tue Jun 11 10:29:25 2013 +1000 + + modesetting: fix adjust frame crash + + When SDL called this it was totally broken, actually hook + up to the underlying drmmode function. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64808 + + Thanks to Peter Wu for harassing me. + + Signed-off-by: Dave Airlie + commit 80054fcafb095aff76f6df00d348c7fd85e8ddbc Author: Jon TURNEY Date: Sat Mar 30 19:44:14 2013 +0000 @@ -19668,6 +27068,16 @@ Date: Tue Mar 19 12:12:41 2013 -0700 Reviewed-by: Chris Wilson Signed-off-by: Keith Packard +commit c64fa9a2961f82719cc7734a4222f31297a2e593 +Author: Maarten Lankhorst +Date: Wed Apr 3 12:08:44 2013 +0200 + + support 32 bpp pixmaps when 24 bpp fb is used. + + Fixes background corruption in ubuntu. + + Signed-off-by: Maarten Lankhorst + commit 8928f8fa0bb154ce437af703ff702016f0dcf127 Author: Geert Uytterhoeven Date: Mon Mar 18 21:38:10 2013 +0100 @@ -19693,6 +27103,12 @@ Date: Mon Mar 25 14:51:58 2013 +1000 Signed-off-by: Peter Hutterer +commit 3a9a6c972e4bc88dc3dde9399df3b0cda759cd70 +Author: Maarten Lankhorst +Date: Wed Mar 27 10:33:46 2013 +0100 + + bump version to 0.7.0 + commit ac4c2abe985ce6816a3389c41eb23462c6ac2486 Author: vdb@picaros.org Date: Thu Mar 7 16:07:31 2013 +0100 @@ -19723,6 +27139,22 @@ Date: Thu Mar 7 16:07:31 2013 +0100 Reviewed-by: Aaron Plattner Signed-off-by: Keith Packard +commit 862bc2836835b93f4b2cfd2de6ca344f65484a00 +Author: Maarten Lankhorst +Date: Tue Mar 26 15:19:52 2013 +0100 + + modesetting: return null for get_modes if output could not be retrieved + + Signed-off-by: Maarten Lankhorst + +commit 6b79a8791d35bbd1a13ebdec1c582f66c559c039 +Author: Maarten Lankhorst +Date: Tue Mar 26 15:19:33 2013 +0100 + + modesetting: clean up leaks + + Signed-off-by: Maarten Lankhorst + commit 2967391c6d35f03121afa8003e0fb94b62495129 Author: Peter Hutterer Date: Thu Feb 28 10:43:05 2013 +1000 @@ -19800,6 +27232,23 @@ Date: Fri Mar 1 08:43:58 2013 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard +commit 1754973206c09a901747e71d4abdf666293da59e +Author: Aaron Plattner +Date: Wed Feb 20 17:27:16 2013 -0800 + + modesetting: match PCI class 3, any subclass + + If a device is not primary, the PCI device match fails because the + xf86-video-modesetting driver looks specifically for a PCI class match of + 0x30000 with a mask of 0xffffff. This fails to match, for example, a + non-primary Intel VGA device, because it is reported as having a class of + 0x38000. + + Fix that by ignoring the low 16 bits of the class in the pci_id_match table. + + Signed-off-by: Aaron Plattner + Reviewed on IRC by Adam Jackson + commit cc3d1a5a6120e721a46c67446ba68f5596055633 Author: Piotr Dziwinski Date: Sat Feb 23 13:14:45 2013 +0100 @@ -19875,6 +27324,16 @@ Date: Mon Mar 18 10:01:20 2013 -0700 Signed-off-by: Keith Packard +commit beb1715e96b649a0903fa61f30dd1eb69411da2f +Author: Colin Walters +Date: Wed Jan 4 22:37:06 2012 +0000 + + autogen.sh: Implement GNOME Build API + + http://people.gnome.org/~walters/docs/build-api.txt + + Signed-off-by: Adam Jackson + commit 7050aae69c2a55dfdbb5c6af7882307e90ba4275 Author: Robert Morell Date: Tue Mar 12 09:40:16 2013 -0700 @@ -20229,6 +27688,24 @@ Date: Thu Feb 21 09:02:44 2013 +1000 Reviewed-by: Peter Hutterer Tested-by: Knut Petersen +commit 75815dbb373d5a74d57cbec9d469f9f88a8ee3ef +Author: Chris Wilson +Date: Mon Dec 3 13:25:19 2012 +0000 + + Add missing GTF modes + + A fixed-mode output device like a panel will often only inform of its + preferred mode through its EDID. However, the driver will adjust user + specified modes for display through use of a panel-fitter allowing + greater flexibility in upscaling. This is often used by games to set a + low resolution for performance and use the panel fitter to fill the + screen. + + v2: Use the presence of the 'scaling mode' connector property as an + indication that a panel fitter is attached to that pipe. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55564 + commit e27b2e61632b220ddc36d0d0387581a9f4774f21 Author: Peter Harris Date: Tue Feb 19 16:08:52 2013 -0500 @@ -20849,6 +28326,17 @@ Date: Sat Jan 26 14:13:33 2013 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard +commit ac34281b8a487640c61f258ae45a6f17a4fb3cc0 +Author: Dave Airlie +Date: Thu Feb 7 12:24:20 2013 +1000 + + modesetting: provide dummy hooks for shadow + + Since in some wierd cases the server can call these without checking they + exist. + + Signed-off-by: Dave Airlie + commit 73974dd7ea9ca4d4cdd5464cb813088a6ee9770b Author: Alan Coopersmith Date: Sun Jan 27 15:42:02 2013 -0800 @@ -21440,6 +28928,26 @@ Date: Tue Jan 8 20:24:32 2013 -0800 Signed-off-by: Keith Packard Reviewed-by: Dave Airlie +commit 34a571c5b9781025897ba5e5c5e2a34ae5262266 +Author: Dave Airlie +Date: Wed Jan 9 13:04:00 2013 +1000 + + modesetting: bump to 0.6.0 + +commit 8650ff14a52047173fa32f12f22ec6f4e38ff433 +Author: Dave Airlie +Date: Wed Jan 9 12:48:30 2013 +1000 + + modesetting: fix crashes caused by udev race conditions + + So the kernel removes the device, and the driver processes the first + udev event, and gets no output back from the kernel, so it check + and don't fall over. + + This fixes a couple of crashes seen when hotplugging USB devices. + + Signed-off-by: Dave Airlie + commit 0e1ab433f4048b3367bb2f01d16cd00502538e4d Author: Peter Hutterer Date: Fri Jan 4 12:26:58 2013 +1000 @@ -22507,6 +30015,31 @@ Date: Tue Nov 20 14:50:41 2012 -0500 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer +commit 0b198248ecfbcb7e7c61688145be4005366da23d +Author: Thierry Reding +Date: Thu Nov 8 14:28:10 2012 +0100 + + Remove call to miInitializeBackingStore() + + Recent versions of the X server no longer provide this function, which + has been obsolete for over 2 years now. + + Signed-off-by: Thierry Reding + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit 739d6c067a9167226ce248aa82997bfc2cca7259 +Author: Thierry Reding +Date: Thu Nov 8 14:28:09 2012 +0100 + + build: Put m4 macros in m4 subdirectory + + This silences a warning from libtoolize when running the autogen.sh + script. + + Signed-off-by: Thierry Reding + Signed-off-by: Dave Airlie + commit 1712a45422a63f11b2146541279616fcfda09ec6 Merge: e54f71a 338bec3 Author: Keith Packard @@ -25175,6 +32708,16 @@ Date: Mon Sep 10 14:48:37 2012 +1000 Reviewed-by: Keith Packard Signed-off-by: Dave Airlie +commit e47ad8a0aec7662970e7f81e6ee487330bf094c1 +Author: Dave Airlie +Date: Mon Sep 17 11:48:14 2012 +1000 + + modesetting: remove alloca usage again + + this slipped back in. + + Signed-off-by: Dave Airlie + commit 22746df15b5f75dc85f5cf5b73932eb8a44cb89b Author: Dave Airlie Date: Thu Sep 6 16:33:54 2012 +1000 @@ -25189,6 +32732,23 @@ Date: Thu Sep 6 16:33:54 2012 +1000 Reviewed-by: Chris Wilson Signed-off-by: Dave Airlie +commit f8eb8c1cb4f453bdbe6a81815be8ecefba2084aa +Author: Alon Levy +Date: Tue Aug 28 11:46:47 2012 +1000 + + modesetting: add virtual connector support + + [airlied: also make sure we don't crash in future.] + + Signed-off-by: Alon Levy + Signed-off-by: Dave Airlie + +commit 5eb697d88f0735e98fe9a97770ddda83202b1597 +Author: Maarten Lankhorst +Date: Thu Sep 13 08:45:14 2012 +0200 + + bump version to 0.5.0 + commit f0bad69edd57facd6cffde8cb0863d1a735e2492 Author: Keith Packard Date: Wed Sep 5 14:45:08 2012 -0700 @@ -25524,6 +33084,16 @@ Date: Thu Aug 16 15:43:34 2012 -0700 Signed-off-by: Jeremy Huddleston Sequoia +commit e3d7d5d18e3281677890064679af459e1af108cf +Author: Adam Jackson +Date: Thu Jul 19 22:15:10 2012 +0000 + + Implement ->driverFunc + + Copied from fbdev, makes it so we can run without iopl. + + Signed-off-by: Adam Jackson + commit ad5fe2d9614959b68bf71e23abf7e5abac9c2734 Merge: 16d8da5 99b94af Author: Keith Packard @@ -26407,6 +33977,41 @@ Date: Fri Jul 20 00:59:20 2012 -0700 Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard +commit 02811f1a9cc35c5f82accb0459cb3910165e7e45 +Author: Dave Airlie +Date: Thu Jul 19 14:12:59 2012 +1000 + + modesetting: add output slave support. + + This allows the driver to operate as an output slave. + + It adds scan out pixmap, and the capability + checks to make sure they available. + + Signed-off-by: Dave Airlie + +commit fa171c5a81b1c226b5da54f35e6726d9c8e13afb +Author: Dave Airlie +Date: Tue Jun 5 14:43:21 2012 +0100 + + modesetting: add platform bus support + +commit 709dbc68cdea9d282ba318c1cbc76614e98f41c4 +Author: Dave Airlie +Date: Wed Jul 25 15:38:34 2012 +1000 + + modesetting: fix warning about close being undefined. + + Signed-off-by: Dave Airlie + +commit 71b86ea8dd69f21d090edd4f61698ad11b952d5e +Author: Dave Airlie +Date: Wed Jul 25 15:33:52 2012 +1000 + + modesetting: drop useless xf86PciInfo include + + Signed-off-by: Dave Airlie + commit 3b7f313b3d74f9df876152c55d55cbb339bf2d02 Author: Jeremy Huddleston Date: Tue Jul 24 00:32:30 2012 -0700 @@ -29767,6 +37372,22 @@ Date: Thu Jun 21 00:55:53 2012 -0300 Reviewed-by: Keith Packard Signed-off-by: Keith Packard +commit cf196efa05bbefdeb43f6e6bcc5f6d9080fea715 +Author: Dave Airlie +Date: Fri Jun 22 15:24:43 2012 +0100 + + modesetting 0.4.0: bump configure.ac + +commit 30ab80ef5421fea9d9dd0779aa138892ff62bd6e +Author: Dave Airlie +Date: Fri Jun 22 15:26:28 2012 +0100 + + modesetting: pci probing requires interface version 1.4 + + Set the drm interface version to 1.4 so we get the bus id correctly. + + Signed-off-by: Dave Airlie + commit d642e7128790ec6b709df8d1a91333ab87598077 Author: Yaakov Selkowitz Date: Thu Jun 21 20:01:49 2012 +0100 @@ -30344,6 +37965,16 @@ Date: Tue Jun 5 17:54:02 2012 +0100 Tested-by: Keith Packard Signed-off-by: Keith Packard +commit ec79187d9a23ba30eafc7ba225049559e6bcb78d +Author: Dave Airlie +Date: Tue Jun 5 14:41:18 2012 +0100 + + modesetting: workaround kernel bug reporting 0x0 as valid mins + + It reports these but then you can't create a 0 sized bo. + + Signed-off-by: Dave Airlie + commit 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 Author: Dave Airlie Date: Tue Jun 5 13:22:18 2012 +0100 @@ -30772,6 +38403,14 @@ Date: Wed May 23 11:22:05 2012 +0200 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer +commit e07c945ab992b1b1acdd9f5554e0688f744e4769 +Author: Dave Airlie +Date: Fri Jun 1 12:34:42 2012 +0100 + + modesetting: bump to latest X server compat api. + + Signed-off-by: Dave Airlie + commit 78f0d9cdc441a575e15e5f7200ce74750d2f7ad2 Author: Chad Versace Date: Wed May 2 16:18:49 2012 -0700 @@ -30978,6 +38617,34 @@ Date: Mon Dec 5 10:55:20 2011 -0800 Reviewed-by: Eric Anholt Reviewed-by: Christopher James Halse Rogers +commit 1c01090f6485cb82c2511fb461e66ff15a097358 +Author: Dave Airlie +Date: Wed May 23 11:31:39 2012 +0100 + + modesetting: fix make distcheck + + add missing compat header file. + + Signed-off-by: Dave Airlie + +commit ef47a1b3bfec33d4031af2e01bdd46d634be2f51 +Author: Dave Airlie +Date: Wed May 23 11:21:55 2012 +0100 + + modesetting: convert to new scrn conversion APIs. + + Generated with util/modular/x-driver-screen-scrn-conv.sh + + Signed-off-by: Dave Airlie + +commit 3e46d578d8c40c95343278db0a66c931e85247c7 +Author: Dave Airlie +Date: Wed May 23 11:21:39 2012 +0100 + + modesetting: add compat header file + + Signed-off-by: Dave Airlie + commit 2d4fda4b09e67e47d3e6fc4743fc6e81bfe40f28 Author: Marcin Slusarz Date: Mon May 21 21:39:43 2012 +0200 @@ -31591,6 +39258,37 @@ Date: Wed May 9 21:17:16 2012 -0700 Merge remote-tracking branch 'whot/for-keith' +commit e8da587845978ad66c3b3e2e085fd99c16b5d3c8 +Author: Dave Airlie +Date: Wed May 9 09:33:54 2012 +0100 + + bump version to 0.3.0 + +commit 62543946490e7decae4f6549d83072f004e850d4 +Author: Matt Turner +Date: Wed May 9 00:26:29 2012 -0400 + + configure.ac: remove DRI and RENDER + + Driver doesn't support either of these. + + Signed-off-by: Matt Turner + Signed-off-by: Dave Airlie + +commit 7dc22b7911ac3d5c131075903e3fbf52c58eac15 +Author: Dave Airlie +Date: Wed May 9 09:32:05 2012 +0100 + + modesetting: make sure the pci device corresponds to the drm device + + If we get asked to pci open a device with a kms path override, + make sure they match, otherwise this driver can steal the primary + device binding for a usb adaptor. + + The driver should fallback to the old probe entry point in this case. + + Signed-off-by: Dave Airlie + commit afc153a5b4fc58ae70dc214f61a71b1a8c855f06 Author: James Cloos Date: Tue May 8 17:55:10 2012 -0400 @@ -31821,6 +39519,18 @@ Date: Tue May 1 10:21:11 2012 -0700 Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer +commit d063f64b5c8c8c27fca41163c93dbca06a774d1c +Author: Dave Airlie +Date: Tue May 1 17:12:29 2012 +0100 + + modesetting: attempt to work out if we want 24 or 32bpp + + the cirrus driver presents certain challenges, and this is a + workaround, until we can possibly agree some sane interface + for exposing this information. + + Signed-off-by: Dave Airlie + commit 0426e6d65b6598edfbcb2fc66ee65fb08256469e Author: Jon TURNEY Date: Tue Jan 3 00:14:32 2012 +0000 @@ -31833,6 +39543,17 @@ Date: Tue Jan 3 00:14:32 2012 +0000 Signed-off-by: Jon TURNEY Reviewed-by: Yaakov Selkowitz +commit 610f532e6a3d934c473d2d16dff95f582285b2eb +Author: Dave Airlie +Date: Tue May 1 16:52:18 2012 +0100 + + modesetting: move opening kernel device to before setting depth + + due to interaction between option handling and set depth, we need + to what fbdev does to get the device path early. + + Signed-off-by: Dave Airlie + commit f3410b97cf9b48a47bee3d15d232f8a88e75f4ef Author: Peter Hutterer Date: Mon Apr 30 10:01:48 2012 +1000 @@ -32529,6 +40250,18 @@ Date: Wed Apr 18 15:56:37 2012 +1000 Signed-off-by: Peter Hutterer +commit 00c663a3bc76d567ad7edd6d6ef3f7f725b5df3a +Author: Dave Airlie +Date: Tue Apr 17 11:50:40 2012 +0100 + + modesetting: add set/drop master around VT switch + +commit 001dec898098e11c569abc20a307b3c2af2e2184 +Author: Dave Airlie +Date: Tue Apr 17 11:48:03 2012 +0100 + + cursor: hide cursors on LeaveVT + commit 80fefc42f5e67e6b4a4b440d8991bee7e5f38359 Merge: 9779b90 12188c8 Author: Keith Packard @@ -32617,6 +40350,25 @@ Date: Thu Apr 12 15:54:00 2012 +1000 Reviewed-by: Chase Douglas Reviewed-by: Daniel Stone +commit d5d5b407436dfdbffcd56bbefecf17d11750dddf +Author: Dave Airlie +Date: Sat Apr 14 19:21:47 2012 +0100 + + dirty: check malloc return + + Suggested by keithp. + + Signed-off-by: Dave Airlie + +commit 6c1b5cb903f2ff9cb915273835c301d6ac255f45 +Author: Dave Airlie +Date: Sat Apr 14 15:01:16 2012 +0100 + + drop use of alloca, just use malloc/free + + Reported-by: Alan Coopersmith + Signed-off-by: Dave Airlie + commit c5a45b0f7658c77725adce2b64a0fbd62f208328 Author: Daniel Kurtz Date: Thu Apr 12 10:11:10 2012 +1000 @@ -33292,6 +41044,12 @@ Date: Mon Mar 5 00:05:48 2012 -0800 Signed-off-by: Jeremy Huddleston +commit 0e8ee1cf4f3377a2916c43527ae0dc6cb07a67ec +Author: Dave Airlie +Date: Fri Mar 23 14:54:05 2012 +0000 + + modesetting: fix build against older Xext + commit a7eac500e652f30deffd9dc5e623fab701077738 Merge: bf876c8 d645edd Author: Peter Hutterer @@ -33813,6 +41571,73 @@ Date: Wed Mar 14 11:32:36 2012 -0700 Signed-off-by: Keith Packard +commit 53204d5c8bd83c957fbdb7d3dc2891118ed7658b +Author: Sascha Hauer +Date: Sat Mar 3 14:09:25 2012 +0100 + + make busID non mandatory + + Currently the driver only probes a device when it has a + busID. The busID is optional so don't depend on it. + + Signed-off-by: Sascha Hauer + Signed-off-by: Dave Airlie + +commit bb7e39c1f2112f5fb7e87baddb114ab164fbc749 +Author: Sascha Hauer +Date: Sat Mar 3 14:09:27 2012 +0100 + + do not bail out on non pci devices + + To make the driver work on nin PCI devices we shouldn't bail + out in this case. + + Signed-off-by: Sascha Hauer + Signed-off-by: Dave Airlie + +commit 2b6848fcb3f85f9ce18a6de1dc6c3ac047101aa8 +Author: Sascha Hauer +Date: Sat Mar 3 14:09:26 2012 +0100 + + Fix non PCI device probing + + When no devicename is found in the option then the driver probes + by PciInfo no matter if it's valid or not. Instead of doing this + use PciInfo only when it's valid and fall back to the devicename + otherwise. With devicename probing use open_hw() to fall back + on the KMSDEVICE environment variable or to the default device. + + Signed-off-by: Sascha Hauer + Signed-off-by: Dave Airlie + +commit 456a001e3f7a24f443cf0bad8400d5d600e2ad46 +Author: Sascha Hauer +Date: Sat Mar 3 14:09:24 2012 +0100 + + introduce open_hw() function + + probe_hw opens the hardware in the order we want it: + first try devname, if this is NULL then try the KMSDEVICE + environment variable and as a last fallback use "/dev/dri/card0". + Instead of implementing the same code again when really opening + the device move the code to a open_hw() function and let probe_hw + use it. + + Signed-off-by: Sascha Hauer + Signed-off-by: Dave Airlie + +commit aa6ceaaa843525b2243569de162ed0b17faa7510 +Author: Sascha Hauer +Date: Sat Mar 3 14:09:23 2012 +0100 + + fix if() brackets in Probe function + + in Probe() the indention shows what's meant but there are no + brackets. Add them. + + Signed-off-by: Sascha Hauer + Signed-off-by: Dave Airlie + commit b1be72c5ca6cb98ba64637990b142be0f1710a19 Author: Keith Packard Date: Sun Mar 4 20:26:18 2012 -0800 @@ -33878,6 +41703,119 @@ Date: Fri Feb 17 13:54:57 2012 -0800 Signed-off-by: Jeremy Huddleston +commit 1349a2b7ab04553c8fddb60534400dea5cbd3cca +Author: Dave Airlie +Date: Wed Feb 22 10:07:06 2012 +0000 + + xf86-video-modesetting 0.2.0 + +commit e5648616d222966a95edd6c35807dcf5b91a0f96 +Author: Dave Airlie +Date: Wed Feb 22 09:59:12 2012 +0000 + + modesetting: fix warnings, remove dead code. + + Signed-off-by: Dave Airlie + +commit f7724167746d15c0ca32a7f5f95fb594addcddd1 +Author: Gaetan Nadon +Date: Sun Feb 19 16:13:34 2012 -0500 + + config: layout and comment the top portion of configure.ac + + Reorder statements to be consistent with other modules so things + are easier to find. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit a0bb835dc7db1ddd0472058a2a05a600ddea3930 +Author: Gaetan Nadon +Date: Sun Feb 19 08:36:19 2012 -0500 + + config: replace deprecated AC_HELP_STRING with AS_HELP_STRING + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit d56293cae78323b8976859c4461f8809a76a0b03 +Author: Gaetan Nadon +Date: Sun Feb 19 08:36:17 2012 -0500 + + make: add all warnings according to the platform + + The current code only adds -Wall and only for gcc. + Automake reserves the use of CPPFLAGS for the user to override + on the command line. + This also breaks the option --enable-strict-compilation + + The variable CWARNFLAGS contains the complete set of warnings + and is platform sensitive. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit fa201fe8299099f7192a4399c9df245efcee3f8a +Author: Gaetan Nadon +Date: Sun Feb 19 08:36:16 2012 -0500 + + make: remove empty variable assignment + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit e159fbd8805005bb7a33bf2076fd2cef00e987c6 +Author: Gaetan Nadon +Date: Sun Feb 19 08:36:15 2012 -0500 + + Remove unneeded AM_PROG_CC_C_CO + + There are no objects in subdirs or compiled multiple times + with different flags. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit 70558492376e66b73063e51b128b5bbad14b84f4 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:28 2012 -0500 + + Remove redundant AC_PROG_CC + + Already covered by XORG_DEFAULT_OPTIONS + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit d4bb99ce754073de090221d98000f609a3891380 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:27 2012 -0500 + + Replace obsolete AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit 5c2d152cad66c3f8ed6a4e82c3e6a45269bbb66d +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:26 2012 -0500 + + Add missing targets for ChangeLog and INSTALL + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit 8673f545cdb465b6e74f1d2fcabe29bc7fa0243d +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:25 2012 -0500 + + Remove redundant EXTRA_DIST for the README file. + + Autotools know about it, it is always distributed. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + commit 71594746c7da32e1c7986341a0da30f241a7a2be Merge: d53235a eaba06a Author: Keith Packard @@ -33885,6 +41823,144 @@ Date: Wed Feb 22 18:07:20 2012 +1300 Merge remote-tracking branch 'whot/for-keith' +commit 88b637e59a37af8ec6c4c0783504b8f1a49e5595 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:24 2012 -0500 + + make: remove redundant AUTOMAKE_OPTIONS + + Already covered by AM_INIT_AUTOMAKE([foreign dist-bzip2]) + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit a7ea959094e9a8d862637a0ea515f687aaf89d29 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:23 2012 -0500 + + Fix typo in .gitignore + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit 861e2b444ffb24921e07fdc25ab2679c9b6d2f4d +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:22 2012 -0500 + + man: missing AM_V_GEN and hard-coded sed command name + + Let's use the common xorg makefile for all drivers. + This ensures no new problems are introduced. + Improvements are welcome and to be applied to all drivers. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit 453bbe5b442a9c21d7c22437545e487e2993ceb7 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:21 2012 -0500 + + Add contact information to the README file + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit dd1d7e3519ea2f148be83ef7ab0b228da95ff9c3 +Author: Gaetan Nadon +Date: Sun Feb 19 08:34:20 2012 -0500 + + Fill the COPYING file with license text + + This reflects the copyright license text in the source code + + Signed-off-by: Gaetan Nadon + Signed-off-by: Dave Airlie + +commit b0e12e250d4b3438fb3306155a7bbff3e2d7f9b7 +Author: Dave Airlie +Date: Mon Feb 20 11:08:40 2012 +0000 + + modesetting: disable dirty updates for ENOSYS + + the kernel can also return ENOSYS for this to say its not used. + + Signed-off-by: Dave Airlie + +commit c5529d68c5b01cf0f36d8f2ce3694a7a0f3333da +Author: Dave Airlie +Date: Mon Feb 20 11:05:59 2012 +0000 + + modesetting: fix shadow resizing. + + if we hotplugged and output, the shadow got disabled by accident. + + Signed-off-by: Dave Airlie + +commit f3b9e52b29e8b8c4b12bc2ce290ab44e88750ad9 +Author: Dave Airlie +Date: Mon Feb 20 11:00:56 2012 +0000 + + modesetting: move shadow stuff to other structure + + we need this for resize to work properly. + + Signed-off-by: Dave Airlie + +commit eb44a004b7230321ce6837ef44610153b1d2017b +Author: Dave Airlie +Date: Mon Feb 20 10:54:36 2012 +0000 + + modesetting: fix stride if kernel modifies it. + + If the kernel aligns things use its values instead. + + fixes output on nouveau here. + + Signed-off-by: Dave Airlie + +commit 2150cbda8c75d348f39926bbc23d3e4ca9b42c88 +Author: Dave Airlie +Date: Mon Feb 20 10:54:21 2012 +0000 + + shadowfb: dump shadowfb state at startup + +commit 86080a5f7a589e55a485c42bab47c6c8ff6428c1 +Author: Dave Airlie +Date: Thu Feb 16 19:41:40 2012 +0000 + + use a cap to decide if shadow is preferred or not. + +commit fc5f39acd49d023a82ab05fffde1b423b697753c +Author: Dave Airlie +Date: Thu Feb 16 19:41:30 2012 +0000 + + cleanup dumb cap fetch + +commit d94b3eaba9a33d0d78ed2d9acbc33394f40fdc2e +Author: Dave Airlie +Date: Mon Nov 14 11:22:44 2011 +0000 + + modesetting: add cursor fallback if kernel rejects cursor. + + If the kernel rejects a cursor, cause a fallback, this isn't 100% as + we can lose the initial cursor, but it works fine once wm starts. + + Signed-off-by: Dave Airlie + +commit 594b3c4d6f6f748e08baffc4bc1c3ffad9b0d9cf +Author: Dave Airlie +Date: Thu Feb 16 19:31:33 2012 +0000 + + fix some whitespace + +commit 2e297978c928c571cf0a80e8d38423089014f07e +Author: Dave Airlie +Date: Wed Oct 5 15:12:43 2011 +0100 + + fixup device open + + Signed-off-by: Dave Airlie + commit eaba06a27c5520a02f08431ac1e4b0e0bdc22cd8 Author: Chase Douglas Date: Mon Feb 13 16:00:48 2012 -0800 @@ -39035,6 +47111,20 @@ Date: Tue Nov 1 21:32:36 2011 +0000 Reviewed-by: Daniel Stone Signed-off-by: Keith Packard +commit f47f6b6a53d414f28374391964c2930427d28f46 +Author: James Simmons +Date: Thu Nov 3 13:20:18 2011 +0000 + + don't map cursors in sw cursor mode + +commit d4eebe5217a89de196c1933e1fe4d37e22d59c6b +Author: Dave Airlie +Date: Thu Nov 3 13:18:46 2011 +0000 + + configure: don't require xvmc. + + Not needed in here + commit 548c6fe044068ffba9b5306dc6b11f2ba22782a4 Merge: 3881b0b ffe8ec8 Author: Keith Packard @@ -41125,6 +49215,18 @@ Date: Wed Sep 28 17:27:45 2011 -0400 Reviewed-by: Aaron Plattner Tested-by: Aaron Plattner +commit 6f581e3fde7ddc943c04f274e01735beb358b7f9 +Author: Dave Airlie +Date: Mon Oct 3 16:09:12 2011 +0100 + + fix fb_id for dirty reporting + +commit 79959b734702486971447a11b2e4181463fda3bf +Author: Dave Airlie +Date: Mon Oct 3 11:35:39 2011 +0100 + + fix make distcheck + commit 524e5445c0b6df5247d4aac5368470bb89ef4080 Author: Alan Coopersmith Date: Sat Oct 1 08:43:52 2011 -0700 @@ -41295,6 +49397,98 @@ Date: Fri Aug 26 18:27:02 2011 +0600 Reviewed-by: Jeremy Huddleston Tested-by: Matthieu Herrb +commit cb65ec6b58daf9a1afc40c8693fa0632f8cf0585 +Author: Dave Airlie +Date: Thu Sep 29 16:06:52 2011 +0100 + + check drm support dumb buffer capability + +commit 6ccd13a2d7d78db2d5bd3fafb00f78d2ceb11741 +Author: Dave Airlie +Date: Thu Sep 29 16:00:50 2011 +0100 + + add initial man page + +commit 1f37991dec98073d5dfbf0c30213f838999bd9da +Author: Dave Airlie +Date: Thu Sep 29 15:55:36 2011 +0100 + + add shadowfb support, default to on. + + we should probably expose a bit from kernel to say if shadow is preferred + or wasteful. + +commit 0b5e574dff230c7879eb9655bb7252553bbace50 +Author: Dave Airlie +Date: Thu Sep 29 15:55:24 2011 +0100 + + remove unused debug + +commit d686130c17126d86db55aae6b65b12d8bcf6a098 +Author: Dave Airlie +Date: Thu Sep 29 14:13:58 2011 +0100 + + add -Wall, cleanup warnings + +commit a4f6e661b5d6662c413c86eeefb4affddd65c562 +Author: Dave Airlie +Date: Thu Sep 29 14:05:43 2011 +0100 + + fix server recycling + +commit 7847321138be62b929123b25929a69f0a57aca3f +Author: Dave Airlie +Date: Thu Sep 29 12:38:26 2011 +0100 + + port damage tracking code from st/xorg + +commit 4d3aadb22fc03f259a9d1717b55ce16d7a32e2be +Author: Dave Airlie +Date: Thu Sep 29 12:34:27 2011 +0100 + + drop loading dri2 + +commit 1b1382c9e1995dcfe5dfec1de17155fa627ac6e8 +Author: Dave Airlie +Date: Thu Sep 29 12:34:17 2011 +0100 + + update authors/copyright + +commit 263597dbb3a75d711b5ad2e1f51554e6b2601d9a +Author: Dave Airlie +Date: Thu Sep 29 12:30:46 2011 +0100 + + gut some more unneeded code + +commit a72bdf170c8bc55eef3d2dbb8e316839552288a5 +Author: Dave Airlie +Date: Thu Sep 29 12:28:59 2011 +0100 + + modesetting: rewrite probing based on fbdev. + + This isn't perfect, it should really do more with bus id matching + and finding the write drm device using sysfs if it can. but it removes + lots of hardcoding of pci ids. + +commit a77fae850511c4d73af2af2b88804586f950f28d +Author: Dave Airlie +Date: Thu Sep 29 11:52:51 2011 +0100 + + cleanup some the drmmode_display header file + +commit 2a4618905445ce13fd272a4634ef5103dc804231 +Author: Dave Airlie +Date: Thu Sep 29 11:49:26 2011 +0100 + + modesetting: restart driver effort from other codebases + + This starts a randr 1.2 compatible driver with cursors. + + TODO: + libkms + dirty handling + server recycling. + commit 057cc92ebfeebe81b7d01ff2c6aa2c066c8d1a64 Merge: afb1fe6 52c9b59 Author: Peter Hutterer @@ -51638,6 +59832,14 @@ Date: Wed Mar 9 14:53:26 2011 +1000 Reviewed-by: Daniel Stone Reviewed-by: Alan Coopersmith +commit e2f8315daefc6e56ac8395a9f58f87bbf0809039 +Author: Dave Airlie +Date: Thu Mar 10 09:13:50 2011 +1000 + + drop exa + + don't provide accel in this framework + commit c48c530e541e201ea1afe2512d85967659ceef84 Author: Dave Airlie Date: Wed Mar 9 15:11:42 2011 +1000 @@ -70655,6 +78857,19 @@ Date: Fri Feb 26 14:02:09 2010 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone +commit 1f0e69b3a13258b79bffdec76b46f7960eb334b3 +Author: Matt Turner +Date: Mon Mar 8 10:54:21 2010 -0500 + + Don't check for Xinerama. + + It doesn't seem to be used anywhere, so don't require it. + + CC: Jerome Glisse + CC: Alex Deucher + CC: Dave Airlie + Signed-off-by: Matt Turner + commit bbae92795c7eab062e6722c42fa7915e0cee5d69 Author: Matt Turner Date: Mon Feb 15 20:08:09 2010 -0500 @@ -101229,6 +109444,13 @@ Date: Sat Jun 21 16:00:05 2008 -0400 Actually fetch all blocks of EEDID if asked to. +commit 9c4c323d50bd8b369e82a1dff28abdc15a219a5e +Author: Thomas Hellstrom +Date: Mon Jun 30 18:59:13 2008 +0100 + + Avoid an EXA init segfault. + Don't allocate each VRAM buffer with a 16MB alignment. + commit 211e2bdcc677122145998829a7f26610c7c567e6 Author: Adam Jackson Date: Mon Jun 30 10:29:17 2008 -0400 @@ -101250,6 +109472,65 @@ Date: Thu Jun 26 21:23:31 2008 -0400 Fix a leak of window devPrivates in window.c/CrushTree(). +commit a65888d6785934a669ad3b822bf2d636db351858 +Author: Alan Hourihane +Date: Fri Jun 27 17:32:28 2008 +0100 + + fixes for gallium stride changes + +commit e0c43fff3208350995c45604624dd4825f40598c +Author: Alan Hourihane +Date: Fri Jun 27 09:46:24 2008 +0100 + + More error checking + +commit 387ec961f2a5e791fd010906a5115cf8393471f3 +Author: Alan Hourihane +Date: Thu Jun 26 23:34:51 2008 +0100 + + add --with-gallium-dir to specify location of gallium tree + +commit 410b0a4254ca48548b443c1e8fbbcf7a6b9aa862 +Author: Alan Hourihane +Date: Thu Jun 26 22:49:33 2008 +0100 + + NULL checks + +commit 621fa337fb53d535f53cec30bb7161801001bb7f +Author: Alan Hourihane +Date: Thu Jun 26 22:47:20 2008 +0100 + + Fix copy surface + +commit ccd0c76472a7d8a85aed0ea6fea4011109f305d6 +Author: Alan Hourihane +Date: Thu Jun 26 22:27:44 2008 +0100 + + Add EXA winsys for gallium pipe driver interface. + + Plug in the EXA framework into the pipe driver + for surface_copy & surface_fill. + + Back pixmaps with drmBO's including the front buffer. + +commit 0e1aa03708d95cc1542bee31709a345d0f748f0c +Author: Alan Hourihane +Date: Thu Jun 26 22:27:14 2008 +0100 + + yet more + +commit 2b3a3bc9202f4e6f9886a08a4dfa597a83a5e933 +Author: Alan Hourihane +Date: Thu Jun 26 22:26:16 2008 +0100 + + more formatting fixes + +commit 2a45c28712a544c6f1c3eb753678ba1738cfdd67 +Author: Alan Hourihane +Date: Thu Jun 26 22:25:17 2008 +0100 + + formatting fixes + commit 15e4b6c57484b6afb790c7dc1db9f529ba2219cf Author: Peter Hutterer Date: Tue Jun 24 13:46:40 2008 +0930 @@ -101642,6 +109923,22 @@ Date: Tue Jun 17 10:35:24 2008 -0400 Still won't work until the kernel makes the resource files actually exist. +commit 47969d79289ad92f658c9a6dd2a2fc6b5f1b6c99 +Author: Alan Hourihane +Date: Mon Jun 16 15:07:39 2008 +0100 + + Add DRI2 support. + + Add EXA stubs. + + Currently tested with i915. + +commit 6a1910a0e562e36e0836e948b287ec37c90df02d +Author: Zack Rusin +Date: Mon Jun 16 00:31:53 2008 -0400 + + Adding some readme. + commit 8c9234a163eceda2abc0a2523e0f5587ea399935 Author: Keith Packard Date: Sun Jun 15 10:01:28 2008 +0930 @@ -102224,6 +110521,12 @@ Date: Wed Jun 4 13:39:39 2008 +0930 X.Org Bug 16204 +commit cba8b25a7e2608cd093283f86f08fba50a6a62f7 +Author: Alan Hourihane +Date: Mon Jun 2 11:17:47 2008 +0100 + + Bring inline with current modesetting-101 branch for connector/encoder changes + commit 26e7e69ab893d1f2b35213250ada40ec90944f62 Author: Peter Hutterer Date: Mon Jun 2 11:04:41 2008 +0930 @@ -102372,6 +110675,24 @@ Date: Thu May 29 17:42:49 2008 +0930 Xext: only free events in case of core motion events. +commit 000ead4503ddcfdf66ce9fffc572a3a741f4055a +Author: Alan Hourihane +Date: Wed May 28 19:59:38 2008 +0100 + + Plug in hardware cursor support + +commit f9f7a872bf3f8522213aabb291d9d54e56d48c4b +Author: Alan Hourihane +Date: Wed May 28 15:55:36 2008 +0100 + + Run indent + +commit 106bea5ad1bdd5795d6ed625fc6351a161bffa6e +Author: Alan Hourihane +Date: Wed May 28 13:33:07 2008 +0100 + + Initial commit of new modesetting driver + commit 8cf7755a85f5c1e5da7805c12b7511581a368782 Author: Peter Hutterer Date: Wed May 28 18:05:25 2008 +0930 diff --git a/xserver/Makefile.in b/xserver/Makefile.in index ea16d0f89..3f54863cb 100644 --- a/xserver/Makefile.in +++ b/xserver/Makefile.in @@ -54,8 +54,8 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xorg-server.pc.in \ $(srcdir)/xserver.ent.in $(top_srcdir)/configure COPYING \ - ChangeLog INSTALL config.guess config.sub depcomp install-sh \ - ltmain.sh missing ylwrap + ChangeLog INSTALL TODO config.guess config.sub depcomp \ + install-sh ltmain.sh missing 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 \ @@ -291,6 +291,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/TODO b/xserver/TODO new file mode 100644 index 000000000..115efc255 --- /dev/null +++ b/xserver/TODO @@ -0,0 +1,68 @@ +tree inheritance: + +init-cleanup + +driver todo for megamerge: +nuke ddc1 paths +nuke weak functions +i810 kms +mach64 LinearVidMem removal +openbsd pciaccess fd inversion +fix linux int10 ReadBIOS and/or merge int10 and generic +geode/sis/xgi *apVidMem removal +i128/mga BiosBase removal +sis virtualFrom removal +mach64/rendition max[HV]Value removal +cirrus should prefer 16bpp +external RAMDAC code motion for glint/s3/tga +freedreno oslib.h detangle + +unify xinerama protocol ~-1kloc +- add screen id token +- add removal api +- add primary flag dealie? + +fold up pre-1.2 randr +s/xf86DefaultModes/DMTModes/ -100 +GLX for Xnest (works-ish on other branch) +rootless-merge merge +rootless-using xwayland +glxproxy something something, -15kloc if you can delete it... +maybe merge int10/vbe +fix shadow for multiple pixmaps +top-level loader (almost, ported api, needs motion) +loadable glx for all ddxes +un-special-case colormap privates +redo fbbits a la sna +merge the one snafb bugfix +render: FindGlyph -> FindGlyphs +miValidateTree: 'forward' might be a pessimization +RegionOp's overlapFunc is constant +detach dmx from fb +destroywindow should return void +redo de-sdking of opaque.h + +PRIVATE_COLORMAP +only reason this is special is xf86HandleColormaps, which the ddx drivers +call _after_ creating default colormap, but which registers a devprivate. +should find some symbol always called before xf86HC but never called in +randr 1.2 drivers? xf86ValidateModes perhaps? + +XRT Must Die +Class: Drawable +Types: Colormap, Damage, GC, Picture, Pixmap, Window + +colormaps: +CreateColormap has a special case for the default cmap +uninstall is skipped for server cmaps? because default? +WindowOptRec->colormap is an id not a pointer +ScreenRec->defColormap is an id not a pointer, but, okay? +CopyColormapAndFree is... odd. +AllocColor's CMAPENTRY special case should be moved +ListInstalledColormaps is godawful +not clear why vfb/nest duplicate micmap so much + +pixmap/window: +aaaaaaaaaa + + diff --git a/xserver/Xext/Makefile.in b/xserver/Xext/Makefile.in index 1582bb2a6..99278612a 100644 --- a/xserver/Xext/Makefile.in +++ b/xserver/Xext/Makefile.in @@ -317,6 +317,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/Xext/dpms.c b/xserver/Xext/dpms.c index 5f1a35d9c..cdfaa9724 100644 --- a/xserver/Xext/dpms.c +++ b/xserver/Xext/dpms.c @@ -14,14 +14,14 @@ 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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, +BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation +Except as contained in this notice, the name of Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital +dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ diff --git a/xserver/Xext/dpmsstubs.c b/xserver/Xext/dpmsstubs.c index 80f13f5df..f05d1e9f9 100644 --- a/xserver/Xext/dpmsstubs.c +++ b/xserver/Xext/dpmsstubs.c @@ -14,14 +14,14 @@ 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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, +BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation +Except as contained in this notice, the name of Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital +dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ diff --git a/xserver/Xext/panoramiX.c b/xserver/Xext/panoramiX.c index 4d79c4654..2bbae2f5e 100644 --- a/xserver/Xext/panoramiX.c +++ b/xserver/Xext/panoramiX.c @@ -427,7 +427,7 @@ XineramaReinitData(void) /* * PanoramiXExtensionInit(): - * Called from InitExtensions in main(). + * Called from InitExtensions in main(). * Register PanoramiXeen Extension * Initialize global variables. */ diff --git a/xserver/Xext/panoramiX.h b/xserver/Xext/panoramiX.h index 6578dfa17..c16b9a5e2 100644 --- a/xserver/Xext/panoramiX.h +++ b/xserver/Xext/panoramiX.h @@ -28,7 +28,7 @@ Equipment Corporation. /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ -/* +/* * PanoramiX definitions */ diff --git a/xserver/Xext/panoramiXprocs.c b/xserver/Xext/panoramiXprocs.c index 83a2e0856..413a66afb 100644 --- a/xserver/Xext/panoramiXprocs.c +++ b/xserver/Xext/panoramiXprocs.c @@ -509,7 +509,7 @@ PanoramiXConfigureWindow(ClientPtr client) } } - /* have to go forward or you get expose events before + /* have to go forward or you get expose events before ConfigureNotify events */ FOR_NSCREENS_FORWARD(j) { stuff->window = win->info[j].id; @@ -1037,7 +1037,7 @@ PanoramiXClearToBackground(ClientPtr client) return result; } -/* +/* For Window to Pixmap copies you're screwed since each screen's pixmap will look like what it sees on its screen. Unless the screens overlap and the window lies on each, the two copies @@ -1193,9 +1193,8 @@ PanoramiXCopyArea(ClientPtr client) Bool overlap; RegionValidate(&totalReg, &overlap); - (*pDst->pScreen->SendGraphicsExpose) (client, &totalReg, - stuff->dstDrawable, - X_CopyArea, 0); + SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, + X_CopyArea, 0); RegionUninit(&totalReg); } } @@ -1306,9 +1305,8 @@ PanoramiXCopyPlane(ClientPtr client) Bool overlap; RegionValidate(&totalReg, &overlap); - (*pdstDraw->pScreen->SendGraphicsExpose) (client, &totalReg, - stuff->dstDrawable, - X_CopyPlane, 0); + SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, + X_CopyPlane, 0); RegionUninit(&totalReg); } @@ -1910,7 +1908,7 @@ PanoramiXGetImage(ClientPtr client) } rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, - XRC_DRAWABLE, client, DixWriteAccess); + XRC_DRAWABLE, client, DixReadAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; diff --git a/xserver/Xext/saver.c b/xserver/Xext/saver.c index 8e92fdf2f..2c14ea00e 100644 --- a/xserver/Xext/saver.c +++ b/xserver/Xext/saver.c @@ -467,9 +467,6 @@ CreateSaverWindow(ScreenPtr pScreen) WindowPtr pWin; int result; unsigned long mask; - Colormap *installedMaps; - int numInstalled; - int i; Colormap wantMap; ColormapPtr pCmap; @@ -545,18 +542,7 @@ CreateSaverWindow(ScreenPtr pScreen) /* check and install our own colormap if it isn't installed now */ wantMap = wColormap(pWin); - if (wantMap == None) - return TRUE; - installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof(Colormap)); - numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pScreen, installedMaps); - for (i = 0; i < numInstalled; i++) - if (installedMaps[i] == wantMap) - break; - - free((char *) installedMaps); - - if (i < numInstalled) + if (wantMap == None || IsMapInstalled(wantMap, pWin)) return TRUE; result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP, diff --git a/xserver/Xext/security.c b/xserver/Xext/security.c index 421b25201..cce7c467d 100644 --- a/xserver/Xext/security.c +++ b/xserver/Xext/security.c @@ -67,7 +67,6 @@ typedef struct { static const char *SecurityTrustedExtensions[] = { "XC-MISC", "BIG-REQUESTS", - "XpExtension", NULL }; @@ -929,12 +928,12 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata) * Returns: nothing. * * Side Effects: - * + * * If a new client is connecting, its authorization ID is copied to * client->authID. If this is a generated authorization, its reference * count is bumped, its timer is cancelled if it was running, and its * trustlevel is copied to TRUSTLEVEL(client). - * + * * If a client is disconnecting and the client was using a generated * authorization, the authorization's reference count is decremented, and * if it is now zero, the timer for this authorization is started. diff --git a/xserver/Xext/shm.c b/xserver/Xext/shm.c index 744b93c42..4cf83a0a5 100644 --- a/xserver/Xext/shm.c +++ b/xserver/Xext/shm.c @@ -260,7 +260,7 @@ ShmDestroyPixmap(PixmapPtr pPixmap) pScreen->DestroyPixmap = ShmDestroyPixmap; if (shmdesc) - ShmDetachSegment(shmdesc, pPixmap->drawable.id); + ShmDetachSegment(shmdesc, 0); return ret; } @@ -404,7 +404,7 @@ ProcShmAttach(ClientPtr client) } /* The attach was performed with root privs. We must - * do manual checking of access rights for the credentials + * do manual checking of access rights for the credentials * of the client */ if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) { @@ -427,7 +427,7 @@ ProcShmAttach(ClientPtr client) /*ARGSUSED*/ static int ShmDetachSegment(void *value, /* must conform to DeleteType */ - XID shmseg) + XID unused) { ShmDescPtr shmdesc = (ShmDescPtr) value; ShmDescPtr *prev; @@ -971,6 +971,12 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) stuff->offset); if (pMap) { + result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, + RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); + if (result != Success) { + pDraw->pScreen->DestroyPixmap(pMap); + return result; + } dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -1147,7 +1153,7 @@ ProcShmAttachFd(ClientPtr client) fd, 0); close(fd); - if ((shmdesc->addr == ((char *) -1))) { + if (shmdesc->addr == ((char *) -1)) { free(shmdesc); return BadAccess; } @@ -1237,7 +1243,7 @@ ProcShmCreateSegment(ClientPtr client) MAP_SHARED|__MAP_NOFAULT, fd, 0); - if ((shmdesc->addr == ((char *) -1))) { + if (shmdesc->addr == ((char *) -1)) { close(fd); free(shmdesc); return BadAccess; diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c index 755ed94a1..ba08cd1bb 100644 --- a/xserver/Xext/sync.c +++ b/xserver/Xext/sync.c @@ -2715,7 +2715,7 @@ IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) break; } } - /* + /* * We've been called exactly on the idle time, but we have a * NegativeTransition trigger which requires a transition from an * idle time greater than this. Schedule a wakeup for the next diff --git a/xserver/Xext/syncsrv.h b/xserver/Xext/syncsrv.h index 8c2c00df0..a8062d1c6 100644 --- a/xserver/Xext/syncsrv.h +++ b/xserver/Xext/syncsrv.h @@ -30,13 +30,13 @@ and Olivetti Research Limited, Cambridge, England. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or Olivetti not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c index 546b942a1..273793806 100644 --- a/xserver/Xext/xres.c +++ b/xserver/Xext/xres.c @@ -358,8 +358,8 @@ ResGetApproxPixmapBytes(PixmapPtr pix) bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; nPixels = pix->drawable.width * pix->drawable.height; - /* Divide by refcnt as pixmap could be shared between clients, - * so total pixmap mem is shared between these. + /* Divide by refcnt as pixmap could be shared between clients, + * so total pixmap mem is shared between these. */ return (nPixels * bytesPerPixel) / pix->refcnt; } @@ -375,7 +375,7 @@ ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) *bytes += size.pixmapRefSize; } -static void +static void ResFindPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; @@ -448,13 +448,13 @@ ProcXResQueryClientPixmapBytes(ClientPtr client) FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, (void *) (&bytes)); - /* - * Make sure win background pixmaps also held to account. + /* + * Make sure win background pixmaps also held to account. */ FindClientResourcesByType(clients[clientID], RT_WINDOW, ResFindWindowPixmaps, (void *) (&bytes)); - /* + /* * GC Tile & Stipple pixmaps too. */ FindClientResourcesByType(clients[clientID], RT_GC, diff --git a/xserver/Xext/xvdisp.c b/xserver/Xext/xvdisp.c index c466af532..c2d0fc9c1 100644 --- a/xserver/Xext/xvdisp.c +++ b/xserver/Xext/xvdisp.c @@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -297,9 +297,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep) if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ else WriteToClient(_c, sz_xvImageFormatInfo, _d) -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - static int ProcXvQueryExtension(ClientPtr client) { @@ -356,8 +353,6 @@ ProcXvQueryAdaptors(ClientPtr client) return Success; } - (*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - rep = (xvQueryAdaptorsReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -422,18 +417,12 @@ ProcXvQueryEncodings(ClientPtr client) XvPortPtr pPort; int ne; XvEncodingPtr pe; - int status; REQUEST(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - rep = (xvQueryEncodingsReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -485,11 +474,6 @@ ProcXvPutVideo(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; @@ -520,11 +504,6 @@ ProcXvPutStill(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; @@ -555,11 +534,6 @@ ProcXvGetVideo(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; @@ -590,11 +564,6 @@ ProcXvGetStill(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; @@ -631,7 +600,6 @@ ProcXvSelectVideoNotify(ClientPtr client) static int ProcXvSelectPortNotify(ClientPtr client) { - int status; XvPortPtr pPort; REQUEST(xvSelectPortNotifyReq); @@ -639,11 +607,6 @@ ProcXvSelectPortNotify(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - return XvdiSelectPortNotify(client, pPort, stuff->onoff); } @@ -659,11 +622,6 @@ ProcXvGrabPort(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - status = XvdiGrabPort(client, pPort, stuff->time, &result); if (status != Success) { @@ -684,7 +642,6 @@ ProcXvGrabPort(ClientPtr client) static int ProcXvUngrabPort(ClientPtr client) { - int status; XvPortPtr pPort; REQUEST(xvGrabPortReq); @@ -692,18 +649,13 @@ ProcXvUngrabPort(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - return XvdiUngrabPort(client, pPort, stuff->time); } static int ProcXvStopVideo(ClientPtr client) { - int status, ret; + int ret; DrawablePtr pDraw; XvPortPtr pPort; @@ -712,11 +664,6 @@ ProcXvStopVideo(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); if (ret != Success) return ret; @@ -735,11 +682,6 @@ ProcXvSetPortAttribute(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; @@ -769,11 +711,6 @@ ProcXvGetPortAttribute(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; @@ -800,7 +737,6 @@ ProcXvGetPortAttribute(ClientPtr client) static int ProcXvQueryBestSize(ClientPtr client) { - int status; unsigned int actual_width, actual_height; XvPortPtr pPort; xvQueryBestSizeReply rep; @@ -810,12 +746,7 @@ ProcXvQueryBestSize(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - - (*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion, + (*pPort->pAdaptor->ddQueryBestSize) (pPort, stuff->motion, stuff->vid_w, stuff->vid_h, stuff->drw_w, stuff->drw_h, &actual_width, &actual_height); @@ -836,7 +767,7 @@ ProcXvQueryBestSize(ClientPtr client) static int ProcXvQueryPortAttributes(ClientPtr client) { - int status, size, i; + int size, i; XvPortPtr pPort; XvAttributePtr pAtt; xvQueryPortAttributesReply rep; @@ -847,11 +778,6 @@ ProcXvQueryPortAttributes(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - rep = (xvQueryPortAttributesReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -902,11 +828,6 @@ ProcXvPutImage(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; @@ -930,8 +851,7 @@ ProcXvPutImage(ClientPtr client) width = stuff->width; height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, - pPort, pImage, &width, + size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); size += sizeof(xvPutImageReq); size = bytes_to_int32(size); @@ -968,11 +888,6 @@ ProcXvShmPutImage(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; @@ -1001,8 +916,7 @@ ProcXvShmPutImage(ClientPtr client) width = stuff->width; height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (client, - pPort, pImage, + size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); if ((size_needed + stuff->offset) > shmdesc->size) @@ -1086,7 +1000,7 @@ ProcXvQueryImageAttributes(ClientPtr client) width = stuff->width; height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, pPort, pImage, + size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, offsets, pitches); diff --git a/xserver/Xext/xvdix.h b/xserver/Xext/xvdix.h index bb08cf4c7..621a1e3a3 100644 --- a/xserver/Xext/xvdix.h +++ b/xserver/Xext/xvdix.h @@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -25,18 +25,18 @@ SOFTWARE. #ifndef XVDIX_H #define XVDIX_H /* -** File: +** File: ** ** xvdix.h --- Xv device independent header file ** -** Author: +** Author: ** ** David Carver (Digital Workstation Engineering/Project Athena) ** ** Revisions: ** ** 29.08.91 Carver -** - removed UnrealizeWindow wrapper unrealizing windows no longer +** - removed UnrealizeWindow wrapper unrealizing windows no longer ** preempts video ** ** 11.06.91 Carver @@ -157,32 +157,29 @@ typedef struct { int nPorts; struct _XvPortRec *pPorts; ScreenPtr pScreen; - int (*ddAllocatePort) (unsigned long, struct _XvPortRec *, - struct _XvPortRec **); - int (*ddFreePort) (struct _XvPortRec *); - int (*ddPutVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddPutStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddGetVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddGetVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddGetStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddGetStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddStopVideo) (ClientPtr, struct _XvPortRec *, DrawablePtr); - int (*ddSetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32); - int (*ddGetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32 *); - int (*ddQueryBestSize) (ClientPtr, struct _XvPortRec *, CARD8, + int (*ddStopVideo) (struct _XvPortRec *, DrawablePtr); + int (*ddSetPortAttribute) (struct _XvPortRec *, Atom, INT32); + int (*ddGetPortAttribute) (struct _XvPortRec *, Atom, INT32 *); + int (*ddQueryBestSize) (struct _XvPortRec *, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); - int (*ddPutImage) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutImage) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); - int (*ddQueryImageAttributes) (ClientPtr, struct _XvPortRec *, XvImagePtr, + int (*ddQueryImageAttributes) (struct _XvPortRec *, XvImagePtr, CARD16 *, CARD16 *, int *, int *); DevUnion devPriv; } XvAdaptorRec, *XvAdaptorPtr; @@ -213,9 +210,6 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; - Bool (*ddCloseScreen) (ScreenPtr); - int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *); - DevUnion devPriv; } XvScreenRec, *XvScreenPtr; #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \ @@ -235,8 +229,10 @@ extern _X_EXPORT int SProcXvDispatch(ClientPtr); extern _X_EXPORT int XvScreenInit(ScreenPtr); extern _X_EXPORT DevPrivateKey XvGetScreenKey(void); extern _X_EXPORT unsigned long XvGetRTPort(void); +extern _X_EXPORT void XvFreeAdaptor(XvAdaptorPtr pAdaptor); +extern void _X_EXPORT XvFillColorKey(DrawablePtr pDraw, CARD32 key, + RegionPtr region); extern _X_EXPORT int XvdiSendPortNotify(XvPortPtr, Atom, INT32); -extern _X_EXPORT int XvdiVideoStopped(XvPortPtr, int); extern _X_EXPORT int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, @@ -260,7 +256,6 @@ extern _X_EXPORT int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL); extern _X_EXPORT int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); extern _X_EXPORT int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); extern _X_EXPORT int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr); -extern _X_EXPORT int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *); extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time); diff --git a/xserver/Xext/xvmain.c b/xserver/Xext/xvmain.c index 00b5179bd..0abf190dc 100644 --- a/xserver/Xext/xvmain.c +++ b/xserver/Xext/xvmain.c @@ -4,13 +4,13 @@ and the Massachusetts Institute of Technology, Cambridge, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Digital or MIT not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -23,11 +23,11 @@ SOFTWARE. ******************************************************************/ /* -** File: +** File: ** ** xvmain.c --- Xv server extension main device independent module. -** -** Author: +** +** Author: ** ** David Carver (Digital Workstation Engineering/Project Athena) ** @@ -58,7 +58,7 @@ SOFTWARE. ** ** 24.01.91 Carver ** - version 1.4 upgrade -** +** ** Notes: ** ** Port structures reference client structures in a two different @@ -86,7 +86,7 @@ SOFTWARE. #include "scrnintstr.h" #include "windowstr.h" #include "pixmapstr.h" -#include "gc.h" +#include "gcstruct.h" #include "extnsionst.h" #include "extinit.h" #include "dixstruct.h" @@ -302,8 +302,6 @@ XvCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; - (*pxvs->ddCloseScreen) (pScreen); - free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); @@ -358,7 +356,7 @@ XvDestroyPixmap(PixmapPtr pPix) if (pp->pDraw == (DrawablePtr) pPix) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); - (void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw); + (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; @@ -406,7 +404,7 @@ XvDestroyWindow(WindowPtr pWin) if (pp->pDraw == (DrawablePtr) pWin) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); - (void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw); + (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; @@ -425,34 +423,10 @@ XvDestroyWindow(WindowPtr pWin) } -/* The XvdiVideoStopped procedure is a hook for the device dependent layer. - It provides a way for the dd layer to inform the di layer that video has - stopped in a port for reasons that the di layer had no control over; note - that it doesn't call back into the dd layer */ - -int -XvdiVideoStopped(XvPortPtr pPort, int reason) -{ - - /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */ - - if (!pPort->pDraw) - return Success; - - XvdiSendVideoNotify(pPort, pPort->pDraw, reason); - - pPort->pDraw = NULL; - pPort->client = NULL; - pPort->time = currentTime; - - return Success; - -} - static int XvdiDestroyPort(void *pPort, XID id) { - return (*((XvPortPtr) pPort)->pAdaptor->ddFreePort) (pPort); + return Success; } static int @@ -592,7 +566,7 @@ XvdiPutVideo(ClientPtr client, XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - (void) (*pPort->pAdaptor->ddPutVideo) (client, pDraw, pPort, pGC, + (void) (*pPort->pAdaptor->ddPutVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -634,7 +608,7 @@ XvdiPutStill(ClientPtr client, pPort->time = currentTime; - status = (*pPort->pAdaptor->ddPutStill) (client, pDraw, pPort, pGC, + status = (*pPort->pAdaptor->ddPutStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -670,7 +644,7 @@ XvdiPutImage(ClientPtr client, pPort->time = currentTime; - return (*pPort->pAdaptor->ddPutImage) (client, pDraw, pPort, pGC, + return (*pPort->pAdaptor->ddPutImage) (pDraw, pPort, pGC, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, image, data, sync, width, height); @@ -709,7 +683,7 @@ XvdiGetVideo(ClientPtr client, XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - (void) (*pPort->pAdaptor->ddGetVideo) (client, pDraw, pPort, pGC, + (void) (*pPort->pAdaptor->ddGetVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -749,7 +723,7 @@ XvdiGetStill(ClientPtr client, return Success; } - status = (*pPort->pAdaptor->ddGetStill) (client, pDraw, pPort, pGC, + status = (*pPort->pAdaptor->ddGetStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -941,7 +915,7 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff) return Success; } - /* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE + /* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */ if (!tpn) { @@ -981,29 +955,7 @@ XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) XvdiSendVideoNotify(pPort, pDraw, XvStopped); - status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pDraw); - - pPort->pDraw = NULL; - pPort->client = (ClientPtr) client; - pPort->time = currentTime; - - return status; - -} - -int -XvdiPreemptVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) -{ - int status; - - /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */ - - if (!pPort->pDraw || (pPort->pDraw != pDraw)) - return Success; - - XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); - - status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pPort->pDraw); + status = (*pPort->pAdaptor->ddStopVideo) (pPort, pDraw); pPort->pDraw = NULL; pPort->client = (ClientPtr) client; @@ -1046,7 +998,7 @@ XvdiSetPortAttribute(ClientPtr client, int status; status = - (*pPort->pAdaptor->ddSetPortAttribute) (client, pPort, attribute, + (*pPort->pAdaptor->ddSetPortAttribute) (pPort, attribute, value); if (status == Success) XvdiSendPortNotify(pPort, attribute, value); @@ -1060,7 +1012,7 @@ XvdiGetPortAttribute(ClientPtr client, { return - (*pPort->pAdaptor->ddGetPortAttribute) (client, pPort, attribute, + (*pPort->pAdaptor->ddGetPortAttribute) (pPort, attribute, p_value); } @@ -1091,3 +1043,77 @@ WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to) cpswapl(from->u.portNotify.value, to->u.portNotify.value); } + +void +XvFreeAdaptor(XvAdaptorPtr pAdaptor) +{ + int i; + + free(pAdaptor->name); + pAdaptor->name = NULL; + + if (pAdaptor->pEncodings) { + XvEncodingPtr pEncode = pAdaptor->pEncodings; + + for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) + free(pEncode->name); + free(pAdaptor->pEncodings); + pAdaptor->pEncodings = NULL; + } + + free(pAdaptor->pFormats); + pAdaptor->pFormats = NULL; + + free(pAdaptor->pPorts); + pAdaptor->pPorts = NULL; + + if (pAdaptor->pAttributes) { + XvAttributePtr pAttribute = pAdaptor->pAttributes; + + for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) + free(pAttribute->name); + free(pAdaptor->pAttributes); + pAdaptor->pAttributes = NULL; + } + + free(pAdaptor->pImages); + pAdaptor->pImages = NULL; + + free(pAdaptor->devPriv.ptr); + pAdaptor->devPriv.ptr = NULL; +} + +void +XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region) +{ + ScreenPtr pScreen = pDraw->pScreen; + ChangeGCVal pval[2]; + BoxPtr pbox = RegionRects(region); + int i, nbox = RegionNumRects(region); + xRectangle *rects; + GCPtr gc; + + gc = GetScratchGC(pDraw->depth, pScreen); + if (!gc) + return; + + pval[0].val = key; + pval[1].val = IncludeInferiors; + (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); + ValidateGC(pDraw, gc); + + rects = malloc(nbox * sizeof(xRectangle)); + if (rects) { + for (i = 0; i < nbox; i++, pbox++) { + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; + rects[i].width = pbox->x2 - pbox->x1; + rects[i].height = pbox->y2 - pbox->y1; + } + + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + + free(rects); + } + FreeScratchGC(gc); +} diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in index 4f78a59ff..21e4d9d46 100644 --- a/xserver/Xi/Makefile.in +++ b/xserver/Xi/Makefile.in @@ -246,6 +246,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c index b0bc47e6d..0857bcee6 100644 --- a/xserver/Xi/exevents.c +++ b/xserver/Xi/exevents.c @@ -1403,7 +1403,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, if (grab->ownerEvents) { WindowPtr focus = NullWindow; - WindowPtr sprite_win = dev->spriteInfo->sprite->win; + WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev); } @@ -1429,8 +1429,9 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, } else { GrabPtr devgrab = dev->deviceGrab.grab; + WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); - DeliverDeviceEvents(win, ptrev, grab, win, dev); + DeliverDeviceEvents(sprite_win, ptrev, grab, win, dev); /* FIXME: bad hack * Implicit passive grab activated in response to this event. Store * the event. diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in index 44947ab5c..748bcad49 100644 --- a/xserver/composite/Makefile.in +++ b/xserver/composite/Makefile.in @@ -264,6 +264,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c index dfbff06ca..8daded0a5 100644 --- a/xserver/composite/compalloc.c +++ b/xserver/composite/compalloc.c @@ -156,7 +156,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) return BadAccess; /* - * Allocate per-client per-window structure + * Allocate per-client per-window structure * The client *could* allocate multiple, but while supported, * it is not expected to be common */ @@ -353,7 +353,7 @@ compRedirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update) if (ccw->update == CompositeRedirectManual) return BadAccess; /* - * Allocate per-client per-window structure + * Allocate per-client per-window structure * The client *could* allocate multiple, but while supported, * it is not expected to be common */ @@ -401,7 +401,7 @@ compRedirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update) return BadAlloc; if (ccw->update == CompositeRedirectManual) { csw->update = CompositeRedirectManual; - /* + /* * tell damage extension that damage events for this client are * critical output */ @@ -430,7 +430,7 @@ compFreeClientSubwindows(WindowPtr pWin, XID id) *prev = ccw->next; if (ccw->update == CompositeRedirectManual) { - /* + /* * tell damage extension that damage events for this client are * critical output */ diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c index cadedbd37..f1a825573 100644 --- a/xserver/composite/compext.c +++ b/xserver/composite/compext.c @@ -299,7 +299,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); pScreen = pWin->drawable.pScreen; - /* + /* * Create an OverlayClient structure to mark this client's * interest in the overlay window */ @@ -351,7 +351,7 @@ ProcCompositeReleaseOverlayWindow(ClientPtr client) REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); - /* + /* * Has client queried a reference to the overlay window * on this screen? If not, generate an error. */ @@ -594,9 +594,6 @@ CompositeExtensionInit(void) return; CompositeReqCode = (CARD8) extEntry->base; - miRegisterRedirectBorderClipProc(compSetRedirectBorderClip, - compGetRedirectBorderClip); - /* Initialization succeeded */ noCompositeExtension = FALSE; } diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c index 48e938fac..3ac075a46 100644 --- a/xserver/composite/compinit.c +++ b/xserver/composite/compinit.c @@ -78,6 +78,7 @@ compCloseScreen(ScreenPtr pScreen) pScreen->PositionWindow = cs->PositionWindow; pScreen->GetImage = cs->GetImage; + pScreen->GetSpans = cs->GetSpans; pScreen->SourceValidate = cs->SourceValidate; free(cs); @@ -119,12 +120,12 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) pScreen->backingStoreSupport != NotUseful) { if (pWin->backingStore != NotUseful && !pWin->backStorage) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = (void *) (intptr_t) 1; + pWin->backStorage = TRUE; } else if (pWin->backingStore == NotUseful && pWin->backStorage) { compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = NULL; + pWin->backStorage = FALSE; } } @@ -150,6 +151,21 @@ compGetImage(DrawablePtr pDrawable, pScreen->GetImage = compGetImage; } +static void +compGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, + int nspans, char *pdstStart) +{ + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + + pScreen->GetSpans = cs->GetSpans; + if (pDrawable->type == DRAWABLE_WINDOW) + compPaintChildrenToWindow((WindowPtr) pDrawable); + (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); + cs->GetSpans = pScreen->GetSpans; + pScreen->GetSpans = compGetSpans; +} + static void compSourceValidate(DrawablePtr pDrawable, int x, int y, @@ -193,7 +209,7 @@ compFindVisuallessDepth(ScreenPtr pScreen, int d) } } /* - * If there isn't one, then it's gonna be hard to have + * If there isn't one, then it's gonna be hard to have * an associated visual */ return 0; @@ -432,6 +448,9 @@ compScreenInit(ScreenPtr pScreen) cs->GetImage = pScreen->GetImage; pScreen->GetImage = compGetImage; + cs->GetSpans = pScreen->GetSpans; + pScreen->GetSpans = compGetSpans; + cs->SourceValidate = pScreen->SourceValidate; pScreen->SourceValidate = compSourceValidate; diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h index 56b76c540..09241f2a2 100644 --- a/xserver/composite/compint.h +++ b/xserver/composite/compint.h @@ -76,7 +76,7 @@ /* * enable this for debugging - + #define COMPOSITE_DEBUG */ @@ -168,6 +168,7 @@ typedef struct _CompScreen { CompOverlayClientPtr pOverlayClients; GetImageProcPtr GetImage; + GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; } CompScreenRec, *CompScreenPtr; diff --git a/xserver/composite/compoverlay.c b/xserver/composite/compoverlay.c index 7932dda8d..20c860d5f 100644 --- a/xserver/composite/compoverlay.c +++ b/xserver/composite/compoverlay.c @@ -52,7 +52,7 @@ #include "panoramiXsrv.h" #endif -/* +/* * Delete the given overlay client list element from its screen list. */ void @@ -110,7 +110,7 @@ compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient) pOc->pNext = cs->pOverlayClients; cs->pOverlayClients = pOc; - /* + /* * Create a resource for this element so it can be deleted * when the client goes away. */ diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c index 9a6b2dae8..77bdfa23c 100644 --- a/xserver/composite/compwindow.c +++ b/xserver/composite/compwindow.c @@ -567,10 +567,11 @@ compCreateWindow(WindowPtr pWin) if (pWin->parent && ret) { CompSubwindowsPtr csw = GetCompSubwindows(pWin->parent); CompClientWindowPtr ccw; + PixmapPtr parent_pixmap = (*pScreen->GetWindowPixmap)(pWin->parent); + PixmapPtr window_pixmap = (*pScreen->GetWindowPixmap)(pWin); - (*pScreen->SetWindowPixmap) (pWin, - (*pScreen->GetWindowPixmap) (pWin-> - parent)); + if (window_pixmap != parent_pixmap) + (*pScreen->SetWindowPixmap) (pWin, parent_pixmap); if (csw) for (ccw = csw->clients; ccw; ccw = ccw->next) compRedirectWindow(clients[CLIENT_ID(ccw->id)], diff --git a/xserver/config/Makefile.in b/xserver/config/Makefile.in index 6e2d1f45c..140548f1f 100644 --- a/xserver/config/Makefile.in +++ b/xserver/config/Makefile.in @@ -285,6 +285,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/config/config.c b/xserver/config/config.c index a26d835e1..b5d634b87 100644 --- a/xserver/config/config.c +++ b/xserver/config/config.c @@ -128,160 +128,21 @@ device_is_duplicate(const char *config_info) } struct OdevAttributes * -config_odev_allocate_attribute_list(void) +config_odev_allocate_attributes(void) { - struct OdevAttributes *attriblist; - - attriblist = XNFalloc(sizeof(struct OdevAttributes)); - xorg_list_init(&attriblist->list); - return attriblist; -} - -void -config_odev_free_attribute_list(struct OdevAttributes *attribs) -{ - config_odev_free_attributes(attribs); - free(attribs); -} - -static struct OdevAttribute * -config_odev_find_attribute(struct OdevAttributes *attribs, int attrib_id) -{ - struct OdevAttribute *oa; - - xorg_list_for_each_entry(oa, &attribs->list, member) { - if (oa->attrib_id == attrib_id) - return oa; - } - return NULL; -} - -static struct OdevAttribute * -config_odev_find_or_add_attribute(struct OdevAttributes *attribs, int attrib) -{ - struct OdevAttribute *oa; - - oa = config_odev_find_attribute(attribs, attrib); - if (oa) - return oa; - - oa = XNFcalloc(sizeof(struct OdevAttribute)); - oa->attrib_id = attrib; - xorg_list_append(&oa->member, &attribs->list); - - return oa; -} - -static int config_odev_get_attribute_type(int attrib) -{ - switch (attrib) { - case ODEV_ATTRIB_PATH: - case ODEV_ATTRIB_SYSPATH: - case ODEV_ATTRIB_BUSID: - return ODEV_ATTRIB_STRING; - case ODEV_ATTRIB_FD: - case ODEV_ATTRIB_MAJOR: - case ODEV_ATTRIB_MINOR: - return ODEV_ATTRIB_INT; - case ODEV_ATTRIB_DRIVER: - return ODEV_ATTRIB_STRING; - default: - LogMessage(X_ERROR, "Error %s called for unknown attribute %d\n", - __func__, attrib); - return ODEV_ATTRIB_UNKNOWN; - } -} - -Bool -config_odev_add_attribute(struct OdevAttributes *attribs, int attrib, - const char *attrib_name) -{ - struct OdevAttribute *oa; - - if (config_odev_get_attribute_type(attrib) != ODEV_ATTRIB_STRING) { - LogMessage(X_ERROR, "Error %s called for non string attrib %d\n", - __func__, attrib); - return FALSE; - } - - oa = config_odev_find_or_add_attribute(attribs, attrib); - free(oa->attrib_name); - oa->attrib_name = XNFstrdup(attrib_name); - oa->attrib_type = ODEV_ATTRIB_STRING; - return TRUE; -} - -Bool -config_odev_add_int_attribute(struct OdevAttributes *attribs, int attrib, - int attrib_value) -{ - struct OdevAttribute *oa; - - if (config_odev_get_attribute_type(attrib) != ODEV_ATTRIB_INT) { - LogMessage(X_ERROR, "Error %s called for non integer attrib %d\n", - __func__, attrib); - return FALSE; - } - - oa = config_odev_find_or_add_attribute(attribs, attrib); - oa->attrib_value = attrib_value; - oa->attrib_type = ODEV_ATTRIB_INT; - return TRUE; -} - -char * -config_odev_get_attribute(struct OdevAttributes *attribs, int attrib_id) -{ - struct OdevAttribute *oa; - - oa = config_odev_find_attribute(attribs, attrib_id); - if (!oa) - return NULL; - - if (oa->attrib_type != ODEV_ATTRIB_STRING) { - LogMessage(X_ERROR, "Error %s called for non string attrib %d\n", - __func__, attrib_id); - return NULL; - } - return oa->attrib_name; -} - -int -config_odev_get_int_attribute(struct OdevAttributes *attribs, int attrib_id, int def) -{ - struct OdevAttribute *oa; - - oa = config_odev_find_attribute(attribs, attrib_id); - if (!oa) - return def; - - if (oa->attrib_type != ODEV_ATTRIB_INT) { - LogMessage(X_ERROR, "Error %s called for non integer attrib %d\n", - __func__, attrib_id); - return def; - } - - return oa->attrib_value; + struct OdevAttributes *attribs = XNFcalloc(sizeof (struct OdevAttributes)); + attribs->fd = -1; + return attribs; } void config_odev_free_attributes(struct OdevAttributes *attribs) { - struct OdevAttribute *iter, *safe; - int major = 0, minor = 0, fd = -1; - - xorg_list_for_each_entry_safe(iter, safe, &attribs->list, member) { - switch (iter->attrib_id) { - case ODEV_ATTRIB_MAJOR: major = iter->attrib_value; break; - case ODEV_ATTRIB_MINOR: minor = iter->attrib_value; break; - case ODEV_ATTRIB_FD: fd = iter->attrib_value; break; - } - xorg_list_del(&iter->member); - if (iter->attrib_type == ODEV_ATTRIB_STRING) - free(iter->attrib_name); - free(iter); - } - - if (fd != -1) - systemd_logind_release_fd(major, minor, fd); + if (attribs->fd != -1) + systemd_logind_release_fd(attribs->major, attribs->minor, attribs->fd); + free(attribs->path); + free(attribs->syspath); + free(attribs->busid); + free(attribs->driver); + free(attribs); } diff --git a/xserver/config/udev.c b/xserver/config/udev.c index 71215afb3..28c265817 100644 --- a/xserver/config/udev.c +++ b/xserver/config/udev.c @@ -310,12 +310,11 @@ device_removed(struct udev_device *device) const char *path = udev_device_get_devnode(device); dev_t devnum = udev_device_get_devnum(device); - if (strncmp(sysname,"card", 4) != 0) - return; - ErrorF("removing GPU device %s %s\n", syspath, path); - if (!path) + if ((strncmp(sysname,"card", 4) != 0) || (path == NULL)) return; + LogMessage(X_INFO, "config/udev: removing GPU device %s %s\n", + syspath, path); config_udev_odev_setup_attribs(path, syspath, major(devnum), minor(devnum), DeleteGPUDeviceRequest); /* Retry vtenter after a drm node removal */ @@ -472,12 +471,12 @@ config_udev_odev_setup_attribs(const char *path, const char *syspath, int major, int minor, config_odev_probe_proc_ptr probe_callback) { - struct OdevAttributes *attribs = config_odev_allocate_attribute_list(); + struct OdevAttributes *attribs = config_odev_allocate_attributes(); - config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path); - config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath); - config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MAJOR, major); - config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MINOR, minor); + attribs->path = XNFstrdup(path); + attribs->syspath = XNFstrdup(syspath); + attribs->major = major; + attribs->minor = minor; /* ownership of attribs is passed to probe layer */ probe_callback(attribs); diff --git a/xserver/configure b/xserver/configure index 82f3c0728..1253b5884 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.16.4. +# Generated by GNU Autoconf 2.69 for xorg-server 1.17.2. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.16.4' -PACKAGE_STRING='xorg-server 1.16.4' +PACKAGE_VERSION='1.17.2' +PACKAGE_STRING='xorg-server 1.17.2' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -729,6 +729,7 @@ KDRIVELINUX_FALSE KDRIVELINUX_TRUE KDRIVE_LIBS KDRIVE_LOCAL_LIBS +KDRIVE_MAIN_LIB KDRIVE_PURE_LIBS KDRIVE_CFLAGS KDRIVE_PURE_INCS @@ -787,10 +788,6 @@ XWIN_XV_FALSE XWIN_XV_TRUE XWIN_RANDR_FALSE XWIN_RANDR_TRUE -XWIN_PRIMARYFB_FALSE -XWIN_PRIMARYFB_TRUE -XWIN_NATIVEGDI_FALSE -XWIN_NATIVEGDI_TRUE XWIN_GLX_WINDOWS_FALSE XWIN_GLX_WINDOWS_TRUE XWIN_CLIPBOARD_FALSE @@ -821,6 +818,8 @@ GLAMOR_LIBS GLAMOR_CFLAGS GLAMOR_FALSE GLAMOR_TRUE +XORG_DRIVER_MODESETTING_FALSE +XORG_DRIVER_MODESETTING_TRUE XORG_BUS_PLATFORM_FALSE XORG_BUS_PLATFORM_TRUE XF86VIDMODE_FALSE @@ -1004,8 +1003,6 @@ MITSHM_FALSE MITSHM_TRUE COMPOSITE_FALSE COMPOSITE_TRUE -XREGISTRY_FALSE -XREGISTRY_TRUE XVMC_FALSE XVMC_TRUE XV_FALSE @@ -1350,7 +1347,6 @@ enable_aiglx enable_glx_tls with_khronos_spec_dir enable_privsep -enable_registry enable_composite enable_mitshm enable_xres @@ -1408,6 +1404,7 @@ enable_kdrive_kbd enable_kdrive_mouse enable_kdrive_evdev enable_libunwind +enable_xshmfence enable_install_setuid enable_unix_transport enable_tcp_transport @@ -2062,7 +2059,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.16.4 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.17.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2132,7 +2129,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.16.4:";; + short | recursive ) echo "Configuration of xorg-server 1.17.2:";; esac cat <<\_ACEOF @@ -2179,7 +2176,6 @@ Optional Features: --enable-glx-tls Build GLX with TLS support (default: auto) --enable-privsep Build support for X server privilege separation (default is NO) - --disable-registry Build string registry module (default: enabled) --disable-composite Build Composite extension (default: enabled) --disable-mitshm Build SHM extension (default: auto) --disable-xres Build XRes extension (default: enabled) @@ -2247,6 +2243,7 @@ Optional Features: --enable-kdrive-mouse Build mouse driver for kdrive (default: auto) --enable-kdrive-evdev Build evdev driver for kdrive (default: auto) --enable-libunwind Use libunwind for backtracing (default: auto) + --disable-xshmfence Disable xshmfence (default: auto) --enable-install-setuid Install Xorg server as owned by root with setuid bit (default: auto) --enable-unix-transport Enable UNIX domain socket transport @@ -2581,7 +2578,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.16.4 +xorg-server configure 1.17.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3290,7 +3287,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.16.4, which was +It was created by xorg-server $as_me 1.17.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3638,8 +3635,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2014-12-20" -RELEASE_NAME="Marionberry Pie" +RELEASE_DATE="2015-06-16" +RELEASE_NAME="lambic" am__api_version='1.12' @@ -4118,7 +4115,7 @@ fi # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.16.4' + VERSION='1.17.2' cat >>confdefs.h <<_ACEOF @@ -21756,9 +21753,13 @@ fi $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - ENDIAN="X_BIG_ENDIAN";; #( + +$as_echo "#define X_BYTE_ORDER X_BIG_ENDIAN" >>confdefs.h +;; #( no) - ENDIAN="X_LITTLE_ENDIAN" ;; #( + +$as_echo "#define X_BYTE_ORDER X_LITTLE_ENDIAN" >>confdefs.h + ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h @@ -21996,7 +21997,7 @@ fi for ac_func in backtrace ffs geteuid getuid issetugid getresuid \ - getdtablesize getifaddrs getpeereid getpeerucred getzoneid \ + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -22076,6 +22077,19 @@ fi +ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl +_ACEOF + + { $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 : @@ -22190,62 +22204,6 @@ else fi -for ac_header in asm/mtrr.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "asm/mtrr.h" "ac_cv_header_asm_mtrr_h" "$ac_includes_default" -if test "x$ac_cv_header_asm_mtrr_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ASM_MTRR_H 1 -_ACEOF - ac_cv_asm_mtrr_h=yes -fi - -done - -if test "x$ac_cv_asm_mtrr_h" = xyes; then - HAVE_MTRR=yes -fi - -for ac_header in sys/memrange.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/memrange.h" "ac_cv_header_sys_memrange_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_memrange_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MEMRANGE_H 1 -_ACEOF - ac_cv_memrange_h=yes -fi - -done - -if test "x$ac_cv_memrange_h" = xyes; then - HAVE_MTRR=yes -fi - -if test "x$HAVE_MTRR" = xyes; then - -$as_echo "#define HAS_MTRR_SUPPORT 1" >>confdefs.h - -fi - -for ac_header in machine/mtrr.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "machine/mtrr.h" "ac_cv_header_machine_mtrr_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_mtrr_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MACHINE_MTRR_H 1 -_ACEOF - ac_cv_machine_mtrr_h=yes -fi - -done - -if test "x$ac_cv_machine_mtrr_h" = xyes; then - -$as_echo "#define HAS_MTRR_BUILTIN 1" >>confdefs.h - -fi - for ac_header in sys/linker.h do : ac_fn_c_check_header_compile "$LINENO" "sys/linker.h" "ac_cv_header_sys_linker_h" "#include @@ -23182,13 +23140,6 @@ else fi -# Check whether --enable-registry was given. -if test "${enable_registry+set}" = set; then : - enableval=$enable_registry; XREGISTRY=$enableval -else - XREGISTRY=yes -fi - # Check whether --enable-composite was given. if test "${enable_composite+set}" = set; then : enableval=$enable_composite; COMPOSITE=$enableval @@ -23587,6 +23538,13 @@ else LIBUNWIND="auto" fi +# Check whether --enable-xshmfence was given. +if test "${enable_xshmfence+set}" = set; then : + enableval=$enable_xshmfence; XSHMFENCE="$enableval" +else + XSHMFENCE="auto" +fi + # Check whether --enable-install-setuid was given. @@ -24099,6 +24057,7 @@ case $host_os in CONFIG_UDEV=no CONFIG_UDEV_KMS=no DGA=no + DRM=no DRI2=no DRI3=no INT10MODULE=no @@ -24194,7 +24153,7 @@ DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" -XSHMFENCE="xshmfence >= 1.1" +LIBXSHMFENCE="xshmfence >= 1.1" XPROTO="xproto >= 7.0.26" RANDRPROTO="randrproto >= 1.4.0" @@ -24207,7 +24166,7 @@ FIXESPROTO="fixesproto >= 5.0" DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" -XTRANS="xtrans >= 1.3.3" +XTRANS="xtrans >= 1.3.5" PRESENTPROTO="presentproto >= 1.0" LIBAPPLEWM="applewm >= 1.4" @@ -24503,6 +24462,9 @@ $as_echo "yes" >&6; } fi if test "x$CONFIG_UDEV" = xauto; then CONFIG_UDEV="$HAVE_LIBUDEV" + +$as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h + fi if test "x$CONFIG_UDEV" = xyes; then CONFIG_UDEV_TRUE= @@ -25112,20 +25074,6 @@ if test "x$XVMC" = xyes; then $as_echo "#define XvMCExtension 1" >>confdefs.h -fi - - if test "x$XREGISTRY" = xyes; then - XREGISTRY_TRUE= - XREGISTRY_FALSE='#' -else - XREGISTRY_TRUE='#' - XREGISTRY_FALSE= -fi - -if test "x$XREGISTRY" = xyes; then - -$as_echo "#define XREGISTRY 1" >>confdefs.h - fi if test "x$COMPOSITE" = xyes; then @@ -25590,6 +25538,7 @@ fi + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSHMFENCE" >&5 $as_echo_n "checking for XSHMFENCE... " >&6; } @@ -25598,12 +25547,12 @@ if test -n "$XSHMFENCE_CFLAGS"; then pkg_cv_XSHMFENCE_CFLAGS="$XSHMFENCE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XSHMFENCE\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$XSHMFENCE") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXSHMFENCE\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$LIBXSHMFENCE") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XSHMFENCE_CFLAGS=`$PKG_CONFIG --cflags "$XSHMFENCE" 2>/dev/null` + pkg_cv_XSHMFENCE_CFLAGS=`$PKG_CONFIG --cflags "$LIBXSHMFENCE" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -25615,12 +25564,12 @@ if test -n "$XSHMFENCE_LIBS"; then pkg_cv_XSHMFENCE_LIBS="$XSHMFENCE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$XSHMFENCE\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$XSHMFENCE") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$LIBXSHMFENCE\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$LIBXSHMFENCE") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XSHMFENCE_LIBS=`$PKG_CONFIG --libs "$XSHMFENCE" 2>/dev/null` + pkg_cv_XSHMFENCE_LIBS=`$PKG_CONFIG --libs "$LIBXSHMFENCE" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -25641,9 +25590,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$XSHMFENCE" 2>&1` + XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$LIBXSHMFENCE" 2>&1` else - XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$XSHMFENCE" 2>&1` + XSHMFENCE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$LIBXSHMFENCE" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XSHMFENCE_PKG_ERRORS" >&5 @@ -25660,8 +25609,21 @@ else $as_echo "yes" >&6; } HAVE_XSHMFENCE=yes fi +if test "x$XSHMFENCE" = "xauto"; then + XSHMFENCE="$HAVE_XSHMFENCE" +fi - if test "x$HAVE_XSHMFENCE" = xyes; then +if test "x$XSHMFENCE" = "xyes"; then + if test "x$HAVE_XSHMFENCE" != "xyes"; then + as_fn_error $? "xshmfence requested but not installed." "$LINENO" 5 + fi + +$as_echo "#define HAVE_XSHMFENCE 1" >>confdefs.h + + REQUIRED_LIBS="$REQUIRED_LIBS $LIBXSHMFENCE" +fi + + if test "x$XSHMFENCE" = xyes; then XSHMFENCE_TRUE= XSHMFENCE_FALSE='#' else @@ -25670,17 +25632,7 @@ else fi -case x"$HAVE_XSHMFENCE" in - xyes) - -$as_echo "#define HAVE_XSHMFENCE 1" >>confdefs.h - - REQUIRED_LIBS="$REQUIRED_LIBS xshmfence" - ;; -esac - - -case "$DRI3,$HAVE_XSHMFENCE" in +case "$DRI3,$XSHMFENCE" in yes,yes | auto,yes) ;; yes,no) @@ -28233,7 +28185,7 @@ fi sparc*) SOLARIS_INOUT_ARCH="sparcv8plus" ;; - i*86) + i*86|x86_64*) if test x$SOLARIS_64 = xyes ; then SOLARIS_INOUT_ARCH="amd64" else @@ -28251,16 +28203,15 @@ fi gnu*) XORG_OS_SUBDIR="hurd" ;; + cygwin*) + XORG_OS_SUBDIR="stub" + ;; *) XORG_OS_SUBDIR="stub" - { $as_echo "$as_me:${as_lineno-$LINENO}: Your OS is unknown. Xorg currently only supports Linux, -Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd. If you are -interested in porting Xorg to your platform, please email -xorg@lists.freedesktop.org." >&5 -$as_echo "$as_me: Your OS is unknown. Xorg currently only supports Linux, -Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd. If you are -interested in porting Xorg to your platform, please email -xorg@lists.freedesktop.org." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Your OS is unknown. If you are interested in porting Xorg to your platform, +please email xorg@lists.freedesktop.org." >&5 +$as_echo "$as_me: Your OS is unknown. If you are interested in porting Xorg to your platform, +please email xorg@lists.freedesktop.org." >&6;} ;; esac @@ -28705,6 +28656,18 @@ fi XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi + if test "x$DRM" = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm >= 2.4.46\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm >= 2.4.46") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +fi + XORG_DRIVER_MODESETTING=yes + fi + @@ -29017,6 +28980,14 @@ else XORG_BUS_PLATFORM_FALSE= fi + if test "x$XORG_DRIVER_MODESETTING" = xyes; then + XORG_DRIVER_MODESETTING_TRUE= + XORG_DRIVER_MODESETTING_FALSE='#' +else + XORG_DRIVER_MODESETTING_TRUE='#' + XORG_DRIVER_MODESETTING_FALSE= +fi + if test "x$GLAMOR" = xyes; then GLAMOR_TRUE= @@ -29352,12 +29323,12 @@ if test -n "$XWINMODULES_CFLAGS"; then pkg_cv_XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau" 2>/dev/null` + pkg_cv_XWINMODULES_CFLAGS=`$PKG_CONFIG --cflags "x11 xdmcp xau xfixes" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29369,12 +29340,12 @@ if test -n "$XWINMODULES_LIBS"; then pkg_cv_XWINMODULES_LIBS="$XWINMODULES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xdmcp xau xfixes\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xdmcp xau xfixes") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau" 2>/dev/null` + pkg_cv_XWINMODULES_LIBS=`$PKG_CONFIG --libs "x11 xdmcp xau xfixes" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -29395,14 +29366,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` else - XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau" 2>&1` + XWINMODULES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xdmcp xau xfixes" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWINMODULES_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (x11 xdmcp xau) were not met: + as_fn_error $? "Package requirements (x11 xdmcp xau xfixes) were not met: $XWINMODULES_PKG_ERRORS @@ -29776,22 +29747,6 @@ else XWIN_GLX_WINDOWS_FALSE= fi - if test "x$XWIN" = xyes; then - XWIN_NATIVEGDI_TRUE= - XWIN_NATIVEGDI_FALSE='#' -else - XWIN_NATIVEGDI_TRUE='#' - XWIN_NATIVEGDI_FALSE= -fi - - if test "x$XWIN" = xyes; then - XWIN_PRIMARYFB_TRUE= - XWIN_PRIMARYFB_FALSE='#' -else - XWIN_PRIMARYFB_TRUE='#' - XWIN_PRIMARYFB_FALSE= -fi - if test "x$XWIN" = xyes; then XWIN_RANDR_TRUE= XWIN_RANDR_FALSE='#' @@ -31095,7 +31050,7 @@ $as_echo "#define KDRIVE_MOUSE 1" >>confdefs.h fi - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi @@ -31356,7 +31311,8 @@ fi fi ;; esac - KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB" + 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" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" @@ -31370,6 +31326,7 @@ fi + if test "x$KDRIVELINUX" = xyes; then KDRIVELINUX_TRUE= KDRIVELINUX_FALSE='#' @@ -31674,7 +31631,7 @@ $as_echo "$as_me: WARNING: ***********************************************" >&2;} fi -ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" +ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -31994,10 +31951,6 @@ if test -z "${XVMC_TRUE}" && test -z "${XVMC_FALSE}"; then as_fn_error $? "conditional \"XVMC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XREGISTRY_TRUE}" && test -z "${XREGISTRY_FALSE}"; then - as_fn_error $? "conditional \"XREGISTRY\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${COMPOSITE_TRUE}" && test -z "${COMPOSITE_FALSE}"; then as_fn_error $? "conditional \"COMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32178,6 +32131,10 @@ if test -z "${XORG_BUS_PLATFORM_TRUE}" && test -z "${XORG_BUS_PLATFORM_FALSE}"; as_fn_error $? "conditional \"XORG_BUS_PLATFORM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${XORG_DRIVER_MODESETTING_TRUE}" && test -z "${XORG_DRIVER_MODESETTING_FALSE}"; then + as_fn_error $? "conditional \"XORG_DRIVER_MODESETTING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GLAMOR_TRUE}" && test -z "${GLAMOR_FALSE}"; then as_fn_error $? "conditional \"GLAMOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32206,14 +32163,6 @@ if test -z "${XWIN_GLX_WINDOWS_TRUE}" && test -z "${XWIN_GLX_WINDOWS_FALSE}"; th as_fn_error $? "conditional \"XWIN_GLX_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XWIN_NATIVEGDI_TRUE}" && test -z "${XWIN_NATIVEGDI_FALSE}"; then - as_fn_error $? "conditional \"XWIN_NATIVEGDI\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${XWIN_PRIMARYFB_TRUE}" && test -z "${XWIN_PRIMARYFB_FALSE}"; then - as_fn_error $? "conditional \"XWIN_PRIMARYFB\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${XWIN_RANDR_TRUE}" && test -z "${XWIN_RANDR_FALSE}"; then as_fn_error $? "conditional \"XWIN_RANDR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32695,7 +32644,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.16.4, which was +This file was extended by xorg-server $as_me 1.17.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -32761,7 +32710,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.16.4 +xorg-server config.status 1.17.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -33221,6 +33170,9 @@ do "hw/xfree86/doc/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/doc/Makefile" ;; "hw/xfree86/dri/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri/Makefile" ;; "hw/xfree86/dri2/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri2/Makefile" ;; + "hw/xfree86/dri2/pci_ids/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri2/pci_ids/Makefile" ;; + "hw/xfree86/drivers/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/drivers/Makefile" ;; + "hw/xfree86/drivers/modesetting/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/drivers/modesetting/Makefile" ;; "hw/xfree86/exa/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/exa/Makefile" ;; "hw/xfree86/exa/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/exa/man/Makefile" ;; "hw/xfree86/fbdevhw/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/fbdevhw/Makefile" ;; @@ -33266,6 +33218,7 @@ do "hw/xwin/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/Makefile" ;; "hw/xwin/glx/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/glx/Makefile" ;; "hw/xwin/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/man/Makefile" ;; + "hw/xwin/winclipboard/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xwin/winclipboard/Makefile" ;; "hw/xquartz/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/Makefile" ;; "hw/xquartz/GL/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/GL/Makefile" ;; "hw/xquartz/bundle/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xquartz/bundle/Makefile" ;; diff --git a/xserver/configure.ac b/xserver/configure.ac index df0d40d6f..bd9aad523 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.16.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2014-12-20" -RELEASE_NAME="Marionberry Pie" +AC_INIT([xorg-server], 1.17.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2015-06-16" +RELEASE_NAME="lambic" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -139,7 +139,8 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_TYPEOF -AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) +AC_C_BIGENDIAN(AC_DEFINE(X_BYTE_ORDER, X_BIG_ENDIAN, [byte order]), + AC_DEFINE(X_BYTE_ORDER, X_LITTLE_ENDIAN, [byte order])) AC_CHECK_SIZEOF([unsigned long]) if test "$ac_cv_sizeof_unsigned_long" = 8; then @@ -216,10 +217,12 @@ AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ - getdtablesize getifaddrs getpeereid getpeerucred getzoneid \ + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext]) AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup]) +AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) + dnl Find the math libary, then check for cbrt function in it. AC_CHECK_LIB(m, sqrt) AC_CHECK_FUNCS([cbrt]) @@ -234,29 +237,6 @@ dnl fbdev header AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes]) -dnl MTRR header -AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes) -if test "x$ac_cv_asm_mtrr_h" = xyes; then - HAVE_MTRR=yes -fi - -dnl BSD MTRR header -AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes) -if test "x$ac_cv_memrange_h" = xyes; then - HAVE_MTRR=yes -fi - -if test "x$HAVE_MTRR" = xyes; then - AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available]) -fi - -dnl A NetBSD MTRR header -AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes) -if test "x$ac_cv_machine_mtrr_h" = xyes; then - AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR - support is available]) -fi - dnl FreeBSD kldload support (sys/linker.h) AC_CHECK_HEADERS([sys/linker.h], [ac_cv_sys_linker_h=yes], @@ -633,7 +613,6 @@ fi AM_CONDITIONAL(X_PRIVSEP, [test x$ENABLE_PRIVSEP = xyes]) dnl Extensions. -AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes]) AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto]) AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) @@ -695,6 +674,7 @@ AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd d AC_ARG_ENABLE(kdrive-mouse, AS_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) AC_ARG_ENABLE(kdrive-evdev, AS_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"]) +AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xshmfence (default: auto)]), [XSHMFENCE="$enableval"], [XSHMFENCE="auto"]) dnl chown/chmod to be setuid root as part of build @@ -755,6 +735,7 @@ case $host_os in CONFIG_UDEV=no CONFIG_UDEV_KMS=no DGA=no + DRM=no DRI2=no DRI3=no INT10MODULE=no @@ -834,7 +815,7 @@ DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" -XSHMFENCE="xshmfence >= 1.1" +LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules XPROTO="xproto >= 7.0.26" @@ -848,7 +829,7 @@ FIXESPROTO="fixesproto >= 5.0" DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" BIGREQSPROTO="bigreqsproto >= 1.1.0" -XTRANS="xtrans >= 1.3.3" +XTRANS="xtrans >= 1.3.5" PRESENTPROTO="presentproto >= 1.0" dnl List of libraries that require a specific version @@ -908,6 +889,7 @@ fi PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no]) if test "x$CONFIG_UDEV" = xauto; then CONFIG_UDEV="$HAVE_LIBUDEV" + AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.]) fi AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) if test "x$CONFIG_UDEV" = xyes; then @@ -978,7 +960,7 @@ if test "x$SUID_WRAPPER" = xyes; then 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 Xorg.bin and Xorg.wrap]) + AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap]) SETUID="no" fi AM_CONDITIONAL(SUID_WRAPPER, [test "x$SUID_WRAPPER" = xyes]) @@ -1083,11 +1065,6 @@ if test "x$XVMC" = xyes; then AC_DEFINE(XvMCExtension, 1, [Build XvMC extension]) fi -AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes]) -if test "x$XREGISTRY" = xyes; then - AC_DEFINE(XREGISTRY, 1, [Build registry module]) -fi - AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes]) if test "x$COMPOSITE" = xyes; then AC_DEFINE(COMPOSITE, 1, [Support Composite Extension]) @@ -1292,20 +1269,23 @@ esac AM_CONDITIONAL(BUSFAULT, test x"$BUSFAULT" = xyes) -PKG_CHECK_MODULES([XSHMFENCE], $XSHMFENCE, - [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no]) -AM_CONDITIONAL(XSHMFENCE, test "x$HAVE_XSHMFENCE" = xyes) +PKG_CHECK_MODULES([XSHMFENCE], $LIBXSHMFENCE, [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no]) +if test "x$XSHMFENCE" = "xauto"; then + XSHMFENCE="$HAVE_XSHMFENCE" +fi -case x"$HAVE_XSHMFENCE" in - xyes) - AC_DEFINE(HAVE_XSHMFENCE, 1, [Have X Shared Memory Fence library]) - REQUIRED_LIBS="$REQUIRED_LIBS xshmfence" - ;; -esac +if test "x$XSHMFENCE" = "xyes"; then + if test "x$HAVE_XSHMFENCE" != "xyes"; then + AC_MSG_ERROR([xshmfence requested but not installed.]) + fi + AC_DEFINE(HAVE_XSHMFENCE, 1, [Have xshmfence support]) + REQUIRED_LIBS="$REQUIRED_LIBS $LIBXSHMFENCE" +fi +AM_CONDITIONAL(XSHMFENCE, [test "x$XSHMFENCE" = xyes]) -case "$DRI3,$HAVE_XSHMFENCE" in +case "$DRI3,$XSHMFENCE" in yes,yes | auto,yes) ;; yes,no) @@ -2061,7 +2041,7 @@ if test "x$XORG" = xyes; then sparc*) SOLARIS_INOUT_ARCH="sparcv8plus" ;; - i*86) + i*86|x86_64*) if test x$SOLARIS_64 = xyes ; then SOLARIS_INOUT_ARCH="amd64" else @@ -2079,11 +2059,13 @@ if test "x$XORG" = xyes; then gnu*) XORG_OS_SUBDIR="hurd" ;; + cygwin*) + XORG_OS_SUBDIR="stub" + ;; *) XORG_OS_SUBDIR="stub" AC_MSG_NOTICE([m4_text_wrap(m4_join([ ], - [Your OS is unknown. Xorg currently only supports Linux,], - [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.], + [Your OS is unknown.], [If you are interested in porting Xorg to your platform,], [please email xorg@lists.freedesktop.org.]))]) ;; @@ -2114,6 +2096,12 @@ if test "x$XORG" = xyes; then XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi + 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 + fi + AC_SUBST([XORG_LIBS]) AC_SUBST([XORG_SYS_LIBS]) AC_SUBST([XORG_INCS]) @@ -2184,6 +2172,7 @@ 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]) dnl glamor AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes]) @@ -2218,7 +2207,7 @@ if test "x$XWIN" = xyes; then AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau]) + PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes]) if test "x$WINDOWSWM" = xauto; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) @@ -2282,8 +2271,6 @@ AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes]) -AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) @@ -2439,7 +2426,7 @@ if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) fi - XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms" + XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv" fi @@ -2496,7 +2483,8 @@ if test "$KDRIVE" = yes; then fi ;; esac - KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB" + 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" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" @@ -2508,6 +2496,7 @@ AC_SUBST([KDRIVE_INCS]) AC_SUBST([KDRIVE_PURE_INCS]) AC_SUBST([KDRIVE_CFLAGS]) AC_SUBST([KDRIVE_PURE_LIBS]) +AC_SUBST([KDRIVE_MAIN_LIB]) AC_SUBST([KDRIVE_LOCAL_LIBS]) AC_SUBST([KDRIVE_LIBS]) AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) @@ -2629,6 +2618,9 @@ hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile +hw/xfree86/dri2/pci_ids/Makefile +hw/xfree86/drivers/Makefile +hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile @@ -2674,6 +2666,7 @@ hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile +hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile diff --git a/xserver/damageext/Makefile.in b/xserver/damageext/Makefile.in index 82caf6805..37a79fc38 100644 --- a/xserver/damageext/Makefile.in +++ b/xserver/damageext/Makefile.in @@ -232,6 +232,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/dbe/Makefile.in b/xserver/dbe/Makefile.in index 824c1e586..6d6461f8e 100644 --- a/xserver/dbe/Makefile.in +++ b/xserver/dbe/Makefile.in @@ -263,6 +263,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/dbe/dbe.c b/xserver/dbe/dbe.c index fc3d475a8..e5d928d7b 100644 --- a/xserver/dbe/dbe.c +++ b/xserver/dbe/dbe.c @@ -1,5 +1,5 @@ /****************************************************************************** - * + * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * Permission is hereby granted, free of charge, to any person obtaining @@ -9,10 +9,10 @@ * 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. @@ -20,12 +20,12 @@ * 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. - * + * * DIX DBE code * *****************************************************************************/ @@ -152,7 +152,7 @@ ProcDbeGetVersion(ClientPtr client) * BadIDChoice - id is out of range for client; id is already in use * BadMatch - window is not an InputOutput window; * visual of window is not on list returned by - * DBEGetVisualInfo; + * DBEGetVisualInfo; * BadValue - invalid swap action is specified * BadWindow - window is not a valid window * Success @@ -839,7 +839,7 @@ SProcDbeGetVersion(ClientPtr client) * BadIDChoice - id is out of range for client; id is already in use * BadMatch - window is not an InputOutput window; * visual of window is not on list returned by - * DBEGetVisualInfo; + * DBEGetVisualInfo; * BadValue - invalid swap action is specified * BadWindow - window is not a valid window * Success @@ -1065,7 +1065,7 @@ SProcDbeDispatch(ClientPtr client) * * TRUE - setup was successful * FALSE - the window's background state is NONE - * + * *****************************************************************************/ static Bool diff --git a/xserver/dbe/dbestruct.h b/xserver/dbe/dbestruct.h index 200206652..fe2ef0af6 100644 --- a/xserver/dbe/dbestruct.h +++ b/xserver/dbe/dbestruct.h @@ -1,5 +1,5 @@ /****************************************************************************** - * + * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * Permission is hereby granted, free of charge, to any person obtaining @@ -9,10 +9,10 @@ * 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. @@ -20,12 +20,12 @@ * 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. - * + * * Header file for DIX-related DBE * *****************************************************************************/ @@ -139,7 +139,7 @@ typedef struct _DbeWindowPrivRec { * possibly resulting in a page swap and loss of performance. Initially we * will use this array to store buffer IDs. For situations where we have * more IDs than can fit in this static array, we will allocate a larger - * array to use, possibly suffering a performance loss. + * array to use, possibly suffering a performance loss. */ XID initIDs[DBE_INIT_MAX_IDS]; diff --git a/xserver/dbe/midbe.c b/xserver/dbe/midbe.c index 0479ecc5e..8f759107a 100644 --- a/xserver/dbe/midbe.c +++ b/xserver/dbe/midbe.c @@ -1,5 +1,5 @@ /****************************************************************************** - * + * * Copyright (c) 1994, 1995 Hewlett-Packard Company * * Permission is hereby granted, free of charge, to any person obtaining @@ -9,10 +9,10 @@ * 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. @@ -20,12 +20,12 @@ * 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. - * + * * Machine-independent DBE code * *****************************************************************************/ @@ -396,7 +396,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) * resource deletion easier. It is not guaranteed which delete function is * called first. Hence, we will let miDbeWinPrivDelete() free all DBE * resources. - * + * * This function deletes/frees the following stuff associated with * the window private: * @@ -443,7 +443,7 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) * * Description: * - * This function was cloned from miMbxPositionWindow() in mimultibuf.c. + * This function was cloned from miMbxPositionWindow() in mimultibuf.c. * This function resizes the buffer when the window is resized. * *****************************************************************************/ diff --git a/xserver/dbe/midbe.h b/xserver/dbe/midbe.h index 4eed538d0..67320eabf 100644 --- a/xserver/dbe/midbe.h +++ b/xserver/dbe/midbe.h @@ -8,10 +8,10 @@ * 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. @@ -19,12 +19,12 @@ * 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 Hewlett-Packard * Company 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 Hewlett-Packard Company. - * + * * Header file for users of machine-independent DBE code * *****************************************************************************/ diff --git a/xserver/devbook.am b/xserver/devbook.am index 400b2ca55..edddc863d 100644 --- a/xserver/devbook.am +++ b/xserver/devbook.am @@ -20,6 +20,8 @@ noinst_DATA = # DocBook/XML file with chapters, appendix and images it includes dist_noinst_DATA = $(docbook) $(chapters) +FILTER_XMLTO=$(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) + if HAVE_STYLESHEETS XMLTO_HTML_FLAGS = \ @@ -29,12 +31,12 @@ XMLTO_HTML_FLAGS = \ noinst_DATA += $(docbook:.xml=.html) %.html: %.xml $(chapters) - $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< + $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< if HAVE_XMLTO_TEXT noinst_DATA += $(docbook:.xml=.txt) %.txt: %.xml $(chapters) - $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< + $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< endif HAVE_XMLTO_TEXT if HAVE_FOP @@ -46,9 +48,9 @@ XMLTO_FO_FLAGS = \ noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) %.pdf: %.xml $(chapters) - $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< + $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< %.ps: %.xml $(chapters) - $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< + $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< endif HAVE_FOP endif HAVE_STYLESHEETS diff --git a/xserver/dix/Makefile.in b/xserver/dix/Makefile.in index 30aa663f4..9ec551430 100644 --- a/xserver/dix/Makefile.in +++ b/xserver/dix/Makefile.in @@ -278,6 +278,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/dix/atom.c b/xserver/dix/atom.c index 6f85968cd..22cd0dc0e 100644 --- a/xserver/dix/atom.c +++ b/xserver/dix/atom.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/colormap.c b/xserver/dix/colormap.c index c1ff88e1a..4d408d5d2 100644 --- a/xserver/dix/colormap.c +++ b/xserver/dix/colormap.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -181,11 +181,11 @@ static void FindColorInRootCmap(ColormapPtr /* pmap */ , #define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask | ALPHAMASK(vis)) -/* GetNextBitsOrBreak(bits, mask, base) -- +/* GetNextBitsOrBreak(bits, mask, base) -- * (Suggestion: First read the macro, then read this explanation. * * Either generate the next value to OR in to a pixel or break out of this - * while loop + * while loop * * This macro is used when we're trying to generate all 2^n combinations of * bits in mask. What we're doing here is counting in binary, except that @@ -197,11 +197,11 @@ static void FindColorInRootCmap(ColormapPtr /* pmap */ , * base has 1 bit set where the least significant bit of mask is set * * For example,if mask is 01010, base should be 0010 and we count like this: - * 00010 (see this isn't so hard), + * 00010 (see this isn't so hard), * then we add base to bits and get 0100. (bits & ~mask) is (0100 & 0100) so * we add that to bits getting (0100 + 0100) = * 01000 for our next value. - * then we add 0010 to get + * then we add 0010 to get * 01010 and we're done (easy as 1, 2, 3) */ #define GetNextBitsOrBreak(bits, mask, base) \ @@ -225,9 +225,9 @@ typedef struct _colorResource { * fShared should only be set if refcnt == AllocPrivate, and only in red map */ -/** - * Create and initialize the color map - * +/** + * Create and initialize the color map + * * \param mid resource to use for this colormap * \param alloc 1 iff all entries are allocated writable */ @@ -370,7 +370,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, if (!AddResource(mid, RT_COLORMAP, (void *) pmap)) return BadAlloc; - /* + /* * Security creation/labeling check */ i = XaceHook(XACE_RESOURCE_ACCESS, clients[client], mid, RT_COLORMAP, @@ -1456,7 +1456,7 @@ FreePixels(ColormapPtr pmap, int client) } } -/** +/** * Frees all of a client's colors and cells. * * \param value must conform to DeleteType @@ -1574,7 +1574,7 @@ AllocColorPlanes(int client, ColormapPtr pmap, int colors, /* Allocate the proper pixels */ /* XXX This is sort of bad, because of contig is set, we force all * r + g + b bits to be contiguous. Should only force contiguity - * per mask + * per mask */ ok = AllocPseudo(client, pmap, colors, r + g + b, contig, pixels, &mask, &ppixFirst); @@ -1786,7 +1786,7 @@ AllocPseudo(int client, ColormapPtr pmap, int c, int r, Bool contig, * pixels are the unique pixels. *pMask has the mask to Or with the * unique pixels to get the rest of them. * - * Returns True iff all pixels could be allocated + * Returns True iff all pixels could be allocated * All cells allocated will have refcnt set to AllocPrivate and shared to FALSE * (see AllocShared for why we care) */ @@ -2056,7 +2056,7 @@ AllocShared(ColormapPtr pmap, Pixel * ppix, int c, int r, int g, int b, } /** FreeColors - * Free colors and/or cells (probably slow for large numbers) + * Free colors and/or cells (probably slow for large numbers) */ int FreeColors(ColormapPtr pmap, int client, int count, Pixel * pixels, Pixel mask) @@ -2097,7 +2097,7 @@ FreeColors(ColormapPtr pmap, int client, int count, Pixel * pixels, Pixel mask) /** * Helper for FreeColors -- frees all combinations of *newpixels and mask bits * which the client has allocated in channel colormap cells of pmap. - * doesn't change newpixels if it doesn't need to + * doesn't change newpixels if it doesn't need to * * \param pmap which colormap head * \param color which sub-map, eg, RED, BLUE, PSEUDO diff --git a/xserver/dix/cursor.c b/xserver/dix/cursor.c index 56c560640..1525857e3 100644 --- a/xserver/dix/cursor.c +++ b/xserver/dix/cursor.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/devices.c b/xserver/dix/devices.c index 9e1c546e8..03290e486 100644 --- a/xserver/dix/devices.c +++ b/xserver/dix/devices.c @@ -177,6 +177,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (!isfinite(f[i])) return BadValue; + if (!dev->valuator) + return BadMatch; + if (!checkonly) DeviceSetTransform(dev, f); } @@ -1214,63 +1217,6 @@ QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode) } } -/* Notably, this function does not expand the destination's keycode range, or - * notify clients. */ -Bool -SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src) -{ - int i, j; - KeySym *tmp; - int rowDif = src->minKeyCode - dst->minKeyCode; - - /* if keysym map size changes, grow map first */ - if (src->mapWidth < dst->mapWidth) { - for (i = src->minKeyCode; i <= src->maxKeyCode; i++) { -#define SI(r, c) (((r - src->minKeyCode) * src->mapWidth) + (c)) -#define DI(r, c) (((r - dst->minKeyCode) * dst->mapWidth) + (c)) - for (j = 0; j < src->mapWidth; j++) - dst->map[DI(i, j)] = src->map[SI(i, j)]; - for (j = src->mapWidth; j < dst->mapWidth; j++) - dst->map[DI(i, j)] = NoSymbol; -#undef SI -#undef DI - } - return TRUE; - } - else if (src->mapWidth > dst->mapWidth) { - i = sizeof(KeySym) * src->mapWidth * - (dst->maxKeyCode - dst->minKeyCode + 1); - tmp = calloc(sizeof(KeySym), i); - if (!tmp) - return FALSE; - - if (dst->map) { - for (i = 0; i <= dst->maxKeyCode - dst->minKeyCode; i++) - memmove(&tmp[i * src->mapWidth], &dst->map[i * dst->mapWidth], - dst->mapWidth * sizeof(KeySym)); - free(dst->map); - } - dst->mapWidth = src->mapWidth; - dst->map = tmp; - } - else if (!dst->map) { - i = sizeof(KeySym) * src->mapWidth * - (dst->maxKeyCode - dst->minKeyCode + 1); - tmp = calloc(sizeof(KeySym), i); - if (!tmp) - return FALSE; - - dst->map = tmp; - dst->mapWidth = src->mapWidth; - } - - memmove(&dst->map[rowDif * dst->mapWidth], src->map, - (src->maxKeyCode - src->minKeyCode + 1) * - dst->mapWidth * sizeof(KeySym)); - - return TRUE; -} - Bool InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels, CARD8 *map) @@ -2257,7 +2203,7 @@ ProcBell(ClientPtr client) for (dev = inputInfo.devices; dev; dev = dev->next) { if ((dev == keybd || (!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) && - dev->kbdfeed && dev->kbdfeed->BellProc) { + ((dev->kbdfeed && dev->kbdfeed->BellProc) || dev->xkb_interest)) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess); if (rc != Success) @@ -2679,7 +2625,7 @@ GetPairedDevice(DeviceIntPtr dev) * slave. * - MASTER_KEYBOARD: the master keyboard for this device or NULL for a * floating slave - * - MASTER_POINTER: the master keyboard for this device or NULL for a + * - MASTER_POINTER: the master pointer for this device or NULL for a * floating slave * - POINTER_OR_FLOAT: the master pointer for this device or the device for * a floating slave diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c index 4e24e627f..9044ac786 100644 --- a/xserver/dix/dispatch.c +++ b/xserver/dix/dispatch.c @@ -26,13 +26,13 @@ Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -364,9 +364,9 @@ Dispatch(void) clientReady[0] = SmartScheduleClient(clientReady, nready); nready = 1; } - /***************** - * Handle events in round robin fashion, doing input between - * each round + /***************** + * Handle events in round robin fashion, doing input between + * each round *****************/ while (!dispatchException && (--nready >= 0)) { @@ -1597,6 +1597,52 @@ ProcClearToBackground(ClientPtr client) return Success; } +/* send GraphicsExpose events, or a NoExpose event, based on the region */ +void +SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, + int major, int minor) +{ + if (pRgn && !RegionNil(pRgn)) { + xEvent *pEvent; + xEvent *pe; + BoxPtr pBox; + int i; + int numRects; + + numRects = RegionNumRects(pRgn); + pBox = RegionRects(pRgn); + if (!(pEvent = calloc(numRects, sizeof(xEvent)))) + return; + pe = pEvent; + + for (i = 1; i <= numRects; i++, pe++, pBox++) { + pe->u.u.type = GraphicsExpose; + pe->u.graphicsExposure.drawable = drawable; + pe->u.graphicsExposure.x = pBox->x1; + pe->u.graphicsExposure.y = pBox->y1; + pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; + pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; + pe->u.graphicsExposure.count = numRects - i; + pe->u.graphicsExposure.majorEvent = major; + pe->u.graphicsExposure.minorEvent = minor; + } + /* GraphicsExpose is a "critical event", which TryClientEvents + * handles specially. */ + TryClientEvents(client, NULL, pEvent, numRects, + (Mask) 0, NoEventMask, NullGrab); + free(pEvent); + } + else { + xEvent event = { + .u.noExposure.drawable = drawable, + .u.noExposure.majorEvent = major, + .u.noExposure.minorEvent = minor + }; + event.u.u.type = NoExpose; + WriteEventsToClient(client, 1, &event); + } +} + int ProcCopyArea(ClientPtr client) { @@ -1628,8 +1674,7 @@ ProcCopyArea(ClientPtr client) stuff->width, stuff->height, stuff->dstX, stuff->dstY); if (pGC->graphicsExposures) { - (*pDst->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); + SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0); if (pRgn) RegionDestroy(pRgn); } @@ -1676,8 +1721,7 @@ ProcCopyPlane(ClientPtr client) stuff->srcY, stuff->width, stuff->height, stuff->dstX, stuff->dstY, stuff->bitPlane); if (pGC->graphicsExposures) { - (*pdstDraw->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); + SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); if (pRgn) RegionDestroy(pRgn); } @@ -3157,7 +3201,7 @@ ProcChangeAccessControl(ClientPtr client) /********************* * CloseDownRetainedResources * - * Find all clients that are gone and have terminated in RetainTemporary + * Find all clients that are gone and have terminated in RetainTemporary * and destroy their resources. *********************/ @@ -3191,13 +3235,11 @@ ProcKillClient(ClientPtr client) rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); if (rc == Success) { CloseDownClient(killclient); - /* if an LBX proxy gets killed, isItTimeToYield will be set */ - if (isItTimeToYield || (client == killclient)) { + if (client == killclient) { /* force yield and return Success, so that Dispatch() * doesn't try to touch client */ isItTimeToYield = TRUE; - return Success; } return Success; } diff --git a/xserver/dix/dispatch.h b/xserver/dix/dispatch.h index 3f3f3a2d9..939a6b936 100644 --- a/xserver/dix/dispatch.h +++ b/xserver/dix/dispatch.h @@ -26,7 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* * This prototypes the dispatch.c module (except for functions declared in * global headers), plus related dispatch procedures from devices.c, events.c, - * extension.c, property.c. + * extension.c, property.c. */ #ifdef HAVE_DIX_CONFIG_H diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c index 1c6442c8f..bc2732fb9 100644 --- a/xserver/dix/dixfonts.c +++ b/xserver/dix/dixfonts.c @@ -806,7 +806,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, int i; LFclosurePtr c; - /* + /* * The right error to return here would be BadName, however the * specification does not allow for a Name error on this request. * Perhaps a better solution would be to return a nil list, i.e. @@ -1057,7 +1057,7 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, int i; LFWIclosurePtr c; - /* + /* * The right error to return here would be BadName, however the * specification does not allow for a Name error on this request. * Perhaps a better solution would be to return a nil list, i.e. @@ -1851,7 +1851,7 @@ GetClientResolutions(int *num) pScreen = screenInfo.screens[0]; res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; /* - * XXX - we'll want this as long as bitmap instances are prevalent + * XXX - we'll want this as long as bitmap instances are prevalent so that we can match them from scalable fonts */ if (res.x_resolution < 88) diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c index cdd370bd6..205550eb4 100644 --- a/xserver/dix/dixutils.c +++ b/xserver/dix/dixutils.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -352,7 +352,7 @@ DeleteWindowFromAnySaveSet(WindowPtr pWin) /* No-op Don't Do Anything : sometimes we need to be able to call a procedure * that doesn't do anything. For example, on screen with only static * colormaps, if someone calls install colormap, it's easier to have a dummy - * procedure to call than to check if there's a procedure + * procedure to call than to check if there's a procedure */ void NoopDDA(void) @@ -373,7 +373,7 @@ static Bool inHandler; static Bool handlerDeleted; /** - * + * * \param pTimeout DIX doesn't want to know how OS represents time * \param pReadMask nor how it represents the det of descriptors */ diff --git a/xserver/dix/events.c b/xserver/dix/events.c index b8c67fdfc..250061568 100644 --- a/xserver/dix/events.c +++ b/xserver/dix/events.c @@ -1063,6 +1063,7 @@ MonthChangedOrBadTime(CARD32 *ms) void NoticeTime(const DeviceIntPtr dev, TimeStamp time) { + currentTime = time; lastDeviceEventTime[XIAllDevices].time = currentTime; lastDeviceEventTime[dev->id].time = currentTime; diff --git a/xserver/dix/extension.c b/xserver/dix/extension.c index ede4bf5bd..56e3abc14 100644 --- a/xserver/dix/extension.c +++ b/xserver/dix/extension.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -139,7 +139,9 @@ AddExtension(const char *name, int NumEvents, int NumErrors, ext->errorLast = 0; } +#ifdef X_REGISTRY_REQUEST RegisterExtensionNames(ext); +#endif return ext; } diff --git a/xserver/dix/gc.c b/xserver/dix/gc.c index 88d650121..78f3be29d 100644 --- a/xserver/dix/gc.c +++ b/xserver/dix/gc.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -87,22 +87,22 @@ ValidateGC(DrawablePtr pDraw, GC * pGC) * specified. ddxen can call this too; they should normally pass * NullClient for the client since any access checking should have * already been done at a higher level. - * + * * If you have any XIDs, you must use ChangeGCXIDs: - * + * * CARD32 v[2]; * v[0] = FillTiled; * v[1] = pid; * ChangeGCXIDs(client, pGC, GCFillStyle|GCTile, v); - * + * * However, if you need to pass a pointer to a pixmap or font, you must * use ChangeGC: - * + * * ChangeGCVal v[2]; * v[0].val = FillTiled; * v[1].ptr = pPixmap; * ChangeGC(client, pGC, GCFillStyle|GCTile, v); - * + * * If you have neither XIDs nor pointers, you can use either function, * but ChangeGC will do less work. * @@ -495,7 +495,6 @@ NewGCObject(ScreenPtr pScreen, int depth) pGC->graphicsExposures = TRUE; pGC->clipOrg.x = 0; pGC->clipOrg.y = 0; - pGC->clientClipType = CT_NONE; pGC->clientClip = (void *) NULL; pGC->numInDashList = 2; pGC->dash = DefaultDash; @@ -791,7 +790,7 @@ since we can't create them without already having a GC. any code using the tile or stipple has to set them explicitly anyway, since the state of the scratch gc is unknown. This is OK because ChangeGC() has to be able to deal with NULL tiles and -stipples anyway (in case the CreateGC() call has provided a +stipples anyway (in case the CreateGC() call has provided a value for them -- we can't set the default tile until the client-supplied attributes are installed, since the fgPixel is what fills the default tile. (maybe this comment should @@ -1033,7 +1032,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, } /* - sets reasonable defaults + sets reasonable defaults if we can get a pre-allocated one, use it and mark it as used. if we can't, create one out of whole cloth (The Velveteen GC -- if you use it often enough it will become real.) @@ -1067,7 +1066,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen) pGC->graphicsExposures = FALSE; pGC->clipOrg.x = 0; pGC->clipOrg.y = 0; - if (pGC->clientClipType != CT_NONE) + if (pGC->clientClip) (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); pGC->stateChanges = GCAllBits; return pGC; diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c index ffa89fad2..6fb12c5c1 100644 --- a/xserver/dix/getevents.c +++ b/xserver/dix/getevents.c @@ -1248,8 +1248,8 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) double x, y, ox, oy; int has_x, has_y; - has_x = valuator_mask_fetch_double(mask, 0, &ox); - has_y = valuator_mask_fetch_double(mask, 1, &oy); + has_x = valuator_mask_isset(mask, 0); + has_y = valuator_mask_isset(mask, 1); if (!has_x && !has_y) return; @@ -1263,23 +1263,23 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) pixman_f_transform_invert(&invert, &dev->scale_and_transform); transform(&invert, &ox, &oy); - - x = ox; - y = oy; } - if (valuator_mask_isset(mask, 0)) - ox = x = valuator_mask_get_double(mask, 0); + if (has_x) + ox = valuator_mask_get_double(mask, 0); - if (valuator_mask_isset(mask, 1)) - oy = y = valuator_mask_get_double(mask, 1); + if (has_y) + oy = valuator_mask_get_double(mask, 1); + + x = ox; + y = oy; transform(&dev->scale_and_transform, &x, &y); - if (valuator_mask_isset(mask, 0) || ox != x) + if (has_x || ox != x) valuator_mask_set_double(mask, 0, x); - if (valuator_mask_isset(mask, 1) || oy != y) + if (has_y || oy != y) valuator_mask_set_double(mask, 1, y); } @@ -2044,7 +2044,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, event->root = scr->root->drawable.id; - event_set_root_coordinates(event, screenx, screeny); + event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y); event->touchid = client_id; event->flags = flags; @@ -2082,8 +2082,8 @@ GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti, /* Get screen event coordinates from the sprite. Is this really the best * we can do? */ event_set_root_coordinates(event, - dev->last.valuators[0], - dev->last.valuators[1]); + dev->last.valuators[0] - scr->x, + dev->last.valuators[1] - scr->y); event->touchid = ti->client_id; event->flags = flags; diff --git a/xserver/dix/globals.c b/xserver/dix/globals.c index 21813bb63..673260176 100644 --- a/xserver/dix/globals.c +++ b/xserver/dix/globals.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/glyphcurs.c b/xserver/dix/glyphcurs.c index 54040253c..eca6a4cb8 100644 --- a/xserver/dix/glyphcurs.c +++ b/xserver/dix/glyphcurs.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/grabs.c b/xserver/dix/grabs.c index e3fc38bf5..b92f1e7ce 100644 --- a/xserver/dix/grabs.c +++ b/xserver/dix/grabs.c @@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR @@ -419,9 +419,9 @@ GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab) /** * Compares two grabs and returns TRUE if the first grab matches the second - * grab. - * - * A match is when + * grab. + * + * A match is when * - the devices set for the grab are equal (this is optional). * - the event types for both grabs are equal. * - XXX @@ -522,7 +522,7 @@ GrabsAreIdentical(GrabPtr pFirstGrab, GrabPtr pSecondGrab) * Any previously existing grab that matches the new grab will be removed. * Adding a new grab that would override another client's grab will result in * a BadAccess. - * + * * @return Success or X error code on failure. */ int diff --git a/xserver/dix/inpututils.c b/xserver/dix/inpututils.c index e5bcc31f7..5c2a32d1c 100644 --- a/xserver/dix/inpututils.c +++ b/xserver/dix/inpututils.c @@ -239,8 +239,10 @@ build_modmap_from_modkeymap(CARD8 *modmap, KeyCode *modkeymap, if (!modkeymap[i]) continue; +#if MAP_LENGTH < 256 if (modkeymap[i] >= MAP_LENGTH) return BadValue; +#endif if (modmap[modkeymap[i]]) return BadValue; diff --git a/xserver/dix/main.c b/xserver/dix/main.c index 7427e08ca..09f9504b8 100644 --- a/xserver/dix/main.c +++ b/xserver/dix/main.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -269,6 +269,8 @@ dix_main(int argc, char *argv[], char *envp[]) dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); + dixCloseRegistry(); + #ifdef PANORAMIX if (!noPanoramiXExtension) { if (!PanoramiXCreateConnectionBlock()) { diff --git a/xserver/dix/pixmap.c b/xserver/dix/pixmap.c index 4b880af58..00e298f5c 100644 --- a/xserver/dix/pixmap.c +++ b/xserver/dix/pixmap.c @@ -164,9 +164,9 @@ PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) } Bool -PixmapStartDirtyTracking(PixmapPtr src, - PixmapPtr slave_dst, - int x, int y) +PixmapStartDirtyTracking2(PixmapPtr src, + PixmapPtr slave_dst, + int x, int y, int dst_x, int dst_y) { ScreenPtr screen = src->drawable.pScreen; PixmapDirtyUpdatePtr dirty_update; @@ -179,6 +179,8 @@ PixmapStartDirtyTracking(PixmapPtr src, dirty_update->slave_dst = slave_dst; dirty_update->x = x; dirty_update->y = y; + dirty_update->dst_x = dst_x; + dirty_update->dst_y = dst_y; dirty_update->damage = DamageCreate(NULL, NULL, DamageReportNone, @@ -194,6 +196,14 @@ PixmapStartDirtyTracking(PixmapPtr src, 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) { @@ -261,7 +271,7 @@ 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, dst_box.x1, 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); diff --git a/xserver/dix/property.c b/xserver/dix/property.c index 9f51cd0ff..ff7f31aa9 100644 --- a/xserver/dix/property.c +++ b/xserver/dix/property.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/protocol.txt b/xserver/dix/protocol.txt index f83f38c58..c22379581 100644 --- a/xserver/dix/protocol.txt +++ b/xserver/dix/protocol.txt @@ -1082,33 +1082,3 @@ R009 XVideo-MotionCompensation:GetDRInfo E000 XVideo-MotionCompensation:BadContext E001 XVideo-MotionCompensation:BadSurface E002 XVideo-MotionCompensation:BadSubpicture -R000 XpExtension:QueryVersion -R001 XpExtension:GetPrinterList -R002 XpExtension:CreateContext -R003 XpExtension:SetContext -R004 XpExtension:GetContext -R005 XpExtension:DestroyContext -R006 XpExtension:GetContextScreen -R007 XpExtension:StartJob -R008 XpExtension:EndJob -R009 XpExtension:StartDoc -R010 XpExtension:EndDoc -R011 XpExtension:PutDocumentData -R012 XpExtension:GetDocumentData -R013 XpExtension:StartPage -R014 XpExtension:EndPage -R015 XpExtension:SelectInput -R016 XpExtension:InputSelected -R017 XpExtension:GetAttributes -R018 XpExtension:SetAttributes -R019 XpExtension:GetOneAttribute -R020 XpExtension:RehashPrinterList -R021 XpExtension:GetPageDimensions -R022 XpExtension:QueryScreens -R023 XpExtension:SetImageResolution -R024 XpExtension:GetImageResolution -V000 XpExtension:PrintNotify -V001 XpExtension:AttributeNotify -E000 XpExtension:BadContext -E001 XpExtension:BadSequence -E002 XpExtension:BadResourceID diff --git a/xserver/dix/region.c b/xserver/dix/region.c index e5eed0150..04e590170 100644 --- a/xserver/dix/region.c +++ b/xserver/dix/region.c @@ -21,20 +21,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group 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 Open Group. - -Copyright 1987, 1988, 1989 by -Digital Equipment Corporation, Maynard, Massachusetts. + +Copyright 1987, 1988, 1989 by +Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -118,9 +118,9 @@ Equipment Corporation. * there is no separate list of band start pointers. * * The y-x band representation does not minimize rectangles. In particular, - * if a rectangle vertically crosses a band (the rectangle has scanlines in + * if a rectangle vertically crosses a band (the rectangle has scanlines in * the y1 to y2 area spanned by the band), then the rectangle may be broken - * down into two or more smaller rectangles stacked one atop the other. + * down into two or more smaller rectangles stacked one atop the other. * * ----------- ----------- * | | | | band 0 @@ -948,7 +948,7 @@ RegionUnionO(RegionPtr pReg, /*- *----------------------------------------------------------------------- * RegionAppend -- - * + * * "Append" the rgn rectangles onto the end of dstrgn, maintaining * knowledge of YX-banding when it's easy. Otherwise, dstrgn just * becomes a non-y-x-banded random collection of rectangles, and not @@ -1103,7 +1103,7 @@ QuickSortRects(BoxRec rects[], int numRects) /*- *----------------------------------------------------------------------- * RegionValidate -- - * + * * Take a ``region'' which is a non-y-x-banded random collection of * rectangles, and compute a nice region which is the union of all the * rectangles. diff --git a/xserver/dix/registry.c b/xserver/dix/registry.c index 82a3340e1..84d48b4e3 100644 --- a/xserver/dix/registry.c +++ b/xserver/dix/registry.c @@ -21,8 +21,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #endif -#ifdef XREGISTRY - #include #include #include @@ -31,6 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "registry.h" #define BASE_SIZE 16 + +#ifdef X_REGISTRY_REQUEST #define CORE "X11" #define FILENAME SERVER_MISC_CONFIG_PATH "/protocol.txt" @@ -42,9 +42,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static FILE *fh; static char ***requests, **events, **errors; -static const char **resources; -static unsigned nmajor, *nminor, nevent, nerror, nresource; +static unsigned nmajor, *nminor, nevent, nerror; +#endif +#ifdef X_REGISTRY_RESOURCE +static const char **resources; +static unsigned nresource; +#endif + +#if defined(X_REGISTRY_RESOURCE) || defined(X_REGISTRY_REQUEST) /* * File parsing routines */ @@ -72,7 +78,12 @@ double_size(void *p, unsigned n, unsigned size) memset(*ptr + s, 0, f - s); return TRUE; } +#endif +#ifdef X_REGISTRY_REQUEST +/* + * Request/event/error registry functions + */ static void RegisterRequestName(unsigned major, unsigned minor, char *name) { @@ -197,28 +208,6 @@ RegisterExtensionNames(ExtensionEntry * extEntry) } } -/* - * Registration functions - */ - -void -RegisterResourceName(RESTYPE resource, const char *name) -{ - resource &= TypeMask; - - while (resource >= nresource) { - if (!double_size(&resources, nresource, sizeof(char *))) - return; - nresource = nresource ? nresource * 2 : BASE_SIZE; - } - - resources[resource] = name; -} - -/* - * Lookup functions - */ - const char * LookupRequestName(int major, int minor) { @@ -269,6 +258,26 @@ LookupErrorName(int error) return errors[error] ? errors[error] : XREGISTRY_UNKNOWN; } +#endif /* X_REGISTRY_REQUEST */ + +#ifdef X_REGISTRY_RESOURCE +/* + * Resource registry functions + */ + +void +RegisterResourceName(RESTYPE resource, const char *name) +{ + resource &= TypeMask; + + while (resource >= nresource) { + if (!double_size(&resources, nresource, sizeof(char *))) + return; + nresource = nresource ? nresource * 2 : BASE_SIZE; + } + + resources[resource] = name; +} const char * LookupResourceName(RESTYPE resource) @@ -279,10 +288,12 @@ LookupResourceName(RESTYPE resource) return resources[resource] ? resources[resource] : XREGISTRY_UNKNOWN; } +#endif /* X_REGISTRY_RESOURCE */ void dixFreeRegistry(void) { +#ifdef X_REGISTRY_REQUEST /* Free all memory */ while (nmajor--) { while (nminor[nmajor]) @@ -299,21 +310,30 @@ dixFreeRegistry(void) while (nerror--) free(errors[nerror]); free(errors); - - free(resources); - requests = NULL; nminor = NULL; events = NULL; errors = NULL; + nmajor = nevent = nerror = 0; +#endif + +#ifdef X_REGISTRY_RESOURCE + free(resources); + resources = NULL; + nresource = 0; +#endif +} - nmajor = nevent = nerror = nresource = 0; - +void +dixCloseRegistry(void) +{ +#ifdef X_REGISTRY_REQUEST if (fh) { fclose(fh); fh = NULL; } +#endif } /* @@ -322,16 +342,24 @@ dixFreeRegistry(void) void dixResetRegistry(void) { +#ifdef X_REGISTRY_REQUEST ExtensionEntry extEntry = { .name = CORE }; +#endif dixFreeRegistry(); +#ifdef X_REGISTRY_REQUEST /* Open the protocol file */ fh = fopen(FILENAME, "r"); if (!fh) LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME "\n"); + /* Add the core protocol */ + RegisterExtensionNames(&extEntry); +#endif + +#ifdef X_REGISTRY_RESOURCE /* Add built-in resources */ RegisterResourceName(RT_NONE, "NONE"); RegisterResourceName(RT_WINDOW, "WINDOW"); @@ -343,9 +371,5 @@ dixResetRegistry(void) RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY"); RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT"); RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB"); - - /* Add the core protocol */ - RegisterExtensionNames(&extEntry); +#endif } - -#endif /* XREGISTRY */ diff --git a/xserver/dix/resource.c b/xserver/dix/resource.c index 623d862d6..26debdb00 100644 --- a/xserver/dix/resource.c +++ b/xserver/dix/resource.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -101,7 +101,7 @@ Equipment Corporation. * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange */ -/* +/* * A resource ID is a 32 bit quantity, the upper 2 bits of which are * off-limits for client-visible resources. The next 8 bits are * used as client ID, and the low 22 bits come from the client. @@ -524,8 +524,10 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name) resourceTypes[next].findSubResFunc = DefaultFindSubRes; resourceTypes[next].errorValue = BadValue; +#if X_REGISTRY_RESOURCE /* Called even if name is NULL, to remove any previous entry */ RegisterResourceName(next, name); +#endif return next; } @@ -723,7 +725,7 @@ GetXIDRange(int client, Bool server, XID *minp, XID *maxp) /** * GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. - * This function tries to find count unused XIDs for the given client. It + * This function tries to find count unused XIDs for the given client. It * puts the IDs in the array pids and returns the number found, which should * almost always be the number requested. * @@ -1116,8 +1118,8 @@ FreeClientResources(ClientPtr client) resources = clientTable[client->index].resources; for (j = 0; j < clientTable[client->index].buckets; j++) { /* It may seem silly to update the head of this resource list as - we delete the members, since the entire list will be deleted any way, - but there are some resource deletion functions "FreeClientPixels" for + we delete the members, since the entire list will be deleted any way, + but there are some resource deletion functions "FreeClientPixels" for one which do a LookupID on another resource id (a Colormap id in this case), so the resource list must be kept valid up to the point that it is deleted, so every time we delete a resource, we must update the diff --git a/xserver/dix/selection.c b/xserver/dix/selection.c index e905b1ec2..4e994b1ec 100644 --- a/xserver/dix/selection.c +++ b/xserver/dix/selection.c @@ -26,13 +26,13 @@ Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -176,7 +176,7 @@ ProcSetSelectionOwner(ClientPtr client) if (rc == Success) { /* If the timestamp in client's request is in the past relative to the time stamp indicating the last time the owner of the - selection was set, do not set the selection, just return + selection was set, do not set the selection, just return success. */ if (CompareTimeStamps(time, pSel->lastTimeChanged) == EARLIER) return Success; diff --git a/xserver/dix/swaprep.c b/xserver/dix/swaprep.c index 559fe271e..905fef710 100644 --- a/xserver/dix/swaprep.c +++ b/xserver/dix/swaprep.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/swapreq.c b/xserver/dix/swapreq.c index 0f6d49ef0..61d3ce0f4 100644 --- a/xserver/dix/swapreq.c +++ b/xserver/dix/swapreq.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/tables.c b/xserver/dix/tables.c index 686cddd7d..88b372eb7 100644 --- a/xserver/dix/tables.c +++ b/xserver/dix/tables.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/dix/window.c b/xserver/dix/window.c index f4acdc889..d49276c98 100644 --- a/xserver/dix/window.c +++ b/xserver/dix/window.c @@ -49,13 +49,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -135,7 +135,7 @@ Equipment Corporation. #include /* must come after server includes */ /****** - * Window stuff for server + * Window stuff for server * * CreateRootWindow, CreateWindow, ChangeWindowAttributes, * GetWindowAttributes, DeleteWindow, DestroySubWindows, @@ -357,13 +357,12 @@ SetWindowToDefaults(WindowPtr pWin) pWin->firstChild = NullWindow; pWin->lastChild = NullWindow; - pWin->valdata = (ValidatePtr) NULL; - pWin->optional = (WindowOptPtr) NULL; + pWin->valdata = NULL; + pWin->optional = NULL; pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (void *) NULL; + pWin->backStorage = 0; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ @@ -634,7 +633,7 @@ RealChildHead(WindowPtr pWin) /***** * CreateWindow - * Makes a window in response to client request + * Makes a window in response to client request *****/ WindowPtr @@ -1039,10 +1038,10 @@ SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2) /***** * ChangeWindowAttributes - * + * * The value-mask specifies which attributes are to be changed; the * value-list contains one value for each one bit in the mask, from least - * to most significant bit in the mask. + * to most significant bit in the mask. *****/ int @@ -1460,8 +1459,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) /* We SHOULD check for an error value here XXX */ (*pScreen->ChangeWindowAttributes) (pWin, vmaskCopy); - /* - If the border contents have changed, redraw the border. + /* + If the border contents have changed, redraw the border. Note that this has to be done AFTER pScreen->ChangeWindowAttributes for the tile to be rotated, and the correct function selected. */ @@ -1551,7 +1550,7 @@ MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr) NULL; + pWin->prevSib = NULL; pNextSib->prevSib = pWin; pParent->firstChild = pWin; } @@ -1813,11 +1812,9 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) #define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - /* * IsSiblingAboveMe - * returns Above if pSib above pMe in stack or Below otherwise + * returns Above if pSib above pMe in stack or Below otherwise */ static int @@ -1848,7 +1845,7 @@ WindowExtents(WindowPtr pWin, BoxPtr pBox) return pBox; } -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) +#define IS_SHAPED(pWin) (wBoundingShape (pWin) != NULL) static RegionPtr MakeBoundingRegion(WindowPtr pWin, BoxPtr pBox) @@ -1917,7 +1914,7 @@ IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) } /* - * WhereDoIGoInTheStack() + * WhereDoIGoInTheStack() * Given pWin and pSib and the relationshipe smode, return * the window that pWin should go ABOVE. * If a pSib is specified: @@ -1925,7 +1922,7 @@ IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) * Below: pWin is placed just below pSib * TopIf: if pSib occludes pWin, then pWin is placed * at the top of the stack - * BottomIf: if pWin occludes pSib, then pWin is + * BottomIf: if pWin occludes pSib, then pWin is * placed at the bottom of the stack * Opposite: if pSib occludes pWin, then pWin is placed at the * top of the stack, else if pWin occludes pSib, then @@ -1954,7 +1951,7 @@ WhereDoIGoInTheStack(WindowPtr pWin, WindowPtr pHead, pFirst; if ((pWin == pWin->parent->firstChild) && (pWin == pWin->parent->lastChild)) - return ((WindowPtr) NULL); + return NULL; pHead = RealChildHead(pWin->parent); pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; box.x1 = x; @@ -2062,10 +2059,10 @@ ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstChange, kind); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pWin->drawable.pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, + kind); } - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, - kind); } if (pWin->realized) WindowsRestructured(); @@ -2092,8 +2089,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) h = pWin->drawable.height, bw = pWin->borderWidth; int rc, action, smode = Above; - if ((pWin->drawable.class == InputOnly) && - (mask & IllegalInputOnlyConfigureMask)) + if ((pWin->drawable.class == InputOnly) && (mask & CWBorderWidth)) return BadMatch; if ((mask & CWSibling) && !(mask & CWStackMode)) @@ -2320,7 +2316,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) * For RaiseLowest, raises the lowest mapped child (if any) that is * obscured by another child to the top of the stack. For LowerHighest, * lowers the highest mapped child (if any) that is obscuring another - * child to the bottom of the stack. Exposure processing is performed + * child to the bottom of the stack. Exposure processing is performed * ******/ @@ -2580,10 +2576,10 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, + VTMap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, - VTMap); } WindowsRestructured(); } @@ -2601,7 +2597,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) (*pScreen->PostValidateTree) (NullWindow, pWin, VTMap); RegionNull(&temp); RegionCopy(&temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); + (*pScreen->WindowExposures) (pWin, &temp); RegionUninit(&temp); } @@ -2645,8 +2641,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) RealizeTree(pWin); if (pWin->viewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, - (WindowPtr - *) NULL); + NULL); } } } @@ -2656,17 +2651,16 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) pLayerWin = (*pScreen->GetLayerWindow) (pParent); if (pLayerWin->parent != pParent) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pLayerWin, - pLayerWin, - (WindowPtr *) NULL); + pLayerWin, NULL); pFirstMapped = pLayerWin; } if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstMapped, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped, + VTMap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped, - VTMap); WindowsRestructured(); } } @@ -2760,9 +2754,9 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) if (!fromConfigure) { (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } if (wasRealized && !fromConfigure) { WindowsRestructured(); @@ -2807,8 +2801,6 @@ UnmapSubwindows(WindowPtr pWin) pChild->mapped = FALSE; if (pChild->realized) UnrealizeTree(pChild, FALSE); - if (wasViewable) { - } } } if (wasViewable) { @@ -2818,8 +2810,7 @@ UnmapSubwindows(WindowPtr pWin) else { WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, - (WindowPtr *) NULL); + (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); (*pScreen->MarkWindow) (pLayerWin->parent); /* Windows between pWin and pLayerWin may not have been marked */ @@ -2833,9 +2824,10 @@ UnmapSubwindows(WindowPtr pWin) } (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, + VTUnmap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap); } if (wasRealized) { WindowsRestructured(); @@ -2878,7 +2870,7 @@ HandleSaveSet(ClientPtr client) } free(client->saveSet); client->numSaved = 0; - client->saveSet = (SaveSetElt *) NULL; + client->saveSet = NULL; } /** @@ -3251,7 +3243,7 @@ CheckWindowOptionalNeed(WindowPtr w) return; if (optional->userProps != NULL) return; - if (optional->backingBitPlanes != ~0L) + if (optional->backingBitPlanes != (CARD32)~0L) return; if (optional->backingPixel != 0) return; @@ -3335,9 +3327,9 @@ MakeWindowOptional(WindowPtr pWin) * changing the window cursor (e.g. using XDefineCursor()) will not have any * visible effect. Only when one of the device cursors is set to None again, * this device's cursor will display the changed standard cursor. - * + * * CursorIsNone of the window struct is NOT modified if you set a device - * cursor. + * cursor. * * Assumption: If there is a node for a device in the list, the device has a * cursor. If the cursor is set to None, it is inherited by the parent. @@ -3432,7 +3424,7 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor) if (pOldCursor) FreeCursor(pOldCursor, (Cursor) 0); - /* FIXME: We SHOULD check for an error value here XXX + /* FIXME: We SHOULD check for an error value here XXX (comment taken from ChangeWindowAttributes) */ (*pScreen->ChangeWindowAttributes) (pWin, CWCursor); @@ -3499,7 +3491,7 @@ WindowSeekDeviceCursor(WindowPtr pWin, } /* Return True if a parent has the same device cursor set or False if - * otherwise + * otherwise */ static Bool WindowParentHasDeviceCursor(WindowPtr pWin, @@ -3594,22 +3586,19 @@ SetRootClip(ScreenPtr pScreen, Bool enable) if (pWin->firstChild) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild, pWin->firstChild, - (WindowPtr *) NULL); + NULL); } else { (*pScreen->MarkWindow) (pWin); anyMarked = TRUE; } - if (anyMarked) + if (anyMarked) { (*pScreen->ValidateTree) (pWin, NullWindow, VTOther); - } - - if (WasViewable) { - if (anyMarked) (*pScreen->HandleExposures) (pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); + } } if (pWin->realized) WindowsRestructured(); diff --git a/xserver/doc/Makefile.am b/xserver/doc/Makefile.am index e6974fef1..b305f4db7 100644 --- a/xserver/doc/Makefile.am +++ b/xserver/doc/Makefile.am @@ -12,4 +12,4 @@ include $(top_srcdir)/devbook.am endif HAVE_XMLTO endif ENABLE_DEVEL_DOCS -EXTRA_DIST = smartsched +EXTRA_DIST = smartsched filter-xmlto.sh diff --git a/xserver/doc/Makefile.in b/xserver/doc/Makefile.in index 53f935472..4d358b6fa 100644 --- a/xserver/doc/Makefile.in +++ b/xserver/doc/Makefile.in @@ -261,6 +261,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -511,6 +512,7 @@ SUBDIRS = dtrace # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @@ -525,7 +527,7 @@ SUBDIRS = dtrace @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA) # Generate DocBook/XML output formats with or without stylesheets -EXTRA_DIST = smartsched +EXTRA_DIST = smartsched filter-xmlto.sh all: all-recursive .SUFFIXES: @@ -869,13 +871,13 @@ uninstall-am: ps ps-am tags tags-recursive uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/doc/Xserver-spec.xml b/xserver/doc/Xserver-spec.xml index cd1a9d07a..4c344194d 100644 --- a/xserver/doc/Xserver-spec.xml +++ b/xserver/doc/Xserver-spec.xml @@ -1217,11 +1217,9 @@ library is contained in dix/dixfonts.c
Memory Management -Memory management is based on functions in the C runtime library. -Xalloc(), Xrealloc(), and Xfree() are deprecated aliases for malloc(), +Memory management is based on functions in the C runtime library, malloc(), realloc(), and free(), and you should simply call the C library functions -directly. Consult a C runtime library reference -manual for more details. +directly. Consult a C runtime library reference manual for more details. Treat memory allocation carefully in your implementation. Memory diff --git a/xserver/doc/dtrace/Makefile.in b/xserver/doc/dtrace/Makefile.in index 21b68a4ac..715f7f0ae 100644 --- a/xserver/doc/dtrace/Makefile.in +++ b/xserver/doc/dtrace/Makefile.in @@ -252,6 +252,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/doc/filter-xmlto.sh b/xserver/doc/filter-xmlto.sh new file mode 100644 index 000000000..3596ed13a --- /dev/null +++ b/xserver/doc/filter-xmlto.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Run the xmlto command, filtering its output to +# reduce the amount of useless warnings in the build log. +# +# Exit with the status of the xmlto process, not the status of the +# output filtering commands +# +# This is a bit twisty, but avoids any temp files by using pipes for +# everything. It routes the command output through file +# descriptor 4 while sending the (numeric) exit status through +# standard output. +# +(((("$@" 2>&1; echo $? >&3) | + grep -v overflows | + grep -v 'Making' | + grep -v 'hyphenation' | + grep -v 'Font.*not found' | + grep -v '/tmp/xml' | + grep -v Rendered >&4) 3>&1) | + (read status; exit $status)) 4>&1 diff --git a/xserver/dri3/Makefile.in b/xserver/dri3/Makefile.in index d756874ba..d3a635279 100644 --- a/xserver/dri3/Makefile.in +++ b/xserver/dri3/Makefile.in @@ -262,6 +262,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/dri3/dri3.c b/xserver/dri3/dri3.c index 76e07b40e..385862a3b 100644 --- a/xserver/dri3/dri3.c +++ b/xserver/dri3/dri3.c @@ -30,6 +30,8 @@ int dri3_request; DevPrivateKeyRec dri3_screen_private_key; DevPrivateKeyRec dri3_window_private_key; +static int dri3_screen_generation; + static Bool dri3_close_screen(ScreenPtr screen) { @@ -44,6 +46,8 @@ dri3_close_screen(ScreenPtr screen) Bool dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info) { + dri3_screen_generation = serverGeneration; + if (!dixRegisterPrivateKey(&dri3_screen_private_key, PRIVATE_SCREEN, 0)) return FALSE; @@ -68,6 +72,12 @@ dri3_extension_init(void) ExtensionEntry *extension; int i; + /* If no screens support DRI3, there's no point offering the + * extension at all + */ + if (dri3_screen_generation != serverGeneration) + return; + #ifdef PANORAMIX if (!noPanoramiXExtension) return; diff --git a/xserver/dri3/dri3.h b/xserver/dri3/dri3.h index edc7fa267..7562352ff 100644 --- a/xserver/dri3/dri3.h +++ b/xserver/dri3/dri3.h @@ -23,8 +23,6 @@ #ifndef _DRI3_H_ #define _DRI3_H_ -#include - #ifdef DRI3 #include diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in index ea840749f..1729314ba 100644 --- a/xserver/exa/Makefile.in +++ b/xserver/exa/Makefile.in @@ -265,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/exa/exa.c b/xserver/exa/exa.c index a2995db24..51d36f3f3 100644 --- a/xserver/exa/exa.c +++ b/xserver/exa/exa.c @@ -719,7 +719,7 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) return; - /* Try and keep the offscreen memory area tidy every now and then (at most + /* Try and keep the offscreen memory area tidy every now and then (at most * once per second) when the server has been idle for at least 100ms. */ if (pExaScr->numOffscreenAvailable > 1) { diff --git a/xserver/exa/exa.h b/xserver/exa/exa.h index 98d094dff..949ea3ac0 100644 --- a/xserver/exa/exa.h +++ b/xserver/exa/exa.h @@ -233,7 +233,7 @@ typedef struct _ExaDriver { * @{ */ /** - * PrepareCopy() sets up the driver for doing a copy within video + * PrepareCopy() sets up the driver for doing a copy within video * memory. * * @param pSrcPixmap source pixmap @@ -471,7 +471,7 @@ typedef struct _ExaDriver { * UploadToScreen() can aid in pixmap migration, but is most important for * the performance of exaGlyphs() (antialiased font drawing) by allowing * pipelining of data uploads, avoiding a sync of the card after each glyph. - * + * * @return TRUE if the driver successfully uploaded the data. FALSE * indicates that EXA should fall back to doing the upload in software. * @@ -512,7 +512,7 @@ typedef struct _ExaDriver { * migration, which is the read from framebuffer when evicting pixmaps from * framebuffer memory. Thus, it is highly recommended, even though * implementations are typically complicated. - * + * * @return TRUE if the driver successfully downloaded the data. FALSE * indicates that EXA should fall back to doing the download in software. * @@ -704,7 +704,7 @@ typedef struct _ExaDriver { * @{ */ /** - * EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support + * EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support * offscreen pixmaps. */ #define EXA_OFFSCREEN_PIXMAPS (1 << 0) diff --git a/xserver/exa/exa_accel.c b/xserver/exa/exa_accel.c index 9c742bdc9..5aa7d1078 100644 --- a/xserver/exa/exa_accel.c +++ b/xserver/exa/exa_accel.c @@ -413,7 +413,7 @@ exaHWCopyNtoN(DrawablePtr pSrcDrawable, if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, pGC->fillStyle, pGC->alu, - pGC->clientClipType)) { + pGC->clientClip != NULL)) { dstregion = RegionCreate(NullBox, 0); RegionCopy(dstregion, srcregion); RegionTranslate(dstregion, dst_off_x - dx - src_off_x, @@ -771,7 +771,7 @@ exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg) static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, CARD32 planemask, CARD32 alu, - unsigned int clientClipType); + Bool hasClientClip); static void exaPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) @@ -816,11 +816,11 @@ exaPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) && exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ? pGC->fgPixel : pGC->tile.pixel, pGC->planemask, - pGC->alu, pGC->clientClipType)) || + pGC->alu, pGC->clientClip != NULL)) || (pGC->fillStyle == FillTiled && !pGC->tileIsPixel && exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg, pGC->planemask, pGC->alu, - pGC->clientClipType))) { + pGC->clientClip != NULL))) { goto out; } } @@ -990,7 +990,7 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, - CARD32 planemask, CARD32 alu, unsigned int clientClipType) + CARD32 planemask, CARD32 alu, Bool hasClientClip) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); @@ -1013,8 +1013,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid, alu, - clientClipType) ? NULL : - pRegion; + hasClientClip) ? NULL : pRegion; exaDoMigration(pixmaps, 1, TRUE); } @@ -1074,7 +1073,7 @@ exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, Bool exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu, - unsigned int clientClipType) + Bool hasClientClip) { ExaScreenPriv(pDrawable->pScreen); PixmapPtr pPixmap; @@ -1096,7 +1095,7 @@ exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, if (tileWidth == 1 && tileHeight == 1) return exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel(pTile), planemask, - alu, clientClipType); + alu, hasClientClip); pPixmap = exaGetDrawablePixmap(pDrawable); pExaPixmap = ExaGetPixmapPriv(pPixmap); @@ -1113,8 +1112,7 @@ exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, pixmaps[0].pPix = pPixmap; pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillTiled, alu, - clientClipType) ? NULL : - pRegion; + hasClientClip) ? NULL : pRegion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; diff --git a/xserver/exa/exa_glyphs.c b/xserver/exa/exa_glyphs.c index aa71b215e..41f3694f2 100644 --- a/xserver/exa/exa_glyphs.c +++ b/xserver/exa/exa_glyphs.c @@ -16,7 +16,7 @@ * 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 + * 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 @@ -33,7 +33,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Owen Taylor @@ -318,8 +318,8 @@ exaGlyphCacheHashRemove(ExaGlyphCachePtr cache, int pos) * are: * * | XXXXXXXXXX | - * i j - * + * i j + * * |XXX XXXX| * j i * diff --git a/xserver/exa/exa_priv.h b/xserver/exa/exa_priv.h index 61a1f4ccb..ca4db720f 100644 --- a/xserver/exa/exa_priv.h +++ b/xserver/exa/exa_priv.h @@ -214,18 +214,6 @@ typedef struct { DevPrivateKeyRec gcPrivateKeyRec; } ExaScreenPrivRec, *ExaScreenPrivPtr; -/* - * This is the only completely portable way to - * compute this info. - */ -#ifndef BitsPerPixel -#define BitsPerPixel(d) (\ - PixmapWidthPaddingInfo[d].notPower2 ? \ - (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \ - ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ - (PixmapWidthPaddingInfo[d].padRoundUp+1))) -#endif - extern DevPrivateKeyRec exaScreenPrivateKeyRec; #define exaScreenPrivateKey (&exaScreenPrivateKeyRec) @@ -467,12 +455,11 @@ ExaCheckAddTraps(PicturePtr pPicture, static _X_INLINE Bool exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask, unsigned int fillStyle, unsigned char alu, - unsigned int clientClipType) + Bool clientClip) { return ((alu != GXcopy && alu != GXclear && alu != GXset && alu != GXcopyInverted) || fillStyle == FillStippled || - clientClipType != CT_NONE || - !EXA_PM_IS_SOLID(pDrawable, planemask)); + clientClip != FALSE || !EXA_PM_IS_SOLID(pDrawable, planemask)); } void @@ -482,7 +469,7 @@ Bool exaFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu, - unsigned int clientClipType); + Bool clientClip); void diff --git a/xserver/exa/exa_render.c b/xserver/exa/exa_render.c index c4edf407e..e3e552697 100644 --- a/xserver/exa/exa_render.c +++ b/xserver/exa/exa_render.c @@ -559,7 +559,7 @@ exaCompositeRects(CARD8 op, box.y2 = y2 < MAXSHORT ? y2 : MAXSHORT; /* The pixmap migration code relies on pendingDamage indicating - * the bounds of the current rendering, so we need to force + * the bounds of the current rendering, so we need to force * the actual damage into that region before we do anything, and * (see use of DamagePendingRegion in exaCopyDirty) */ @@ -613,7 +613,7 @@ exaCompositeRects(CARD8 op, /************************************************************/ if (!pMask) { - /* Now we have to flush the damage out from pendingDamage => damage + /* Now we have to flush the damage out from pendingDamage => damage * Calling DamageRegionProcessPending has that effect. */ diff --git a/xserver/exa/exa_unaccel.c b/xserver/exa/exa_unaccel.c index b0c6344a5..73eada9c2 100644 --- a/xserver/exa/exa_unaccel.c +++ b/xserver/exa/exa_unaccel.c @@ -107,7 +107,7 @@ ExaCheckPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage || exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, - pGC->alu, pGC->clientClipType)) + pGC->alu, pGC->clientClip != NULL)) exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); else pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, @@ -143,7 +143,7 @@ ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (pExaScr->prepare_access_reg && !exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle, - pGC->alu, pGC->clientClipType) && + pGC->alu, pGC->clientClip != NULL) && RegionInitBoxes(®, pbox, nbox)) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDst); @@ -179,10 +179,9 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable, ExaScreenPriv(pScreen); if (pExaScr->prepare_access_reg && - !(checkReads && exaGCReadsDestination(pDrawable, - pGC->planemask, - pGC->fillStyle, - pGC->alu, pGC->clientClipType))) { + !(checkReads && exaGCReadsDestination(pDrawable, pGC->planemask, + pGC->fillStyle, pGC->alu, + pGC->clientClip != NULL))) { BoxRec box; RegionRec reg; int xoff, yoff; diff --git a/xserver/fb/Makefile.am b/xserver/fb/Makefile.am index 752eabeb7..65b5d9432 100644 --- a/xserver/fb/Makefile.am +++ b/xserver/fb/Makefile.am @@ -44,8 +44,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbstipple.c \ - fbtile.c \ fbtrap.c \ fbutil.c \ fbwindow.c diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in index 0db6f3041..fcc7e4c29 100644 --- a/xserver/fb/Makefile.in +++ b/xserver/fb/Makefile.in @@ -84,9 +84,8 @@ am_libfb_la_OBJECTS = libfb_la-fb24_32.lo libfb_la-fballpriv.lo \ libfb_la-fbimage.lo libfb_la-fbline.lo libfb_la-fboverlay.lo \ libfb_la-fbpict.lo libfb_la-fbpixmap.lo libfb_la-fbpoint.lo \ libfb_la-fbpush.lo libfb_la-fbscreen.lo libfb_la-fbseg.lo \ - libfb_la-fbsetsp.lo libfb_la-fbsolid.lo libfb_la-fbstipple.lo \ - libfb_la-fbtile.lo libfb_la-fbtrap.lo libfb_la-fbutil.lo \ - libfb_la-fbwindow.lo + libfb_la-fbsetsp.lo libfb_la-fbsolid.lo libfb_la-fbtrap.lo \ + libfb_la-fbutil.lo libfb_la-fbwindow.lo libfb_la_OBJECTS = $(am_libfb_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -106,8 +105,7 @@ am__objects_1 = libwfb_la-fb24_32.lo libwfb_la-fballpriv.lo \ libwfb_la-fboverlay.lo libwfb_la-fbpict.lo \ libwfb_la-fbpixmap.lo libwfb_la-fbpoint.lo libwfb_la-fbpush.lo \ libwfb_la-fbscreen.lo libwfb_la-fbseg.lo libwfb_la-fbsetsp.lo \ - libwfb_la-fbsolid.lo libwfb_la-fbstipple.lo \ - libwfb_la-fbtile.lo libwfb_la-fbtrap.lo libwfb_la-fbutil.lo \ + libwfb_la-fbsolid.lo libwfb_la-fbtrap.lo libwfb_la-fbutil.lo \ libwfb_la-fbwindow.lo am_libwfb_la_OBJECTS = $(am__objects_1) libwfb_la_OBJECTS = $(am_libwfb_la_OBJECTS) @@ -296,6 +294,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -572,8 +571,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbstipple.c \ - fbtile.c \ fbtrap.c \ fbutil.c \ fbwindow.c @@ -660,8 +657,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbsetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbsolid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbstipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbtile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbtrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbwindow.Plo@am__quote@ @@ -690,8 +685,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbsetsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbsolid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbstipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbtile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbtrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbwindow.Plo@am__quote@ @@ -892,20 +885,6 @@ libfb_la-fbsolid.lo: fbsolid.c @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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c -libfb_la-fbstipple.lo: fbstipple.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbstipple.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbstipple.Tpo -c -o libfb_la-fbstipple.lo `test -f 'fbstipple.c' || echo '$(srcdir)/'`fbstipple.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbstipple.Tpo $(DEPDIR)/libfb_la-fbstipple.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbstipple.c' object='libfb_la-fbstipple.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbstipple.lo `test -f 'fbstipple.c' || echo '$(srcdir)/'`fbstipple.c - -libfb_la-fbtile.lo: fbtile.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbtile.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbtile.Tpo -c -o libfb_la-fbtile.lo `test -f 'fbtile.c' || echo '$(srcdir)/'`fbtile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbtile.Tpo $(DEPDIR)/libfb_la-fbtile.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbtile.c' object='libfb_la-fbtile.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) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbtile.lo `test -f 'fbtile.c' || echo '$(srcdir)/'`fbtile.c - libfb_la-fbtrap.lo: fbtrap.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) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbtrap.lo -MD -MP -MF $(DEPDIR)/libfb_la-fbtrap.Tpo -c -o libfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfb_la-fbtrap.Tpo $(DEPDIR)/libfb_la-fbtrap.Plo @@ -1102,20 +1081,6 @@ libwfb_la-fbsolid.lo: fbsolid.c @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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbsolid.lo `test -f 'fbsolid.c' || echo '$(srcdir)/'`fbsolid.c -libwfb_la-fbstipple.lo: fbstipple.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbstipple.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbstipple.Tpo -c -o libwfb_la-fbstipple.lo `test -f 'fbstipple.c' || echo '$(srcdir)/'`fbstipple.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbstipple.Tpo $(DEPDIR)/libwfb_la-fbstipple.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbstipple.c' object='libwfb_la-fbstipple.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbstipple.lo `test -f 'fbstipple.c' || echo '$(srcdir)/'`fbstipple.c - -libwfb_la-fbtile.lo: fbtile.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbtile.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbtile.Tpo -c -o libwfb_la-fbtile.lo `test -f 'fbtile.c' || echo '$(srcdir)/'`fbtile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbtile.Tpo $(DEPDIR)/libwfb_la-fbtile.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fbtile.c' object='libwfb_la-fbtile.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) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbtile.lo `test -f 'fbtile.c' || echo '$(srcdir)/'`fbtile.c - libwfb_la-fbtrap.lo: fbtrap.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) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbtrap.lo -MD -MP -MF $(DEPDIR)/libwfb_la-fbtrap.Tpo -c -o libwfb_la-fbtrap.lo `test -f 'fbtrap.c' || echo '$(srcdir)/'`fbtrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libwfb_la-fbtrap.Tpo $(DEPDIR)/libwfb_la-fbtrap.Plo diff --git a/xserver/fb/fb.h b/xserver/fb/fb.h index 90577677b..ab110f327 100644 --- a/xserver/fb/fb.h +++ b/xserver/fb/fb.h @@ -83,11 +83,7 @@ #define FB_SHIFT LOG2_BITMAP_PAD #endif -#if FB_SHIFT < LOG2_BITMAP_PAD -error FB_SHIFT must be >= LOG2_BITMAP_PAD -#endif #define FB_UNIT (1 << FB_SHIFT) -#define FB_HALFUNIT (1 << (FB_SHIFT-1)) #define FB_MASK (FB_UNIT - 1) #define FB_ALLONES ((FbBits) -1) #if GLYPHPADBYTES != 4 @@ -105,37 +101,15 @@ error FB_SHIFT must be >= LOG2_BITMAP_PAD #define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT))) #define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT))) #define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1)) -#if FB_SHIFT == 6 -#ifdef WIN32 -typedef unsigned __int64 FbBits; -#else -#if defined(__alpha__) || defined(__alpha) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__sparc64__) || defined(_LP64) || \ - defined(__s390x__) || \ - defined(amd64) || defined (__amd64__) || \ - defined (__powerpc64__) -typedef unsigned long FbBits; -#else -typedef unsigned long long FbBits; -#endif -#endif -#endif #if FB_SHIFT == 5 typedef CARD32 FbBits; -#endif - -#if FB_SHIFT == 4 -typedef CARD16 FbBits; +#else +#error "Unsupported FB_SHIFT" #endif #if LOG2_BITMAP_PAD == FB_SHIFT typedef FbBits FbStip; -#else -#if LOG2_BITMAP_PAD == 5 -typedef CARD32 FbStip; -#endif #endif typedef int FbStride; @@ -264,122 +238,8 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); n >>= FB_SHIFT; \ } -#if FB_SHIFT == 6 -#define FbDoLeftMaskByteRRop6Cases(dst,xor) \ - case (sizeof (FbBits) - 7) | (1 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 7) | (2 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 7) | (3 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 7) | (4 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 7) | (5 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 7) | (6 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 7): \ - FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ - break; \ - case (sizeof (FbBits) - 6) | (1 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 6) | (2 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 6) | (3 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 6) | (4 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 6) | (5 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 6): \ - FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ - break; \ - case (sizeof (FbBits) - 5) | (1 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 5) | (2 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 5) | (3 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 5) | (4 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 5): \ - FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ - break; \ - case (sizeof (FbBits) - 4) | (1 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 4) | (2 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - break; \ - case (sizeof (FbBits) - 4) | (3 << (FB_SHIFT - 3)): \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ - FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ - break; \ - case (sizeof (FbBits) - 4): \ - FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ - break; - -#define FbDoRightMaskByteRRop6Cases(dst,xor) \ - case 4: \ - FbStorePart(dst,0,CARD32,xor); \ - break; \ - case 5: \ - FbStorePart(dst,0,CARD32,xor); \ - FbStorePart(dst,4,CARD8,xor); \ - break; \ - case 6: \ - FbStorePart(dst,0,CARD32,xor); \ - FbStorePart(dst,4,CARD16,xor); \ - break; \ - case 7: \ - FbStorePart(dst,0,CARD32,xor); \ - FbStorePart(dst,4,CARD16,xor); \ - FbStorePart(dst,6,CARD8,xor); \ - break; -#else -#define FbDoLeftMaskByteRRop6Cases(dst,xor) -#define FbDoRightMaskByteRRop6Cases(dst,xor) -#endif - #define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \ switch (lb) { \ - FbDoLeftMaskByteRRop6Cases(dst,xor) \ case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ break; \ @@ -416,7 +276,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); FbStorePart(dst,0,CARD16,xor); \ FbStorePart(dst,2,CARD8,xor); \ break; \ - FbDoRightMaskByteRRop6Cases(dst,xor) \ default: \ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \ } \ @@ -470,21 +329,7 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); FbLaneCase2((n)>>2,a,(o)+2) \ } -#define FbLaneCase8(n,a,o) \ - if ((n) == 0x0ff) { \ - *(FbBits *) ((a)+(o)) = fgxor; \ - } else { \ - FbLaneCase4((n)&15,a,o) \ - FbLaneCase4((n)>>4,a,(o)+4) \ - } - -#if FB_SHIFT == 6 -#define FbLaneCase(n,a) FbLaneCase8(n,(CARD8 *) (a),0) -#endif - -#if FB_SHIFT == 5 #define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0) -#endif /* Rotate a filled pixel value to the specified alignement */ #define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b))) @@ -497,19 +342,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); #define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24)) /* step a rotation value to the next/previous rotation value */ -#if FB_UNIT == 64 -#define FbNext24Rot(r) ((r) == 16 ? 0 : (r) + 8) -#define FbPrev24Rot(r) ((r) == 0 ? 16 : (r) - 8) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define FbFirst24Rot(x) (((x) + 8) % 24) -#else -#define FbFirst24Rot(x) ((x) % 24) -#endif - -#endif - -#if FB_UNIT == 32 #define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8) #define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8) @@ -518,7 +350,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); #else #define FbFirst24Rot(x) ((x) % 24) #endif -#endif #define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8) #define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8) @@ -621,7 +452,6 @@ typedef struct { FbBits bgand, bgxor; /* for stipples */ FbBits fg, bg, pm; /* expanded and filled */ unsigned int dashLength; /* total of all dash elements */ - unsigned char evenStipple; /* stipple is even */ unsigned char bpp; /* current drawable bpp */ } FbGCPrivRec, *FbGCPrivPtr; @@ -714,11 +544,6 @@ typedef struct { * Accelerated tiles are power of 2 width <= FB_UNIT */ #define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w)) -/* - * Accelerated stipples are power of 2 width and <= FB_UNIT/dstBpp - * with dstBpp a power of 2 as well - */ -#define FbEvenStip(w,bpp) ((w) * (bpp) <= FB_UNIT && FbPowerOfTwo(w) && FbPowerOfTwo(bpp)) /* * fb24_32.c @@ -925,13 +750,6 @@ fbArc24(FbBits * dst, int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor); extern _X_EXPORT void - -fbGlyph24(FbBits * dstLine, - FbStride dstStride, - int dstBpp, FbStip * stipple, FbBits fg, int height, int shift); - -extern _X_EXPORT void - fbPolyline24(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig); @@ -1220,9 +1038,6 @@ fbGetSpans(DrawablePtr pDrawable, * fbglyph.c */ -extern _X_EXPORT Bool - fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height); - extern _X_EXPORT void fbPolyGlyphBlt(DrawablePtr pDrawable, @@ -1283,15 +1098,6 @@ fbGetImage(DrawablePtr pDrawable, */ extern _X_EXPORT void - -fbZeroLine(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr ppt); - -extern _X_EXPORT void - fbZeroSegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs); - -extern _X_EXPORT void - fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); @@ -1339,36 +1145,12 @@ extern _X_EXPORT RegionPtr extern _X_EXPORT void -fbDots(FbBits * dstOrig, - FbStride dstStride, - int dstBpp, - BoxPtr pBox, - xPoint * pts, - int npt, - int xorg, int yorg, int xoff, int yoff, FbBits andOrig, FbBits xorOrig); - -extern _X_EXPORT void - fbPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, xPoint * pptInit); /* * fbpush.c */ -extern _X_EXPORT void - -fbPushPattern(DrawablePtr pDrawable, - GCPtr pGC, - FbStip * src, - FbStride srcStride, - int srcX, int x, int y, int width, int height); - -extern _X_EXPORT void - -fbPushFill(DrawablePtr pDrawable, - GCPtr pGC, - FbStip * src, - FbStride srcStride, int srcX, int x, int y, int width, int height); extern _X_EXPORT void @@ -1462,34 +1244,20 @@ typedef void FbBres(DrawablePtr pDrawable, int signdy, int axis, int x, int y, int e, int e1, int e3, int len); -extern _X_EXPORT FbBres fbBresSolid, fbBresDash, fbBresFill, fbBresFillDash; +extern _X_EXPORT void +fbSegment(DrawablePtr pDrawable, + GCPtr pGC, + int xa, int ya, int xb, int yb, Bool drawLast, int *dashOffset); /* * fbsetsp.c */ extern _X_EXPORT void - fbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); -extern _X_EXPORT FbBres *fbSelectBres(DrawablePtr pDrawable, GCPtr pGC); - -extern _X_EXPORT void - -fbBres(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, int axis, int x, int y, int e, int e1, int e3, int len); - -extern _X_EXPORT void - -fbSegment(DrawablePtr pDrawable, - GCPtr pGC, - int xa, int ya, int xb, int yb, Bool drawLast, int *dashOffset); - /* * fbsolid.c */ @@ -1506,105 +1274,11 @@ fbSolid24(FbBits * dst, FbStride dstStride, int dstX, int width, int height, FbBits and, FbBits xor); -/* - * fbstipple.c - */ - -extern _X_EXPORT void - fbTransparentSpan(FbBits * dst, FbBits stip, FbBits fgxor, int n); - -extern _X_EXPORT void - -fbEvenStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipHeight, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot); - -extern _X_EXPORT void - -fbOddStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipWidth, - int stipHeight, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot); - -extern _X_EXPORT void - -fbStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipWidth, - int stipHeight, - Bool even, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot); - -/* - * fbtile.c - */ - -extern _X_EXPORT void - -fbEvenTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileHeight, int alu, FbBits pm, int xRot, int yRot); - -extern _X_EXPORT void - -fbOddTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileWidth, - int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot); - -extern _X_EXPORT void - -fbTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileWidth, - int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot); - /* * fbutil.c */ extern _X_EXPORT FbBits fbReplicatePixel(Pixel p, int bpp); -extern _X_EXPORT void - fbReduceRasterOp(int rop, FbBits fg, FbBits pm, FbBits * andp, FbBits * xorp); - #ifdef FB_ACCESS_WRAPPER extern _X_EXPORT ReadMemoryProcPtr wfbReadMemory; extern _X_EXPORT WriteMemoryProcPtr wfbWriteMemory; @@ -1621,13 +1295,13 @@ extern _X_EXPORT Bool fbDestroyWindow(WindowPtr pWin); extern _X_EXPORT Bool - fbMapWindow(WindowPtr pWindow); + fbRealizeWindow(WindowPtr pWindow); extern _X_EXPORT Bool fbPositionWindow(WindowPtr pWin, int x, int y); extern _X_EXPORT Bool - fbUnmapWindow(WindowPtr pWindow); + fbUnrealizeWindow(WindowPtr pWindow); extern _X_EXPORT void diff --git a/xserver/fb/fb24_32.c b/xserver/fb/fb24_32.c index ecb39510d..b95019eb6 100644 --- a/xserver/fb/fb24_32.c +++ b/xserver/fb/fb24_32.c @@ -15,7 +15,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. diff --git a/xserver/fb/fb24_32.h b/xserver/fb/fb24_32.h index b357edf38..77eef2339 100644 --- a/xserver/fb/fb24_32.h +++ b/xserver/fb/fb24_32.h @@ -15,7 +15,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. diff --git a/xserver/fb/fbbits.c b/xserver/fb/fbbits.c index ac44f3e67..d7d089c17 100644 --- a/xserver/fb/fbbits.c +++ b/xserver/fb/fbbits.c @@ -70,9 +70,6 @@ #define POLYSEGMENT fbPolySegment16 #define BITS CARD16 #define BITS2 CARD32 -#if FB_SHIFT == 6 -#define BITS4 FbBits -#endif #include "fbbits.h" @@ -85,9 +82,6 @@ #undef POLYSEGMENT #undef BITS #undef BITS2 -#if FB_SHIFT == 6 -#undef BITS4 -#endif #define BRESSOLID fbBresSolid24 #define BRESDASH fbBresDash24 @@ -155,9 +149,6 @@ #define POLYLINE fbPolyline32 #define POLYSEGMENT fbPolySegment32 #define BITS CARD32 -#if FB_SHIFT == 6 -#define BITS2 FbBits -#endif #include "fbbits.h" @@ -169,6 +160,3 @@ #undef POLYLINE #undef POLYSEGMENT #undef BITS -#if FB_SHIFT == 6 -#undef BITS2 -#endif diff --git a/xserver/fb/fbblt.c b/xserver/fb/fbblt.c index c615106d1..b4123656a 100644 --- a/xserver/fb/fbblt.c +++ b/xserver/fb/fbblt.c @@ -520,277 +520,12 @@ fbBlt24(FbBits * srcLine, #endif } -#if FB_SHIFT == FB_STIP_SHIFT + 1 - -/* - * Could be generalized to FB_SHIFT > FB_STIP_SHIFT + 1 by - * creating an ring of values stepped through for each line - */ - -void -fbBltOdd(FbBits * srcLine, - FbStride srcStrideEven, - FbStride srcStrideOdd, - int srcXEven, - int srcXOdd, - FbBits * dstLine, - FbStride dstStrideEven, - FbStride dstStrideOdd, - int dstXEven, - int dstXOdd, int width, int height, int alu, FbBits pm, int bpp) -{ - FbBits *src; - int leftShiftEven, rightShiftEven; - FbBits startmaskEven, endmaskEven; - int nmiddleEven; - - FbBits *dst; - int leftShiftOdd, rightShiftOdd; - FbBits startmaskOdd, endmaskOdd; - int nmiddleOdd; - - int leftShift, rightShift; - FbBits startmask, endmask; - int nmiddle; - - int srcX, dstX; - - FbBits bits, bits1; - int n; - - Bool destInvarient; - Bool even; - - FbDeclareMergeRop(); - - FbInitializeMergeRop(alu, pm); - destInvarient = FbDestInvarientMergeRop(); - - srcLine += srcXEven >> FB_SHIFT; - dstLine += dstXEven >> FB_SHIFT; - srcXEven &= FB_MASK; - dstXEven &= FB_MASK; - srcXOdd &= FB_MASK; - dstXOdd &= FB_MASK; - - FbMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven); - FbMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd); - - even = TRUE; - InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven); - InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd); - while (height--) { - src = srcLine; - dst = dstLine; - if (even) { - srcX = srcXEven; - dstX = dstXEven; - startmask = startmaskEven; - endmask = endmaskEven; - nmiddle = nmiddleEven; - leftShift = leftShiftEven; - rightShift = rightShiftEven; - srcLine += srcStrideEven; - dstLine += dstStrideEven; - even = FALSE; - } - else { - srcX = srcXOdd; - dstX = dstXOdd; - startmask = startmaskOdd; - endmask = endmaskOdd; - nmiddle = nmiddleOdd; - leftShift = leftShiftOdd; - rightShift = rightShiftOdd; - srcLine += srcStrideOdd; - dstLine += dstStrideOdd; - even = TRUE; - } - if (srcX == dstX) { - if (startmask) { - bits = READ(src++); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), startmask)); - dst++; - } - n = nmiddle; - if (destInvarient) { - while (n--) { - bits = READ(src++); - WRITE(dst, FbDoDestInvarientMergeRop(bits)); - dst++; - } - } - else { - while (n--) { - bits = READ(src++); - WRITE(dst, FbDoMergeRop(bits, READ(dst))); - dst++; - } - } - if (endmask) { - bits = READ(src); - WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask)); - } - } - else { - bits = 0; - if (srcX > dstX) - bits = READ(src++); - if (startmask) { - bits1 = FbScrLeft(bits, leftShift); - bits = READ(src++); - bits1 |= FbScrRight(bits, rightShift); - WRITE(dst, FbDoMaskMergeRop(bits1, READ(dst), startmask)); - dst++; - } - n = nmiddle; - if (destInvarient) { - while (n--) { - bits1 = FbScrLeft(bits, leftShift); - bits = READ(src++); - bits1 |= FbScrRight(bits, rightShift); - WRITE(dst, FbDoDestInvarientMergeRop(bits1)); - dst++; - } - } - else { - while (n--) { - bits1 = FbScrLeft(bits, leftShift); - bits = READ(src++); - bits1 |= FbScrRight(bits, rightShift); - WRITE(dst, FbDoMergeRop(bits1, READ(dst))); - dst++; - } - } - if (endmask) { - bits1 = FbScrLeft(bits, leftShift); - if (FbScrLeft(endmask, rightShift)) { - bits = READ(src); - bits1 |= FbScrRight(bits, rightShift); - } - WRITE(dst, FbDoMaskMergeRop(bits1, READ(dst), endmask)); - } - } - } -} - -void -fbBltOdd24(FbBits * srcLine, - FbStride srcStrideEven, - FbStride srcStrideOdd, - int srcXEven, - int srcXOdd, - FbBits * dstLine, - FbStride dstStrideEven, - FbStride dstStrideOdd, - int dstXEven, int dstXOdd, int width, int height, int alu, FbBits pm) -{ - Bool even = TRUE; - - while (height--) { - if (even) { - fbBlt24Line(srcLine, srcXEven, dstLine, dstXEven, - width, alu, pm, FALSE); - srcLine += srcStrideEven; - dstLine += dstStrideEven; - even = FALSE; - } - else { - fbBlt24Line(srcLine, srcXOdd, dstLine, dstXOdd, - width, alu, pm, FALSE); - srcLine += srcStrideOdd; - dstLine += dstStrideOdd; - even = TRUE; - } - } -} - -#endif - -#if FB_STIP_SHIFT != FB_SHIFT -void -fbSetBltOdd(FbStip * stip, - FbStride stipStride, - int srcX, - FbBits ** bits, - FbStride * strideEven, - FbStride * strideOdd, int *srcXEven, int *srcXOdd) -{ - int srcAdjust; - int strideAdjust; - - /* - * bytes needed to align source - */ - srcAdjust = (((int) stip) & (FB_MASK >> 3)); - /* - * FbStip units needed to align stride - */ - strideAdjust = stipStride & (FB_MASK >> FB_STIP_SHIFT); - - *bits = (FbBits *) ((char *) stip - srcAdjust); - if (srcAdjust) { - *strideEven = FbStipStrideToBitsStride(stipStride + 1); - *strideOdd = FbStipStrideToBitsStride(stipStride); - - *srcXEven = srcX + (srcAdjust << 3); - *srcXOdd = srcX + (srcAdjust << 3) - (strideAdjust << FB_STIP_SHIFT); - } - else { - *strideEven = FbStipStrideToBitsStride(stipStride); - *strideOdd = FbStipStrideToBitsStride(stipStride + 1); - - *srcXEven = srcX; - *srcXOdd = srcX + (strideAdjust << FB_STIP_SHIFT); - } -} -#endif - void fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */ int dstX, int width, int height, int alu, FbBits pm, int bpp) { -#if FB_STIP_SHIFT != FB_SHIFT - if (FB_STIP_ODDSTRIDE(srcStride) || FB_STIP_ODDPTR(src) || - FB_STIP_ODDSTRIDE(dstStride) || FB_STIP_ODDPTR(dst)) { - FbStride srcStrideEven, srcStrideOdd; - FbStride dstStrideEven, dstStrideOdd; - int srcXEven, srcXOdd; - int dstXEven, dstXOdd; - FbBits *s, *d; - int sx, dx; - - src += srcX >> FB_STIP_SHIFT; - srcX &= FB_STIP_MASK; - dst += dstX >> FB_STIP_SHIFT; - dstX &= FB_STIP_MASK; - - fbSetBltOdd(src, srcStride, srcX, - &s, &srcStrideEven, &srcStrideOdd, &srcXEven, &srcXOdd); - - fbSetBltOdd(dst, dstStride, dstX, - &d, &dstStrideEven, &dstStrideOdd, &dstXEven, &dstXOdd); - - if (bpp == 24 && !FbCheck24Pix(pm)) { - fbBltOdd24(s, srcStrideEven, srcStrideOdd, - srcXEven, srcXOdd, - d, dstStrideEven, dstStrideOdd, - dstXEven, dstXOdd, width, height, alu, pm); - } - else { - fbBltOdd(s, srcStrideEven, srcStrideOdd, - srcXEven, srcXOdd, - d, dstStrideEven, dstStrideOdd, - dstXEven, dstXOdd, width, height, alu, pm, bpp); - } - } - else -#endif - { - fbBlt((FbBits *) src, FbStipStrideToBitsStride(srcStride), - srcX, - (FbBits *) dst, FbStipStrideToBitsStride(dstStride), - dstX, width, height, alu, pm, bpp, FALSE, FALSE); - } + fbBlt((FbBits *) src, FbStipStrideToBitsStride(srcStride), srcX, + (FbBits *) dst, FbStipStrideToBitsStride(dstStride), dstX, + width, height, alu, pm, bpp, FALSE, FALSE); } diff --git a/xserver/fb/fbbltone.c b/xserver/fb/fbbltone.c index bfcb5a263..d089a433c 100644 --- a/xserver/fb/fbbltone.c +++ b/xserver/fb/fbbltone.c @@ -26,6 +26,101 @@ #include "fb.h" +/* + * Stipple masks are independent of bit/byte order as long + * as bitorder == byteorder. FB doesn't handle the case + * where these differ + */ +#define BitsMask(x,w) ((FB_ALLONES << ((x) & FB_MASK)) & \ + (FB_ALLONES >> ((FB_UNIT - ((x) + (w))) & FB_MASK))) + +#define Mask(x,w) BitsMask((x)*(w),(w)) + +#define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w)) + +#define C1(b,w) \ + (SelMask(b,0,w)) + +#define C2(b,w) \ + (SelMask(b,0,w) | \ + SelMask(b,1,w)) + +#define C4(b,w) \ + (SelMask(b,0,w) | \ + SelMask(b,1,w) | \ + SelMask(b,2,w) | \ + SelMask(b,3,w)) + +#define C8(b,w) \ + (SelMask(b,0,w) | \ + SelMask(b,1,w) | \ + SelMask(b,2,w) | \ + SelMask(b,3,w) | \ + SelMask(b,4,w) | \ + SelMask(b,5,w) | \ + SelMask(b,6,w) | \ + SelMask(b,7,w)) + +static const FbBits fbStipple8Bits[256] = { + C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4), + C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4), + C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4), + C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4), + C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4), + C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4), + C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4), + C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4), + C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4), + C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4), + C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4), + C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4), + C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4), + C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4), + C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4), + C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4), + C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4), + C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4), + C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4), + C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4), + C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4), + C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4), + C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4), + C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4), + C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4), + C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4), + C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4), + C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4), + C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4), + C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4), + C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4), + C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4), + C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4), + C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4), + C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4), + C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4), + C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4), + C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4), + C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4), + C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4), + C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4), + C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4), + C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4), +}; + +static const FbBits fbStipple4Bits[16] = { + C4(0, 8), C4(1, 8), C4(2, 8), C4(3, 8), C4(4, 8), C4(5, 8), + C4(6, 8), C4(7, 8), C4(8, 8), C4(9, 8), C4(10, 8), C4(11, 8), + C4(12, 8), C4(13, 8), C4(14, 8), C4(15, 8), +}; + +static const FbBits fbStipple2Bits[4] = { + C2(0, 16), C2(1, 16), C2(2, 16), C2(3, 16), +}; + +static const FbBits fbStipple1Bits[2] = { + C1(0, 32), C1(1, 32), +}; + #ifdef __clang__ /* shift overflow is intentional */ #pragma clang diagnostic ignored "-Wshift-overflow" @@ -62,85 +157,6 @@ bits = (src < srcEnd ? READ(src++) : 0); \ } -#define LaneCases1(n,a) case n: FbLaneCase(n,a); break -#define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a) -#define LaneCases4(n,a) LaneCases2(n,a); LaneCases2(n+2,a) -#define LaneCases8(n,a) LaneCases4(n,a); LaneCases4(n+4,a) -#define LaneCases16(n,a) LaneCases8(n,a); LaneCases8(n+8,a) -#define LaneCases32(n,a) LaneCases16(n,a); LaneCases16(n+16,a) -#define LaneCases64(n,a) LaneCases32(n,a); LaneCases32(n+32,a) -#define LaneCases128(n,a) LaneCases64(n,a); LaneCases64(n+64,a) -#define LaneCases256(n,a) LaneCases128(n,a); LaneCases128(n+128,a) - -#if FB_SHIFT == 6 -#define LaneCases(a) LaneCases256(0,a) -#endif - -#if FB_SHIFT == 5 -#define LaneCases(a) LaneCases16(0,a) -#endif - -#if FB_SHIFT == 6 -CARD8 fb8Lane[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, -}; - -CARD8 fb16Lane[256] = { - 0x00, 0x03, 0x0c, 0x0f, - 0x30, 0x33, 0x3c, 0x3f, - 0xc0, 0xc3, 0xcc, 0xcf, - 0xf0, 0xf3, 0xfc, 0xff, -}; - -CARD8 fb32Lane[16] = { - 0x00, 0x0f, 0xf0, 0xff, -}; -#endif - -#if FB_SHIFT == 5 -CARD8 fb8Lane[16] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -}; - -CARD8 fb16Lane[16] = { - 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -CARD8 fb32Lane[16] = { - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -#endif - -CARD8 *fbLaneTable[33] = { - 0, 0, 0, 0, 0, 0, 0, 0, - fb8Lane, 0, 0, 0, 0, 0, 0, 0, - fb16Lane, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - fb32Lane -}; - void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ @@ -169,7 +185,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ Bool transparent; /* accelerate 0 nop */ int srcinc; /* source units consumed */ Bool endNeedsLoad = FALSE; /* need load for endmask */ - CARD8 *fbLane; int startbyte, endbyte; if (dstBpp == 24) { @@ -191,7 +206,7 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ pixelsPerDst = FB_UNIT / dstBpp; /* - * Number of source stipple patterns in FbStip + * Number of source stipple patterns in FbStip */ unitsPerSrc = FB_STIP_UNIT / pixelsPerDst; @@ -233,15 +248,26 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ * Get pointer to stipple mask array for this depth */ fbBits = 0; /* unused */ - if (pixelsPerDst <= 8) - fbBits = fbStippleTable[pixelsPerDst]; - fbLane = 0; - if (transparent && fgand == 0 && dstBpp >= 8) - fbLane = fbLaneTable[dstBpp]; + switch (pixelsPerDst) { + case 8: + fbBits = fbStipple8Bits; + break; + case 4: + fbBits = fbStipple4Bits; + break; + case 2: + fbBits = fbStipple2Bits; + break; + case 1: + fbBits = fbStipple1Bits; + break; + default: + return; + } /* - * Compute total number of destination words written, but - * don't count endmask + * Compute total number of destination words written, but + * don't count endmask */ nDst = nmiddle; if (startmask) @@ -287,21 +313,11 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ * Consume stipple bits for startmask */ if (startmask) { -#if FB_UNIT > 32 - if (pixelsPerDst == 16) - mask = FbStipple16Bits(FbLeftStipBits(bits, 16)); - else -#endif - mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; - if (fbLane) { - fbTransparentSpan(dst, mask & startmask, fgxor, 1); - } - else { - if (mask || !transparent) - FbDoLeftMaskByteStippleRRop(dst, mask, - fgand, fgxor, bgand, bgxor, - startbyte, startmask); - } + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; + if (mask || !transparent) + FbDoLeftMaskByteStippleRRop(dst, mask, + fgand, fgxor, bgand, bgxor, + startbyte, startmask); bits = FbStipLeft(bits, pixelsPerDst); dst++; n--; @@ -314,41 +330,22 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ w -= n; if (copy) { while (n--) { -#if FB_UNIT > 32 - if (pixelsPerDst == 16) - mask = FbStipple16Bits(FbLeftStipBits(bits, 16)); - else -#endif - mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; WRITE(dst, FbOpaqueStipple(mask, fgxor, bgxor)); dst++; bits = FbStipLeft(bits, pixelsPerDst); } } else { - if (fbLane) { - while (bits && n) { - switch (fbLane[FbLeftStipBits(bits, pixelsPerDst)]) { - LaneCases((CARD8 *) dst); - } - bits = FbStipLeft(bits, pixelsPerDst); - dst++; - n--; - } - dst += n; - } - else { - while (n--) { - left = FbLeftStipBits(bits, pixelsPerDst); - if (left || !transparent) { - mask = fbBits[left]; - WRITE(dst, FbStippleRRop(READ(dst), mask, - fgand, fgxor, bgand, - bgxor)); - } - dst++; - bits = FbStipLeft(bits, pixelsPerDst); + while (n--) { + left = FbLeftStipBits(bits, pixelsPerDst); + if (left || !transparent) { + mask = fbBits[left]; + WRITE(dst, FbStippleRRop(READ(dst), mask, fgand, + fgxor, bgand, bgxor)); } + dst++; + bits = FbStipLeft(bits, pixelsPerDst); } } if (!w) @@ -369,21 +366,10 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ if (endNeedsLoad) { LoadBits; } -#if FB_UNIT > 32 - if (pixelsPerDst == 16) - mask = FbStipple16Bits(FbLeftStipBits(bits, 16)); - else -#endif - mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; - if (fbLane) { - fbTransparentSpan(dst, mask & endmask, fgxor, 1); - } - else { - if (mask || !transparent) - FbDoRightMaskByteStippleRRop(dst, mask, - fgand, fgxor, bgand, bgxor, - endbyte, endmask); - } + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; + if (mask || !transparent) + FbDoRightMaskByteStippleRRop(dst, mask, fgand, fgxor, + bgand, bgxor, endbyte, endmask); } dst += dstStride; src += srcStride; @@ -412,47 +398,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ #define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r)) -/* - * Untested for MSBFirst or FB_UNIT == 32 - */ - -#if FB_UNIT == 64 -#define C4_24(b,r) \ - (SelMask24(b,0,r) | \ - SelMask24(b,1,r) | \ - SelMask24(b,2,r) | \ - SelMask24(b,3,r)) - -#define FbStip24New(rot) (2 + (rot != 0)) -#define FbStip24Len 4 - -const FbBits fbStipple24Bits[3][1 << FbStip24Len] = { - /* rotate 0 */ - { - C4_24(0, 0), C4_24(1, 0), C4_24(2, 0), C4_24(3, 0), - C4_24(4, 0), C4_24(5, 0), C4_24(6, 0), C4_24(7, 0), - C4_24(8, 0), C4_24(9, 0), C4_24(10, 0), C4_24(11, 0), - C4_24(12, 0), C4_24(13, 0), C4_24(14, 0), C4_24(15, 0), - }, - /* rotate 8 */ - { - C4_24(0, 8), C4_24(1, 8), C4_24(2, 8), C4_24(3, 8), - C4_24(4, 8), C4_24(5, 8), C4_24(6, 8), C4_24(7, 8), - C4_24(8, 8), C4_24(9, 8), C4_24(10, 8), C4_24(11, 8), - C4_24(12, 8), C4_24(13, 8), C4_24(14, 8), C4_24(15, 8), - }, - /* rotate 16 */ - { - C4_24(0, 16), C4_24(1, 16), C4_24(2, 16), C4_24(3, 16), - C4_24(4, 16), C4_24(5, 16), C4_24(6, 16), C4_24(7, 16), - C4_24(8, 16), C4_24(9, 16), C4_24(10, 16), C4_24(11, 16), - C4_24(12, 16), C4_24(13, 16), C4_24(14, 16), C4_24(15, 16), - } -}; - -#endif - -#if FB_UNIT == 32 #define C2_24(b,r) \ (SelMask24(b,0,r) | \ SelMask24(b,1,r)) @@ -478,7 +423,6 @@ const FbBits fbStipple24Bits[3][1 << FbStip24Len] = { C2_24(0, 16), C2_24(1, 16), C2_24(2, 16), C2_24(3, 16), } }; -#endif #if BITMAP_BIT_ORDER == LSBFirst diff --git a/xserver/fb/fbcopy.c b/xserver/fb/fbcopy.c index 541ef713b..5bbabc39f 100644 --- a/xserver/fb/fbcopy.c +++ b/xserver/fb/fbcopy.c @@ -271,5 +271,5 @@ fbCopyPlane(DrawablePtr pSrcDrawable, else return miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, - widthSrc, heightSrc, xOut, yOut, bitplane); + widthSrc, heightSrc, xOut, yOut); } diff --git a/xserver/fb/fbfill.c b/xserver/fb/fbfill.c index de9d6b313..05d81ab77 100644 --- a/xserver/fb/fbfill.c +++ b/xserver/fb/fbfill.c @@ -26,6 +26,88 @@ #include "fb.h" +static void +fbTile(FbBits * dst, FbStride dstStride, int dstX, int width, int height, + FbBits * tile, FbStride tileStride, int tileWidth, int tileHeight, + int alu, FbBits pm, int bpp, int xRot, int yRot) +{ + int tileX, tileY; + int widthTmp; + int h, w; + int x, y; + + modulus(-yRot, tileHeight, tileY); + y = 0; + while (height) { + h = tileHeight - tileY; + if (h > height) + h = height; + height -= h; + widthTmp = width; + x = dstX; + modulus(dstX - xRot, tileWidth, tileX); + while (widthTmp) { + w = tileWidth - tileX; + if (w > widthTmp) + w = widthTmp; + widthTmp -= w; + fbBlt(tile + tileY * tileStride, + tileStride, + tileX, + dst + y * dstStride, + dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE); + x += w; + tileX = 0; + } + y += h; + tileY = 0; + } +} + +static void +fbStipple(FbBits * dst, FbStride dstStride, + int dstX, int dstBpp, + int width, int height, + FbStip * stip, FbStride stipStride, + int stipWidth, int stipHeight, + FbBits fgand, FbBits fgxor, + FbBits bgand, FbBits bgxor, + int xRot, int yRot) +{ + int stipX, stipY, sx; + int widthTmp; + int h, w; + int x, y; + + modulus(-yRot, stipHeight, stipY); + modulus(dstX / dstBpp - xRot, stipWidth, stipX); + y = 0; + while (height) { + h = stipHeight - stipY; + if (h > height) + h = height; + height -= h; + widthTmp = width; + x = dstX; + sx = stipX; + while (widthTmp) { + w = (stipWidth - sx) * dstBpp; + if (w > widthTmp) + w = widthTmp; + widthTmp -= w; + fbBltOne(stip + stipY * stipStride, + stipStride, + sx, + dst + y * dstStride, + dstStride, x, dstBpp, w, h, fgand, fgxor, bgand, bgxor); + x += w; + sx = 0; + } + y += h; + stipY = 0; + } +} + void fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height) { @@ -97,7 +179,7 @@ fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height) fbStipple(dst + (y + dstYoff) * dstStride, dstStride, (x + dstXoff) * dstBpp, dstBpp, width * dstBpp, height, stip, stipStride, stipWidth, stipHeight, - pPriv->evenStipple, fgand, fgxor, bgand, bgxor, + fgand, fgxor, bgand, bgxor, pGC->patOrg.x + pDrawable->x + dstXoff, pGC->patOrg.y + pDrawable->y - y); fbFinishAccess(&pStip->drawable); diff --git a/xserver/fb/fbfillrect.c b/xserver/fb/fbfillrect.c index 64ba2b493..0075b2cdb 100644 --- a/xserver/fb/fbfillrect.c +++ b/xserver/fb/fbfillrect.c @@ -74,7 +74,7 @@ fbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrect, xRectangle *prect) } else { pbox = RegionRects(pClip); - /* + /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect() */ diff --git a/xserver/fb/fbgc.c b/xserver/fb/fbgc.c index f4d7f3a99..19c613158 100644 --- a/xserver/fb/fbgc.c +++ b/xserver/fb/fbgc.c @@ -110,80 +110,6 @@ fbPadPixmap(PixmapPtr pPixmap) fbFinishAccess(&pPixmap->drawable); } -/* - * Verify that 'bits' repeats every 'len' bits - */ -static Bool -fbBitsRepeat(FbBits bits, int len, int width) -{ - FbBits mask = FbBitsMask(0, len); - FbBits orig = bits & mask; - int i; - - if (width > FB_UNIT) - width = FB_UNIT; - for (i = 0; i < width / len; i++) { - if ((bits & mask) != orig) - return FALSE; - bits = FbScrLeft(bits, len); - } - return TRUE; -} - -/* - * Check whether an entire bitmap line is a repetition of - * the first 'len' bits - */ -static Bool -fbLineRepeat(FbBits * bits, int len, int width) -{ - FbBits first = bits[0]; - - if (!fbBitsRepeat(first, len, width)) - return FALSE; - width = (width + FB_UNIT - 1) >> FB_SHIFT; - bits++; - while (--width) - if (READ(bits) != first) - return FALSE; - return TRUE; -} - -/* - * The even stipple code wants the first FB_UNIT/bpp bits on - * each scanline to represent the entire stipple - */ -static Bool -fbCanEvenStipple(PixmapPtr pStipple, int bpp) -{ - int len = FB_UNIT / bpp; - FbBits *bits; - int stride; - int stip_bpp; - _X_UNUSED int stipXoff, stipYoff; - int h; - - /* can't even stipple 24bpp drawables */ - if ((bpp & (bpp - 1)) != 0) - return FALSE; - /* make sure the stipple width is a multiple of the even stipple width */ - if (pStipple->drawable.width % len != 0) - return FALSE; - fbGetDrawable(&pStipple->drawable, bits, stride, stip_bpp, stipXoff, - stipYoff); - h = pStipple->drawable.height; - /* check to see that the stipple repeats horizontally */ - while (h--) { - if (!fbLineRepeat(bits, len, pStipple->drawable.width)) { - fbFinishAccess(&pStipple->drawable); - return FALSE; - } - bits += stride; - } - fbFinishAccess(&pStipple->drawable); - return TRUE; -} - void fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { @@ -193,7 +119,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) /* * if the client clip is different or moved OR the subwindowMode has * changed OR the window's clip has changed since the last validation - * we need to recompute the composite clip + * we need to recompute the composite clip */ if ((changes & @@ -239,16 +165,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) fbPadPixmap(pGC->tile.pixmap); } if (changes & GCStipple) { - pPriv->evenStipple = FALSE; - if (pGC->stipple) { - - /* can we do an even stipple ?? */ - if (FbEvenStip(pGC->stipple->drawable.width, - pDrawable->bitsPerPixel) && - (fbCanEvenStipple(pGC->stipple, pDrawable->bitsPerPixel))) - pPriv->evenStipple = TRUE; - if (pGC->stipple->drawable.width * pDrawable->bitsPerPixel < FB_UNIT) fbPadPixmap(pGC->stipple); diff --git a/xserver/fb/fbglyph.c b/xserver/fb/fbglyph.c index 4f2904c31..61cb8de33 100644 --- a/xserver/fb/fbglyph.c +++ b/xserver/fb/fbglyph.c @@ -29,7 +29,7 @@ #include #include "dixfontstr.h" -Bool +static Bool fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) { BoxRec box; @@ -56,11 +56,7 @@ fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) #define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg) #define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg) #define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg) -#if FB_UNIT == 6 && IMAGE_BYTE_ORDER == LSBFirst -#define WRITE8(d) WRITE((FbBits *) &(d[0]), fg) -#else #define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB) -#endif /* * This is a bit tricky, but it's brief. Write 12 bytes worth @@ -69,7 +65,7 @@ fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) * * a b c d a b c d a b c d bytes * A B C A B C A B C A B C pixels - * + * * f0 f1 f2 * A B C A B C A B C A B C pixels LSB * C A B C A B C A B C A B pixels MSB @@ -120,7 +116,7 @@ fbGlyphIn(RegionPtr pRegion, int x, int y, int width, int height) #define CASE(a,b,c,d) (a | (b << 1) | (c << 2) | (d << 3)) #endif -void +static void fbGlyph24(FbBits * dstBits, FbStride dstStride, int dstBpp, FbStip * stipple, FbBits fg, int x, int height) diff --git a/xserver/fb/fbline.c b/xserver/fb/fbline.c index 80dc89dde..3e582e6fd 100644 --- a/xserver/fb/fbline.c +++ b/xserver/fb/fbline.c @@ -26,7 +26,7 @@ #include "fb.h" -void +static void fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) { int x1, y1, x2, y2; @@ -54,7 +54,7 @@ fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) } } -void +static void fbZeroSegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs) { int dashOffset; diff --git a/xserver/fb/fboverlay.c b/xserver/fb/fboverlay.c index 935bf1b50..1e5e6b3be 100644 --- a/xserver/fb/fboverlay.c +++ b/xserver/fb/fboverlay.c @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -240,12 +240,11 @@ fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } void -fbOverlayWindowExposures(WindowPtr pWin, - RegionPtr prgn, RegionPtr other_exposed) +fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) { fbOverlayUpdateLayerRegion(pWin->drawable.pScreen, fbOverlayWindowLayer(pWin), prgn); - miWindowExposures(pWin, prgn, other_exposed); + miWindowExposures(pWin, prgn); } Bool diff --git a/xserver/fb/fboverlay.h b/xserver/fb/fboverlay.h index 57c9873c2..3312145bf 100644 --- a/xserver/fb/fboverlay.h +++ b/xserver/fb/fboverlay.h @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -82,9 +82,7 @@ extern _X_EXPORT void fbOverlayCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern _X_EXPORT void - -fbOverlayWindowExposures(WindowPtr pWin, - RegionPtr prgn, RegionPtr other_exposed); +fbOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn); extern _X_EXPORT Bool diff --git a/xserver/fb/fbpict.c b/xserver/fb/fbpict.c index 21baf8950..c8378ad90 100644 --- a/xserver/fb/fbpict.c +++ b/xserver/fb/fbpict.c @@ -82,7 +82,7 @@ fbDestroyGlyphCache(void) } } -void +static void fbUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr pGlyph) { @@ -113,7 +113,7 @@ fbGlyphs(CARD8 op, int xDst = list->xOff, yDst = list->yOff; miCompositeSourceValidate(pSrc); - + n_glyphs = 0; for (i = 0; i < nlist; ++i) n_glyphs += list[i].len; @@ -122,12 +122,12 @@ fbGlyphs(CARD8 op, glyphCache = pixman_glyph_cache_create(); pixman_glyph_cache_freeze (glyphCache); - + if (n_glyphs > N_STACK_GLYPHS) { if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t)))) goto out; } - + i = 0; x = y = 0; while (nlist--) { @@ -309,24 +309,16 @@ create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) return NULL; #ifdef FB_ACCESS_WRAPPER -#if FB_SHIFT==5 - pixman_image_set_accessors(image, (pixman_read_memory_func_t) wfbReadMemory, (pixman_write_memory_func_t) wfbWriteMemory); - -#else - -#error The pixman library only works when FbBits is 32 bits wide - -#endif #endif /* pCompositeClip is undefined for source pictures, so * only set the clip region for pictures with drawables */ if (has_clip) { - if (pict->clientClipType != CT_NONE) + if (pict->clientClip) pixman_image_set_has_client_clip(image, TRUE); if (*xoff || *yoff) diff --git a/xserver/fb/fbpict.h b/xserver/fb/fbpict.h index 8b0f59f7a..5cb866368 100644 --- a/xserver/fb/fbpict.h +++ b/xserver/fb/fbpict.h @@ -71,10 +71,6 @@ fbTriangles(CARD8 op, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris); -extern _X_EXPORT void -fbUnrealizeGlyph(ScreenPtr pScreen, - GlyphPtr pGlyph); - extern _X_EXPORT void fbGlyphs(CARD8 op, PicturePtr pSrc, diff --git a/xserver/fb/fbpixmap.c b/xserver/fb/fbpixmap.c index 677f28af0..951a92574 100644 --- a/xserver/fb/fbpixmap.c +++ b/xserver/fb/fbpixmap.c @@ -132,7 +132,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ r++; \ } -/* Convert bitmap clip mask into clipping region. +/* Convert bitmap clip mask into clipping region. * First, goes through each line and makes boxes by noting the transitions * from 0 to 1 and 1 to 0. * Then it coalesces the current line with the previous if they have boxes @@ -246,8 +246,8 @@ fbPixmapToRegion(PixmapPtr pPix) rx1, h, base + (width & FB_MASK), h + 1); } /* if all rectangles on this line have the same x-coords as - * those on the previous line, then add 1 to all the previous y2s and - * throw away all the rectangles from this line + * those on the previous line, then add 1 to all the previous y2s and + * throw away all the rectangles from this line */ fSame = FALSE; if (irectPrevStart != -1) { diff --git a/xserver/fb/fbpoint.c b/xserver/fb/fbpoint.c index d5129d796..be7c801d5 100644 --- a/xserver/fb/fbpoint.c +++ b/xserver/fb/fbpoint.c @@ -35,7 +35,7 @@ typedef void (*FbDots) (FbBits * dst, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); -void +static void fbDots(FbBits * dstOrig, FbStride dstStride, int dstBpp, diff --git a/xserver/fb/fbpush.c b/xserver/fb/fbpush.c index f0a861cbe..1d1bcfd08 100644 --- a/xserver/fb/fbpush.c +++ b/xserver/fb/fbpush.c @@ -26,7 +26,7 @@ #include "fb.h" -void +static void fbPushPattern(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, @@ -84,7 +84,7 @@ fbPushPattern(DrawablePtr pDrawable, } } -void +static void fbPushFill(DrawablePtr pDrawable, GCPtr pGC, FbStip * src, diff --git a/xserver/fb/fbrop.h b/xserver/fb/fbrop.h index 4362adb37..bc12b144e 100644 --- a/xserver/fb/fbrop.h +++ b/xserver/fb/fbrop.h @@ -92,19 +92,9 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; #define fbAndStip(rop,fg,pm) fbAndT(rop,fg,pm,FbStip) /* - * Stippling operations; + * Stippling operations; */ -extern _X_EXPORT const FbBits fbStipple16Bits[256]; /* half of table */ - -#define FbStipple16Bits(b) \ - (fbStipple16Bits[(b)&0xff] | fbStipple16Bits[(b) >> 8] << FB_HALFUNIT) -extern _X_EXPORT const FbBits fbStipple8Bits[256]; -extern _X_EXPORT const FbBits fbStipple4Bits[16]; -extern _X_EXPORT const FbBits fbStipple2Bits[4]; -extern _X_EXPORT const FbBits fbStipple1Bits[2]; -extern _X_EXPORT const FbBits *const fbStippleTable[]; - #define FbStippleRRop(dst, b, fa, fx, ba, bx) \ (FbDoRRop(dst, fa, fx) & b) | (FbDoRRop(dst, ba, bx) & ~b) diff --git a/xserver/fb/fbscreen.c b/xserver/fb/fbscreen.c index 0d4d87f8b..71bcc5d30 100644 --- a/xserver/fb/fbscreen.c +++ b/xserver/fb/fbscreen.c @@ -110,8 +110,8 @@ fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ pScreen->DestroyWindow = fbDestroyWindow; pScreen->PositionWindow = fbPositionWindow; pScreen->ChangeWindowAttributes = fbChangeWindowAttributes; - pScreen->RealizeWindow = fbMapWindow; - pScreen->UnrealizeWindow = fbUnmapWindow; + pScreen->RealizeWindow = fbRealizeWindow; + pScreen->UnrealizeWindow = fbUnrealizeWindow; pScreen->CopyWindow = fbCopyWindow; pScreen->CreatePixmap = fbCreatePixmap; pScreen->DestroyPixmap = fbDestroyPixmap; diff --git a/xserver/fb/fbseg.c b/xserver/fb/fbseg.c index 16e0426e5..c3c196ab4 100644 --- a/xserver/fb/fbseg.c +++ b/xserver/fb/fbseg.c @@ -33,7 +33,7 @@ ((dir < 0) ? FbStipLeft(mask,bpp) : \ FbStipRight(mask,bpp))) -void +static void fbBresSolid(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -105,7 +105,7 @@ fbBresSolid(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -178,7 +178,7 @@ fbBresDash(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresFill(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -218,7 +218,7 @@ fbSetFg(DrawablePtr pDrawable, GCPtr pGC, Pixel fg) } } -void +static void fbBresFillDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -436,7 +436,7 @@ fbBresDash24RRop(DrawablePtr pDrawable, * based on the contents of the specified GC. */ -FbBres * +static FbBres * fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); @@ -495,18 +495,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) return bres; } -void -fbBres(DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) -{ - (*fbSelectBres(pDrawable, pGC)) (pDrawable, pGC, dashOffset, - signdx, signdy, axis, x1, y1, - e, e1, e3, len); -} - void fbSegment(DrawablePtr pDrawable, GCPtr pGC, diff --git a/xserver/fb/fbstipple.c b/xserver/fb/fbstipple.c deleted file mode 100644 index f6c84a212..000000000 --- a/xserver/fb/fbstipple.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright © 1998 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "fb.h" - -/* - * This is a slight abuse of the preprocessor to generate repetitive - * code, the idea is to generate code for each case of a copy-mode - * transparent stipple - */ -#define LaneCases1(c,a) case c: \ - while (n--) { FbLaneCase(c,a); a++; } \ - break -#define LaneCases2(c,a) LaneCases1(c,a); LaneCases1(c+1,a) -#define LaneCases4(c,a) LaneCases2(c,a); LaneCases2(c+2,a) -#define LaneCases8(c,a) LaneCases4(c,a); LaneCases4(c+4,a) -#define LaneCases16(c,a) LaneCases8(c,a); LaneCases8(c+8,a) -#define LaneCases32(c,a) LaneCases16(c,a); LaneCases16(c+16,a) -#define LaneCases64(c,a) LaneCases32(c,a); LaneCases32(c+32,a) -#define LaneCases128(c,a) LaneCases64(c,a); LaneCases64(c+64,a) -#define LaneCases256(c,a) LaneCases128(c,a); LaneCases128(c+128,a) - -#if FB_SHIFT == 6 -#define LaneCases(a) LaneCases256(0,a) -#endif - -#if FB_SHIFT == 5 -#define LaneCases(a) LaneCases16(0,a) -#endif - -/* - * Repeat a transparent stipple across a scanline n times - */ - -void -fbTransparentSpan(FbBits * dst, FbBits stip, FbBits fgxor, int n) -{ - FbStip s; - - s = ((FbStip) (stip) & 0x01); - s |= ((FbStip) (stip >> 8) & 0x02); - s |= ((FbStip) (stip >> 16) & 0x04); - s |= ((FbStip) (stip >> 24) & 0x08); -#if FB_SHIFT > 5 - s |= ((FbStip) (stip >> 32) & 0x10); - s |= ((FbStip) (stip >> 40) & 0x20); - s |= ((FbStip) (stip >> 48) & 0x40); - s |= ((FbStip) (stip >> 56) & 0x80); -#endif - switch (s) { - LaneCases(dst); - } -} - -void -fbEvenStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipHeight, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot) -{ - FbBits startmask, endmask; - FbBits mask, and, xor; - int nmiddle, n; - FbStip *s, *stipEnd, bits; - int rot, stipX, stipY; - int pixelsPerDst; - const FbBits *fbBits; - Bool transparent; - int startbyte, endbyte; - - /* - * Check for a transparent stipple (stencil) - */ - transparent = FALSE; - if (dstBpp >= 8 && fgand == 0 && bgand == FB_ALLONES && bgxor == 0) - transparent = TRUE; - - pixelsPerDst = FB_UNIT / dstBpp; - /* - * Adjust dest pointers - */ - dst += dstX >> FB_SHIFT; - dstX &= FB_MASK; - FbMaskBitsBytes(dstX, width, fgand == 0 && bgand == 0, - startmask, startbyte, nmiddle, endmask, endbyte); - - if (startmask) - dstStride--; - dstStride -= nmiddle; - - xRot *= dstBpp; - /* - * Compute stip start scanline and rotation parameters - */ - stipEnd = stip + stipStride * stipHeight; - modulus(-yRot, stipHeight, stipY); - s = stip + stipStride * stipY; - modulus(-xRot, FB_UNIT, stipX); - rot = stipX; - - /* - * Get pointer to stipple mask array for this depth - */ - /* fbStippleTable covers all valid bpp (4,8,16,32) */ - fbBits = fbStippleTable[pixelsPerDst]; - - while (height--) { - /* - * Extract stipple bits for this scanline; - */ - bits = READ(s); - s += stipStride; - if (s == stipEnd) - s = stip; -#if FB_UNIT > 32 - if (pixelsPerDst == 16) - mask = FbStipple16Bits(FbLeftStipBits(bits, 16)); - else -#endif - mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; - /* - * Rotate into position and compute reduced rop values - */ - mask = FbRotLeft(mask, rot); - and = (fgand & mask) | (bgand & ~mask); - xor = (fgxor & mask) | (bgxor & ~mask); - - if (transparent) { - if (startmask) { - fbTransparentSpan(dst, mask & startmask, fgxor, 1); - dst++; - } - fbTransparentSpan(dst, mask, fgxor, nmiddle); - dst += nmiddle; - if (endmask) - fbTransparentSpan(dst, mask & endmask, fgxor, 1); - } - else { - /* - * Fill scanline - */ - if (startmask) { - FbDoLeftMaskByteRRop(dst, startbyte, startmask, and, xor); - dst++; - } - n = nmiddle; - if (!and) - while (n--) - WRITE(dst++, xor); - else { - while (n--) { - WRITE(dst, FbDoRRop(READ(dst), and, xor)); - dst++; - } - } - if (endmask) - FbDoRightMaskByteRRop(dst, endbyte, endmask, and, xor); - } - dst += dstStride; - } -} - -void -fbOddStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipWidth, - int stipHeight, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot) -{ - int stipX, stipY, sx; - int widthTmp; - int h, w; - int x, y; - - modulus(-yRot, stipHeight, stipY); - modulus(dstX / dstBpp - xRot, stipWidth, stipX); - y = 0; - while (height) { - h = stipHeight - stipY; - if (h > height) - h = height; - height -= h; - widthTmp = width; - x = dstX; - sx = stipX; - while (widthTmp) { - w = (stipWidth - sx) * dstBpp; - if (w > widthTmp) - w = widthTmp; - widthTmp -= w; - fbBltOne(stip + stipY * stipStride, - stipStride, - sx, - dst + y * dstStride, - dstStride, x, dstBpp, w, h, fgand, fgxor, bgand, bgxor); - x += w; - sx = 0; - } - y += h; - stipY = 0; - } -} - -void -fbStipple(FbBits * dst, - FbStride dstStride, - int dstX, - int dstBpp, - int width, - int height, - FbStip * stip, - FbStride stipStride, - int stipWidth, - int stipHeight, - Bool even, - FbBits fgand, - FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot) -{ - if (even) - fbEvenStipple(dst, dstStride, dstX, dstBpp, width, height, - stip, stipStride, stipHeight, - fgand, fgxor, bgand, bgxor, xRot, yRot); - else - fbOddStipple(dst, dstStride, dstX, dstBpp, width, height, - stip, stipStride, stipWidth, stipHeight, - fgand, fgxor, bgand, bgxor, xRot, yRot); -} diff --git a/xserver/fb/fbtile.c b/xserver/fb/fbtile.c deleted file mode 100644 index 785c5f0e4..000000000 --- a/xserver/fb/fbtile.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright © 1998 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "fb.h" - -/* - * Accelerated tile fill -- tile width is a power of two not greater - * than FB_UNIT - */ - -void -fbEvenTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileHeight, int alu, FbBits pm, int xRot, int yRot) -{ - FbBits *t, *tileEnd, bits; - FbBits startmask, endmask; - FbBits and, xor; - int n, nmiddle; - int tileX, tileY; - int rot; - int startbyte, endbyte; - - dst += dstX >> FB_SHIFT; - dstX &= FB_MASK; - FbMaskBitsBytes(dstX, width, FbDestInvarientRop(alu, pm), - startmask, startbyte, nmiddle, endmask, endbyte); - if (startmask) - dstStride--; - dstStride -= nmiddle; - - /* - * Compute tile start scanline and rotation parameters - */ - tileEnd = tile + tileHeight * tileStride; - modulus(-yRot, tileHeight, tileY); - t = tile + tileY * tileStride; - modulus(-xRot, FB_UNIT, tileX); - rot = tileX; - - while (height--) { - - /* - * Pick up bits for this scanline - */ - bits = READ(t); - t += tileStride; - if (t >= tileEnd) - t = tile; - bits = FbRotLeft(bits, rot); - and = fbAnd(alu, bits, pm); - xor = fbXor(alu, bits, pm); - - if (startmask) { - FbDoLeftMaskByteRRop(dst, startbyte, startmask, and, xor); - dst++; - } - n = nmiddle; - if (!and) - while (n--) - WRITE(dst++, xor); - else - while (n--) { - WRITE(dst, FbDoRRop(READ(dst), and, xor)); - dst++; - } - if (endmask) - FbDoRightMaskByteRRop(dst, endbyte, endmask, and, xor); - dst += dstStride; - } -} - -void -fbOddTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileWidth, - int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot) -{ - int tileX, tileY; - int widthTmp; - int h, w; - int x, y; - - modulus(-yRot, tileHeight, tileY); - y = 0; - while (height) { - h = tileHeight - tileY; - if (h > height) - h = height; - height -= h; - widthTmp = width; - x = dstX; - modulus(dstX - xRot, tileWidth, tileX); - while (widthTmp) { - w = tileWidth - tileX; - if (w > widthTmp) - w = widthTmp; - widthTmp -= w; - fbBlt(tile + tileY * tileStride, - tileStride, - tileX, - dst + y * dstStride, - dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE); - x += w; - tileX = 0; - } - y += h; - tileY = 0; - } -} - -void -fbTile(FbBits * dst, - FbStride dstStride, - int dstX, - int width, - int height, - FbBits * tile, - FbStride tileStride, - int tileWidth, - int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot) -{ - if (FbEvenTile(tileWidth)) - fbEvenTile(dst, dstStride, dstX, width, height, - tile, tileStride, tileHeight, alu, pm, xRot, yRot); - else - fbOddTile(dst, dstStride, dstX, width, height, - tile, tileStride, tileWidth, tileHeight, - alu, pm, bpp, xRot, yRot); -} diff --git a/xserver/fb/fbutil.c b/xserver/fb/fbutil.c index 2ca80d1c9..c1d5923c4 100644 --- a/xserver/fb/fbutil.c +++ b/xserver/fb/fbutil.c @@ -39,84 +39,6 @@ fbReplicatePixel(Pixel p, int bpp) return b; } -void -fbReduceRasterOp(int rop, FbBits fg, FbBits pm, FbBits * andp, FbBits * xorp) -{ - FbBits and, xor; - - switch (rop) { - default: - case GXclear: /* 0 0 0 0 */ - and = 0; - xor = 0; - break; - case GXand: /* 0 0 0 1 */ - and = fg; - xor = 0; - break; - case GXandReverse: /* 0 0 1 0 */ - and = fg; - xor = fg; - break; - case GXcopy: /* 0 0 1 1 */ - and = 0; - xor = fg; - break; - case GXandInverted: /* 0 1 0 0 */ - and = ~fg; - xor = 0; - break; - case GXnoop: /* 0 1 0 1 */ - and = FB_ALLONES; - xor = 0; - break; - case GXxor: /* 0 1 1 0 */ - and = FB_ALLONES; - xor = fg; - break; - case GXor: /* 0 1 1 1 */ - and = ~fg; - xor = fg; - break; - case GXnor: /* 1 0 0 0 */ - and = ~fg; - xor = ~fg; - break; - case GXequiv: /* 1 0 0 1 */ - and = FB_ALLONES; - xor = ~fg; - break; - case GXinvert: /* 1 0 1 0 */ - and = FB_ALLONES; - xor = FB_ALLONES; - break; - case GXorReverse: /* 1 0 1 1 */ - and = ~fg; - xor = FB_ALLONES; - break; - case GXcopyInverted: /* 1 1 0 0 */ - and = 0; - xor = ~fg; - break; - case GXorInverted: /* 1 1 0 1 */ - and = fg; - xor = ~fg; - break; - case GXnand: /* 1 1 1 0 */ - and = fg; - xor = FB_ALLONES; - break; - case GXset: /* 1 1 1 1 */ - and = 0; - xor = FB_ALLONES; - break; - } - and |= ~pm; - xor &= pm; - *andp = and; - *xorp = xor; -} - #define O 0 #define I FB_ALLONES @@ -139,233 +61,3 @@ const FbMergeRopRec FbMergeRopBits[16] = { {O, O, O, I}, /* set 0xf 1 */ }; -/* - * Stipple masks are independent of bit/byte order as long - * as bitorder == byteorder. FB doesn't handle the case - * where these differ - */ -#define BitsMask(x,w) ((FB_ALLONES << ((x) & FB_MASK)) & \ - (FB_ALLONES >> ((FB_UNIT - ((x) + (w))) & FB_MASK))) - -#define Mask(x,w) BitsMask((x)*(w),(w)) - -#define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w)) - -#define C1(b,w) \ - (SelMask(b,0,w)) - -#define C2(b,w) \ - (SelMask(b,0,w) | \ - SelMask(b,1,w)) - -#define C4(b,w) \ - (SelMask(b,0,w) | \ - SelMask(b,1,w) | \ - SelMask(b,2,w) | \ - SelMask(b,3,w)) - -#define C8(b,w) \ - (SelMask(b,0,w) | \ - SelMask(b,1,w) | \ - SelMask(b,2,w) | \ - SelMask(b,3,w) | \ - SelMask(b,4,w) | \ - SelMask(b,5,w) | \ - SelMask(b,6,w) | \ - SelMask(b,7,w)) - -#if FB_UNIT == 16 -#define fbStipple16Bits 0 -#define fbStipple8Bits 0 -const FbBits fbStipple4Bits[16] = { - C4(0, 4), C4(1, 4), C4(2, 4), C4(3, 4), C4(4, 4), C4(5, 4), - C4(6, 4), C4(7, 4), C4(8, 4), C4(9, 4), C4(10, 4), C4(11, 4), - C4(12, 4), C4(13, 4), C4(14, 4), C4(15, 4), -}; - -const FbBits fbStipple2Bits[4] = { - C2(0, 8), C2(1, 8), C2(2, 8), C2(3, 8), -}; - -const FbBits fbStipple1Bits[2] = { - C1(0, 16), C1(1, 16), -}; -#endif -#if FB_UNIT == 32 -#define fbStipple16Bits 0 -const FbBits fbStipple8Bits[256] = { - C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4), - C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4), - C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4), - C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4), - C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4), - C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4), - C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4), - C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4), - C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4), - C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4), - C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4), - C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4), - C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4), - C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4), - C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4), - C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4), - C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4), - C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4), - C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4), - C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4), - C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4), - C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4), - C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4), - C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4), - C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4), - C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4), - C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4), - C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4), - C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4), - C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4), - C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4), - C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4), - C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4), - C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4), - C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4), - C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4), - C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4), - C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4), - C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4), - C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4), - C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4), - C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4), - C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4), -}; - -const FbBits fbStipple4Bits[16] = { - C4(0, 8), C4(1, 8), C4(2, 8), C4(3, 8), C4(4, 8), C4(5, 8), - C4(6, 8), C4(7, 8), C4(8, 8), C4(9, 8), C4(10, 8), C4(11, 8), - C4(12, 8), C4(13, 8), C4(14, 8), C4(15, 8), -}; - -const FbBits fbStipple2Bits[4] = { - C2(0, 16), C2(1, 16), C2(2, 16), C2(3, 16), -}; - -const FbBits fbStipple1Bits[2] = { - C1(0, 32), C1(1, 32), -}; -#endif -#if FB_UNIT == 64 -const FbBits fbStipple16Bits[256] = { - C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4), - C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4), - C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4), - C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4), - C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4), - C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4), - C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4), - C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4), - C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4), - C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4), - C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4), - C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4), - C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4), - C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4), - C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4), - C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4), - C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4), - C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4), - C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4), - C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4), - C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4), - C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4), - C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4), - C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4), - C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4), - C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4), - C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4), - C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4), - C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4), - C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4), - C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4), - C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4), - C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4), - C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4), - C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4), - C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4), - C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4), - C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4), - C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4), - C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4), - C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4), - C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4), - C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4), -}; - -const FbBits fbStipple8Bits[256] = { - C8(0, 8), C8(1, 8), C8(2, 8), C8(3, 8), C8(4, 8), C8(5, 8), - C8(6, 8), C8(7, 8), C8(8, 8), C8(9, 8), C8(10, 8), C8(11, 8), - C8(12, 8), C8(13, 8), C8(14, 8), C8(15, 8), C8(16, 8), C8(17, 8), - C8(18, 8), C8(19, 8), C8(20, 8), C8(21, 8), C8(22, 8), C8(23, 8), - C8(24, 8), C8(25, 8), C8(26, 8), C8(27, 8), C8(28, 8), C8(29, 8), - C8(30, 8), C8(31, 8), C8(32, 8), C8(33, 8), C8(34, 8), C8(35, 8), - C8(36, 8), C8(37, 8), C8(38, 8), C8(39, 8), C8(40, 8), C8(41, 8), - C8(42, 8), C8(43, 8), C8(44, 8), C8(45, 8), C8(46, 8), C8(47, 8), - C8(48, 8), C8(49, 8), C8(50, 8), C8(51, 8), C8(52, 8), C8(53, 8), - C8(54, 8), C8(55, 8), C8(56, 8), C8(57, 8), C8(58, 8), C8(59, 8), - C8(60, 8), C8(61, 8), C8(62, 8), C8(63, 8), C8(64, 8), C8(65, 8), - C8(66, 8), C8(67, 8), C8(68, 8), C8(69, 8), C8(70, 8), C8(71, 8), - C8(72, 8), C8(73, 8), C8(74, 8), C8(75, 8), C8(76, 8), C8(77, 8), - C8(78, 8), C8(79, 8), C8(80, 8), C8(81, 8), C8(82, 8), C8(83, 8), - C8(84, 8), C8(85, 8), C8(86, 8), C8(87, 8), C8(88, 8), C8(89, 8), - C8(90, 8), C8(91, 8), C8(92, 8), C8(93, 8), C8(94, 8), C8(95, 8), - C8(96, 8), C8(97, 8), C8(98, 8), C8(99, 8), C8(100, 8), C8(101, 8), - C8(102, 8), C8(103, 8), C8(104, 8), C8(105, 8), C8(106, 8), C8(107, 8), - C8(108, 8), C8(109, 8), C8(110, 8), C8(111, 8), C8(112, 8), C8(113, 8), - C8(114, 8), C8(115, 8), C8(116, 8), C8(117, 8), C8(118, 8), C8(119, 8), - C8(120, 8), C8(121, 8), C8(122, 8), C8(123, 8), C8(124, 8), C8(125, 8), - C8(126, 8), C8(127, 8), C8(128, 8), C8(129, 8), C8(130, 8), C8(131, 8), - C8(132, 8), C8(133, 8), C8(134, 8), C8(135, 8), C8(136, 8), C8(137, 8), - C8(138, 8), C8(139, 8), C8(140, 8), C8(141, 8), C8(142, 8), C8(143, 8), - C8(144, 8), C8(145, 8), C8(146, 8), C8(147, 8), C8(148, 8), C8(149, 8), - C8(150, 8), C8(151, 8), C8(152, 8), C8(153, 8), C8(154, 8), C8(155, 8), - C8(156, 8), C8(157, 8), C8(158, 8), C8(159, 8), C8(160, 8), C8(161, 8), - C8(162, 8), C8(163, 8), C8(164, 8), C8(165, 8), C8(166, 8), C8(167, 8), - C8(168, 8), C8(169, 8), C8(170, 8), C8(171, 8), C8(172, 8), C8(173, 8), - C8(174, 8), C8(175, 8), C8(176, 8), C8(177, 8), C8(178, 8), C8(179, 8), - C8(180, 8), C8(181, 8), C8(182, 8), C8(183, 8), C8(184, 8), C8(185, 8), - C8(186, 8), C8(187, 8), C8(188, 8), C8(189, 8), C8(190, 8), C8(191, 8), - C8(192, 8), C8(193, 8), C8(194, 8), C8(195, 8), C8(196, 8), C8(197, 8), - C8(198, 8), C8(199, 8), C8(200, 8), C8(201, 8), C8(202, 8), C8(203, 8), - C8(204, 8), C8(205, 8), C8(206, 8), C8(207, 8), C8(208, 8), C8(209, 8), - C8(210, 8), C8(211, 8), C8(212, 8), C8(213, 8), C8(214, 8), C8(215, 8), - C8(216, 8), C8(217, 8), C8(218, 8), C8(219, 8), C8(220, 8), C8(221, 8), - C8(222, 8), C8(223, 8), C8(224, 8), C8(225, 8), C8(226, 8), C8(227, 8), - C8(228, 8), C8(229, 8), C8(230, 8), C8(231, 8), C8(232, 8), C8(233, 8), - C8(234, 8), C8(235, 8), C8(236, 8), C8(237, 8), C8(238, 8), C8(239, 8), - C8(240, 8), C8(241, 8), C8(242, 8), C8(243, 8), C8(244, 8), C8(245, 8), - C8(246, 8), C8(247, 8), C8(248, 8), C8(249, 8), C8(250, 8), C8(251, 8), - C8(252, 8), C8(253, 8), C8(254, 8), C8(255, 8), -}; - -const FbBits fbStipple4Bits[16] = { - C4(0, 16), C4(1, 16), C4(2, 16), C4(3, 16), C4(4, 16), C4(5, 16), - C4(6, 16), C4(7, 16), C4(8, 16), C4(9, 16), C4(10, 16), C4(11, 16), - C4(12, 16), C4(13, 16), C4(14, 16), C4(15, 16), -}; - -const FbBits fbStipple2Bits[4] = { - C2(0, 32), C2(1, 32), C2(2, 32), C2(3, 32), -}; - -#define fbStipple1Bits 0 -#endif -const FbBits *const fbStippleTable[] = { - 0, - fbStipple1Bits, - fbStipple2Bits, - 0, - fbStipple4Bits, - 0, - 0, - 0, - fbStipple8Bits, -}; diff --git a/xserver/fb/fbwindow.c b/xserver/fb/fbwindow.c index c90175faa..7a5fac869 100644 --- a/xserver/fb/fbwindow.c +++ b/xserver/fb/fbwindow.c @@ -46,7 +46,7 @@ fbDestroyWindow(WindowPtr pWin) } Bool -fbMapWindow(WindowPtr pWindow) +fbRealizeWindow(WindowPtr pWindow) { return TRUE; } @@ -58,7 +58,7 @@ fbPositionWindow(WindowPtr pWin, int x, int y) } Bool -fbUnmapWindow(WindowPtr pWindow) +fbUnrealizeWindow(WindowPtr pWindow) { return TRUE; } diff --git a/xserver/fb/wfbrename.h b/xserver/fb/wfbrename.h index 54d00d003..baa80f8bb 100644 --- a/xserver/fb/wfbrename.h +++ b/xserver/fb/wfbrename.h @@ -1,4 +1,3 @@ -#define fb16Lane wfb16Lane #define fb24_32CopyMtoN wfb24_32CopyMtoN #define fb24_32CreateScreenResources wfb24_32CreateScreenResources #define fb24_32GetImage wfb24_32GetImage @@ -7,8 +6,6 @@ #define fb24_32PutZImage wfb24_32PutZImage #define fb24_32ReformatTile wfb24_32ReformatTile #define fb24_32SetSpans wfb24_32SetSpans -#define fb32Lane wfb32Lane -#define fb8Lane wfb8Lane #define fbAddTraps wfbAddTraps #define fbAddTriangles wfbAddTriangles #define fbAllocatePrivates wfbAllocatePrivates @@ -61,8 +58,6 @@ #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 -#define fbEvenStipple wfbEvenStipple -#define fbEvenTile wfbEvenTile #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill #define fbFillRegionSolid wfbFillRegionSolid @@ -79,19 +74,13 @@ #define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 #define fbGlyph8 wfbGlyph8 -#define fbGlyphIn wfbGlyphIn #define fbHasVisualTypes wfbHasVisualTypes #define fbImageGlyphBlt wfbImageGlyphBlt #define fbIn wfbIn #define fbInitializeColormap wfbInitializeColormap #define fbInitVisuals wfbInitVisuals -#define fbInstallColormap wfbInstallColormap -#define fbLaneTable wfbLaneTable #define fbListInstalledColormaps wfbListInstalledColormaps -#define fbMapWindow wfbMapWindow #define FbMergeRopBits wFbMergeRopBits -#define fbOddStipple wfbOddStipple -#define fbOddTile wfbOddTile #define fbOver wfbOver #define fbOver24 wfbOver24 #define fbOverlayCloseScreen wfbOverlayCloseScreen @@ -134,7 +123,6 @@ #define fbQueryBestSize wfbQueryBestSize #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont -#define fbReduceRasterOp wfbReduceRasterOp #define fbReplicatePixel wfbReplicatePixel #define fbResolveColor wfbResolveColor #define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec @@ -148,23 +136,12 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbStipple wfbStipple -#define fbStipple1Bits wfbStipple1Bits -#define fbStipple24Bits wfbStipple24Bits -#define fbStipple2Bits wfbStipple2Bits -#define fbStipple4Bits wfbStipple4Bits -#define fbStipple8Bits wfbStipple8Bits -#define fbStippleTable wfbStippleTable -#define fbTile wfbTile -#define fbTransparentSpan wfbTransparentSpan #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -#define fbUnmapWindow wfbUnmapWindow +#define fbUnrealizeWindow wfbUnrealizeWindow #define fbUnrealizeFont wfbUnrealizeFont #define fbValidateGC wfbValidateGC #define fbWinPrivateKeyRec wfbWinPrivateKeyRec -#define fbZeroLine wfbZeroLine -#define fbZeroSegment wfbZeroSegment #define free_pixman_pict wfb_free_pixman_pict #define image_from_pict wfb_image_from_pict diff --git a/xserver/glamor/Makefile.am b/xserver/glamor/Makefile.am index bde58b632..db72cb11c 100644 --- a/xserver/glamor/Makefile.am +++ b/xserver/glamor/Makefile.am @@ -7,20 +7,21 @@ AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS) libglamor_la_SOURCES = \ glamor.c \ glamor_context.h \ - glamor_copyarea.c \ - glamor_copywindow.c \ + glamor_copy.c \ glamor_core.c \ + glamor_dash.c \ glamor_debug.h \ - glamor_fill.c \ glamor_font.c \ glamor_font.h \ glamor_glx.c \ glamor_glyphs.c \ - glamor_polylines.c \ - glamor_segment.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 \ @@ -31,10 +32,8 @@ libglamor_la_SOURCES = \ glamor_transform.c \ glamor_transform.h \ glamor_trapezoid.c \ - glamor_tile.c \ glamor_triangles.c\ glamor_addtraps.c\ - glamor_copyplane.c\ glamor_glyphblt.c\ glamor_points.c\ glamor_priv.h\ @@ -45,7 +44,10 @@ libglamor_la_SOURCES = \ glamor_window.c\ glamor_fbo.c\ glamor_compositerects.c\ + glamor_utils.c\ glamor_utils.h\ + glamor_xv.c \ + glamor_sync.c \ glamor.h libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c diff --git a/xserver/glamor/Makefile.in b/xserver/glamor/Makefile.in index 0f65e3392..53a28429e 100644 --- a/xserver/glamor/Makefile.in +++ b/xserver/glamor/Makefile.in @@ -76,18 +76,17 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libglamor_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libglamor_la_OBJECTS = glamor.lo glamor_copyarea.lo \ - glamor_copywindow.lo glamor_core.lo glamor_fill.lo \ - glamor_font.lo glamor_glx.lo glamor_glyphs.lo \ - glamor_polylines.lo glamor_segment.lo glamor_image.lo \ - glamor_render.lo glamor_gradient.lo glamor_program.lo \ - glamor_rects.lo glamor_spans.lo glamor_text.lo \ - glamor_transfer.lo glamor_transform.lo glamor_trapezoid.lo \ - glamor_tile.lo glamor_triangles.lo glamor_addtraps.lo \ - glamor_copyplane.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 +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 libglamor_la_OBJECTS = $(am_libglamor_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -278,6 +277,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -521,20 +521,21 @@ AM_CFLAGS = $(CWARNFLAGS) $(DIX_CFLAGS) $(GLAMOR_CFLAGS) libglamor_la_SOURCES = \ glamor.c \ glamor_context.h \ - glamor_copyarea.c \ - glamor_copywindow.c \ + glamor_copy.c \ glamor_core.c \ + glamor_dash.c \ glamor_debug.h \ - glamor_fill.c \ glamor_font.c \ glamor_font.h \ glamor_glx.c \ glamor_glyphs.c \ - glamor_polylines.c \ - glamor_segment.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 \ @@ -545,10 +546,8 @@ libglamor_la_SOURCES = \ glamor_transform.c \ glamor_transform.h \ glamor_trapezoid.c \ - glamor_tile.c \ glamor_triangles.c\ glamor_addtraps.c\ - glamor_copyplane.c\ glamor_glyphblt.c\ glamor_points.c\ glamor_priv.h\ @@ -559,7 +558,10 @@ libglamor_la_SOURCES = \ glamor_window.c\ glamor_fbo.c\ glamor_compositerects.c\ + glamor_utils.c\ glamor_utils.h\ + glamor_xv.c \ + glamor_sync.c \ glamor.h libglamor_egl_stubs_la_SOURCES = glamor_egl_stubs.c @@ -623,13 +625,11 @@ 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_compositerects.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_copyarea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_copyplane.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_copywindow.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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_dash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_egl_stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_fbo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_fill.Plo@am__quote@ @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@ @@ -637,23 +637,26 @@ distclean-compile: @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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_lines.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_picture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_pixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_points.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_polylines.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_prepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_program.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_rects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_render.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_segment.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_segs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_spans.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_text.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_tile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_transform.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_trapezoid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_triangles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_vbo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_window.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_xv.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/xserver/glamor/glamor.c b/xserver/glamor/glamor.c index 358890375..a8cc810d1 100644 --- a/xserver/glamor/glamor.c +++ b/xserver/glamor/glamor.c @@ -35,10 +35,9 @@ #include "glamor_priv.h" -static DevPrivateKeyRec glamor_screen_private_key_index; -DevPrivateKey glamor_screen_private_key = &glamor_screen_private_key_index; -static DevPrivateKeyRec glamor_pixmap_private_key_index; -DevPrivateKey glamor_pixmap_private_key = &glamor_pixmap_private_key_index; +DevPrivateKeyRec glamor_screen_private_key; +DevPrivateKeyRec glamor_pixmap_private_key; +DevPrivateKeyRec glamor_gc_private_key; /** * glamor_get_drawable_pixmap() returns a backing pixmap for a given drawable. @@ -68,7 +67,7 @@ glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type) glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = dixLookupPrivate(&pixmap->devPrivates, - glamor_pixmap_private_key); + &glamor_pixmap_private_key); if (pixmap_priv == NULL) { pixmap_priv = calloc(sizeof(*pixmap_priv), 1); glamor_set_pixmap_private(pixmap, pixmap_priv); @@ -107,6 +106,7 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) ErrorF("XXX fail to create fbo.\n"); return; } + fbo->external = TRUE; glamor_pixmap_attach_fbo(pixmap, fbo); } @@ -123,8 +123,6 @@ glamor_set_screen_pixmap(PixmapPtr screen_pixmap, PixmapPtr *back_pixmap) pixmap_priv->base.fbo->width = screen_pixmap->drawable.width; pixmap_priv->base.fbo->height = screen_pixmap->drawable.height; - - glamor_priv->back_pixmap = back_pixmap; } uint32_t @@ -222,23 +220,20 @@ void glamor_destroy_textured_pixmap(PixmapPtr pixmap) { if (pixmap->refcnt == 1) { - glamor_pixmap_private *pixmap_priv; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - if (pixmap_priv != NULL) - glamor_pixmap_destroy_fbo(pixmap_priv); + glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); + if (pixmap_priv != NULL) { +#if GLAMOR_HAS_GBM + glamor_egl_destroy_pixmap_image(pixmap); +#endif + glamor_set_pixmap_private(pixmap, NULL); + } } } Bool glamor_destroy_pixmap(PixmapPtr pixmap) { - glamor_screen_private - *glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); - if (glamor_priv->dri3_enabled) - glamor_egl_destroy_textured_pixmap(pixmap); - else - glamor_destroy_textured_pixmap(pixmap); + glamor_destroy_textured_pixmap(pixmap); return fbDestroyPixmap(pixmap); } @@ -251,27 +246,22 @@ glamor_block_handler(ScreenPtr screen) glamor_priv->tick++; glFlush(); glamor_fbo_expire(glamor_priv); - if (glamor_priv->state == RENDER_STATE - && glamor_priv->render_idle_cnt++ > RENDER_IDEL_MAX) { - glamor_priv->state = IDLE_STATE; - glamor_priv->render_idle_cnt = 0; - } } static void -_glamor_block_handler(void *data, OSTimePtr timeout, void *last_select_mask) +_glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask) { - glamor_screen_private *glamor_priv = data; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + + screen->BlockHandler = glamor_priv->saved_procs.block_handler; + screen->BlockHandler(screen, timeout, readmask); + glamor_priv->saved_procs.block_handler = screen->BlockHandler; + screen->BlockHandler = _glamor_block_handler; glamor_make_current(glamor_priv); glFlush(); } -static void -_glamor_wakeup_handler(void *data, int result, void *last_select_mask) -{ -} - static void glamor_set_debug_level(int *debug_level) { @@ -302,6 +292,11 @@ 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; @@ -310,6 +305,35 @@ glamor_create_screen_resources(ScreenPtr screen) return ret; } +static Bool +glamor_check_instruction_count(int gl_version) +{ + GLint max_native_alu_instructions; + + /* Avoid using glamor if the reported instructions limit is too low, + * as this would cause glamor to fallback on sw due to large shaders + * which ends up being unbearably slow. + */ + if (gl_version < 30) { + if (!epoxy_has_gl_extension("GL_ARB_fragment_program")) { + ErrorF("GL_ARB_fragment_program required\n"); + return FALSE; + } + + glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, + &max_native_alu_instructions); + if (max_native_alu_instructions < GLAMOR_MIN_ALU_INSTRUCTIONS) { + LogMessage(X_WARNING, + "glamor requires at least %d instructions (%d reported)\n", + GLAMOR_MIN_ALU_INSTRUCTIONS, max_native_alu_instructions); + return FALSE; + } + } + + return TRUE; +} + /** Set up glamor for an already-configured GL context. */ Bool glamor_init(ScreenPtr screen, unsigned int flags) @@ -330,13 +354,8 @@ glamor_init(ScreenPtr screen, unsigned int flags) return FALSE; glamor_priv->flags = flags; - if (flags & GLAMOR_INVERTED_Y_AXIS) { - glamor_priv->yInverted = TRUE; - } - else - glamor_priv->yInverted = FALSE; - if (!dixRegisterPrivateKey(glamor_screen_private_key, PRIVATE_SCREEN, 0)) { + if (!dixRegisterPrivateKey(&glamor_screen_private_key, PRIVATE_SCREEN, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate screen private\n", screen->myNum); @@ -345,11 +364,19 @@ 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, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate pixmap private\n", screen->myNum); - goto fail;; + goto fail; + } + + if (!dixRegisterPrivateKey(&glamor_gc_private_key, PRIVATE_GC, + sizeof (glamor_gc_private))) { + LogMessage(X_WARNING, + "glamor%d: Failed to allocate gc private\n", + screen->myNum); + goto fail; } if (epoxy_is_desktop_gl()) @@ -386,6 +413,9 @@ glamor_init(ScreenPtr screen, unsigned int flags) ErrorF("Require OpenGL version 2.1 or later.\n"); goto fail; } + + if (!glamor_check_instruction_count(gl_version)) + goto fail; } else { if (gl_version < 20) { ErrorF("Require Open GLES2.0 or later.\n"); @@ -398,6 +428,10 @@ glamor_init(ScreenPtr screen, unsigned int flags) } } + glamor_priv->has_rw_pbo = FALSE; + if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) + glamor_priv->has_rw_pbo = TRUE; + glamor_priv->has_khr_debug = epoxy_has_gl_extension("GL_KHR_debug"); glamor_priv->has_pack_invert = epoxy_has_gl_extension("GL_MESA_pack_invert"); @@ -407,6 +441,18 @@ glamor_init(ScreenPtr screen, unsigned int flags) epoxy_has_gl_extension("GL_ARB_map_buffer_range"); glamor_priv->has_buffer_storage = epoxy_has_gl_extension("GL_ARB_buffer_storage"); + glamor_priv->has_nv_texture_barrier = + epoxy_has_gl_extension("GL_NV_texture_barrier"); + glamor_priv->has_unpack_subimage = + glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP || + epoxy_gl_version() >= 30 || + epoxy_has_gl_extension("GL_EXT_unpack_subimage"); + glamor_priv->has_pack_subimage = + glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP || + epoxy_gl_version() >= 30 || + epoxy_has_gl_extension("GL_NV_pack_subimage"); + + glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glamor_priv->max_fbo_size); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, max_viewport_size); glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size[0]); @@ -417,6 +463,9 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_set_debug_level(&glamor_debug_level); + glamor_priv->saved_procs.close_screen = screen->CloseScreen; + screen->CloseScreen = glamor_close_screen; + /* If we are using egl screen, call egl screen init to * register correct close screen function. */ if (flags & GLAMOR_USE_EGL_SCREEN) { @@ -426,9 +475,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; } - glamor_priv->saved_procs.close_screen = screen->CloseScreen; - screen->CloseScreen = glamor_close_screen; - glamor_priv->saved_procs.create_screen_resources = screen->CreateScreenResources; screen->CreateScreenResources = glamor_create_screen_resources; @@ -437,11 +483,9 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; if (flags & GLAMOR_USE_SCREEN) { - if (!RegisterBlockAndWakeupHandlers(_glamor_block_handler, - _glamor_wakeup_handler, - glamor_priv)) { - goto fail; - } + + glamor_priv->saved_procs.block_handler = screen->BlockHandler; + screen->BlockHandler = _glamor_block_handler; glamor_priv->saved_procs.create_gc = screen->CreateGC; screen->CreateGC = glamor_create_gc; @@ -505,17 +549,12 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_init_vbo(screen); glamor_init_pixmap_fbo(screen); - glamor_init_solid_shader(screen); - glamor_init_tile_shader(screen); -#ifdef GLAMOR_TRAPEZOID_SHADER - glamor_init_trapezoid_shader(screen); -#endif glamor_init_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); #endif glamor_pixmap_init(screen); - glamor_glyphs_init(screen); + glamor_sync_init(screen); glamor_priv->screen = screen; @@ -538,11 +577,6 @@ glamor_release_screen_priv(ScreenPtr screen) #endif glamor_fini_vbo(screen); glamor_fini_pixmap_fbo(screen); - glamor_fini_solid_shader(screen); - glamor_fini_tile_shader(screen); -#ifdef GLAMOR_TRAPEZOID_SHADER - glamor_fini_trapezoid_shader(screen); -#endif glamor_fini_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_fini_gradient_shader(screen); @@ -557,9 +591,8 @@ _X_EXPORT void glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv) { glamor_pixmap_private *old_priv; - glamor_pixmap_fbo *fbo; - old_priv = dixGetPrivate(&pixmap->devPrivates, glamor_pixmap_private_key); + old_priv = dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (priv) { assert(old_priv == NULL); @@ -567,12 +600,12 @@ glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv) else { if (old_priv == NULL) return; - fbo = glamor_pixmap_detach_fbo(old_priv); - glamor_purge_fbo(fbo); + + glamor_pixmap_destroy_fbo(old_priv); free(old_priv); } - dixSetPrivate(&pixmap->devPrivates, glamor_pixmap_private_key, priv); + dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key, priv); } Bool @@ -587,6 +620,7 @@ glamor_close_screen(ScreenPtr screen) #endif glamor_priv = glamor_get_screen_private(screen); flags = glamor_priv->flags; + glamor_sync_close(screen); glamor_glyphs_fini(screen); screen->CloseScreen = glamor_priv->saved_procs.close_screen; screen->CreateScreenResources = @@ -601,6 +635,7 @@ glamor_close_screen(ScreenPtr screen) 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)) { @@ -617,8 +652,6 @@ glamor_close_screen(ScreenPtr screen) #endif screen_pixmap = screen->GetScreenPixmap(screen); glamor_set_pixmap_private(screen_pixmap, NULL); - if (glamor_priv->back_pixmap && *glamor_priv->back_pixmap) - glamor_set_pixmap_private(*glamor_priv->back_pixmap, NULL); glamor_release_screen_priv(screen); diff --git a/xserver/glamor/glamor.h b/xserver/glamor/glamor.h index b0f2212d9..206158c02 100644 --- a/xserver/glamor/glamor.h +++ b/xserver/glamor/glamor.h @@ -63,7 +63,7 @@ typedef enum glamor_pixmap_type { } glamor_pixmap_type_t; #define GLAMOR_EGL_EXTERNAL_BUFFER 3 -#define GLAMOR_INVERTED_Y_AXIS 1 +#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) @@ -79,12 +79,6 @@ typedef enum glamor_pixmap_type { * @screen: Current screen pointer. * @flags: Please refer the flags description above. * - * @GLAMOR_INVERTED_Y_AXIS: - * set 1 means the GL env's origin (0,0) is at top-left. - * EGL/DRM platform is an example need to set this bit. - * glx platform's origin is at bottom-left thus need to - * clear this bit. - * * @GLAMOR_USE_SCREEN: * If running in an pre-existing X environment, and the * gl context is GLX, then you should set this bit and @@ -176,6 +170,10 @@ extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, unsigned int, Bool, CARD16 *, CARD32 *); +extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap); + +extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen); + /* @glamor_supports_pixmap_import_export: Returns whether * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and * glamor_pixmap_from_fd() are supported. @@ -321,6 +319,10 @@ extern _X_EXPORT int glamor_create_gc(GCPtr gc); extern _X_EXPORT void glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable); +extern _X_EXPORT void glamor_destroy_gc(GCPtr gc); + +#define HAS_GLAMOR_DESTROY_GC 1 + 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); @@ -354,6 +356,17 @@ extern _X_EXPORT Bool glamor_copy_n_to_n_nf(DrawablePtr src, 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, diff --git a/xserver/glamor/glamor_copy.c b/xserver/glamor/glamor_copy.c new file mode 100644 index 000000000..3320935f0 --- /dev/null +++ b/xserver/glamor/glamor_copy.c @@ -0,0 +1,747 @@ +/* + * 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 "glamor_priv.h" +#include "glamor_transfer.h" +#include "glamor_prepare.h" +#include "glamor_transform.h" + +struct copy_args { + PixmapPtr src_pixmap; + glamor_pixmap_fbo *src; + uint32_t bitplane; + int dx, dy; +}; + +static Bool +use_copyarea(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg) +{ + struct copy_args *args = arg; + glamor_pixmap_fbo *src = args->src; + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, src->tex); + + glUniform2f(prog->fill_offset_uniform, args->dx, args->dy); + glUniform2f(prog->fill_size_uniform, src->width, src->height); + + return TRUE; +} + +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"), + .fs_exec = " gl_FragColor = texture2D(sampler, fill_pos);\n", + .locations = glamor_program_location_fill, + .use = use_copyarea, +}; + +/* + * Configure the copy plane program for the current operation + */ + +static Bool +use_copyplane(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg) +{ + struct copy_args *args = arg; + glamor_pixmap_fbo *src = args->src; + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, src->tex); + + glUniform2f(prog->fill_offset_uniform, args->dx, args->dy); + glUniform2f(prog->fill_size_uniform, src->width, src->height); + + glamor_set_color(dst, gc->fgPixel, prog->fg_uniform); + glamor_set_color(dst, gc->bgPixel, prog->bg_uniform); + + /* XXX handle 2 10 10 10 and 1555 formats; presumably the pixmap private knows this? */ + switch (args->src_pixmap->drawable.depth) { + case 24: + glUniform4ui(prog->bitplane_uniform, + (args->bitplane >> 16) & 0xff, + (args->bitplane >> 8) & 0xff, + (args->bitplane ) & 0xff, + 0); + + glUniform4f(prog->bitmul_uniform, 0xff, 0xff, 0xff, 0); + break; + case 32: + glUniform4ui(prog->bitplane_uniform, + (args->bitplane >> 16) & 0xff, + (args->bitplane >> 8) & 0xff, + (args->bitplane ) & 0xff, + (args->bitplane >> 24) & 0xff); + + glUniform4f(prog->bitmul_uniform, 0xff, 0xff, 0xff, 0xff); + break; + case 16: + glUniform4ui(prog->bitplane_uniform, + (args->bitplane >> 11) & 0x1f, + (args->bitplane >> 5) & 0x3f, + (args->bitplane ) & 0x1f, + 0); + + glUniform4f(prog->bitmul_uniform, 0x1f, 0x3f, 0x1f, 0); + break; + case 15: + glUniform4ui(prog->bitplane_uniform, + (args->bitplane >> 10) & 0x1f, + (args->bitplane >> 5) & 0x1f, + (args->bitplane ) & 0x1f, + 0); + + glUniform4f(prog->bitmul_uniform, 0x1f, 0x1f, 0x1f, 0); + break; + case 8: + glUniform4ui(prog->bitplane_uniform, + 0, 0, 0, args->bitplane); + glUniform4f(prog->bitmul_uniform, 0, 0, 0, 0xff); + break; + case 1: + glUniform4ui(prog->bitplane_uniform, + 0, 0, 0, args->bitplane); + glUniform4f(prog->bitmul_uniform, 0, 0, 0, 0xff); + break; + } + + return TRUE; +} + +static const glamor_facet glamor_facet_copyplane = { + "copy_plane", + .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"), + .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, + .use = use_copyplane, +}; + +/* + * When all else fails, pull the bits out of the GPU and do the + * operation with fb + */ + +static void +glamor_copy_bail(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW) && glamor_prepare_access(src, GLAMOR_ACCESS_RO)) { + if (bitplane) { + if (src->bitsPerPixel > 1) + fbCopyNto1(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + else + fbCopy1toN(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + } else { + fbCopyNtoN(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + } + } + glamor_finish_access(dst); + glamor_finish_access(src); +} + +/** + * Implements CopyPlane and CopyArea from the GPU to the GPU by using + * the source as a texture and painting that into the destination. + * + * This requires that source and dest are different textures, or that + * (if the copy area doesn't overlap), GL_NV_texture_barrier is used + * to ensure that the caches are flushed at the right times. + */ +static Bool +glamor_copy_cpu_fbo(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + ScreenPtr screen = dst->pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); + FbBits *src_bits; + FbStride src_stride; + int src_bpp; + int src_xoff, src_yoff; + int dst_xoff, dst_yoff; + + if (gc && gc->alu != GXcopy) + goto bail; + + if (gc && !glamor_pm_is_solid(dst, gc->planemask)) + goto bail; + + glamor_make_current(glamor_priv); + glamor_prepare_access(src, GLAMOR_ACCESS_RO); + + glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff); + + fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); + + glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, + dst_xoff, dst_yoff, + (uint8_t *) src_bits, src_stride * sizeof (FbBits)); + glamor_finish_access(src); + + return TRUE; + +bail: + return FALSE; +} + +/** + * Implements CopyArea from the GPU to the CPU using glReadPixels from the + * source FBO. + */ +static Bool +glamor_copy_fbo_cpu(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + ScreenPtr screen = dst->pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); + FbBits *dst_bits; + FbStride dst_stride; + int dst_bpp; + int src_xoff, src_yoff; + int dst_xoff, dst_yoff; + + if (gc && gc->alu != GXcopy) + goto bail; + + if (gc && !glamor_pm_is_solid(dst, gc->planemask)) + goto bail; + + glamor_make_current(glamor_priv); + glamor_prepare_access(dst, GLAMOR_ACCESS_RW); + + glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff); + + fbGetDrawable(dst, dst_bits, dst_stride, dst_bpp, dst_xoff, dst_yoff); + + glamor_download_boxes(src_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, + dst_xoff, dst_yoff, + (uint8_t *) dst_bits, dst_stride * sizeof (FbBits)); + glamor_finish_access(dst); + + return TRUE; + +bail: + return FALSE; +} + +/* + * Copy from GPU to GPU by using the source + * as a texture and painting that into the destination + */ + +static Bool +glamor_copy_fbo_fbo_draw(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + ScreenPtr screen = dst->pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + PixmapPtr src_pixmap = glamor_get_drawable_pixmap(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 dst_off_x, dst_off_y; + int src_off_x, src_off_y; + GLshort *v; + char *vbo_offset; + 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)) + goto bail_ctx; + + if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) + goto bail_ctx; + + if (bitplane) { + prog = &glamor_priv->copy_plane_prog; + copy_facet = &glamor_facet_copyplane; + } else { + prog = &glamor_priv->copy_area_prog; + copy_facet = &glamor_facet_copyarea; + } + + if (prog->failed) + goto bail_ctx; + + if (!prog->prog) { + if (!glamor_build_program(screen, prog, + copy_facet, NULL)) + goto bail_ctx; + } + + args.src_pixmap = src_pixmap; + args.bitplane = bitplane; + + /* Set up the vertex buffers for the points */ + + v = glamor_get_vbo_space(dst->pScreen, nbox * 8 * sizeof (int16_t), &vbo_offset); + + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, + 2 * sizeof (GLshort), vbo_offset); + + for (n = 0; n < nbox; n++) { + v[0] = box->x1; v[1] = box->y1; + v[2] = box->x1; v[3] = box->y2; + v[4] = box->x2; v[5] = box->y2; + v[6] = box->x2; v[7] = box->y1; + v += 8; + box++; + } + + glamor_put_vbo_space(screen); + + 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); + + 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); + + 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); + + 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); + } + } + } + if (set_scissor) + glDisable(GL_SCISSOR_TEST); + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); + + glDisable(GL_COLOR_LOGIC_OP); + return TRUE; + +bail_ctx: + glDisable(GL_COLOR_LOGIC_OP); + return FALSE; +} + +/** + * Copies from the GPU to the GPU using a temporary pixmap in between, + * to correctly handle overlapping copies. + */ + +static Bool +glamor_copy_fbo_fbo_temp(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + 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; + BoxPtr tmp_box; + + if (nbox == 0) + return TRUE; + + /* Sanity check state to avoid getting halfway through and bailing + * at the last second. Might be nice to have checks that didn't + * involve setting state. + */ + glamor_make_current(glamor_priv); + + if (gc && !glamor_set_planemask(dst_pixmap, 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 + */ + bounds = box[0]; + for (n = 1; n < nbox; n++) { + bounds.x1 = min(bounds.x1, box[n].x1); + bounds.x2 = max(bounds.x2, box[n].x2); + bounds.y1 = min(bounds.y1, box[n].y1); + bounds.y2 = max(bounds.y2, box[n].y2); + } + + /* Allocate a suitable temporary pixmap + */ + tmp_pixmap = glamor_create_pixmap(screen, + bounds.x2 - bounds.x1, + bounds.y2 - bounds.y1, + src->depth, 0); + if (!tmp_pixmap) + goto bail; + + tmp_box = calloc(nbox, sizeof (BoxRec)); + if (!tmp_box) + goto bail_pixmap; + + /* Convert destination boxes into tmp pixmap boxes + */ + for (n = 0; n < nbox; n++) { + tmp_box[n].x1 = box[n].x1 - bounds.x1; + tmp_box[n].x2 = box[n].x2 - bounds.x1; + tmp_box[n].y1 = box[n].y1 - bounds.y1; + tmp_box[n].y2 = box[n].y2 - bounds.y1; + } + + if (!glamor_copy_fbo_fbo_draw(src, + &tmp_pixmap->drawable, + NULL, + tmp_box, + nbox, + dx + bounds.x1, + dy + bounds.y1, + FALSE, FALSE, + 0, NULL)) + goto bail_box; + + if (!glamor_copy_fbo_fbo_draw(&tmp_pixmap->drawable, + dst, + gc, + box, + nbox, + -bounds.x1, + -bounds.y1, + FALSE, FALSE, + bitplane, closure)) + goto bail_box; + + free(tmp_box); + + glamor_destroy_pixmap(tmp_pixmap); + + return TRUE; +bail_box: + free(tmp_box); +bail_pixmap: + glamor_destroy_pixmap(tmp_pixmap); +bail: + return FALSE; + +bail_ctx: + glDisable(GL_COLOR_LOGIC_OP); + return FALSE; +} + +/** + * Returns TRUE if the copy has to be implemented with + * glamor_copy_fbo_fbo_temp() instead of glamor_copy_fbo_fbo(). + * + * If the src and dst are in the same pixmap, then glamor_copy_fbo_fbo()'s + * sampling would give undefined results (since the same texture would be + * bound as an FBO destination and as a texture source). However, if we + * have GL_NV_texture_barrier, we can take advantage of the exception it + * added: + * + * "- If a texel has been written, then in order to safely read the result + * a texel fetch must be in a subsequent Draw separated by the command + * + * void TextureBarrierNV(void); + * + * TextureBarrierNV() will guarantee that writes have completed and caches + * have been invalidated before subsequent Draws are executed." + */ +static Bool +glamor_copy_needs_temp(DrawablePtr src, + DrawablePtr dst, + BoxPtr box, + int nbox, + int dx, + int dy) +{ + PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); + PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); + ScreenPtr screen = dst->pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + int n; + int dst_off_x, dst_off_y; + int src_off_x, src_off_y; + BoxRec bounds; + + if (src_pixmap != dst_pixmap) + return FALSE; + + if (nbox == 0) + return FALSE; + + if (!glamor_priv->has_nv_texture_barrier) + return TRUE; + + glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y); + glamor_get_drawable_deltas(dst, dst_pixmap, &dst_off_x, &dst_off_y); + + bounds = box[0]; + for (n = 1; n < nbox; n++) { + bounds.x1 = min(bounds.x1, box[n].x1); + bounds.y1 = min(bounds.y1, box[n].y1); + + bounds.x2 = max(bounds.x2, box[n].x2); + bounds.y2 = max(bounds.y2, box[n].y2); + } + + /* Check to see if the pixmap-relative boxes overlap in both X and Y, + * in which case we can't rely on NV_texture_barrier and must + * make a temporary copy + * + * dst.x1 < src.x2 && + * src.x1 < dst.x2 && + * + * dst.y1 < src.y2 && + * src.y1 < dst.y2 + */ + if (bounds.x1 + dst_off_x < bounds.x2 + dx + src_off_x && + bounds.x1 + dx + src_off_x < bounds.x2 + dst_off_x && + + bounds.y1 + dst_off_y < bounds.y2 + dy + src_off_y && + bounds.y1 + dy + src_off_y < bounds.y2 + dst_off_y) { + return TRUE; + } + + glTextureBarrierNV(); + + return FALSE; +} + +static Bool +glamor_copy_gl(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) +{ + PixmapPtr src_pixmap = glamor_get_drawable_pixmap(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); + + if (GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_priv)) { + if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv)) { + if (glamor_copy_needs_temp(src, dst, box, nbox, dx, dy)) + return glamor_copy_fbo_fbo_temp(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + else + return glamor_copy_fbo_fbo_draw(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + } + if (bitplane == 0) + return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + } else if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv) && + dst_priv->type != GLAMOR_DRM_ONLY && + bitplane == 0) { + return glamor_copy_fbo_cpu(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); + } + return FALSE; +} + +void +glamor_copy(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; + glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); +} + +RegionPtr +glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, + int srcx, int srcy, int width, int height, int dstx, int dsty) +{ + return miDoCopy(src, dst, gc, + srcx, srcy, width, height, + dstx, dsty, glamor_copy, 0, NULL); +} + +RegionPtr +glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, + int srcx, int srcy, int width, int height, int dstx, int dsty, + unsigned long bitplane) +{ + if ((bitplane & FbFullMask(src->depth)) == 0) + return miHandleExposures(src, dst, gc, + srcx, srcy, width, height, dstx, dsty); + return miDoCopy(src, dst, gc, + srcx, srcy, width, height, + dstx, dsty, glamor_copy, bitplane, NULL); +} + +void +glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region) +{ + PixmapPtr pixmap = glamor_get_drawable_pixmap(&window->drawable); + DrawablePtr drawable = &pixmap->drawable; + RegionRec dst_region; + int dx, dy; + + dx = old_origin.x - window->drawable.x; + dy = old_origin.y - window->drawable.y; + RegionTranslate(src_region, -dx, -dy); + + RegionNull(&dst_region); + + RegionIntersect(&dst_region, &window->borderClip, src_region); + +#ifdef COMPOSITE + if (pixmap->screen_x || pixmap->screen_y) + RegionTranslate(&dst_region, -pixmap->screen_x, -pixmap->screen_y); +#endif + + miCopyRegion(drawable, drawable, + 0, &dst_region, dx, dy, glamor_copy, 0, 0); + + 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_copyarea.c b/xserver/glamor/glamor_copyarea.c deleted file mode 100644 index e1988225f..000000000 --- a/xserver/glamor/glamor_copyarea.c +++ /dev/null @@ -1,626 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * Copyright © 1998 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Eric Anholt - * Zhigang Gong - */ - -#include "glamor_priv.h" - -/** @file glamor_copyarea.c - * - * GC CopyArea implementation - */ -static Bool -glamor_copy_n_to_n_fbo_blit(DrawablePtr src, - DrawablePtr dst, - GCPtr gc, BoxPtr box, int nbox, int dx, int dy) -{ - ScreenPtr screen = dst->pScreen; - PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); - PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); - glamor_pixmap_private *src_pixmap_priv, *dst_pixmap_priv; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - int dst_x_off, dst_y_off, src_x_off, src_y_off, i; - int fbo_x_off, fbo_y_off; - int src_fbo_x_off, src_fbo_y_off; - - if (!glamor_priv->has_fbo_blit) { - glamor_delayed_fallback(screen, "no EXT_framebuffer_blit\n"); - return FALSE; - } - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); - dst_pixmap_priv = glamor_get_pixmap_private(dst_pixmap); - - if (gc) { - if (gc->alu != GXcopy) { - glamor_delayed_fallback(screen, "non-copy ALU\n"); - return FALSE; - } - } - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(src_pixmap_priv)) { - glamor_delayed_fallback(screen, "no src fbo\n"); - return FALSE; - } - - if (glamor_set_destination_pixmap(dst_pixmap)) - return FALSE; - - pixmap_priv_get_fbo_off(dst_pixmap_priv, &fbo_x_off, &fbo_y_off); - pixmap_priv_get_fbo_off(src_pixmap_priv, &src_fbo_x_off, &src_fbo_y_off); - - glamor_make_current(glamor_priv); - glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, src_pixmap_priv->base.fbo->fb); - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); - dst_x_off += fbo_x_off; - dst_y_off += fbo_y_off; - src_y_off += dy + src_fbo_y_off; - src_x_off += src_fbo_x_off; - - for (i = 0; i < nbox; i++) { - if (glamor_priv->yInverted) { - glBlitFramebuffer(box[i].x1 + dx + src_x_off, - box[i].y1 + src_y_off, - box[i].x2 + dx + src_x_off, - box[i].y2 + src_y_off, - box[i].x1 + dst_x_off, - box[i].y1 + dst_y_off, - box[i].x2 + dst_x_off, - box[i].y2 + dst_y_off, - GL_COLOR_BUFFER_BIT, GL_NEAREST); - } - else { - int flip_dst_y1 = - dst_pixmap->drawable.height - (box[i].y2 + dst_y_off); - int flip_dst_y2 = - dst_pixmap->drawable.height - (box[i].y1 + dst_y_off); - int flip_src_y1 = - src_pixmap->drawable.height - (box[i].y2 + src_y_off); - int flip_src_y2 = - src_pixmap->drawable.height - (box[i].y1 + src_y_off); - - glBlitFramebuffer(box[i].x1 + dx + src_x_off, - flip_src_y1, - box[i].x2 + dx + src_x_off, - flip_src_y2, - box[i].x1 + dst_x_off, - flip_dst_y1, - box[i].x2 + dst_x_off, - flip_dst_y2, - GL_COLOR_BUFFER_BIT, GL_NEAREST); - } - } - glamor_priv->state = BLIT_STATE; - return TRUE; -} - -static Bool -glamor_copy_n_to_n_textured(DrawablePtr src, - DrawablePtr dst, - GCPtr gc, BoxPtr box, int nbox, int dx, int dy) -{ - glamor_screen_private *glamor_priv = - glamor_get_screen_private(dst->pScreen); - PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); - PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst); - int i; - float vertices[8], texcoords[8]; - glamor_pixmap_private *src_pixmap_priv; - glamor_pixmap_private *dst_pixmap_priv; - int src_x_off, src_y_off, dst_x_off, dst_y_off; - enum glamor_pixmap_status src_status = GLAMOR_NONE; - GLfloat dst_xscale, dst_yscale, src_xscale, src_yscale; - - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); - dst_pixmap_priv = glamor_get_pixmap_private(dst_pixmap); - - if (src_pixmap_priv->base.gl_fbo == GLAMOR_FBO_UNATTACHED) { -#ifndef GLAMOR_PIXMAP_DYNAMIC_UPLOAD - glamor_delayed_fallback(dst->pScreen, "src has no fbo.\n"); - return FALSE; -#else - src_status = glamor_upload_pixmap_to_texture(src_pixmap); - if (src_status != GLAMOR_UPLOAD_DONE) - return FALSE; - - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); -#endif - } - - pixmap_priv_get_dest_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale); - pixmap_priv_get_scale(src_pixmap_priv, &src_xscale, &src_yscale); - - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - - glamor_make_current(glamor_priv); - - glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vertices); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - - glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); - dx += src_x_off; - dy += src_y_off; - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, src_pixmap_priv->base.fbo->tex); - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - } - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, - 2 * sizeof(float), texcoords); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glUseProgram(glamor_priv->finish_access_prog[0]); - glUniform1i(glamor_priv->finish_access_revert[0], REVERT_NONE); - glUniform1i(glamor_priv->finish_access_swap_rb[0], SWAP_NONE_UPLOADING); - - for (i = 0; i < nbox; i++) { - - glamor_set_normalize_vcoords(dst_pixmap_priv, - dst_xscale, dst_yscale, - box[i].x1 + dst_x_off, - box[i].y1 + dst_y_off, - box[i].x2 + dst_x_off, - box[i].y2 + dst_y_off, - glamor_priv->yInverted, vertices); - - glamor_set_normalize_tcoords(src_pixmap_priv, - src_xscale, - src_yscale, - box[i].x1 + dx, - box[i].y1 + dy, - box[i].x2 + dx, - box[i].y2 + dy, - glamor_priv->yInverted, texcoords); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - } - - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - /* The source texture is bound to a fbo, we have to flush it here. */ - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; - return TRUE; -} - -static Bool -__glamor_copy_n_to_n(DrawablePtr src, - DrawablePtr dst, - GCPtr gc, - BoxPtr box, - int nbox, - int dx, - int dy, - Bool reverse, - Bool upsidedown, Pixel bitplane, void *closure) -{ - PixmapPtr dst_pixmap, src_pixmap, temp_pixmap = NULL; - DrawablePtr temp_src = src; - glamor_pixmap_private *dst_pixmap_priv, *src_pixmap_priv; - glamor_screen_private *glamor_priv; - BoxRec bound; - ScreenPtr screen; - int temp_dx = dx; - int temp_dy = dy; - int src_x_off, src_y_off, dst_x_off, dst_y_off; - int i; - int overlaped = 0; - Bool ret = FALSE; - - dst_pixmap = glamor_get_drawable_pixmap(dst); - dst_pixmap_priv = glamor_get_pixmap_private(dst_pixmap); - src_pixmap = glamor_get_drawable_pixmap(src); - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); - screen = dst_pixmap->drawable.pScreen; - glamor_priv = glamor_get_screen_private(dst->pScreen); - glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); - - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - - if (src_pixmap_priv->base.fbo - && src_pixmap_priv->base.fbo->fb == dst_pixmap_priv->base.fbo->fb) { - int x_shift = abs(src_x_off - dx - dst_x_off); - int y_shift = abs(src_y_off - dy - dst_y_off); - - for (i = 0; i < nbox; i++) { - if (x_shift < abs(box[i].x2 - box[i].x1) - && y_shift < abs(box[i].y2 - box[i].y1)) { - overlaped = 1; - break; - } - } - } - DEBUGF("Copy %d %d %dx%d dx %d dy %d from %p to %p \n", - box[0].x1, box[0].y1, - box[0].x2 - box[0].x1, box[0].y2 - box[0].y1, - dx, dy, src_pixmap, dst_pixmap); - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && - !overlaped && - (glamor_priv->state != RENDER_STATE - || !src_pixmap_priv->base.gl_tex || !dst_pixmap_priv->base.gl_tex) - && glamor_copy_n_to_n_fbo_blit(src, dst, gc, box, nbox, dx, dy)) { - ret = TRUE; - goto done; - } - glamor_calculate_boxes_bound(&bound, box, nbox); - - /* Overlaped indicate the src and dst are the same pixmap. */ - if (overlaped || (!GLAMOR_PIXMAP_PRIV_HAS_FBO(src_pixmap_priv) - && (((bound.x2 - bound.x1) * (bound.y2 - bound.y1) - * 4 > - src_pixmap->drawable.width * - src_pixmap->drawable.height) - || !(glamor_check_fbo_size(glamor_priv, - src_pixmap->drawable.width, - src_pixmap->drawable. - height))))) { - - temp_pixmap = glamor_create_pixmap(screen, - bound.x2 - bound.x1, - bound.y2 - bound.y1, - src_pixmap->drawable.depth, - overlaped ? 0 : - GLAMOR_CREATE_PIXMAP_CPU); - assert(bound.x2 - bound.x1 <= glamor_priv->max_fbo_size); - assert(bound.y2 - bound.y1 <= glamor_priv->max_fbo_size); - if (!temp_pixmap) - goto done; - glamor_translate_boxes(box, nbox, -bound.x1, -bound.y1); - temp_src = &temp_pixmap->drawable; - - if (overlaped) - glamor_copy_n_to_n_textured(src, temp_src, gc, box, - nbox, - temp_dx + bound.x1, temp_dy + bound.y1); - else - fbCopyNtoN(src, temp_src, gc, box, nbox, - temp_dx + bound.x1, temp_dy + bound.y1, - reverse, upsidedown, bitplane, closure); - glamor_translate_boxes(box, nbox, bound.x1, bound.y1); - temp_dx = -bound.x1; - temp_dy = -bound.y1; - } - else { - temp_dx = dx; - temp_dy = dy; - temp_src = src; - } - - if (glamor_copy_n_to_n_textured - (temp_src, dst, gc, box, nbox, temp_dx, temp_dy)) { - ret = TRUE; - } - done: - if (temp_src != src) - glamor_destroy_pixmap(temp_pixmap); - return ret; -} - -static Bool -_glamor_copy_n_to_n(DrawablePtr src, - DrawablePtr dst, - GCPtr gc, - BoxPtr box, - int nbox, - int dx, - int dy, - Bool reverse, - Bool upsidedown, Pixel bitplane, - void *closure, Bool fallback) -{ - ScreenPtr screen = dst->pScreen; - PixmapPtr dst_pixmap, src_pixmap; - glamor_pixmap_private *dst_pixmap_priv, *src_pixmap_priv; - glamor_screen_private *glamor_priv; - BoxPtr extent; - RegionRec region; - int src_x_off, src_y_off, dst_x_off, dst_y_off; - Bool ok = FALSE; - int force_clip = 0; - - if (nbox == 0) - return TRUE; - dst_pixmap = glamor_get_drawable_pixmap(dst); - dst_pixmap_priv = glamor_get_pixmap_private(dst_pixmap); - src_pixmap = glamor_get_drawable_pixmap(src); - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); - - glamor_priv = glamor_get_screen_private(screen); - - DEBUGF("Copy %d %d %dx%d dx %d dy %d from %p to %p \n", - box[0].x1, box[0].y1, - box[0].x2 - box[0].x1, box[0].y2 - box[0].y1, - dx, dy, src_pixmap, dst_pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_pixmap_priv)) - goto fall_back; - - if (gc) { - if (!glamor_set_planemask(dst_pixmap, gc->planemask)) - goto fall_back; - glamor_make_current(glamor_priv); - if (!glamor_set_alu(screen, gc->alu)) { - goto fail_noregion; - } - } - - if (!src_pixmap_priv) { - glamor_set_pixmap_type(src_pixmap, GLAMOR_MEMORY); - src_pixmap_priv = glamor_get_pixmap_private(src_pixmap); - } - - glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); - glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - - RegionInitBoxes(®ion, box, nbox); - extent = RegionExtents(®ion); - - if (!glamor_check_fbo_size(glamor_priv, - extent->x2 - extent->x1, extent->y2 - extent->y1) - && (src_pixmap_priv->type == GLAMOR_MEMORY - || (src_pixmap_priv == dst_pixmap_priv))) { - force_clip = 1; - } - - if (force_clip || dst_pixmap_priv->type == GLAMOR_TEXTURE_LARGE - || src_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - glamor_pixmap_clipped_regions *clipped_dst_regions; - int n_dst_region, i, j; - PixmapPtr temp_source_pixmap; - glamor_pixmap_private *temp_source_priv = NULL; - - RegionTranslate(®ion, dst_x_off, dst_y_off); - if (!force_clip) - clipped_dst_regions = - glamor_compute_clipped_regions(dst_pixmap_priv, ®ion, - &n_dst_region, 0, reverse, - upsidedown); - else - clipped_dst_regions = - glamor_compute_clipped_regions_ext(dst_pixmap_priv, ®ion, - &n_dst_region, - glamor_priv->max_fbo_size, - glamor_priv->max_fbo_size, - reverse, upsidedown); - for (i = 0; i < n_dst_region; i++) { - int n_src_region; - glamor_pixmap_clipped_regions *clipped_src_regions; - BoxPtr current_boxes; - int n_current_boxes; - - SET_PIXMAP_FBO_CURRENT(dst_pixmap_priv, - clipped_dst_regions[i].block_idx); - - temp_source_pixmap = NULL; - if (src_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - RegionTranslate(clipped_dst_regions[i].region, - -dst_x_off + src_x_off + dx, - -dst_y_off + src_y_off + dy); - clipped_src_regions = - glamor_compute_clipped_regions(src_pixmap_priv, - clipped_dst_regions[i]. - region, &n_src_region, 0, - reverse, upsidedown); - DEBUGF("Source is large pixmap.\n"); - for (j = 0; j < n_src_region; j++) { - if (src_pixmap_priv != dst_pixmap_priv) - SET_PIXMAP_FBO_CURRENT(src_pixmap_priv, - clipped_src_regions[j]. - block_idx); - else if (src_pixmap_priv == dst_pixmap_priv && - clipped_src_regions[j].block_idx != - clipped_dst_regions[i].block_idx) { - /* source and the dest are the same, but need different block_idx. - * we create a empty pixmap and fill the required source fbo and box to - * it. It's a little hacky, but avoid extra copy. */ - temp_source_pixmap = - glamor_create_pixmap(src->pScreen, 0, 0, src->depth, - 0); - if (!temp_source_pixmap) { - ok = FALSE; - goto fail; - } - src->pScreen->ModifyPixmapHeader(temp_source_pixmap, - src_pixmap->drawable. - width, - src_pixmap->drawable. - height, 0, 0, - src_pixmap->devKind, - NULL); - temp_source_priv = - glamor_get_pixmap_private(temp_source_pixmap); - *temp_source_priv = *src_pixmap_priv; - temp_source_priv->large.box = - src_pixmap_priv->large. - box_array[clipped_src_regions[j].block_idx]; - temp_source_priv->base.fbo = - src_pixmap_priv->large. - fbo_array[clipped_src_regions[j].block_idx]; - temp_source_priv->base.pixmap = temp_source_pixmap; - } - assert(temp_source_pixmap || - !(src_pixmap_priv == dst_pixmap_priv && - (clipped_src_regions[j].block_idx != - clipped_dst_regions[i].block_idx))); - - RegionTranslate(clipped_src_regions[j].region, - -src_x_off - dx, -src_y_off - dy); - current_boxes = RegionRects(clipped_src_regions[j].region); - n_current_boxes = - RegionNumRects(clipped_src_regions[j].region); - DEBUGF("dst pixmap fbo idx %d src pixmap fbo idx %d \n", - clipped_dst_regions[i].block_idx, - clipped_src_regions[j].block_idx); - DEBUGF("Copy %d %d %d %d dx %d dy %d from %p to %p \n", - current_boxes[0].x1, current_boxes[0].y1, - current_boxes[0].x2, current_boxes[0].y2, dx, dy, - src_pixmap, dst_pixmap); - if (!temp_source_pixmap) - ok = __glamor_copy_n_to_n(src, dst, gc, current_boxes, - n_current_boxes, dx, dy, - reverse, upsidedown, bitplane, - closure); - else { - ok = __glamor_copy_n_to_n(&temp_source_pixmap->drawable, - dst, gc, current_boxes, - n_current_boxes, dx, dy, - reverse, upsidedown, bitplane, - closure); - temp_source_priv->type = GLAMOR_MEMORY; - temp_source_priv->base.fbo = NULL; - glamor_destroy_pixmap(temp_source_pixmap); - temp_source_pixmap = NULL; - } - - RegionDestroy(clipped_src_regions[j].region); - if (!ok) { - assert(0); - goto fail; - } - } - - if (n_src_region == 0) - ok = TRUE; - free(clipped_src_regions); - } - else { - RegionTranslate(clipped_dst_regions[i].region, - -dst_x_off, -dst_y_off); - current_boxes = RegionRects(clipped_dst_regions[i].region); - n_current_boxes = RegionNumRects(clipped_dst_regions[i].region); - - DEBUGF("dest pixmap fbo idx %d \n", - clipped_dst_regions[i].block_idx); - DEBUGF("Copy %d %d %d %d dx %d dy %d from %p to %p \n", - current_boxes[0].x1, current_boxes[0].y1, - current_boxes[0].x2, current_boxes[0].y2, - dx, dy, src_pixmap, dst_pixmap); - - ok = __glamor_copy_n_to_n(src, dst, gc, current_boxes, - n_current_boxes, dx, dy, reverse, - upsidedown, bitplane, closure); - - } - RegionDestroy(clipped_dst_regions[i].region); - } - if (n_dst_region == 0) - ok = TRUE; - free(clipped_dst_regions); - } - else { - ok = __glamor_copy_n_to_n(src, dst, gc, box, nbox, dx, dy, - reverse, upsidedown, bitplane, closure); - } - - fail: - RegionUninit(®ion); - fail_noregion: - glamor_make_current(glamor_priv); - glamor_set_alu(screen, GXcopy); - - if (ok) - return TRUE; - fall_back: - if (!fallback && glamor_ddx_fallback_check_pixmap(src) - && glamor_ddx_fallback_check_pixmap(dst)) - goto done; - - if (src_pixmap_priv->type == GLAMOR_DRM_ONLY - || dst_pixmap_priv->type == GLAMOR_DRM_ONLY) { - LogMessage(X_WARNING, - "Access a DRM only pixmap is not allowed within glamor.\n"); - return TRUE; - } - glamor_report_delayed_fallbacks(src->pScreen); - glamor_report_delayed_fallbacks(dst->pScreen); - - glamor_fallback("from %p to %p (%c,%c)\n", src, dst, - glamor_get_drawable_location(src), - glamor_get_drawable_location(dst)); - - if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW) && - glamor_prepare_access(src, GLAMOR_ACCESS_RO) && - glamor_prepare_access_gc(gc)) { - fbCopyNtoN(src, dst, gc, box, nbox, - dx, dy, reverse, upsidedown, bitplane, closure); - } - glamor_finish_access_gc(gc); - glamor_finish_access(src); - glamor_finish_access(dst); - ok = TRUE; - - done: - glamor_clear_delayed_fallbacks(src->pScreen); - glamor_clear_delayed_fallbacks(dst->pScreen); - return ok; -} - -RegionPtr -glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - RegionPtr region; - - region = miDoCopy(src, dst, gc, - srcx, srcy, width, height, - dstx, dsty, glamor_copy_n_to_n, 0, NULL); - - return region; -} - -void -glamor_copy_n_to_n(DrawablePtr src, - DrawablePtr dst, - GCPtr gc, - BoxPtr box, - int nbox, - int dx, - int dy, - Bool reverse, Bool upsidedown, Pixel bitplane, void *closure) -{ - _glamor_copy_n_to_n(src, dst, gc, box, nbox, dx, - dy, reverse, upsidedown, bitplane, closure, TRUE); -} - -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) -{ - return _glamor_copy_n_to_n(src, dst, gc, box, nbox, dx, - dy, reverse, upsidedown, bitplane, closure, - FALSE); -} diff --git a/xserver/glamor/glamor_copyplane.c b/xserver/glamor/glamor_copyplane.c deleted file mode 100644 index 2bd2de30d..000000000 --- a/xserver/glamor/glamor_copyplane.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * Copyright © 1998 Keith Packard - * - * 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: - * Zhigang Gong - * - */ - -#include "glamor_priv.h" - -static Bool -_glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty, - unsigned long bitPlane, RegionPtr *pRegion, Bool fallback) -{ - if (!fallback && glamor_ddx_fallback_check_gc(pGC) - && glamor_ddx_fallback_check_pixmap(pSrc) - && glamor_ddx_fallback_check_pixmap(pDst)) - goto fail; - - if (glamor_prepare_access(pDst, GLAMOR_ACCESS_RW) && - glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO) && - glamor_prepare_access_gc(pGC)) { - *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h, - dstx, dsty, bitPlane); - } - glamor_finish_access_gc(pGC); - glamor_finish_access(pSrc); - glamor_finish_access(pDst); - return TRUE; - - fail: - return FALSE; -} - -RegionPtr -glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty, - unsigned long bitPlane) -{ - RegionPtr ret; - - _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h, - dstx, dsty, bitPlane, &ret, TRUE); - return ret; -} - -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) -{ - return _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h, - dstx, dsty, bitPlane, pRegion, FALSE); -} diff --git a/xserver/glamor/glamor_copywindow.c b/xserver/glamor/glamor_copywindow.c deleted file mode 100644 index 1ced4b336..000000000 --- a/xserver/glamor/glamor_copywindow.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * Copyright © 1998 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "glamor_priv.h" - -/** @file glamor_copywindow.c - * - * Screen CopyWindow implementation. - */ - -void -glamor_copy_window(WindowPtr win, DDXPointRec old_origin, RegionPtr src_region) -{ - RegionRec dst_region; - int dx, dy; - PixmapPtr pixmap = win->drawable.pScreen->GetWindowPixmap(win); - - dx = old_origin.x - win->drawable.x; - dy = old_origin.y - win->drawable.y; - REGION_TRANSLATE(win->drawable.pScreen, src_region, -dx, -dy); - - REGION_INIT(win->drawable.pScreen, &dst_region, NullBox, 0); - - REGION_INTERSECT(win->drawable.pScreen, &dst_region, - &win->borderClip, src_region); -#ifdef COMPOSITE - if (pixmap->screen_x || pixmap->screen_y) - REGION_TRANSLATE(win->drawable.pScreen, &dst_region, - -pixmap->screen_x, -pixmap->screen_y); -#endif - - miCopyRegion(&pixmap->drawable, &pixmap->drawable, - NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0, NULL); - - REGION_UNINIT(win->drawable.pScreen, &dst_region); -} diff --git a/xserver/glamor/glamor_core.c b/xserver/glamor/glamor_core.c index b34943761..235a4baed 100644 --- a/xserver/glamor/glamor_core.c +++ b/xserver/glamor/glamor_core.c @@ -35,7 +35,7 @@ #include "glamor_priv.h" -const Bool +Bool glamor_get_drawable_location(const DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); @@ -114,27 +114,6 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) } } -Bool -glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) -{ - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (pixmap->devPrivate.ptr) { - /* Already mapped, nothing needs to be done. Note that we - * aren't allowing promotion from RO to RW, because it would - * require re-mapping the PBO. - */ - assert(!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) || - access == GLAMOR_ACCESS_RO || - pixmap_priv->base.map_access == GLAMOR_ACCESS_RW); - return TRUE; - } - pixmap_priv->base.map_access = access; - - return glamor_download_pixmap_to_cpu(pixmap, access); -} - /* * When downloading a unsupported color format to CPU memory, we need to shuffle the color elements and then use a supported @@ -313,102 +292,6 @@ glamor_fini_finish_access_shaders(ScreenPtr screen) glDeleteProgram(glamor_priv->finish_access_prog[1]); } -void -glamor_finish_access(DrawablePtr drawable) -{ - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - glamor_screen_private *glamor_priv = - glamor_get_screen_private(drawable->pScreen); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv)) - return; - - /* If we are doing a series of unmaps from a nested map, we're - * done. None of the callers do any rendering to maps after - * starting an unmap sequence, so we don't need to delay until the - * last nested unmap. - */ - if (!pixmap->devPrivate.ptr) - return; - - if (pixmap_priv->base.map_access == GLAMOR_ACCESS_RW) { - glamor_restore_pixmap_to_texture(pixmap); - } - - if (pixmap_priv->base.fbo->pbo != 0 && pixmap_priv->base.fbo->pbo_valid) { - assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); - - glamor_make_current(glamor_priv); - glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glDeleteBuffers(1, &pixmap_priv->base.fbo->pbo); - - pixmap_priv->base.fbo->pbo_valid = FALSE; - pixmap_priv->base.fbo->pbo = 0; - } - else { - free(pixmap->devPrivate.ptr); - } - - if (pixmap_priv->type == GLAMOR_TEXTURE_DRM) - pixmap->devKind = pixmap_priv->base.drm_stride; - - if (pixmap_priv->base.gl_fbo == GLAMOR_FBO_DOWNLOADED) - pixmap_priv->base.gl_fbo = GLAMOR_FBO_NORMAL; - - pixmap->devPrivate.ptr = NULL; -} - -/** - * Calls uxa_prepare_access with UXA_PREPARE_SRC for the tile, if that is the - * current fill style. - * - * Solid doesn't use an extra pixmap source, so we don't worry about them. - * Stippled/OpaqueStippled are 1bpp and can be in fb, so we should worry - * about them. - */ -Bool -glamor_prepare_access_gc(GCPtr gc) -{ - if (gc->stipple) { - if (!glamor_prepare_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO)) - return FALSE; - } - if (gc->fillStyle == FillTiled) { - if (!glamor_prepare_access(&gc->tile.pixmap->drawable, - GLAMOR_ACCESS_RO)) { - if (gc->stipple) - glamor_finish_access(&gc->stipple->drawable); - return FALSE; - } - } - return TRUE; -} - -/** - * Finishes access to the tile in the GC, if used. - */ -void -glamor_finish_access_gc(GCPtr gc) -{ - if (gc->fillStyle == FillTiled) - glamor_finish_access(&gc->tile.pixmap->drawable); - if (gc->stipple) - glamor_finish_access(&gc->stipple->drawable); -} - -Bool -glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple, - int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, - unsigned long fg_pixel, unsigned long bg_pixel, - int stipple_x, int stipple_y) -{ - glamor_fallback("stubbed out stipple depth %d\n", pixmap->drawable.depth); - return FALSE; -} - GCOps glamor_gc_ops = { .FillSpans = glamor_fill_spans, .SetSpans = glamor_set_spans, @@ -432,6 +315,58 @@ GCOps glamor_gc_ops = { .PushPixels = glamor_push_pixels, }; +/* + * When the stipple is changed or drawn to, invalidate any + * cached copy + */ +static void +glamor_invalidate_stipple(GCPtr gc) +{ + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + if (gc_priv->stipple) { + if (gc_priv->stipple_damage) + DamageUnregister(gc_priv->stipple_damage); + glamor_destroy_pixmap(gc_priv->stipple); + gc_priv->stipple = NULL; + } +} + +static void +glamor_stipple_damage_report(DamagePtr damage, RegionPtr region, + void *closure) +{ + GCPtr gc = closure; + + glamor_invalidate_stipple(gc); +} + +static void +glamor_stipple_damage_destroy(DamagePtr damage, void *closure) +{ + GCPtr gc = closure; + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + gc_priv->stipple_damage = NULL; + glamor_invalidate_stipple(gc); +} + +void +glamor_track_stipple(GCPtr gc) +{ + if (gc->stipple) { + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + if (!gc_priv->stipple_damage) + gc_priv->stipple_damage = DamageCreate(glamor_stipple_damage_report, + glamor_stipple_damage_destroy, + DamageReportNonEmpty, + TRUE, gc->pScreen, gc); + if (gc_priv->stipple_damage) + DamageRegister(&gc->stipple->drawable, gc_priv->stipple_damage); + } +} + /** * uxa_validate_gc() sets the ops to glamor's implementations, which may be * accelerated or may sync the card and fall back to fb. @@ -502,6 +437,9 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable) changes &= ~GCTile; } + if (changes & GCStipple) + glamor_invalidate_stipple(gc); + if (changes & GCStipple && gc->stipple) { /* We can't inline stipple handling like we do for GCTile because * it sets fbgc privates. @@ -515,14 +453,38 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable) fbValidateGC(gc, changes, drawable); } + if (changes & GCDashList) { + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + if (gc_priv->dash) { + glamor_destroy_pixmap(gc_priv->dash); + gc_priv->dash = NULL; + } + } + gc->ops = &glamor_gc_ops; } +void +glamor_destroy_gc(GCPtr gc) +{ + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + if (gc_priv->dash) { + glamor_destroy_pixmap(gc_priv->dash); + gc_priv->dash = NULL; + } + glamor_invalidate_stipple(gc); + if (gc_priv->stipple_damage) + DamageDestroy(gc_priv->stipple_damage); + miDestroyGC(gc); +} + static GCFuncs glamor_gc_funcs = { glamor_validate_gc, miChangeGC, miCopyGC, - miDestroyGC, + glamor_destroy_gc, miChangeClip, miDestroyClip, miCopyClip @@ -535,6 +497,10 @@ static GCFuncs glamor_gc_funcs = { int glamor_create_gc(GCPtr gc) { + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + + gc_priv->dash = NULL; + gc_priv->stipple = NULL; if (!fbCreateGC(gc)) return FALSE; diff --git a/xserver/glamor/glamor_dash.c b/xserver/glamor/glamor_dash.c new file mode 100644 index 000000000..e8f60fa10 --- /dev/null +++ b/xserver/glamor/glamor_dash.c @@ -0,0 +1,370 @@ +/* + * 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 "glamor_priv.h" +#include "glamor_program.h" +#include "glamor_transform.h" +#include "glamor_transfer.h" +#include "glamor_prepare.h" + +static const char dash_vs_vars[] = + "attribute vec3 primitive;\n" + "varying float dash_offset;\n"; + +static const char dash_vs_exec[] = + " dash_offset = primitive.z / dash_length;\n" + GLAMOR_POS(gl_Position, primitive.xy); + +static const char dash_fs_vars[] = + "varying float dash_offset;\n"; + +static const char on_off_fs_exec[] = + " float pattern = texture2D(dash, vec2(dash_offset, 0.5)).w;\n" + " if (pattern == 0.0)\n" + " discard;\n"; + +/* XXX deal with stippled double dashed lines once we have stippling support */ +static const char double_fs_exec[] = + " float pattern = texture2D(dash, vec2(dash_offset, 0.5)).w;\n" + " if (pattern == 0.0)\n" + " gl_FragColor = bg;\n" + " else\n" + " gl_FragColor = fg;\n"; + + +static const glamor_facet glamor_facet_on_off_dash_lines = { + .version = 130, + .name = "poly_lines_on_off_dash", + .vs_vars = dash_vs_vars, + .vs_exec = dash_vs_exec, + .fs_vars = dash_fs_vars, + .fs_exec = on_off_fs_exec, + .locations = glamor_program_location_dash, +}; + +static const glamor_facet glamor_facet_double_dash_lines = { + .version = 130, + .name = "poly_lines_double_dash", + .vs_vars = dash_vs_vars, + .vs_exec = dash_vs_exec, + .fs_vars = dash_fs_vars, + .fs_exec = double_fs_exec, + .locations = (glamor_program_location_dash| + glamor_program_location_fg| + glamor_program_location_bg), +}; + +static PixmapPtr +glamor_get_dash_pixmap(GCPtr gc) +{ + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + ScreenPtr screen = gc->pScreen; + PixmapPtr pixmap; + int offset; + int d; + uint32_t pixel; + GCPtr scratch_gc; + + if (gc_priv->dash) + return gc_priv->dash; + + offset = 0; + for (d = 0; d < gc->numInDashList; d++) + offset += gc->dash[d]; + + pixmap = glamor_create_pixmap(screen, offset, 1, 8, 0); + if (!pixmap) + goto bail; + + scratch_gc = GetScratchGC(8, screen); + if (!scratch_gc) + goto bail_pixmap; + + pixel = 0xffffffff; + offset = 0; + for (d = 0; d < gc->numInDashList; d++) { + xRectangle rect; + ChangeGCVal changes; + + changes.val = pixel; + (void) ChangeGC(NullClient, scratch_gc, + GCForeground, &changes); + ValidateGC(&pixmap->drawable, scratch_gc); + rect.x = offset; + rect.y = 0; + rect.width = gc->dash[d]; + rect.height = 1; + scratch_gc->ops->PolyFillRect (&pixmap->drawable, scratch_gc, 1, &rect); + offset += gc->dash[d]; + pixel = ~pixel; + } + FreeScratchGC(scratch_gc); + + gc_priv->dash = pixmap; + return pixmap; + +bail_pixmap: + glamor_destroy_pixmap(pixmap); +bail: + return NULL; +} + +static glamor_program * +glamor_dash_setup(DrawablePtr drawable, GCPtr gc) +{ + 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); + PixmapPtr dash_pixmap; + glamor_pixmap_private *dash_priv; + glamor_program *prog; + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + goto bail; + + if (gc->lineWidth != 0) + goto bail; + + dash_pixmap = glamor_get_dash_pixmap(gc); + dash_priv = glamor_get_pixmap_private(pixmap); + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dash_priv)) + goto bail; + + glamor_make_current(glamor_priv); + + switch (gc->lineStyle) { + case LineOnOffDash: + prog = glamor_use_program_fill(pixmap, gc, + &glamor_priv->on_off_dash_line_progs, + &glamor_facet_on_off_dash_lines); + if (!prog) + goto bail_ctx; + break; + case LineDoubleDash: + if (gc->fillStyle != FillSolid) + goto bail_ctx; + + 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; + } + + if (!glamor_use_program(pixmap, gc, prog, NULL)) + goto bail_ctx; + + glamor_set_color(pixmap, gc->fgPixel, prog->fg_uniform); + glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform); + break; + + default: + goto bail_ctx; + } + + + /* Set the dash pattern as texture 1 */ + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, dash_priv->base.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; +} + +static void +glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog, + int n, GLenum mode) +{ + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); + glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); + int box_x, box_y; + int off_x, off_y; + + glEnable(GL_SCISSOR_TEST); + + glamor_pixmap_loop(pixmap_priv, box_x, box_y) { + 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); + + while (nbox--) { + glScissor(box->x1 + off_x, + box->y1 + off_y, + box->x2 - box->x1, + box->y2 - box->y1); + box++; + glDrawArrays(mode, 0, n); + } + } + + glDisable(GL_SCISSOR_TEST); + glDisable(GL_COLOR_LOGIC_OP); + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); +} + +static int +glamor_line_length(short x1, short y1, short x2, short y2) +{ + return max(abs(x2 - x1), abs(y2 - y1)); +} + +Bool +glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points) +{ + ScreenPtr screen = drawable->pScreen; + glamor_program *prog; + short *v; + char *vbo_offset; + int add_last; + int dash_pos; + int prev_x, prev_y; + int i; + + if (n < 2) + return TRUE; + + if (!(prog = glamor_dash_setup(drawable, gc))) + return FALSE; + + add_last = 0; + if (gc->capStyle != CapNotLast) + add_last = 1; + + /* Set up the vertex buffers for the points */ + + v = glamor_get_vbo_space(drawable->pScreen, + (n + add_last) * 3 * sizeof (short), + &vbo_offset); + + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribPointer(GLAMOR_VERTEX_POS, 3, GL_SHORT, GL_FALSE, + 3 * sizeof (short), vbo_offset); + + dash_pos = gc->dashOffset; + prev_x = prev_y = 0; + for (i = 0; i < n; i++) { + int this_x = points[i].x; + int this_y = points[i].y; + if (i) { + if (mode == CoordModePrevious) { + this_x += prev_x; + this_y += prev_y; + } + dash_pos += glamor_line_length(prev_x, prev_y, + this_x, this_y); + } + v[0] = prev_x = this_x; + v[1] = prev_y = this_y; + v[2] = dash_pos; + v += 3; + } + + if (add_last) { + v[0] = prev_x + 1; + v[1] = prev_y; + v[2] = dash_pos + 1; + } + + glamor_put_vbo_space(screen); + + glamor_dash_loop(drawable, gc, prog, n + add_last, GL_LINE_STRIP); + + return TRUE; +} + +static short * +glamor_add_segment(short *v, short x1, short y1, short x2, short y2, + int dash_start, int dash_end) +{ + v[0] = x1; + v[1] = y1; + v[2] = dash_start; + + v[3] = x2; + v[4] = y2; + v[5] = dash_end; + return v + 6; +} + +Bool +glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs) +{ + ScreenPtr screen = drawable->pScreen; + glamor_program *prog; + short *v; + char *vbo_offset; + int dash_start = gc->dashOffset; + int add_last; + int i; + + if (!(prog = glamor_dash_setup(drawable, gc))) + return FALSE; + + add_last = 0; + if (gc->capStyle != CapNotLast) + add_last = 1; + + /* Set up the vertex buffers for the points */ + + v = glamor_get_vbo_space(drawable->pScreen, + (nseg< #include #include #include @@ -70,8 +69,6 @@ struct glamor_egl_screen_private { CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; int fd; - EGLImageKHR front_image; - PixmapPtr *back_pixmap; int cpp; #ifdef GLAMOR_HAS_GBM struct gbm_device *gbm; @@ -177,6 +174,18 @@ glamor_create_texture_from_image(ScreenPtr screen, return TRUE; } +void * +glamor_egl_get_gbm_device(ScreenPtr screen) +{ +#ifdef GLAMOR_HAS_GBM + struct glamor_egl_screen_private *glamor_egl = + glamor_egl_get_screen_private(xf86ScreenToScrn(screen)); + return glamor_egl->gbm; +#else + return NULL; +#endif +} + unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) { @@ -221,13 +230,9 @@ Bool glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_pixmap_private *pixmap_priv; - struct glamor_egl_screen_private *glamor_egl; PixmapPtr screen_pixmap; - glamor_egl = glamor_egl_get_screen_private(scrn); screen_pixmap = screen->GetScreenPixmap(screen); - pixmap_priv = glamor_get_pixmap_private(screen_pixmap); if (!glamor_egl_create_textured_pixmap(screen_pixmap, handle, stride)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -235,8 +240,7 @@ glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) return FALSE; } - glamor_egl->front_image = pixmap_priv->base.image; - glamor_set_screen_pixmap(screen_pixmap, glamor_egl->back_pixmap); + glamor_set_screen_pixmap(screen_pixmap, NULL); return TRUE; } @@ -245,15 +249,7 @@ glamor_egl_create_textured_screen_ext(ScreenPtr screen, int handle, int stride, PixmapPtr *back_pixmap) { - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl; - - glamor_egl = glamor_egl_get_screen_private(scrn); - - glamor_egl->back_pixmap = back_pixmap; - if (!glamor_egl_create_textured_screen(screen, handle, stride)) - return FALSE; - return TRUE; + return glamor_egl_create_textured_screen(screen, handle, stride); } static Bool @@ -269,6 +265,24 @@ glamor_egl_check_has_gem(int fd) return FALSE; } +static void +glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image) +{ + struct glamor_pixmap_private *pixmap_priv = + glamor_get_pixmap_private(pixmap); + EGLImageKHR old; + + old = pixmap_priv->base.image; + if (old) { + ScreenPtr screen = pixmap->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); + + eglDestroyImageKHR(glamor_egl->display, old); + } + pixmap_priv->base.image = image; +} + Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) { @@ -276,8 +290,6 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - struct glamor_pixmap_private *pixmap_priv = - glamor_get_pixmap_private(pixmap); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; GLuint texture; @@ -312,7 +324,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); - pixmap_priv->base.image = image; + glamor_egl_set_pixmap_image(pixmap, image); ret = TRUE; done: @@ -326,8 +338,6 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); struct glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - struct glamor_pixmap_private *pixmap_priv = - glamor_get_pixmap_private(pixmap); struct glamor_egl_screen_private *glamor_egl; EGLImageKHR image; GLuint texture; @@ -347,7 +357,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); - pixmap_priv->base.image = image; + glamor_egl_set_pixmap_image(pixmap, image); ret = TRUE; done: @@ -420,8 +430,8 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, if (image == EGL_NO_IMAGE_KHR) goto failure; - pixmap_priv->base.image = image; glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); + glamor_egl_set_pixmap_image(pixmap, image); } bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0); @@ -520,16 +530,17 @@ glamor_pixmap_from_fd(ScreenPtr screen, #endif } -static void -_glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) +void +glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); - struct glamor_egl_screen_private *glamor_egl = - glamor_egl_get_screen_private(scrn); struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - if (pixmap_priv->base.image) { + if (pixmap_priv && pixmap_priv->base.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.*/ @@ -542,9 +553,6 @@ _glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) { - ScrnInfoPtr scrn = xf86ScreenToScrn(front->drawable.pScreen); - struct glamor_egl_screen_private *glamor_egl = - glamor_egl_get_screen_private(scrn); EGLImageKHR temp; struct glamor_pixmap_private *front_priv = glamor_get_pixmap_private(front); @@ -559,15 +567,12 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_set_pixmap_type(front, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); - glamor_egl->front_image = front_priv->base.image; } void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) { - if (pixmap->refcnt == 1) - _glamor_egl_destroy_pixmap_image(pixmap); glamor_destroy_textured_pixmap(pixmap); } @@ -584,23 +589,15 @@ glamor_egl_close_screen(ScreenPtr screen) screen_pixmap = screen->GetScreenPixmap(screen); pixmap_priv = glamor_get_pixmap_private(screen_pixmap); - eglDestroyImageKHR(glamor_egl->display, glamor_egl->front_image); + eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image); pixmap_priv->base.image = NULL; - glamor_egl->front_image = NULL; - - if (glamor_egl->back_pixmap && *glamor_egl->back_pixmap) { - pixmap_priv = glamor_get_pixmap_private(*glamor_egl->back_pixmap); - if (pixmap_priv->base.image) { - eglDestroyImageKHR(glamor_egl->display, pixmap_priv->base.image); - pixmap_priv->base.image = NULL; - } - } screen->CloseScreen = glamor_egl->saved_close_screen; return screen->CloseScreen(screen); } +#ifdef DRI3 static int glamor_dri3_open_client(ClientPtr client, ScreenPtr screen, @@ -657,12 +654,12 @@ static dri3_screen_info_rec glamor_dri3_info = { .pixmap_from_fd = glamor_pixmap_from_fd, .fd_from_pixmap = glamor_fd_from_pixmap, }; +#endif /* DRI3 */ void glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); @@ -674,7 +671,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) glamor_ctx->make_current = glamor_egl_make_current; +#ifdef DRI3 if (glamor_egl->dri3_capable) { + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); /* Tell the core that we have the interfaces for import/export * of pixmaps. */ @@ -697,6 +696,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) } } } +#endif } static void diff --git a/xserver/glamor/glamor_egl_stubs.c b/xserver/glamor/glamor_egl_stubs.c index 028d1cc05..a93f62dcb 100644 --- a/xserver/glamor/glamor_egl_stubs.c +++ b/xserver/glamor/glamor_egl_stubs.c @@ -36,7 +36,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) } void -glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) +glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) { } diff --git a/xserver/glamor/glamor_eglmodule.c b/xserver/glamor/glamor_eglmodule.c index d7e183649..dd4664b22 100644 --- a/xserver/glamor/glamor_eglmodule.c +++ b/xserver/glamor/glamor_eglmodule.c @@ -29,7 +29,6 @@ #include "dix-config.h" -#include #include #define GLAMOR_FOR_XORG #include diff --git a/xserver/glamor/glamor_fbo.c b/xserver/glamor/glamor_fbo.c index 090dfd8e7..ad4dfe656 100644 --- a/xserver/glamor/glamor_fbo.c +++ b/xserver/glamor/glamor_fbo.c @@ -126,7 +126,7 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, #endif } -void +static void glamor_purge_fbo(glamor_pixmap_fbo *fbo) { glamor_make_current(fbo->glamor_priv); @@ -153,7 +153,7 @@ glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo) #else n_format = cache_format(fbo->format); - if (fbo->fb == 0 || n_format == -1 + 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); @@ -237,6 +237,7 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, fbo->tex = tex; fbo->width = w; fbo->height = h; + fbo->external = FALSE; fbo->format = format; fbo->glamor_priv = glamor_priv; @@ -347,7 +348,6 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, glamor_make_current(glamor_priv); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); 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, @@ -539,8 +539,6 @@ glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv) if (fbo) glamor_destroy_fbo(fbo); } - - free(priv); } Bool diff --git a/xserver/glamor/glamor_fill.c b/xserver/glamor/glamor_fill.c deleted file mode 100644 index 073904d2a..000000000 --- a/xserver/glamor/glamor_fill.c +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright © 2008 Intel Corporation - * Copyright © 1998 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: - * Eric Anholt - * Zhigang Gong - */ - -#include "glamor_priv.h" - -/** @file glamor_fill.c - * - * GC fill implementation, based loosely on fb_fill.c - */ - -/** - * Fills the given rectangle of a drawable with the GC's fill style. - */ -Bool -glamor_fill(DrawablePtr drawable, - GCPtr gc, int x, int y, int width, int height, Bool fallback) -{ - PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable); - int off_x, off_y; - PixmapPtr sub_pixmap = NULL; - glamor_access_t sub_pixmap_access; - DrawablePtr saved_drawable = NULL; - int saved_x = x, saved_y = y; - - glamor_get_drawable_deltas(drawable, dst_pixmap, &off_x, &off_y); - - switch (gc->fillStyle) { - case FillSolid: - if (!glamor_solid(dst_pixmap, - x + off_x, - y + off_y, - width, height, gc->alu, gc->planemask, gc->fgPixel)) - goto fail; - break; - case FillStippled: - case FillOpaqueStippled: - if (!glamor_stipple(dst_pixmap, - gc->stipple, - x + off_x, - y + off_y, - width, - height, - gc->alu, - gc->planemask, - gc->fgPixel, - gc->bgPixel, gc->patOrg.x, gc->patOrg.y)) - goto fail; - break; - case FillTiled: - if (!glamor_tile(dst_pixmap, - gc->tile.pixmap, - x + off_x, - y + off_y, - width, - height, - gc->alu, - gc->planemask, - x - drawable->x - gc->patOrg.x, - y - drawable->y - gc->patOrg.y)) - goto fail; - break; - } - return TRUE; - - fail: - if (!fallback) { - if (glamor_ddx_fallback_check_pixmap(&dst_pixmap->drawable) - && glamor_ddx_fallback_check_gc(gc)) - return FALSE; - } - /* Is it possible to set the access as WO? */ - - sub_pixmap_access = GLAMOR_ACCESS_RW; - - sub_pixmap = glamor_get_sub_pixmap(dst_pixmap, x + off_x, - y + off_y, width, height, - sub_pixmap_access); - - if (sub_pixmap != NULL) { - if (gc->fillStyle != FillSolid) { - gc->patOrg.x += (drawable->x - x); - gc->patOrg.y += (drawable->y - y); - } - saved_drawable = drawable; - drawable = &sub_pixmap->drawable; - saved_x = x; - saved_y = y; - x = 0; - y = 0; - } - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && - glamor_prepare_access_gc(gc)) { - fbFill(drawable, gc, x, y, width, height); - } - glamor_finish_access_gc(gc); - glamor_finish_access(drawable); - - if (sub_pixmap != NULL) { - if (gc->fillStyle != FillSolid) { - gc->patOrg.x -= (saved_drawable->x - saved_x); - gc->patOrg.y -= (saved_drawable->y - saved_y); - } - - x = saved_x; - y = saved_y; - - glamor_put_sub_pixmap(sub_pixmap, dst_pixmap, - x + off_x, y + off_y, - width, height, sub_pixmap_access); - } - - return TRUE; -} - -void -glamor_init_solid_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - const char *solid_vs = - "attribute vec4 v_position;" - "void main()\n" - "{\n" - " gl_Position = v_position;\n" - "}\n"; - const char *solid_fs = - GLAMOR_DEFAULT_PRECISION - "uniform vec4 color;\n" - "void main()\n" - "{\n" - " gl_FragColor = color;\n" - "}\n"; - GLint fs_prog, vs_prog; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glamor_priv->solid_prog = glCreateProgram(); - vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, solid_vs); - fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, solid_fs); - glAttachShader(glamor_priv->solid_prog, vs_prog); - glAttachShader(glamor_priv->solid_prog, fs_prog); - - glBindAttribLocation(glamor_priv->solid_prog, - GLAMOR_VERTEX_POS, "v_position"); - glamor_link_glsl_prog(screen, glamor_priv->solid_prog, "solid"); - - glamor_priv->solid_color_uniform_location = - glGetUniformLocation(glamor_priv->solid_prog, "color"); -} - -void -glamor_fini_solid_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glDeleteProgram(glamor_priv->solid_prog); -} - -static void -_glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - GLfloat xscale, yscale; - float stack_vertices[32]; - float *vertices = stack_vertices; - int valid_nbox = ARRAY_SIZE(stack_vertices) / (4 * 2); - - glamor_set_destination_pixmap_priv_nc(pixmap_priv); - - glamor_make_current(glamor_priv); - glUseProgram(glamor_priv->solid_prog); - - glUniform4fv(glamor_priv->solid_color_uniform_location, 1, color); - - pixmap_priv_get_dest_scale(pixmap_priv, &xscale, &yscale); - - if (nbox > valid_nbox) { - int allocated_nbox; - float *new_vertices; - - if (nbox > GLAMOR_COMPOSITE_VBO_VERT_CNT / 6) - allocated_nbox = GLAMOR_COMPOSITE_VBO_VERT_CNT / 6; - else - allocated_nbox = nbox; - new_vertices = malloc(allocated_nbox * 4 * 2 * sizeof(float)); - if (new_vertices) { - vertices = new_vertices; - valid_nbox = allocated_nbox; - } - } - - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), vertices); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - - while (nbox) { - int box_cnt, i; - float *next_box; - - next_box = vertices; - box_cnt = nbox > valid_nbox ? valid_nbox : nbox; - for (i = 0; i < box_cnt; i++) { - glamor_set_normalize_vcoords(pixmap_priv, xscale, yscale, - box[i].x1, box[i].y1, - box[i].x2, box[i].y2, - glamor_priv->yInverted, - next_box); - next_box += 4 * 2; - } - if (box_cnt == 1) - glDrawArrays(GL_TRIANGLE_FAN, 0, box_cnt * 4); - else { - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - glDrawRangeElements(GL_TRIANGLES, 0, box_cnt * 4, box_cnt * 6, - GL_UNSIGNED_SHORT, NULL); - } else { - glDrawElements(GL_TRIANGLES, box_cnt * 6, GL_UNSIGNED_SHORT, - NULL); - } - } - nbox -= box_cnt; - box += box_cnt; - } - - if (vertices != stack_vertices) - free(vertices); - - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; -} - -/** - * Fills the given rectangles of pixmap with an X pixel value. - * - * This is a helper used by other code after clipping and translation - * of coordinates to a glamor backing pixmap. - */ -Bool -glamor_solid_boxes(PixmapPtr pixmap, - BoxPtr box, int nbox, unsigned long fg_pixel) -{ - glamor_pixmap_private *pixmap_priv; - GLfloat color[4]; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return FALSE; - - glamor_get_rgba_from_pixel(fg_pixel, - &color[0], - &color[1], - &color[2], &color[3], format_for_pixmap(pixmap)); - - if (pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - RegionRec region; - int n_region; - glamor_pixmap_clipped_regions *clipped_regions; - int i; - - RegionInitBoxes(®ion, box, nbox); - clipped_regions = - glamor_compute_clipped_regions(pixmap_priv, ®ion, &n_region, 0, - 0, 0); - for (i = 0; i < n_region; i++) { - BoxPtr inner_box; - int inner_nbox; - - SET_PIXMAP_FBO_CURRENT(pixmap_priv, clipped_regions[i].block_idx); - - inner_box = RegionRects(clipped_regions[i].region); - inner_nbox = RegionNumRects(clipped_regions[i].region); - _glamor_solid_boxes(pixmap, inner_box, inner_nbox, color); - RegionDestroy(clipped_regions[i].region); - } - free(clipped_regions); - RegionUninit(®ion); - } - else - _glamor_solid_boxes(pixmap, box, nbox, color); - - return TRUE; -} - -/** - * Fills a rectangle of a pixmap with an X pixel value. - * - * This is a helper used by other glamor code mostly for clearing of - * buffers to 0. - */ -Bool -glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, unsigned long fg_pixel) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_private *pixmap_priv; - BoxRec box; - - pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return FALSE; - - if (!glamor_set_planemask(pixmap, planemask)) { - glamor_fallback("Failedto set planemask in glamor_solid.\n"); - return FALSE; - } - - glamor_make_current(glamor_priv); - if (!glamor_set_alu(screen, alu)) { - if (alu == GXclear) - fg_pixel = 0; - else { - glamor_fallback("unsupported alu %x\n", alu); - return FALSE; - } - } - box.x1 = x; - box.y1 = y; - box.x2 = x + width; - box.y2 = y + height; - glamor_solid_boxes(pixmap, &box, 1, fg_pixel); - - glamor_set_alu(screen, GXcopy); - - return TRUE; -} diff --git a/xserver/glamor/glamor_font.c b/xserver/glamor/glamor_font.c index 57c607dc2..cc0fecf7a 100644 --- a/xserver/glamor/glamor_font.c +++ b/xserver/glamor/glamor_font.c @@ -46,6 +46,8 @@ glamor_font_get(ScreenPtr screen, FontPtr font) CharInfoPtr glyph; unsigned long count; + if (glamor_priv->glsl_version < 130) + return NULL; privates = FontGetPrivate(font, glamor_font_private_index); if (!privates) { @@ -95,7 +97,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, glamor_font->texture_id); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -167,6 +168,11 @@ glamor_unrealize_font(ScreenPtr screen, FontPtr font) Bool glamor_font_init(ScreenPtr screen) { + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + + if (glamor_priv->glsl_version < 130) + return TRUE; + if (glamor_font_generation != serverGeneration) { glamor_font_private_index = AllocateFontPrivateIndex(); if (glamor_font_private_index == -1) diff --git a/xserver/glamor/glamor_glyphblt.c b/xserver/glamor/glamor_glyphblt.c index 1c511ff2b..73b1df51e 100644 --- a/xserver/glamor/glamor_glyphblt.c +++ b/xserver/glamor/glamor_glyphblt.c @@ -56,7 +56,8 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, glamor_make_current(glamor_priv); - prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_glyph_blt_progs, + prog = glamor_use_program_fill(pixmap, gc, + &glamor_priv->poly_glyph_blt_progs, &glamor_facet_poly_glyph_blt); if (!prog) goto bail_ctx; @@ -74,7 +75,8 @@ 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, prog->matrix_uniform, &off_x, &off_y); + glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE, + prog->matrix_uniform, &off_x, &off_y); max_points = 500; num_points = 0; @@ -105,10 +107,12 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, if (!num_points) { points = glamor_get_vbo_space(screen, - max_points * (2 * sizeof (INT16)), + max_points * + (2 * sizeof (INT16)), &vbo_offset); - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, + glVertexAttribPointer(GLAMOR_VERTEX_POS, + 2, GL_SHORT, GL_FALSE, 0, vbo_offset); } @@ -149,7 +153,8 @@ glamor_poly_glyph_blt(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)) + if (glamor_poly_glyph_blt_gl(drawable, gc, start_x, y, nglyph, ppci, + pglyph_base)) return; miPolyGlyphBlt(drawable, gc, start_x, y, nglyph, ppci, pglyph_base); @@ -160,10 +165,13 @@ 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)) + 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)) + 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; @@ -179,8 +187,8 @@ glamor_image_glyph_blt_nf(DrawablePtr drawable, GCPtr gc, } static Bool -glamor_push_pixels_points(GCPtr gc, PixmapPtr bitmap, - DrawablePtr drawable, int w, int h, int x, int y) +glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, + DrawablePtr drawable, int w, int h, int x, int y) { ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); @@ -188,65 +196,40 @@ glamor_push_pixels_points(GCPtr gc, PixmapPtr bitmap, glamor_pixmap_private *pixmap_priv; uint8_t *bitmap_data = bitmap->devPrivate.ptr; int bitmap_stride = bitmap->devKind; - int off_x, off_y; + glamor_program *prog; + RegionPtr clip = gc->pCompositeClip; + int box_x, box_y; int yy, xx; - GLfloat xscale, yscale; - float color[4]; - unsigned long fg_pixel = gc->fgPixel; - float *points, *next_point; - int num_points = 0; + int num_points; + INT16 *points = NULL; char *vbo_offset; - RegionPtr clip; if (w * h > MAXINT / (2 * sizeof(float))) - return FALSE; - - if (gc->fillStyle != FillSolid) { - glamor_fallback("gc fillstyle not solid\n"); - return FALSE; - } + goto bail; pixmap_priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return FALSE; + goto bail; glamor_make_current(glamor_priv); - if (!glamor_set_alu(screen, gc->alu)) { - if (gc->alu == GXclear) - fg_pixel = 0; - else { - glamor_fallback("unsupported alu %x\n", gc->alu); - return FALSE; - } - } - if (!glamor_set_planemask(pixmap, gc->planemask)) { - glamor_fallback("Failed to set planemask in %s.\n", __FUNCTION__); - return FALSE; - } + prog = glamor_use_program_fill(pixmap, gc, + &glamor_priv->poly_glyph_blt_progs, + &glamor_facet_poly_glyph_blt); + if (!prog) + goto bail_ctx; - glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_set_destination_pixmap_priv_nc(pixmap_priv); - pixmap_priv_get_dest_scale(pixmap_priv, &xscale, &yscale); - - glUseProgram(glamor_priv->solid_prog); - - glamor_get_rgba_from_pixel(fg_pixel, - &color[0], &color[1], &color[2], &color[3], - format_for_pixmap(pixmap)); - glUniform4fv(glamor_priv->solid_color_uniform_location, 1, color); - - points = glamor_get_vbo_space(screen, w * h * sizeof(float) * 2, + points = glamor_get_vbo_space(screen, w * h * sizeof(INT16) * 2, &vbo_offset); - next_point = points; - - clip = fbGetCompositeClip(gc); + num_points = 0; /* Note that because fb sets miTranslate in the GC, our incoming X * and Y are in screen coordinate space (same for spans, but not * other operations). */ + for (yy = 0; yy < h; yy++) { uint8_t *bitmap_row = bitmap_data + yy * bitmap_stride; for (xx = 0; xx < w; xx++) { @@ -255,63 +238,58 @@ glamor_push_pixels_points(GCPtr gc, PixmapPtr bitmap, x + xx, y + yy, NULL)) { - next_point[0] = v_from_x_coord_x(xscale, x + xx + off_x + 0.5); - if (glamor_priv->yInverted) - next_point[1] = v_from_x_coord_y_inverted(yscale, y + yy + off_y + 0.5); - else - next_point[1] = v_from_x_coord_y(yscale, y + yy + off_y + 0.5); - - next_point += 2; + *points++ = x + xx; + *points++ = y + yy; num_points++; } } } - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, 2 * sizeof(float), - vbo_offset); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, + GL_FALSE, 0, vbo_offset); glamor_put_vbo_space(screen); - glDrawArrays(GL_POINTS, 0, num_points); + glamor_pixmap_loop(pixmap_priv, box_x, box_y) { + glamor_set_destination_drawable(drawable, box_x, box_y, FALSE, TRUE, + prog->matrix_uniform, NULL, NULL); - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - - return TRUE; -} - -static Bool -_glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, - DrawablePtr pDrawable, int w, int h, int x, int y, - Bool fallback) -{ - glamor_pixmap_private *pixmap_priv; - - if (!fallback && glamor_ddx_fallback_check_pixmap(pDrawable) - && glamor_ddx_fallback_check_pixmap(&pBitmap->drawable) - && glamor_ddx_fallback_check_gc(pGC)) - return FALSE; - - pixmap_priv = glamor_get_pixmap_private(pBitmap); - if (pixmap_priv->type == GLAMOR_MEMORY) { - if (glamor_push_pixels_points(pGC, pBitmap, pDrawable, w, h, x, y)) - return TRUE; + glDrawArrays(GL_POINTS, 0, num_points); } - miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y); + glDisable(GL_COLOR_LOGIC_OP); + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; + +bail_ctx: + glDisable(GL_COLOR_LOGIC_OP); +bail: + return FALSE; } void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y) { - _glamor_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y, TRUE); + if (glamor_push_pixels_gl(pGC, pBitmap, pDrawable, w, h, x, y)) + return; + + miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y); } Bool -glamor_push_pixels_nf(GCPtr pGC, PixmapPtr pBitmap, - DrawablePtr pDrawable, int w, int h, int x, int y) +glamor_push_pixels_nf(GCPtr gc, PixmapPtr bitmap, + DrawablePtr drawable, int w, int h, int x, int y) { - return _glamor_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y, FALSE); + 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 index 42f5f65f6..1f1362487 100644 --- a/xserver/glamor/glamor_glyphs.c +++ b/xserver/glamor/glamor_glyphs.c @@ -62,14 +62,6 @@ */ #define GLYPH_BUFFER_SIZE 1024 -#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) - typedef struct { PicturePtr source; glamor_composite_rect_t rects[GLYPH_BUFFER_SIZE + 4]; @@ -96,9 +88,11 @@ typedef enum { static DevPrivateKeyRec glamor_glyph_key; static inline struct glamor_glyph * -glamor_glyph_get_private(GlyphPtr glyph) +glamor_glyph_get_private(ScreenPtr screen, GlyphPtr glyph) { - return (struct glamor_glyph *) glyph->devPrivates; + struct glamor_glyph *privates = (struct glamor_glyph*)glyph->devPrivates; + + return &privates[screen->myNum]; } /* @@ -121,24 +115,8 @@ glamor_glyph_get_private(GlyphPtr glyph) * gain. */ -struct glamor_glyph_mask_cache_entry { - int idx; - int width; - int height; - int x; - int y; -}; - -static struct glamor_glyph_mask_cache { - PixmapPtr pixmap; - struct glamor_glyph_mask_cache_entry mcache[MASK_CACHE_WIDTH]; - unsigned int free_bitmap; - unsigned int cleared_bitmap; -} *mask_cache[GLAMOR_NUM_GLYPH_CACHE_FORMATS] = { -NULL}; - static void -clear_mask_cache_bitmap(struct glamor_glyph_mask_cache *maskcache, +clear_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache, unsigned int clear_mask_bits) { unsigned int i = 0; @@ -160,7 +138,7 @@ clear_mask_cache_bitmap(struct glamor_glyph_mask_cache *maskcache, } static void -clear_mask_cache(struct glamor_glyph_mask_cache *maskcache) +clear_mask_cache(glamor_glyph_mask_cache_t *maskcache) { int x = 0; int cnt = MASK_CACHE_WIDTH; @@ -168,7 +146,7 @@ clear_mask_cache(struct glamor_glyph_mask_cache *maskcache) struct glamor_glyph_mask_cache_entry *mce; glamor_solid(maskcache->pixmap, 0, CACHE_PICTURE_SIZE, CACHE_PICTURE_SIZE, - MASK_CACHE_MAX_SIZE, GXcopy, 0xFFFFFFFF, 0); + MASK_CACHE_MAX_SIZE, 0); mce = &maskcache->mcache[0]; while (cnt--) { mce->width = 0; @@ -222,7 +200,7 @@ find_continuous_bits(unsigned int bits, int bits_cnt, unsigned int *pbits_mask) } static struct glamor_glyph_mask_cache_entry * -get_mask_cache(struct glamor_glyph_mask_cache *maskcache, int blocks) +get_mask_cache(glamor_glyph_mask_cache_t *maskcache, int blocks) { int free_cleared_bit, idx = -1; int retry_cnt = 0; @@ -255,7 +233,7 @@ get_mask_cache(struct glamor_glyph_mask_cache *maskcache, int blocks) } static void -put_mask_cache_bitmap(struct glamor_glyph_mask_cache *maskcache, +put_mask_cache_bitmap(glamor_glyph_mask_cache_t *maskcache, unsigned int bitmap) { maskcache->free_bitmap |= bitmap; @@ -269,7 +247,7 @@ glamor_unrealize_glyph_caches(ScreenPtr pScreen) glamor_screen_private *glamor = glamor_get_screen_private(pScreen); int i; - if (!glamor->glyph_cache_initialized) + if (!glamor->glyph_caches_realized) return; for (i = 0; i < GLAMOR_NUM_GLYPH_CACHE_FORMATS; i++) { @@ -281,10 +259,10 @@ glamor_unrealize_glyph_caches(ScreenPtr pScreen) if (cache->glyphs) free(cache->glyphs); - if (mask_cache[i]) - free(mask_cache[i]); + if (glamor->mask_cache[i]) + free(glamor->mask_cache[i]); } - glamor->glyph_cache_initialized = FALSE; + glamor->glyph_caches_realized = FALSE; } void @@ -314,6 +292,9 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) }; 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++) { @@ -353,12 +334,13 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) goto bail; cache->evict = rand() % GLYPH_CACHE_SIZE; - mask_cache[i] = calloc(1, sizeof(*mask_cache[i])); - mask_cache[i]->pixmap = pixmap; - clear_mask_cache(mask_cache[i]); + 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: @@ -375,17 +357,11 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) Bool glamor_glyphs_init(ScreenPtr pScreen) { - glamor_screen_private *glamor = glamor_get_screen_private(pScreen); - - if (glamor->glyph_cache_initialized) - return TRUE; - if (!dixRegisterPrivateKey(&glamor_glyph_key, - PRIVATE_GLYPH, sizeof(struct glamor_glyph))) + PRIVATE_GLYPH, + screenInfo.numScreens * sizeof(struct glamor_glyph))) return FALSE; - glamor->glyph_cache_initialized = TRUE; - return TRUE; } @@ -448,9 +424,9 @@ glamor_glyph_cache_upload_glyph(ScreenPtr screen, box.y1 = y; box.x2 = x + glyph->info.width; box.y2 = y + glyph->info.height; - glamor_copy_n_to_n_nf(&scratch->drawable, - &pCachePixmap->drawable, NULL, - &box, 1, -x, -y, FALSE, FALSE, 0, NULL); + glamor_copy(&scratch->drawable, + &pCachePixmap->drawable, NULL, + &box, 1, -x, -y, FALSE, FALSE, 0, NULL); if (scratch != pGlyphPixmap) screen->DestroyPixmap(scratch); @@ -463,7 +439,7 @@ 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(glyph); + priv = glamor_glyph_get_private(screen, glyph); if (priv->cached) priv->cache->glyphs[priv->pos] = NULL; @@ -794,7 +770,7 @@ glamor_glyphs_intersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs, if (y1 < MINSHORT) y1 = MINSHORT; if (check_fake_overlap) - priv = glamor_glyph_get_private(glyph); + priv = glamor_glyph_get_private(screen, glyph); x2 = x1 + glyph->info.width; y2 = y1 + glyph->info.height; @@ -1082,7 +1058,7 @@ glamor_glyph_cache(glamor_screen_private *glamor, GlyphPtr glyph, int *out_x, mask = glamor_glyph_count_to_mask(s); pos = (cache->count + s - 1) & mask; - priv = glamor_glyph_get_private(glyph); + priv = glamor_glyph_get_private(screen, glyph); if (pos < GLYPH_CACHE_SIZE) { cache->count = pos + s; } @@ -1094,7 +1070,7 @@ glamor_glyph_cache(glamor_screen_private *glamor, GlyphPtr glyph, int *out_x, if (evicted == NULL) continue; - evicted_priv = glamor_glyph_get_private(evicted); + evicted_priv = glamor_glyph_get_private(screen, evicted); assert(evicted_priv->pos == i); if (evicted_priv->size >= s) { cache->glyphs[i] = NULL; @@ -1115,7 +1091,7 @@ glamor_glyph_cache(glamor_screen_private *glamor, GlyphPtr glyph, int *out_x, if (evicted != NULL) { - evicted_priv = glamor_glyph_get_private(evicted); + evicted_priv = glamor_glyph_get_private(screen, evicted); assert(evicted_priv->pos == pos + s); evicted_priv->cached = FALSE; @@ -1182,7 +1158,7 @@ unsigned long long dst_glyphs_cnt = 0; struct glyphs_flush_mask_arg { PicturePtr mask; glamor_glyph_buffer_t *buffer; - struct glamor_glyph_mask_cache *maskcache; + glamor_glyph_mask_cache_t *maskcache; unsigned int used_bitmap; }; @@ -1242,7 +1218,7 @@ glamor_buffer_glyph(glamor_screen_private *glamor_priv, glamor_glyph_cache_t *cache; if (glyphs_dst_mode != GLYPHS_DST_MODE_MASK_TO_DST) - priv = glamor_glyph_get_private(glyph); + priv = glamor_glyph_get_private(screen, glyph); if (PICT_FORMAT_BPP(format) == 1) format = PICT_a8; @@ -1300,7 +1276,7 @@ glamor_buffer_glyph(glamor_screen_private *glamor_priv, rect->x_src = 0 + dx; rect->y_src = 0 + dy; } - priv = glamor_glyph_get_private(glyph); + priv = glamor_glyph_get_private(screen, glyph); } rect->x_dst = x_glyph; @@ -1398,7 +1374,7 @@ glamor_glyphs_via_mask(CARD8 op, glamor_glyph_buffer_t *pmask_buffer; struct glyphs_flush_mask_arg *pmask_arg; struct glamor_glyph_mask_cache_entry *mce = NULL; - struct glamor_glyph_mask_cache *maskcache; + glamor_glyph_mask_cache_t *maskcache; glamor_glyph_cache_t *cache; int glyphs_dst_mode; @@ -1419,7 +1395,7 @@ glamor_glyphs_via_mask(CARD8 op, cache = &glamor_priv->glyphCaches [PICT_FORMAT_RGB(mask_format->format) != 0]; - maskcache = mask_cache[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; @@ -1433,7 +1409,7 @@ glamor_glyphs_via_mask(CARD8 op, glamor_destroy_pixmap(mask_pixmap); return; } - glamor_solid(mask_pixmap, 0, 0, width, height, GXcopy, 0xFFFFFFFF, 0); + glamor_solid(mask_pixmap, 0, 0, width, height, 0); component_alpha = NeedsComponent(mask_format->format); mask = CreatePicture(0, &mask_pixmap->drawable, mask_format, CPComponentAlpha, diff --git a/xserver/glamor/glamor_gradient.c b/xserver/glamor/glamor_gradient.c index 28d66917f..4ded89dcd 100644 --- a/xserver/glamor/glamor_gradient.c +++ b/xserver/glamor/glamor_gradient.c @@ -699,7 +699,7 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, width), (INT16) (dst_picture->pDrawable-> height), - glamor_priv->yInverted, vertices); + vertices); if (tex_normalize) { glamor_set_normalize_tcoords_tri_stripe(*xscale, *yscale, @@ -710,17 +710,14 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, (INT16) (dst_picture-> pDrawable->height + y_source), - glamor_priv->yInverted, tex_vertices); } else { - glamor_set_tcoords_tri_strip((INT16) (dst_picture->pDrawable->width), - (INT16) (dst_picture->pDrawable->height), - x_source, y_source, + glamor_set_tcoords_tri_strip(x_source, y_source, (INT16) (dst_picture->pDrawable->width) + x_source, (INT16) (dst_picture->pDrawable->height) + - y_source, glamor_priv->yInverted, + y_source, tex_vertices); } @@ -1084,13 +1081,11 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, r2 = (float) pixman_fixed_to_double(src_picture->pSourcePict->radial.c2. radius); - glamor_set_circle_centre(width, height, c1x, c1y, glamor_priv->yInverted, - cxy); + glamor_set_circle_centre(width, height, c1x, c1y, cxy); glUniform2fv(c1_uniform_location, 1, cxy); glUniform1f(r1_uniform_location, r1); - glamor_set_circle_centre(width, height, c2x, c2y, glamor_priv->yInverted, - cxy); + glamor_set_circle_centre(width, height, c2x, c2y, cxy); glUniform2fv(c2_uniform_location, 1, cxy); glUniform1f(r2_uniform_location, r2); @@ -1322,7 +1317,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, linear.p1.x), pixman_fixed_to_double(src_picture->pSourcePict-> linear.p1.y), - glamor_priv->yInverted, pt1); + pt1); DEBUGF("pt1:(%f, %f) ---> (%f %f)\n", pixman_fixed_to_double(src_picture->pSourcePict->linear.p1.x), pixman_fixed_to_double(src_picture->pSourcePict->linear.p1.y), @@ -1333,7 +1328,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, linear.p2.x), pixman_fixed_to_double(src_picture->pSourcePict-> linear.p2.y), - glamor_priv->yInverted, pt2); + pt2); DEBUGF("pt2:(%f, %f) ---> (%f %f)\n", pixman_fixed_to_double(src_picture->pSourcePict->linear.p2.x), pixman_fixed_to_double(src_picture->pSourcePict->linear.p2.y), diff --git a/xserver/glamor/glamor_largepixmap.c b/xserver/glamor/glamor_largepixmap.c index b3a8d5d20..b9c3b9af1 100644 --- a/xserver/glamor/glamor_largepixmap.c +++ b/xserver/glamor/glamor_largepixmap.c @@ -2,6 +2,12 @@ #include "glamor_priv.h" +static inline glamor_pixmap_private_large_t * +__glamor_large(glamor_pixmap_private *pixmap_priv) { + assert(pixmap_priv->type == GLAMOR_TEXTURE_LARGE); + return &pixmap_priv->large; +} + /** * Clip the boxes regards to each pixmap's block array. * @@ -154,9 +160,9 @@ glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv, *result_regions; int i, j, x, y, k, inner_n_regions; int width, height; - glamor_pixmap_private_large_t *priv; - - priv = &pixmap_priv->large; + BoxPtr box_array; + BoxRec small_box; + int block_w, block_h; DEBUGF("ext called \n"); @@ -170,14 +176,16 @@ 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; - priv->block_w = priv->base.pixmap->drawable.width; - priv->block_h = priv->base.pixmap->drawable.height; - priv->box_array = &priv->box; - priv->box.x1 = priv->box.y1 = 0; - priv->box.x2 = priv->block_w; - priv->box.y2 = priv->block_h; + block_w = pixmap_priv->base.pixmap->drawable.width; + block_h = pixmap_priv->base.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); + clipped_regions = __glamor_compute_clipped_regions(priv->block_w, priv->block_h, priv->block_wcnt, @@ -193,20 +201,23 @@ glamor_compute_clipped_regions_ext(glamor_pixmap_private *pixmap_priv, *n_region = 0; return NULL; } + block_w = priv->block_w; + block_h = priv->block_h; + box_array = priv->box_array; } - if (inner_block_w >= priv->block_w && inner_block_h >= priv->block_h) + if (inner_block_w >= block_w && inner_block_h >= block_h) return clipped_regions; result_regions = calloc(*n_region - * ((priv->block_w + inner_block_w - 1) / + * ((block_w + inner_block_w - 1) / inner_block_w) - * ((priv->block_h + inner_block_h - 1) / + * ((block_h + inner_block_h - 1) / inner_block_h), sizeof(*result_regions)); k = 0; for (i = 0; i < *n_region; i++) { - x = priv->box_array[clipped_regions[i].block_idx].x1; - y = priv->box_array[clipped_regions[i].block_idx].y1; - width = priv->box_array[clipped_regions[i].block_idx].x2 - x; - height = priv->box_array[clipped_regions[i].block_idx].y2 - y; + x = box_array[clipped_regions[i].block_idx].x1; + y = box_array[clipped_regions[i].block_idx].y1; + width = box_array[clipped_regions[i].block_idx].x2 - x; + height = box_array[clipped_regions[i].block_idx].y2 - y; inner_regions = __glamor_compute_clipped_regions(inner_block_w, inner_block_h, 0, x, y, @@ -343,8 +354,6 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv, int x_center_shift = 0, y_center_shift = 0; glamor_pixmap_private_large_t *priv; - priv = &pixmap_priv->large; - DEBUGRegionPrint(region); if (pixmap_priv->type != GLAMOR_TEXTURE_LARGE) { clipped_regions = calloc(1, sizeof(*clipped_regions)); @@ -355,6 +364,8 @@ _glamor_compute_clipped_regions(glamor_pixmap_private *pixmap_priv, return clipped_regions; } + priv = __glamor_large(pixmap_priv); + pixmap_width = priv->base.pixmap->drawable.width; pixmap_height = priv->base.pixmap->drawable.height; if (repeat_type == 0 || repeat_type == RepeatPad) { @@ -751,7 +762,7 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv, int pixmap_width, pixmap_height; glamor_pixmap_private_large_t *priv; - priv = &pixmap_priv->large; + priv = __glamor_large(pixmap_priv); pixmap_width = priv->base.pixmap->drawable.width; pixmap_height = priv->base.pixmap->drawable.height; @@ -797,9 +808,9 @@ glamor_merge_clipped_regions(glamor_pixmap_private *pixmap_priv, copy_box.y2 = temp_extent->y2 - temp_extent->y1; dx = temp_extent->x1; dy = temp_extent->y1; - glamor_copy_n_to_n(&priv->base.pixmap->drawable, - &temp_pixmap->drawable, - NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); + glamor_copy(&priv->base.pixmap->drawable, + &temp_pixmap->drawable, + NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); // glamor_solid(temp_pixmap, 0, 0, temp_pixmap->drawable.width, // temp_pixmap->drawable.height, GXcopy, 0xffffffff, 0xff00); } @@ -829,9 +840,10 @@ 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_n_to_n(&priv->base.pixmap->drawable, - &temp_pixmap->drawable, - NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); + glamor_copy(&priv->base.pixmap->drawable, + &temp_pixmap->drawable, + NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL); + box++; } } @@ -969,7 +981,7 @@ _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv, need_clean_fbo); } else { - SET_PIXMAP_FBO_CURRENT(priv, clipped_regions[0].block_idx); + glamor_set_pixmap_fbo_current(priv, clipped_regions[0].block_idx); if (repeat_type == RepeatReflect || repeat_type == RepeatNormal) { /* The required source areas are in one region, * we need to shift the corresponding box's coords to proper position, @@ -984,15 +996,15 @@ _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv, shift_y = (temp_box->y1 - rem) / priv->base.pixmap->drawable.height; if (shift_x != 0) { - priv->large.box.x1 += + __glamor_large(priv)->box.x1 += shift_x * priv->base.pixmap->drawable.width; - priv->large.box.x2 += + __glamor_large(priv)->box.x2 += shift_x * priv->base.pixmap->drawable.width; } if (shift_y != 0) { - priv->large.box.y1 += + __glamor_large(priv)->box.y1 += shift_y * priv->base.pixmap->drawable.height; - priv->large.box.y2 += + __glamor_large(priv)->box.y2 += shift_y * priv->base.pixmap->drawable.height; } } @@ -1027,12 +1039,22 @@ glamor_composite_largepixmap_region(CARD8 op, int is_normal_source_fbo = 0; int is_normal_mask_fbo = 0; int fixed_block_width, fixed_block_height; + int dest_block_width, dest_block_height; int null_source, null_mask; glamor_pixmap_private *need_free_source_pixmap_priv = NULL; glamor_pixmap_private *need_free_mask_pixmap_priv = NULL; int source_repeat_type = 0, mask_repeat_type = 0; int ok = TRUE; + if (source_pixmap_priv == dest_pixmap_priv) { + glamor_fallback("source and dest pixmaps are the same\n"); + return FALSE; + } + if (mask_pixmap_priv == dest_pixmap_priv) { + glamor_fallback("mask and dest pixmaps are the same\n"); + return FALSE; + } + if (source->repeat) source_repeat_type = source->repeatType; else @@ -1043,8 +1065,16 @@ glamor_composite_largepixmap_region(CARD8 op, else mask_repeat_type = RepeatNone; - fixed_block_width = dest_pixmap_priv->large.block_w; - fixed_block_height = dest_pixmap_priv->large.block_h; + if (dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { + 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; + } + fixed_block_width = dest_block_width; + fixed_block_height = dest_block_height; + /* If we got an totally out-of-box region for a source or mask * region without repeat, we need to set it as null_source and * give it a solid color (0,0,0,0). */ @@ -1070,8 +1100,8 @@ glamor_composite_largepixmap_region(CARD8 op, int source_transformed_block_width, source_transformed_block_height; if (!glamor_get_transform_block_size(source->transform, - source_pixmap_priv->large.block_w, - source_pixmap_priv->large.block_h, + __glamor_large(source_pixmap_priv)->block_w, + __glamor_large(source_pixmap_priv)->block_h, &source_transformed_block_width, &source_transformed_block_height)) { @@ -1092,8 +1122,8 @@ glamor_composite_largepixmap_region(CARD8 op, int mask_transformed_block_width, mask_transformed_block_height; if (!glamor_get_transform_block_size(mask->transform, - mask_pixmap_priv->large.block_w, - mask_pixmap_priv->large.block_h, + __glamor_large(mask_pixmap_priv)->block_w, + __glamor_large(mask_pixmap_priv)->block_h, &mask_transformed_block_width, &mask_transformed_block_height)) { DEBUGF("mask block size less than 1, fallback.\n"); @@ -1110,8 +1140,8 @@ glamor_composite_largepixmap_region(CARD8 op, /*compute the correct block width and height whose transformed source/mask *region can fit into one texture.*/ - if (force_clip || fixed_block_width < dest_pixmap_priv->large.block_w - || fixed_block_height < dest_pixmap_priv->large.block_h) + 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, &n_dest_regions, @@ -1139,7 +1169,7 @@ glamor_composite_largepixmap_region(CARD8 op, DEBUGF("dest region %d idx %d\n", i, clipped_dest_regions[i].block_idx); DEBUGRegionPrint(clipped_dest_regions[i].region); - SET_PIXMAP_FBO_CURRENT(dest_pixmap_priv, + 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) { @@ -1179,7 +1209,7 @@ glamor_composite_largepixmap_region(CARD8 op, DEBUGF("source clipped result %d region: \n", n_source_regions); for (j = 0; j < n_source_regions; j++) { if (is_normal_source_fbo) - SET_PIXMAP_FBO_CURRENT(source_pixmap_priv, + glamor_set_pixmap_fbo_current(source_pixmap_priv, clipped_source_regions[j].block_idx); if (mask_pixmap_priv && @@ -1266,12 +1296,12 @@ glamor_composite_largepixmap_region(CARD8 op, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { - SET_PIXMAP_FBO_CURRENT(mask_pixmap_priv, + glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); DEBUGF("mask fbo off %d %d \n", - mask_pixmap_priv->large.box.x1, - mask_pixmap_priv->large.box.y1); + __glamor_large(mask_pixmap_priv)->box.x1, + __glamor_large(mask_pixmap_priv)->box.y1); DEBUGF("start composite mask hasn't transform.\n"); RegionTranslate(clipped_mask_regions[k].region, x_dest - x_mask + @@ -1377,7 +1407,7 @@ glamor_composite_largepixmap_region(CARD8 op, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { - SET_PIXMAP_FBO_CURRENT(mask_pixmap_priv, + glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); RegionTranslate(clipped_mask_regions[k].region, diff --git a/xserver/glamor/glamor_lines.c b/xserver/glamor/glamor_lines.c new file mode 100644 index 000000000..e9a619505 --- /dev/null +++ b/xserver/glamor/glamor_lines.c @@ -0,0 +1,187 @@ +/* + * 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 "glamor_priv.h" +#include "glamor_program.h" +#include "glamor_transform.h" +#include "glamor_prepare.h" + +static const glamor_facet glamor_facet_poly_lines = { + .name = "poly_lines", + .vs_vars = "attribute vec2 primitive;\n", + .vs_exec = (" vec2 pos = vec2(0.0,0.0);\n" + GLAMOR_POS(gl_Position, primitive.xy)), +}; + +static Bool +glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points) +{ + 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_program *prog; + int off_x, off_y; + DDXPointPtr v; + char *vbo_offset; + int box_x, box_y; + int add_last; + + pixmap_priv = glamor_get_pixmap_private(pixmap); + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + goto bail; + + add_last = 0; + if (gc->capStyle != CapNotLast) + add_last = 1; + + if (n < 2) + return TRUE; + + glamor_make_current(glamor_priv); + + prog = glamor_use_program_fill(pixmap, gc, + &glamor_priv->poly_line_program, + &glamor_facet_poly_lines); + + if (!prog) + goto bail_ctx; + + /* Set up the vertex buffers for the points */ + + v = glamor_get_vbo_space(drawable->pScreen, + (n + add_last) * sizeof (DDXPointRec), + &vbo_offset); + + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, + sizeof (DDXPointRec), vbo_offset); + + if (mode == CoordModePrevious) { + int i; + DDXPointRec here = { 0, 0 }; + + for (i = 0; i < n; i++) { + here.x += points[i].x; + here.y += points[i].y; + v[i] = here; + } + } else { + memcpy(v, points, n * sizeof (DDXPointRec)); + } + + if (add_last) { + v[n].x = v[n-1].x + 1; + v[n].y = v[n-1].y; + } + + glamor_put_vbo_space(screen); + + glEnable(GL_SCISSOR_TEST); + + glamor_pixmap_loop(pixmap_priv, box_x, box_y) { + 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); + + while (nbox--) { + glScissor(box->x1 + off_x, + box->y1 + off_y, + box->x2 - box->x1, + box->y2 - box->y1); + box++; + glDrawArrays(GL_LINE_STRIP, 0, n + add_last); + } + } + + 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; +} + +static Bool +glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points) +{ + if (gc->lineWidth != 0) + return FALSE; + + switch (gc->lineStyle) { + case LineSolid: + return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points); + case LineOnOffDash: + return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points); + case LineDoubleDash: + if (gc->fillStyle == FillTiled) + return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points); + else + return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points); + default: + return FALSE; + } +} + +static void +glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points) +{ + glamor_fallback("to %p (%c)\n", drawable, + glamor_get_drawable_location(drawable)); + + miPolylines(drawable, gc, mode, n, points); +} + +void +glamor_poly_lines(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points) +{ + if (glamor_poly_lines_gl(drawable, gc, mode, n, points)) + 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 5fdc5f9b0..bc658f801 100644 --- a/xserver/glamor/glamor_picture.c +++ b/xserver/glamor/glamor_picture.c @@ -45,25 +45,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) return glamor_upload_pixmap_to_texture(pixmap); } -Bool -glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access) -{ - if (!picture || !picture->pDrawable) - return TRUE; - - return glamor_prepare_access(picture->pDrawable, access); -} - -void -glamor_finish_access_picture(PicturePtr picture) -{ - if (!picture || !picture->pDrawable) - return; - - glamor_finish_access(picture->pDrawable); -} - -/* +/* * 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. diff --git a/xserver/glamor/glamor_pixmap.c b/xserver/glamor/glamor_pixmap.c index 789d3772e..0d92710cf 100644 --- a/xserver/glamor/glamor_pixmap.c +++ b/xserver/glamor/glamor_pixmap.c @@ -717,7 +717,6 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, } glBindTexture(GL_TEXTURE_2D, *tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); 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); @@ -747,11 +746,6 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, glamor_get_screen_private(pixmap->drawable.pScreen); static float vertices[8]; - static float texcoords[8] = { 0, 1, - 1, 1, - 1, 0, - 0, 0 - }; static float texcoords_inv[8] = { 0, 0, 1, 0, 1, 1, @@ -760,11 +754,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, float *ptexcoords; float dst_xscale, dst_yscale; GLuint tex = 0; - int need_flip; int need_free_bits = 0; - need_flip = !glamor_priv->yInverted; - if (bits == NULL) goto ready_to_upload; @@ -783,6 +774,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, 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; @@ -798,7 +790,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, /* 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 && !need_flip + && revert == REVERT_NONE && swap_rb == SWAP_NONE_UPLOADING #ifdef WALKAROUND_LARGE_TEXTURE_MAP && pixmap_priv->type != GLAMOR_TEXTURE_LARGE #endif @@ -815,47 +807,43 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, format, type, x + fbo_x_off, y + fbo_y_off, w, h, bits, pbo); - return TRUE; - } - - if (need_flip) - ptexcoords = texcoords; - else + } 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, - glamor_priv->yInverted, 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); + 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); + 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); + 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); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDeleteTextures(1, &tex); - glBindFramebuffer(GL_FRAMEBUFFER, 0); + glDisableVertexAttribArray(GLAMOR_VERTEX_POS); + glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); + glDeleteTextures(1, &tex); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + } if (need_free_bits) free(bits); @@ -865,10 +853,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, /* * Prepare to upload a pixmap to texture memory. * no_alpha equals 1 means the format needs to wire alpha to 1. - * Two condtion need to setup a fbo for a pixmap - * 1. !yInverted, we need to do flip if we are not yInverted. - * 2. no_alpha != 0, we need to wire the alpha. - * */ + */ static int glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, int revert, int swap_rb) @@ -896,8 +881,7 @@ glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, return 0; if (!(no_alpha || (revert == REVERT_NORMAL) - || (swap_rb != SWAP_NONE_UPLOADING) - || !glamor_priv->yInverted)) { + || (swap_rb != SWAP_NONE_UPLOADING))) { /* We don't need a fbo, a simple texture uploading should work. */ flag = GLAMOR_CREATE_FBO_NO_FBO; @@ -939,26 +923,6 @@ glamor_put_bits(char *dst_bits, int dst_stride, char *src_bits, } } -/* - * download sub region from a large region. - */ -static void -glamor_get_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; - dst_bits += y * dst_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) @@ -1020,7 +984,7 @@ glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, assert(pbo == 0); - SET_PIXMAP_FBO_CURRENT(pixmap_priv, clipped_regions[i].block_idx); + glamor_set_pixmap_fbo_current(pixmap_priv, clipped_regions[i].block_idx); boxes = RegionRects(clipped_regions[i].region); nbox = RegionNumRects(clipped_regions[i].region); @@ -1100,13 +1064,6 @@ glamor_upload_pixmap_to_texture(PixmapPtr pixmap) return ret; } -void -glamor_restore_pixmap_to_texture(PixmapPtr pixmap) -{ - if (glamor_upload_pixmap_to_texture(pixmap) != GLAMOR_UPLOAD_DONE) - LogMessage(X_WARNING, "Failed to restore pixmap to texture.\n"); -} - /* * as gles2 only support a very small set of color format and * type when do glReadPixel, @@ -1142,7 +1099,7 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, glamor_set_normalize_vcoords((struct glamor_pixmap_private *) NULL, temp_xscale, temp_yscale, 0, 0, w, h, - glamor_priv->yInverted, vertices); + vertices); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); @@ -1153,7 +1110,7 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, source_yscale, x, y, x + w, y + h, - glamor_priv->yInverted, texcoords); + texcoords); glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), texcoords); @@ -1176,330 +1133,6 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, return temp_fbo; } -/* - * Download a sub region of pixmap to a specified memory region. - * The pixmap must have a valid FBO, otherwise return a NULL. - * */ - -static void * -_glamor_download_sub_pixmap_to_cpu(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_access_t access) -{ - glamor_pixmap_private *pixmap_priv; - GLenum gl_access = 0, gl_usage = 0; - void *data, *read; - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - glamor_pixmap_fbo *temp_fbo = NULL; - int need_post_conversion = 0; - int need_free_data = 0; - int fbo_x_off, fbo_y_off; - - data = bits; - pixmap_priv = glamor_get_pixmap_private(pixmap); - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return NULL; - - switch (access) { - case GLAMOR_ACCESS_RO: - gl_access = GL_READ_ONLY; - gl_usage = GL_STREAM_READ; - break; - case GLAMOR_ACCESS_RW: - gl_access = GL_READ_WRITE; - gl_usage = GL_DYNAMIC_DRAW; - break; - default: - ErrorF("Glamor: Invalid access code. %d\n", access); - assert(0); - } - - glamor_make_current(glamor_priv); - glamor_set_destination_pixmap_priv_nc(pixmap_priv); - - need_post_conversion = (revert > REVERT_NORMAL); - if (need_post_conversion) { - if (pixmap->drawable.depth == 1) { - int temp_stride; - - temp_stride = (((w * 8 + 7) / 8) + 3) & ~3; - data = malloc(temp_stride * h); - if (data == NULL) - return NULL; - need_free_data = 1; - } - } - - pixmap_priv_get_fbo_off(pixmap_priv, &fbo_x_off, &fbo_y_off); - - if (glamor_priv->gl_flavor == GLAMOR_GL_ES2 - && !need_post_conversion - && (swap_rb != SWAP_NONE_DOWNLOADING || revert != REVERT_NONE)) { - if (!(temp_fbo = glamor_es2_pixmap_read_prepare(pixmap, x, y, w, h, - format, type, no_alpha, - revert, swap_rb))) { - free(data); - return NULL; - } - x = 0; - y = 0; - fbo_x_off = 0; - fbo_y_off = 0; - } - - glPixelStorei(GL_PACK_ALIGNMENT, 4); - - if (glamor_priv->has_pack_invert || glamor_priv->yInverted) { - - if (!glamor_priv->yInverted) { - assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); - glPixelStorei(GL_PACK_INVERT_MESA, 1); - } - - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && data == NULL) { - assert(pbo > 0); - glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo); - glBufferData(GL_PIXEL_PACK_BUFFER, stride * h, NULL, gl_usage); - } - - glReadPixels(x + fbo_x_off, y + fbo_y_off, w, h, format, type, data); - - if (!glamor_priv->yInverted) { - assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); - glPixelStorei(GL_PACK_INVERT_MESA, 0); - } - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && bits == NULL) { - bits = glMapBuffer(GL_PIXEL_PACK_BUFFER, gl_access); - glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); - } - } - else { - unsigned int temp_pbo; - int yy; - - glamor_make_current(glamor_priv); - glGenBuffers(1, &temp_pbo); - glBindBuffer(GL_PIXEL_PACK_BUFFER, temp_pbo); - glBufferData(GL_PIXEL_PACK_BUFFER, stride * h, NULL, GL_STREAM_READ); - glReadPixels(x + fbo_x_off, y + fbo_y_off, w, h, format, type, 0); - read = glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); - for (yy = 0; yy < pixmap->drawable.height; yy++) - memcpy((char *) data + yy * stride, - (char *) read + (h - yy - 1) * stride, stride); - glUnmapBuffer(GL_PIXEL_PACK_BUFFER); - glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); - glDeleteBuffers(1, &temp_pbo); - } - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - if (need_post_conversion) { - /* As OpenGL desktop version never enters here. - * Don't need to consider if the pbo is valid.*/ - bits = glamor_color_convert_to_bits(data, bits, - w, h, - stride, no_alpha, revert, swap_rb); - } - - if (temp_fbo != NULL) - glamor_destroy_fbo(temp_fbo); - if (need_free_data) - free(data); - - return bits; -} - -void * -glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h, - int stride, void *bits, int pbo, - glamor_access_t access) -{ - 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, 0)) { - glamor_fallback("Unknown pixmap depth %d.\n", pixmap->drawable.depth); - return NULL; - } - - pixmap_priv = glamor_get_pixmap_private(pixmap); - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return NULL; - - 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(®ion, &box, 1); - - if (!force_clip) - clipped_regions = - glamor_compute_clipped_regions(pixmap_priv, ®ion, &n_region, - 0, 0, 0); - else - clipped_regions = - glamor_compute_clipped_regions_ext(pixmap_priv, ®ion, - &n_region, - pixmap_priv->large.block_w, - pixmap_priv->large.block_h, - 0, - 0); - - DEBUGF("start download large pixmap %p %dx%d \n", pixmap, w, h); - for (i = 0; i < n_region; i++) { - BoxPtr boxes; - int nbox; - int temp_stride; - void *temp_bits; - - assert(pbo == 0); - SET_PIXMAP_FBO_CURRENT(pixmap_priv, clipped_regions[i].block_idx); - - boxes = RegionRects(clipped_regions[i].region); - nbox = RegionNumRects(clipped_regions[i].region); - 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; - } - DEBUGF("download x %d y %d w %d h %d temp stride %d \n", - boxes[j].x1, boxes[j].y1, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1, temp_stride); - - /* For large pixmap, we don't support pbo currently. */ - assert(pbo == 0); - if (_glamor_download_sub_pixmap_to_cpu - (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, - access) == FALSE) { - RegionUninit(®ion); - free(sub_bits); - assert(0); - return NULL; - } - if (boxes[j].x1 != x || temp_stride != stride) - glamor_get_bits(bits, stride, temp_bits, temp_stride, - pixmap->drawable.bitsPerPixel, - boxes[j].x1 - x, boxes[j].y1 - y, - boxes[j].x2 - boxes[j].x1, - boxes[j].y2 - boxes[j].y1); - } - - RegionDestroy(clipped_regions[i].region); - } - free(sub_bits); - free(clipped_regions); - RegionUninit(®ion); - return bits; - } - else - return _glamor_download_sub_pixmap_to_cpu(pixmap, format, type, - no_alpha, revert, swap_rb, x, - y, w, h, stride, bits, pbo, - access); -} - -/** - * Move a pixmap to CPU memory. - * The input data is the pixmap's fbo. - * The output data is at pixmap->devPrivate.ptr. We always use pbo - * to read the fbo and then map it to va. If possible, we will use - * it directly as devPrivate.ptr. - * If successfully download a fbo to cpu then return TRUE. - * Otherwise return FALSE. - **/ -Bool -glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access) -{ - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - unsigned int stride; - void *data = NULL, *dst; - glamor_screen_private *glamor_priv = - glamor_get_screen_private(pixmap->drawable.pScreen); - int pbo = 0; - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return TRUE; - - glamor_debug_output(GLAMOR_DEBUG_TEXTURE_DOWNLOAD, - "Downloading pixmap %p %dx%d depth%d\n", - pixmap, - pixmap->drawable.width, - pixmap->drawable.height, pixmap->drawable.depth); - - stride = pixmap->devKind; - - if (glamor_priv->gl_flavor == GLAMOR_GL_ES2 - || (!glamor_priv->has_pack_invert && !glamor_priv->yInverted) - || pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - data = malloc(stride * pixmap->drawable.height); - } - else { - glamor_make_current(glamor_priv); - if (pixmap_priv->base.fbo->pbo == 0) - glGenBuffers(1, &pixmap_priv->base.fbo->pbo); - pbo = pixmap_priv->base.fbo->pbo; - } - - if (pixmap_priv->type == GLAMOR_TEXTURE_DRM) { - stride = PixmapBytePad(pixmap->drawable.width, pixmap->drawable.depth); - pixmap_priv->base.drm_stride = pixmap->devKind; - pixmap->devKind = stride; - } - - dst = glamor_download_sub_pixmap_to_cpu(pixmap, 0, 0, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->devKind, data, pbo, access); - - if (!dst) { - if (data) - free(data); - return FALSE; - } - - if (pbo != 0) - pixmap_priv->base.fbo->pbo_valid = 1; - - pixmap_priv->base.gl_fbo = GLAMOR_FBO_DOWNLOADED; - - pixmap->devPrivate.ptr = dst; - - return TRUE; -} - /* fixup a fbo to the exact size as the pixmap. */ /* XXX LARGE pixmap? */ Bool @@ -1558,132 +1191,3 @@ glamor_fixup_pixmap_priv(ScreenPtr screen, glamor_pixmap_private *pixmap_priv) return ret; } - -/* - * We may use this function to reduce a large pixmap to a small sub - * pixmap. Two scenarios currently: - * 1. When fallback a large textured pixmap to CPU but we do need to - * do rendering within a small sub region, then we can just get a - * sub region. - * - * 2. When uploading a large pixmap to texture but we only need to - * use part of the source/mask picture. As glTexImage2D will be more - * efficient to upload a contingent region rather than a sub block - * in a large buffer. We use this function to gather the sub region - * to a contingent sub pixmap. - * - * The sub-pixmap must have the same format as the source pixmap. - * - * */ -PixmapPtr -glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, - glamor_access_t access) -{ - glamor_screen_private *glamor_priv; - PixmapPtr sub_pixmap; - glamor_pixmap_private *sub_pixmap_priv, *pixmap_priv; - void *data; - int pbo; - int flag; - - if (x < 0 || y < 0) - return NULL; - w = (x + w) > pixmap->drawable.width ? (pixmap->drawable.width - x) : w; - h = (y + h) > pixmap->drawable.height ? (pixmap->drawable.height - y) : h; - - glamor_priv = glamor_get_screen_private(pixmap->drawable.pScreen); - pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - return NULL; - if (glamor_priv->gl_flavor == GLAMOR_GL_ES2 || - pixmap_priv->type == GLAMOR_TEXTURE_LARGE) - flag = GLAMOR_CREATE_PIXMAP_CPU; - else - flag = GLAMOR_CREATE_PIXMAP_MAP; - - sub_pixmap = glamor_create_pixmap(pixmap->drawable.pScreen, w, h, - pixmap->drawable.depth, flag); - - if (sub_pixmap == NULL) - return NULL; - - sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap); - pbo = - sub_pixmap_priv ? (sub_pixmap_priv->base.fbo ? sub_pixmap_priv->base. - fbo->pbo : 0) : 0; - - if (pixmap_priv->base.is_picture) { - sub_pixmap_priv->base.picture = pixmap_priv->base.picture; - sub_pixmap_priv->base.is_picture = pixmap_priv->base.is_picture; - } - - if (pbo) - data = NULL; - else - data = sub_pixmap->devPrivate.ptr; - - data = - glamor_download_sub_pixmap_to_cpu(pixmap, x, y, w, h, - sub_pixmap->devKind, data, pbo, - access); - if (data == NULL) { - fbDestroyPixmap(sub_pixmap); - return NULL; - } - if (pbo) { - assert(sub_pixmap->devPrivate.ptr == NULL); - sub_pixmap->devPrivate.ptr = data; - sub_pixmap_priv->base.fbo->pbo_valid = 1; - } -#if 0 - struct pixman_box16 box; - PixmapPtr new_sub_pixmap; - int dx, dy; - - box.x1 = 0; - box.y1 = 0; - box.x2 = w; - box.y2 = h; - - dx = x; - dy = y; - - new_sub_pixmap = glamor_create_pixmap(pixmap->drawable.pScreen, w, h, - pixmap->drawable.depth, - GLAMOR_CREATE_PIXMAP_CPU); - glamor_copy_n_to_n(&pixmap->drawable, &new_sub_pixmap->drawable, NULL, &box, - 1, dx, dy, 0, 0, 0, NULL); - glamor_compare_pixmaps(new_sub_pixmap, sub_pixmap, 0, 0, w, h, 1, 1); -#endif - - return sub_pixmap; -} - -void -glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, - int w, int h, glamor_access_t access) -{ - void *bits; - int pbo; - glamor_pixmap_private *sub_pixmap_priv; - - if (access != GLAMOR_ACCESS_RO) { - sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap); - if (sub_pixmap_priv->base.fbo && sub_pixmap_priv->base.fbo->pbo_valid) { - bits = NULL; - pbo = sub_pixmap_priv->base.fbo->pbo; - } - else { - bits = sub_pixmap->devPrivate.ptr; - pbo = 0; - } - - assert(x >= 0 && y >= 0); - w = (w > sub_pixmap->drawable.width) ? sub_pixmap->drawable.width : w; - h = (h > sub_pixmap->drawable.height) ? sub_pixmap->drawable.height : h; - glamor_upload_sub_pixmap_to_texture(pixmap, x, y, w, h, - sub_pixmap->devKind, bits, pbo); - } - glamor_destroy_pixmap(sub_pixmap); -} diff --git a/xserver/glamor/glamor_points.c b/xserver/glamor/glamor_points.c index d4525e294..84383d254 100644 --- a/xserver/glamor/glamor_points.c +++ b/xserver/glamor/glamor_points.c @@ -105,9 +105,6 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; - return TRUE; bail_ctx: diff --git a/xserver/glamor/glamor_polylines.c b/xserver/glamor/glamor_polylines.c deleted file mode 100644 index 1adf45ddc..000000000 --- a/xserver/glamor/glamor_polylines.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * Copyright © 1998 Keith Packard - * - * 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: - * Eric Anholt - * - */ - -#include "glamor_priv.h" - -/** @file glamor_polylines.c - * - * GC PolyFillRect implementation, taken straight from fb_fill.c - */ - -/** - * glamor_poly_lines() checks if it can accelerate the lines as a group of - * horizontal or vertical lines (rectangles), and uses existing rectangle fill - * acceleration if so. - */ -static Bool -_glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, - DDXPointPtr points, Bool fallback) -{ - xRectangle *rects; - int x1, x2, y1, y2; - int i; - - /* Don't try to do wide lines or non-solid fill style. */ - if (gc->lineWidth != 0) { - /* This ends up in miSetSpans, which is accelerated as well as we - * can hope X wide lines will be. - */ - goto fail; - } - - if (gc->lineStyle != LineSolid) { - glamor_fallback("non-solid fill line style %d\n", gc->lineStyle); - goto fail; - } - rects = malloc(sizeof(xRectangle) * (n - 1)); - x1 = points[0].x; - y1 = points[0].y; - /* If we have any non-horizontal/vertical, fall back. */ - for (i = 0; i < n - 1; i++) { - if (mode == CoordModePrevious) { - x2 = x1 + points[i + 1].x; - y2 = y1 + points[i + 1].y; - } - else { - x2 = points[i + 1].x; - y2 = points[i + 1].y; - } - if (x1 != x2 && y1 != y2) { - free(rects); - glamor_fallback("stub diagonal poly_line\n"); - goto fail; - } - if (x1 < x2) { - rects[i].x = x1; - rects[i].width = x2 - x1 + 1; - } - else { - rects[i].x = x2; - rects[i].width = x1 - x2 + 1; - } - if (y1 < y2) { - rects[i].y = y1; - rects[i].height = y2 - y1 + 1; - } - else { - rects[i].y = y2; - rects[i].height = y1 - y2 + 1; - } - - x1 = x2; - y1 = y2; - } - gc->ops->PolyFillRect(drawable, gc, n - 1, rects); - free(rects); - return TRUE; - - fail: - if (!fallback && glamor_ddx_fallback_check_pixmap(drawable) - && glamor_ddx_fallback_check_gc(gc)) - return FALSE; - - switch (gc->lineStyle) { - case LineSolid: - if (gc->lineWidth == 0) - miZeroLine(drawable, gc, mode, n, points); - else - miWideLine(drawable, gc, mode, n, points); - break; - case LineOnOffDash: - case LineDoubleDash: - miWideDash(drawable, gc, mode, n, points); - break; - } - - return TRUE; -} - -void -glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, - DDXPointPtr points) -{ - _glamor_poly_lines(drawable, gc, mode, n, points, TRUE); -} - -Bool -glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc, int mode, int n, - DDXPointPtr points) -{ - return _glamor_poly_lines(drawable, gc, mode, n, points, FALSE); -} diff --git a/xserver/glamor/glamor_prepare.c b/xserver/glamor/glamor_prepare.c new file mode 100644 index 000000000..fb85d9082 --- /dev/null +++ b/xserver/glamor/glamor_prepare.c @@ -0,0 +1,271 @@ +/* + * 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 "glamor_priv.h" +#include "glamor_prepare.h" +#include "glamor_transfer.h" + +/* + * Make a pixmap ready to draw with fb by + * creating a PBO large enough for the whole object + * and downloading all of the FBOs into it. + */ + +static Bool +glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) +{ + 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 gl_access, gl_usage; + RegionRec region; + + if (priv->type == GLAMOR_DRM_ONLY) + return FALSE; + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) + return TRUE; + + RegionInit(®ion, box, 1); + + /* See if it's already mapped */ + if (pixmap->devPrivate.ptr) { + /* + * Someone else has mapped this pixmap; + * we'll assume that it's directly mapped + * by a lower level driver + */ + if (!priv->base.prepared) + return TRUE; + + /* In X, multiple Drawables can be stored in the same Pixmap (such as + * each individual window in a non-composited screen pixmap, or the + * reparented window contents inside the window-manager-decorated window + * pixmap on a composited screen). + * + * 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(®ion, ®ion, &priv->base.prepare_region); + if (!RegionNotEmpty(®ion)) + 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); + glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + pixmap->devPrivate.ptr = NULL; + } + } else { + RegionInit(&priv->base.prepare_region, box, 1); + + if (glamor_priv->has_rw_pbo) { + if (priv->base.pbo == 0) + glGenBuffers(1, &priv->base.pbo); + + gl_usage = GL_STREAM_READ; + + glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo); + glBufferData(GL_PIXEL_PACK_BUFFER, + pixmap->devKind * pixmap->drawable.height, NULL, + gl_usage); + } else { + pixmap->devPrivate.ptr = malloc(pixmap->devKind * + pixmap->drawable.height); + if (!pixmap->devPrivate.ptr) + return FALSE; + } + priv->base.map_access = access; + } + + glamor_download_boxes(pixmap, RegionRects(®ion), RegionNumRects(®ion), + 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); + + RegionUninit(®ion); + + if (glamor_priv->has_rw_pbo) { + if (priv->base.map_access == GLAMOR_ACCESS_RW) + gl_access = GL_READ_WRITE; + else + gl_access = GL_READ_ONLY; + + pixmap->devPrivate.ptr = glMapBuffer(GL_PIXEL_PACK_BUFFER, gl_access); + glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + } + + priv->base.prepared = TRUE; + return TRUE; +} + +/* + * When we're done with the drawable, unmap the PBO, reupload + * if we were writing to it and then unbind it to release the memory + */ + +static void +glamor_fini_pixmap(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); + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) + return; + + if (!priv->base.prepared) + return; + + if (glamor_priv->has_rw_pbo) { + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, priv->base.pbo); + glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); + pixmap->devPrivate.ptr = NULL; + } + + if (priv->base.map_access == GLAMOR_ACCESS_RW) { + glamor_upload_boxes(pixmap, + RegionRects(&priv->base.prepare_region), + RegionNumRects(&priv->base.prepare_region), + 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); + } + + RegionUninit(&priv->base.prepare_region); + + if (glamor_priv->has_rw_pbo) { + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glDeleteBuffers(1, &priv->base.pbo); + priv->base.pbo = 0; + } else { + free(pixmap->devPrivate.ptr); + pixmap->devPrivate.ptr = NULL; + } + + priv->base.prepared = FALSE; +} + +Bool +glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) +{ + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); + BoxRec box; + int off_x, off_y; + + glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); + + box.x1 = drawable->x + off_x; + box.x2 = box.x1 + drawable->width; + box.y1 = drawable->y + off_y; + box.y2 = box.y1 + drawable->height; + return glamor_prep_pixmap_box(pixmap, access, &box); +} + +Bool +glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, + int x, int y, int w, int h) +{ + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); + BoxRec box; + int off_x, off_y; + + glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); + box.x1 = drawable->x + x + off_x; + box.x2 = box.x1 + w; + box.y1 = drawable->y + y + off_y; + box.y2 = box.y1 + h; + return glamor_prep_pixmap_box(pixmap, access, &box); +} + +void +glamor_finish_access(DrawablePtr drawable) +{ + glamor_fini_pixmap(glamor_get_drawable_pixmap(drawable)); +} + +/* + * Make a picture ready to use with fb. + */ + +Bool +glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access) +{ + if (!picture || !picture->pDrawable) + return TRUE; + + return glamor_prepare_access(picture->pDrawable, access); +} + +Bool +glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access, + int x, int y, int w, int h) +{ + if (!picture || !picture->pDrawable) + return TRUE; + return glamor_prepare_access_box(picture->pDrawable, access, + x, y, w, h); +} + +void +glamor_finish_access_picture(PicturePtr picture) +{ + if (!picture || !picture->pDrawable) + return; + + glamor_finish_access(picture->pDrawable); +} + +/* + * Make a GC ready to use with fb. This just + * means making sure the appropriate fill pixmap is + * in CPU memory again + */ + +Bool +glamor_prepare_access_gc(GCPtr gc) +{ + switch (gc->fillStyle) { + case FillTiled: + return glamor_prepare_access(&gc->tile.pixmap->drawable, + GLAMOR_ACCESS_RO); + case FillStippled: + case FillOpaqueStippled: + return glamor_prepare_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO); + } + return TRUE; +} + +/* + * Free any temporary CPU pixmaps for the GC + */ +void +glamor_finish_access_gc(GCPtr gc) +{ + switch (gc->fillStyle) { + case FillTiled: + glamor_finish_access(&gc->tile.pixmap->drawable); + break; + case FillStippled: + case FillOpaqueStippled: + glamor_finish_access(&gc->stipple->drawable); + break; + } +} diff --git a/xserver/glamor/glamor_segment.c b/xserver/glamor/glamor_prepare.h similarity index 63% rename from xserver/glamor/glamor_segment.c rename to xserver/glamor/glamor_prepare.h index 53f7da0cb..85fa79574 100644 --- a/xserver/glamor/glamor_segment.c +++ b/xserver/glamor/glamor_prepare.h @@ -20,25 +20,33 @@ * OF THIS SOFTWARE. */ -#include "glamor_priv.h" +#ifndef _GLAMOR_PREPARE_H_ +#define _GLAMOR_PREPARE_H_ Bool -glamor_poly_segment_nf(DrawablePtr drawable, GCPtr gc, int nseg, - xSegment *seg) -{ - if (glamor_ddx_fallback_check_pixmap(drawable) && - glamor_ddx_fallback_check_gc(gc)) { - return FALSE; - } +glamor_prepare_access(DrawablePtr drawable, glamor_access_t access); - miPolySegment(drawable, gc, nseg, seg); - - return TRUE; -} +Bool +glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, + int x, int y, int w, int h); void -glamor_poly_segment(DrawablePtr drawable, GCPtr gc, int nseg, - xSegment *seg) -{ - miPolySegment(drawable, gc, nseg, seg); -} +glamor_finish_access(DrawablePtr drawable); + +Bool +glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access); + +Bool +glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access, + int x, int y, int w, int h); + +void +glamor_finish_access_picture(PicturePtr picture); + +Bool +glamor_prepare_access_gc(GCPtr gc); + +void +glamor_finish_access_gc(GCPtr gc); + +#endif /* _GLAMOR_PREPARE_H_ */ diff --git a/xserver/glamor/glamor_priv.h b/xserver/glamor/glamor_priv.h index c56c55973..612701a19 100644 --- a/xserver/glamor/glamor_priv.h +++ b/xserver/glamor/glamor_priv.h @@ -29,8 +29,13 @@ #include "dix-config.h" -#include #include "glamor.h" +#include "xvdix.h" + +#if XSYNC +#include "misyncshm.h" +#include "misyncstr.h" +#endif #include #if GLAMOR_HAS_GBM @@ -162,6 +167,30 @@ typedef struct { 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; @@ -183,6 +212,10 @@ struct glamor_saved_procs { DestroyPictureProcPtr destroy_picture; UnrealizeGlyphProcPtr unrealize_glyph; SetWindowPixmapProcPtr set_window_pixmap; +#if XSYNC + SyncScreenFuncsRec sync_screen_funcs; +#endif + ScreenBlockHandlerProcPtr block_handler; }; #define CACHE_FORMAT_COUNT 3 @@ -193,13 +226,7 @@ struct glamor_saved_procs { #define GLAMOR_TICK_AFTER(t0, t1) \ (((int)(t1) - (int)(t0)) < 0) -#define IDLE_STATE 0 -#define RENDER_STATE 1 -#define BLIT_STATE 2 -#define RENDER_IDEL_MAX 32 - typedef struct glamor_screen_private { - Bool yInverted; unsigned int tick; enum glamor_gl_flavor gl_flavor; int glsl_version; @@ -208,16 +235,16 @@ typedef struct glamor_screen_private { 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; int max_fbo_size; + int has_rw_pbo; struct xorg_list fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT]; unsigned long fbo_cache_watermark; - /* glamor_solid */ - GLint solid_prog; - GLint solid_color_uniform_location; - /* glamor point shader */ glamor_program point_prog; @@ -235,6 +262,20 @@ typedef struct glamor_screen_private { glamor_program te_text_prog; glamor_program image_text_prog; + /* glamor copy shaders */ + glamor_program copy_area_prog; + glamor_program copy_plane_prog; + + /* glamor line shader */ + glamor_program_fill poly_line_program; + + /* glamor segment shaders */ + glamor_program_fill poly_segment_program; + + /* glamor dash line shader */ + glamor_program_fill on_off_dash_line_progs; + glamor_program double_dash_line_prog; + /* vertext/elment_index buffer object for render */ GLuint vbo, ebo; /** Next offset within the VBO that glamor_get_vbo_space() will use. */ @@ -254,34 +295,25 @@ typedef struct glamor_screen_private { [SHADER_MASK_COUNT] [SHADER_IN_COUNT]; glamor_glyph_cache_t glyphCaches[GLAMOR_NUM_GLYPH_CACHE_FORMATS]; - Bool glyph_cache_initialized; + glamor_glyph_mask_cache_t *mask_cache[GLAMOR_NUM_GLYPH_CACHE_FORMATS]; + Bool glyph_caches_realized; /* shaders to restore a texture to another texture. */ GLint finish_access_prog[2]; GLint finish_access_revert[2]; GLint finish_access_swap_rb[2]; - /* glamor_tile */ - GLint tile_prog; - GLint tile_wh; - /* glamor gradient, 0 for small nstops, 1 for large nstops and 2 for dynamic generate. */ GLint gradient_prog[SHADER_GRADIENT_COUNT][3]; int linear_max_nstops; int radial_max_nstops; - /* glamor trapezoid shader. */ - GLint trapezoid_prog; - - PixmapPtr *back_pixmap; int screen_fbo; struct glamor_saved_procs saved_procs; char delayed_fallback_string[GLAMOR_DELAYED_STRING_MAX + 1]; int delayed_fallback_pending; int flags; - int state; - unsigned int render_idle_cnt; ScreenPtr screen; int dri3_enabled; @@ -322,6 +354,7 @@ enum glamor_fbo_state { * @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. @@ -335,6 +368,7 @@ typedef struct glamor_pixmap_fbo { GLuint pbo; int width; int height; + Bool external; GLenum format; GLenum type; glamor_screen_private *glamor_priv; @@ -405,14 +439,6 @@ typedef struct glamor_pixmap_clipped_regions { RegionPtr region; } glamor_pixmap_clipped_regions; -#define SET_PIXMAP_FBO_CURRENT(priv, idx) \ - do { \ - if (priv->type == GLAMOR_TEXTURE_LARGE) { \ - (priv)->large.base.fbo = priv->large.fbo_array[idx]; \ - (priv)->large.box = priv->large.box_array[idx]; \ - } \ - } while(0) - typedef struct glamor_pixmap_private_base { glamor_pixmap_type_t type; enum glamor_fbo_state gl_fbo; @@ -430,6 +456,9 @@ typedef struct glamor_pixmap_private_base { int drm_stride; glamor_screen_private *glamor_priv; PicturePtr picture; + GLuint pbo; + RegionRec prepare_region; + Bool prepared; #if GLAMOR_HAS_GBM EGLImageKHR image; #endif @@ -482,6 +511,15 @@ typedef struct glamor_pixmap_private { }; } glamor_pixmap_private; +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]; + } +} + static inline glamor_pixmap_fbo * glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int x, int y) { @@ -528,7 +566,7 @@ glamor_pixmap_hcnt(glamor_pixmap_private *priv) for (y = 0; y < glamor_pixmap_hcnt(priv); y++) \ for (x = 0; x < glamor_pixmap_wcnt(priv); x++) -/* +/* * Pixmap dynamic status, used by dynamic upload feature. * * GLAMOR_NONE: initial status, don't need to do anything. @@ -544,19 +582,29 @@ typedef enum glamor_pixmap_status { GLAMOR_UPLOAD_FAILED } glamor_pixmap_status_t; -extern DevPrivateKey glamor_screen_private_key; -extern DevPrivateKey glamor_pixmap_private_key; +/* GC private structure. Currently holds only any computed dash pixmap */ + +typedef struct { + PixmapPtr dash; + PixmapPtr stipple; + DamagePtr stipple_damage; +} glamor_gc_private; + +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) { return (glamor_screen_private *) - dixLookupPrivate(&screen->devPrivates, glamor_screen_private_key); + dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); } static inline void glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) { - dixSetPrivate(&screen->devPrivates, glamor_screen_private_key, priv); + dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); } static inline glamor_pixmap_private * @@ -564,17 +612,23 @@ glamor_get_pixmap_private(PixmapPtr pixmap) { glamor_pixmap_private *priv; - priv = dixLookupPrivate(&pixmap->devPrivates, glamor_pixmap_private_key); + 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); + &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) +{ + return dixLookupPrivate(&gc->devPrivates, &glamor_gc_private_key); +} + /** * Returns TRUE if the given planemask covers all the significant bits in the * pixel values for pDrawable. @@ -602,7 +656,6 @@ 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_purge_fbo(glamor_pixmap_fbo *fbo); void glamor_init_pixmap_fbo(ScreenPtr screen); void glamor_fini_pixmap_fbo(ScreenPtr screen); @@ -614,32 +667,13 @@ glamor_pixmap_fbo *glamor_create_fbo_array(glamor_screen_private *glamor_priv, int flag, int block_w, int block_h, glamor_pixmap_private *); -/* glamor_copyarea.c */ -RegionPtr - -glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, - int srcx, int srcy, int width, int height, int dstx, int dsty); -void glamor_copy_n_to_n(DrawablePtr src, DrawablePtr dst, GCPtr gc, - BoxPtr box, int nbox, int dx, int dy, Bool reverse, - Bool upsidedown, Pixel bitplane, void *closure); - /* glamor_core.c */ -Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access); -void glamor_finish_access(DrawablePtr drawable); -Bool glamor_prepare_access_window(WindowPtr window); -void glamor_finish_access_window(WindowPtr window); -Bool glamor_prepare_access_gc(GCPtr gc); -void glamor_finish_access_gc(GCPtr gc); void glamor_init_finish_access_shaders(ScreenPtr screen); void glamor_fini_finish_access_shaders(ScreenPtr screen); -const Bool glamor_get_drawable_location(const DrawablePtr drawable); + +Bool glamor_get_drawable_location(const DrawablePtr drawable); void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int *x, int *y); -Bool glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple, - int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, - unsigned long fg_pixel, unsigned long bg_pixel, - int stipple_x, int stipple_y); GLint glamor_compile_glsl_prog(GLenum type, const char *source); void glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); @@ -651,7 +685,7 @@ int glamor_set_destination_pixmap_priv(glamor_pixmap_private *pixmap_priv); void glamor_set_destination_pixmap_fbo(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. + * usually use the GLAMOR_PIXMAP_PRIV_HAS_FBO firstly. * */ void glamor_set_destination_pixmap_priv_nc(glamor_pixmap_private *pixmap_priv); @@ -665,17 +699,8 @@ Bool glamor_set_alu(ScreenPtr screen, unsigned char alu); Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask); RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap); -/* glamor_fill.c */ -Bool glamor_fill(DrawablePtr drawable, - GCPtr gc, int x, int y, int width, int height, Bool fallback); -Bool glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, - unsigned long fg_pixel); -Bool glamor_solid_boxes(PixmapPtr pixmap, - BoxPtr box, int nbox, unsigned long fg_pixel); - -void glamor_init_solid_shader(ScreenPtr screen); -void glamor_fini_solid_shader(ScreenPtr screen); +void +glamor_track_stipple(GCPtr gc); /* glamor_glyphs.c */ Bool glamor_realize_glyph_caches(ScreenPtr screen); @@ -687,10 +712,6 @@ void glamor_glyphs(CARD8 op, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs); -/* glamor_polylines.c */ -void glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, - DDXPointPtr points); - /* glamor_render.c */ Bool glamor_composite_clipped_region(CARD8 op, PicturePtr source, @@ -724,8 +745,6 @@ void glamor_composite_glyph_rects(CARD8 op, void glamor_composite_rects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, xRectangle *rects); -void glamor_init_trapezoid_shader(ScreenPtr screen); -void glamor_fini_trapezoid_shader(ScreenPtr screen); PicturePtr glamor_convert_gradient_picture(ScreenPtr screen, PicturePtr source, int x_source, @@ -756,14 +775,6 @@ void glamor_trapezoids(CARD8 op, PictFormatPtr mask_format, INT16 x_src, INT16 y_src, int ntrap, xTrapezoid *traps); -/* glamor_tile.c */ -Bool glamor_tile(PixmapPtr pixmap, PixmapPtr tile, - int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, - int tile_x, int tile_y); -void glamor_init_tile_shader(ScreenPtr screen); -void glamor_fini_tile_shader(ScreenPtr screen); - /* glamor_gradient.c */ void glamor_init_gradient_shader(ScreenPtr screen); void glamor_fini_gradient_shader(ScreenPtr screen); @@ -801,31 +812,6 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset); void glamor_put_vbo_space(ScreenPtr screen); -/** - * Download a pixmap's texture to cpu memory. If success, - * One copy of current pixmap's texture will be put into - * the pixmap->devPrivate.ptr. Will use pbo to map to - * the pointer if possible. - * The pixmap must be a gl texture pixmap. gl_fbo must be GLAMOR_FBO_NORMAL and - * gl_tex must be 1. Used by glamor_prepare_access. - * - */ -Bool glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access); - -void *glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, - int h, int stride, void *bits, int pbo, - glamor_access_t access); - -/** - * Restore a pixmap's data which is downloaded by - * glamor_download_pixmap_to_cpu to its original - * gl texture. Used by glamor_finish_access. - * - * The pixmap must originally be a texture -- gl_fbo must be - * GLAMOR_FBO_NORMAL. - **/ -void glamor_restore_pixmap_to_texture(PixmapPtr pixmap); - /** * According to the flag, * if the flag is GLAMOR_CREATE_FBO_NO_FBO then just ensure @@ -846,11 +832,6 @@ Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h, int stride, void *bits, int pbo); -PixmapPtr glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, - int w, int h, glamor_access_t access); -void glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, - int w, int h, glamor_access_t access); - glamor_pixmap_clipped_regions * glamor_compute_clipped_regions(glamor_pixmap_private *priv, RegionPtr region, int *clipped_nbox, @@ -909,20 +890,10 @@ Bool glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenum type, int no_alpha, int revert, int swap_rb, void *bits); -/** - * Destroy all the resources allocated on the uploading - * phase, includs the tex and fbo. - **/ -void glamor_destroy_upload_pixmap(PixmapPtr pixmap); - int glamor_create_picture(PicturePtr picture); void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap); -Bool glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access); - -void glamor_finish_access_picture(PicturePtr picture); - void glamor_destroy_picture(PicturePtr picture); /* fixup a fbo to the exact size as the pixmap. */ @@ -935,11 +906,6 @@ void glamor_picture_format_fixup(PicturePtr picture, void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); -RegionPtr glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, - int dstx, int dsty, - unsigned long bitPlane); - /* glamor_text.c */ int glamor_poly_text8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars); @@ -981,6 +947,48 @@ void glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); +/* glamor_dash.c */ +Bool +glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points); + +Bool +glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs); + +/* glamor_lines.c */ +void +glamor_poly_lines(DrawablePtr drawable, GCPtr gc, + int mode, int n, DDXPointPtr points); + +/* glamor_segs.c */ +void +glamor_poly_segment(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs); + +/* glamor_copy.c */ +void +glamor_copy(DrawablePtr src, + DrawablePtr dst, + GCPtr gc, + BoxPtr box, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure); + +RegionPtr +glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, + int srcx, int srcy, int width, int height, int dstx, int dsty); + +RegionPtr +glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, + int srcx, int srcy, int width, int height, int dstx, int dsty, + unsigned long bitplane); + /* glamor_glyphblt.c */ void glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, @@ -996,17 +1004,28 @@ void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); -void glamor_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment *pSeg); - -void glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, - DDXPointPtr ppt); - void glamor_composite_rectangles(CARD8 op, PicturePtr dst, xRenderColor *color, int num_rects, xRectangle *rects); +/* glamor_sync.c */ +Bool +glamor_sync_init(ScreenPtr screen); + +void +glamor_sync_close(ScreenPtr screen); + +/* glamor_util.c */ +void +glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, + unsigned long fg_pixel); + +void +glamor_solid_boxes(PixmapPtr pixmap, + BoxPtr box, int nbox, unsigned long fg_pixel); + + /* glamor_xv */ typedef struct { uint32_t transform_index; @@ -1028,21 +1047,46 @@ typedef struct { int src_pix_w, src_pix_h; } glamor_port_private; -void glamor_init_xv_shader(ScreenPtr screen); -void glamor_fini_xv_shader(ScreenPtr screen); +extern XvAttributeRec glamor_xv_attributes[]; +extern int glamor_xv_num_attributes; +extern XvImageRec glamor_xv_images[]; +extern int glamor_xv_num_images; + +void glamor_xv_init_port(glamor_port_private *port_priv); +void glamor_xv_stop_video(glamor_port_private *port_priv); +int glamor_xv_set_port_attribute(glamor_port_private *port_priv, + Atom attribute, INT32 value); +int glamor_xv_get_port_attribute(glamor_port_private *port_priv, + Atom attribute, INT32 *value); +int glamor_xv_query_image_attributes(int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets); +int glamor_xv_put_image(glamor_port_private *port_priv, + DrawablePtr pDrawable, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + int id, + unsigned char *buf, + short width, + short height, + Bool sync, + RegionPtr clipBoxes); +void glamor_xv_core_init(ScreenPtr screen); +void glamor_xv_render(glamor_port_private *port_priv); #include"glamor_utils.h" -/* Dynamic pixmap upload to texture if needed. +/* Dynamic pixmap upload to texture if needed. * Sometimes, the target is a gl texture pixmap/picture, * but the source or mask is in cpu memory. In that case, - * upload the source/mask to gl texture and then avoid + * upload the source/mask to gl texture and then avoid * fallback the whole process to cpu. Most of the time, * this will increase performance obviously. */ #define GLAMOR_PIXMAP_DYNAMIC_UPLOAD #define GLAMOR_GRADIENT_SHADER -#define GLAMOR_TRAPEZOID_SHADER #define GLAMOR_TEXTURED_LARGE_PIXMAP 1 #define WALKAROUND_LARGE_TEXTURE_MAP #if 0 @@ -1053,4 +1097,6 @@ void glamor_fini_xv_shader(ScreenPtr screen); #include "glamor_font.h" +#define GLAMOR_MIN_ALU_INSTRUCTIONS 128 /* Minimum required number of native ALU instructions */ + #endif /* GLAMOR_PRIV_H */ diff --git a/xserver/glamor/glamor_program.c b/xserver/glamor/glamor_program.c index 0f4d0f06a..3207aaf15 100644 --- a/xserver/glamor/glamor_program.c +++ b/xserver/glamor/glamor_program.c @@ -51,42 +51,51 @@ static const glamor_facet glamor_fill_tile = { .use = use_tile, }; -#if 0 static Bool -use_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog) +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); + return glamor_set_stippled(pixmap, gc, prog->fg_uniform, + prog->fill_offset_uniform, + prog->fill_size_uniform); } static const glamor_facet glamor_fill_stipple = { .name = "stipple", - .version = 130, - .vs_exec = " fill_pos = fill_offset + primitive.xy + pos;\n"; - .fs_exec = (" if (texelFetch(sampler, ivec2(mod(fill_pos,fill_size)), 0).x == 0)\n" + .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\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 + " gl_FragColor = fg;\n"), + .locations = glamor_program_location_fg | glamor_program_location_fill, .use = use_stipple, }; +static Bool +use_opaque_stipple(PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg) +{ + if (!use_stipple(pixmap, gc, prog, arg)) + return FALSE; + glamor_set_color(pixmap, gc->bgPixel, prog->bg_uniform); + return TRUE; +} + static const glamor_facet glamor_fill_opaque_stipple = { .name = "opaque_stipple", - .version = 130, - .vs_exec = " fill_pos = fill_offset + primitive.xy + pos;\n"; - .fs_exec = (" if (texelFetch(sampler, ivec2(mod(fill_pos,fill_size)), 0).x == 0)\n" + .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) / fill_size;\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_fill, .use = use_opaque_stipple }; -#endif static const glamor_facet *glamor_facet_fill[4] = { &glamor_fill_solid, &glamor_fill_tile, - NULL, - NULL, + &glamor_fill_stipple, + &glamor_fill_opaque_stipple, }; typedef struct { @@ -117,6 +126,16 @@ static glamor_location_var location_vars[] = { .location = glamor_program_location_font, .fs_vars = "uniform usampler2D font;\n", }, + { + .location = glamor_program_location_bitplane, + .fs_vars = ("uniform uvec4 bitplane;\n" + "uniform vec4 bitmul;\n"), + }, + { + .location = glamor_program_location_dash, + .vs_vars = "uniform float dash_length;\n", + .fs_vars = "uniform sampler2D dash;\n", + }, }; #define NUM_LOCATION_VARS (sizeof location_vars / sizeof location_vars[0]) @@ -196,6 +215,8 @@ static const glamor_facet facet_null_fill = { .name = "" }; +#define DBG 0 + static GLint glamor_get_uniform(glamor_program *prog, glamor_program_location location, @@ -281,7 +302,6 @@ glamor_build_program(ScreenPtr screen, if (!vs_prog_string || !fs_prog_string) goto fail; -#define DBG 0 #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); @@ -318,9 +338,10 @@ glamor_build_program(ScreenPtr screen, 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->font_uniform = glamor_get_uniform(prog, glamor_program_location_font, "font"); - - if (glGetError() != GL_NO_ERROR) - goto fail; + 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"); free(version_string); free(fs_vars); diff --git a/xserver/glamor/glamor_program.h b/xserver/glamor/glamor_program.h index 88efc3593..56ba03aa8 100644 --- a/xserver/glamor/glamor_program.h +++ b/xserver/glamor/glamor_program.h @@ -29,6 +29,8 @@ typedef enum { 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; typedef enum { @@ -61,6 +63,10 @@ struct _glamor_program { GLint fill_size_uniform; GLint fill_offset_uniform; GLint font_uniform; + GLint bitplane_uniform; + GLint bitmul_uniform; + GLint dash_uniform; + GLint dash_length_uniform; glamor_program_location locations; glamor_program_flag flags; glamor_use prim_use; diff --git a/xserver/glamor/glamor_render.c b/xserver/glamor/glamor_render.c index e5d5d2cb1..d9b16ea05 100644 --- a/xserver/glamor/glamor_render.c +++ b/xserver/glamor/glamor_render.c @@ -651,11 +651,12 @@ glamor_composite_with_copy(CARD8 op, if (region->extents.y2 + y_source - y_dest > source->pDrawable->height) goto cleanup_region; } - ret = glamor_copy_n_to_n_nf(source->pDrawable, - dest->pDrawable, NULL, - RegionRects(region), RegionNumRects(region), - x_source - x_dest, y_source - y_dest, - FALSE, FALSE, 0, NULL); + 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; } @@ -792,30 +793,29 @@ glamor_set_normalize_tcoords_generic(glamor_pixmap_private *priv, float *matrix, float xscale, float yscale, int x1, int y1, int x2, int y2, - int yInverted, float *texcoords, + float *texcoords, int stride) { if (!matrix && repeat_type == RepeatNone) glamor_set_normalize_tcoords_ext(priv, xscale, yscale, x1, y1, - x2, y2, yInverted, texcoords, stride); + x2, y2, texcoords, stride); else if (matrix && repeat_type == RepeatNone) glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, yscale, x1, y1, x2, y2, - yInverted, texcoords, stride); else if (!matrix && repeat_type != RepeatNone) glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, xscale, yscale, x1, y1, x2, y2, - yInverted, texcoords, stride); + texcoords, stride); else if (matrix && repeat_type != RepeatNone) glamor_set_repeat_transformed_normalize_tcoords_ext(priv, repeat_type, matrix, xscale, yscale, x1, y1, x2, - y2, yInverted, + y2, texcoords, stride); } @@ -1265,7 +1265,7 @@ glamor_composite_with_shader(CARD8 op, glamor_set_normalize_vcoords_ext(dest_pixmap_priv, dst_xscale, dst_yscale, x_dest, y_dest, x_dest + width, y_dest + height, - glamor_priv->yInverted, vertices, + vertices, vb_stride); vertices += 2; if (key.source != SHADER_SOURCE_SOLID) { @@ -1275,7 +1275,6 @@ glamor_composite_with_shader(CARD8 op, src_yscale, x_source, y_source, x_source + width, y_source + height, - glamor_priv->yInverted, vertices, vb_stride); vertices += 2; } @@ -1287,7 +1286,6 @@ glamor_composite_with_shader(CARD8 op, mask_yscale, x_mask, y_mask, x_mask + width, y_mask + height, - glamor_priv->yInverted, vertices, vb_stride); vertices += 2; } @@ -1315,8 +1313,6 @@ glamor_composite_with_shader(CARD8 op, glDisableVertexAttribArray(GLAMOR_VERTEX_MASK); glDisable(GL_BLEND); DEBUGF("finish rendering.\n"); - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; if (saved_source_format) source->format = saved_source_format; @@ -1404,6 +1400,7 @@ glamor_composite_clipped_region(CARD8 op, { 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; glamor_pixmap_private *temp_src_priv = source_pixmap_priv; glamor_pixmap_private *temp_mask_priv = mask_pixmap_priv; @@ -1506,7 +1503,14 @@ glamor_composite_clipped_region(CARD8 op, } } - /*XXXXX, self copy? */ + if (source_pixmap == dest_pixmap) { + glamor_fallback("source and dest pixmaps are the same\n"); + goto out; + } + if (mask_pixmap == dest_pixmap) { + glamor_fallback("mask and dest pixmaps are the same\n"); + goto out; + } x_dest += dest->pDrawable->x; y_dest += dest->pDrawable->y; @@ -1586,15 +1590,6 @@ _glamor_composite(CARD8 op, RegionRec region; BoxPtr extent; int nbox, ok = FALSE; - PixmapPtr sub_dest_pixmap = NULL; - PixmapPtr sub_source_pixmap = NULL; - PixmapPtr sub_mask_pixmap = NULL; - int dest_x_off, dest_y_off, saved_dest_x, saved_dest_y; - int source_x_off, source_y_off, saved_source_x, saved_source_y; - int mask_x_off, mask_y_off, saved_mask_x, saved_mask_y; - DrawablePtr saved_dest_drawable; - DrawablePtr saved_source_drawable; - DrawablePtr saved_mask_drawable; int force_clip = 0; dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap); @@ -1737,34 +1732,13 @@ _glamor_composite(CARD8 op, dest->pDrawable->width, dest->pDrawable->height, glamor_get_picture_location(dest)); -#define GET_SUB_PICTURE(p, access) do { \ - glamor_get_drawable_deltas(p->pDrawable, p ##_pixmap, \ - & p ##_x_off, & p ##_y_off); \ - sub_ ##p ##_pixmap = glamor_get_sub_pixmap(p ##_pixmap, \ - x_ ##p + p ##_x_off + p->pDrawable->x, \ - y_ ##p + p ##_y_off + p->pDrawable->y, \ - width, height, access); \ - if (sub_ ##p ##_pixmap != NULL) { \ - saved_ ##p ##_drawable = p->pDrawable; \ - saved_ ##p ##_x = x_ ##p; \ - saved_ ##p ##_y = y_ ##p; \ - if (p->pCompositeClip) \ - pixman_region_translate (p->pCompositeClip, \ - -p->pDrawable->x - x_ ##p, \ - -p->pDrawable->y - y_ ##p); \ - p->pDrawable = &sub_ ##p ##_pixmap->drawable; \ - x_ ##p = 0; \ - y_ ##p = 0; \ - } } while(0) - GET_SUB_PICTURE(dest, GLAMOR_ACCESS_RW); - if (source->pDrawable && !source->transform) - GET_SUB_PICTURE(source, GLAMOR_ACCESS_RO); - if (mask && mask->pDrawable && !mask->transform) - GET_SUB_PICTURE(mask, GLAMOR_ACCESS_RO); - - if (glamor_prepare_access_picture(dest, GLAMOR_ACCESS_RW) && - glamor_prepare_access_picture(source, GLAMOR_ACCESS_RO) && - glamor_prepare_access_picture(mask, GLAMOR_ACCESS_RO)) { + if (glamor_prepare_access_picture_box(dest, GLAMOR_ACCESS_RW, + x_dest, y_dest, width, height) && + glamor_prepare_access_picture_box(source, GLAMOR_ACCESS_RO, + x_source, y_source, width, height) && + glamor_prepare_access_picture_box(mask, GLAMOR_ACCESS_RO, + x_mask, y_mask, width, height)) + { fbComposite(op, source, mask, dest, x_source, y_source, @@ -1774,25 +1748,6 @@ _glamor_composite(CARD8 op, glamor_finish_access_picture(source); glamor_finish_access_picture(dest); -#define PUT_SUB_PICTURE(p, access) do { \ - if (sub_ ##p ##_pixmap != NULL) { \ - x_ ##p = saved_ ##p ##_x; \ - y_ ##p = saved_ ##p ##_y; \ - p->pDrawable = saved_ ##p ##_drawable; \ - if (p->pCompositeClip) \ - pixman_region_translate (p->pCompositeClip, \ - p->pDrawable->x + x_ ##p, \ - p->pDrawable->y + y_ ##p); \ - glamor_put_sub_pixmap(sub_ ##p ##_pixmap, p ##_pixmap, \ - x_ ##p + p ##_x_off + p->pDrawable->x, \ - y_ ##p + p ##_y_off + p->pDrawable->y, \ - width, height, access); \ - }} while(0) - if (mask && mask->pDrawable) - PUT_SUB_PICTURE(mask, GLAMOR_ACCESS_RO); - if (source->pDrawable) - PUT_SUB_PICTURE(source, GLAMOR_ACCESS_RO); - PUT_SUB_PICTURE(dest, GLAMOR_ACCESS_RW); done: return ret; } diff --git a/xserver/glamor/glamor_segs.c b/xserver/glamor/glamor_segs.c new file mode 100644 index 000000000..ff0daef10 --- /dev/null +++ b/xserver/glamor/glamor_segs.c @@ -0,0 +1,188 @@ +/* + * 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 "glamor_priv.h" +#include "glamor_program.h" +#include "glamor_transform.h" +#include "glamor_prepare.h" + +static const glamor_facet glamor_facet_poly_segment = { + .name = "poly_segment", + .vs_vars = "attribute vec2 primitive;\n", + .vs_exec = (" vec2 pos = vec2(0.0,0.0);\n" + GLAMOR_POS(gl_Position, primitive.xy)), +}; + +static Bool +glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs) +{ + 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_program *prog; + int off_x, off_y; + xSegment *v; + char *vbo_offset; + int box_x, box_y; + int add_last; + + pixmap_priv = glamor_get_pixmap_private(pixmap); + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + goto bail; + + add_last = 0; + if (gc->capStyle != CapNotLast) + add_last = 1; + + glamor_make_current(glamor_priv); + + prog = glamor_use_program_fill(pixmap, gc, + &glamor_priv->poly_segment_program, + &glamor_facet_poly_segment); + + if (!prog) + goto bail_ctx; + + /* Set up the vertex buffers for the points */ + + v = glamor_get_vbo_space(drawable->pScreen, + (nseg << add_last) * sizeof (xSegment), + &vbo_offset); + + glEnableVertexAttribArray(GLAMOR_VERTEX_POS); + glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, + sizeof(DDXPointRec), vbo_offset); + + if (add_last) { + int i, j; + for (i = 0, j=0; i < nseg; i++) { + v[j++] = segs[i]; + v[j].x1 = segs[i].x2; + v[j].y1 = segs[i].y2; + v[j].x2 = segs[i].x2+1; + v[j].y2 = segs[i].y2; + j++; + } + } else + memcpy(v, segs, nseg * sizeof (xSegment)); + + glamor_put_vbo_space(screen); + + glEnable(GL_SCISSOR_TEST); + + glamor_pixmap_loop(pixmap_priv, box_x, box_y) { + 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); + + while (nbox--) { + glScissor(box->x1 + off_x, + box->y1 + off_y, + box->x2 - box->x1, + box->y2 - box->y1); + box++; + glDrawArrays(GL_LINES, 0, nseg << (1 + add_last)); + } + } + + 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; +} + +static Bool +glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs) +{ + if (gc->lineWidth != 0) + return FALSE; + + switch (gc->lineStyle) { + case LineSolid: + return glamor_poly_segment_solid_gl(drawable, gc, nseg, segs); + case LineOnOffDash: + return glamor_poly_segment_dash_gl(drawable, gc, nseg, segs); + case LineDoubleDash: + if (gc->fillStyle == FillTiled) + return glamor_poly_segment_solid_gl(drawable, gc, nseg, segs); + else + return glamor_poly_segment_dash_gl(drawable, gc, nseg, segs); + default: + return FALSE; + } +} + +static void +glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs) +{ + glamor_fallback("to %p (%c)\n", drawable, + glamor_get_drawable_location(drawable)); + + if (gc->lineWidth == 0) { + if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && + glamor_prepare_access_gc(gc)) { + fbPolySegment(drawable, gc, nseg, segs); + } + glamor_finish_access_gc(gc); + glamor_finish_access(drawable); + } else + miPolySegment(drawable, gc, nseg, segs); +} + +void +glamor_poly_segment(DrawablePtr drawable, GCPtr gc, + int nseg, xSegment *segs) +{ + if (glamor_poly_segment_gl(drawable, gc, nseg, segs)) + return; + + 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 46ba6c38f..6ebb12e18 100644 --- a/xserver/glamor/glamor_spans.c +++ b/xserver/glamor/glamor_spans.c @@ -226,7 +226,7 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, 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); - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->fb); + glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); glPixelStorei(GL_PACK_ALIGNMENT, 4); d = dst; @@ -326,9 +326,6 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, glamor_make_current(glamor_priv); - 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); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { diff --git a/xserver/glamor/glamor_sync.c b/xserver/glamor/glamor_sync.c new file mode 100644 index 000000000..fbc47d4b3 --- /dev/null +++ b/xserver/glamor/glamor_sync.c @@ -0,0 +1,119 @@ +/* + * 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 "glamor_priv.h" +#include "misyncshm.h" +#include "misyncstr.h" + +#if XSYNC +/* + * This whole file exists to wrap a sync fence trigger operation so + * that we can flush GL to provide serialization between the server + * and the shm fence client + */ + +static DevPrivateKeyRec glamor_sync_fence_key; + +struct glamor_sync_fence { + SyncFenceSetTriggeredFunc set_triggered; +}; + +static inline struct glamor_sync_fence * +glamor_get_sync_fence(SyncFence *fence) +{ + return (struct glamor_sync_fence *) dixLookupPrivate(&fence->devPrivates, &glamor_sync_fence_key); +} + +static void +glamor_sync_fence_set_triggered (SyncFence *fence) +{ + ScreenPtr screen = fence->pScreen; + glamor_screen_private *glamor = glamor_get_screen_private(screen); + struct glamor_sync_fence *glamor_fence = glamor_get_sync_fence(fence); + + /* Flush pending rendering operations */ + glamor_make_current(glamor); + glFlush(); + + fence->funcs.SetTriggered = glamor_fence->set_triggered; + fence->funcs.SetTriggered(fence); + glamor_fence->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = glamor_sync_fence_set_triggered; +} + +static void +glamor_sync_create_fence(ScreenPtr screen, + SyncFence *fence, + Bool initially_triggered) +{ + glamor_screen_private *glamor = glamor_get_screen_private(screen); + SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); + struct glamor_sync_fence *glamor_fence = glamor_get_sync_fence(fence); + + screen_funcs->CreateFence = glamor->saved_procs.sync_screen_funcs.CreateFence; + screen_funcs->CreateFence(screen, fence, initially_triggered); + glamor->saved_procs.sync_screen_funcs.CreateFence = screen_funcs->CreateFence; + screen_funcs->CreateFence = glamor_sync_create_fence; + + glamor_fence->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = glamor_sync_fence_set_triggered; +} +#endif + +Bool +glamor_sync_init(ScreenPtr screen) +{ +#if XSYNC + glamor_screen_private *glamor = glamor_get_screen_private(screen); + SyncScreenFuncsPtr screen_funcs; + + if (!dixPrivateKeyRegistered(&glamor_sync_fence_key)) { + if (!dixRegisterPrivateKey(&glamor_sync_fence_key, + PRIVATE_SYNC_FENCE, + sizeof (struct glamor_sync_fence))) + return FALSE; + } + +#ifdef HAVE_XSHMFENCE + if (!miSyncShmScreenInit(screen)) + return FALSE; +#endif + + screen_funcs = miSyncGetScreenFuncs(screen); + glamor->saved_procs.sync_screen_funcs.CreateFence = screen_funcs->CreateFence; + screen_funcs->CreateFence = glamor_sync_create_fence; +#endif + return TRUE; +} + +void +glamor_sync_close(ScreenPtr screen) +{ +#if XSYNC + glamor_screen_private *glamor = glamor_get_screen_private(screen); + SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); + + if (screen_funcs) + screen_funcs->CreateFence = glamor->saved_procs.sync_screen_funcs.CreateFence; +#endif +} diff --git a/xserver/glamor/glamor_text.c b/xserver/glamor/glamor_text.c index 6e02b9aa8..59cd0fdc8 100644 --- a/xserver/glamor/glamor_text.c +++ b/xserver/glamor/glamor_text.c @@ -293,9 +293,6 @@ glamor_poly_text(DrawablePtr drawable, GCPtr gc, glDisable(GL_COLOR_LOGIC_OP); - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; - *final_pos = x; return TRUE; @@ -493,9 +490,6 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc, (void) glamor_text(drawable, gc, glamor_font, prog, x, y, count, chars, charinfo, sixteen); - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; - return TRUE; bail: diff --git a/xserver/glamor/glamor_tile.c b/xserver/glamor/glamor_tile.c deleted file mode 100644 index 4e479763e..000000000 --- a/xserver/glamor/glamor_tile.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * - * 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: - * Eric Anholt - * Zhigang Gong - * - */ - -#include "glamor_priv.h" - -/** @file glamor_tile.c - * - * Implements the basic fill-with-a-tile support used by multiple GC ops. - */ - -void -glamor_init_tile_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - const char *tile_vs = - "attribute vec4 v_position;\n" - "attribute vec4 v_texcoord0;\n" - "varying vec2 tile_texture;\n" - "void main()\n" - "{\n" - " gl_Position = v_position;\n" - " tile_texture = v_texcoord0.xy;\n" - "}\n"; - const char *tile_fs = - GLAMOR_DEFAULT_PRECISION - "varying vec2 tile_texture;\n" - "uniform sampler2D sampler;\n" - "uniform vec2 wh;" - "void main()\n" - "{\n" - " vec2 rel_tex;" - " rel_tex = tile_texture * wh; \n" - " rel_tex = floor(rel_tex) + (fract(rel_tex) / wh); \n" - " gl_FragColor = texture2D(sampler, rel_tex);\n" - "}\n"; - GLint fs_prog, vs_prog; - GLint sampler_uniform_location; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glamor_priv->tile_prog = glCreateProgram(); - vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, tile_vs); - fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, tile_fs); - glAttachShader(glamor_priv->tile_prog, vs_prog); - glAttachShader(glamor_priv->tile_prog, fs_prog); - - glBindAttribLocation(glamor_priv->tile_prog, - GLAMOR_VERTEX_POS, "v_position"); - glBindAttribLocation(glamor_priv->tile_prog, - GLAMOR_VERTEX_SOURCE, "v_texcoord0"); - glamor_link_glsl_prog(screen, glamor_priv->tile_prog, "tile"); - - sampler_uniform_location = - glGetUniformLocation(glamor_priv->tile_prog, "sampler"); - glUseProgram(glamor_priv->tile_prog); - glUniform1i(sampler_uniform_location, 0); - - glamor_priv->tile_wh = - glGetUniformLocation(glamor_priv->tile_prog, "wh"); -} - -void -glamor_fini_tile_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glDeleteProgram(glamor_priv->tile_prog); -} - -static void -_glamor_tile(PixmapPtr pixmap, PixmapPtr tile, - int x, int y, int width, int height, int tile_x, int tile_y) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - int x1 = x; - int x2 = x + width; - int y1 = y; - int y2 = y + height; - int tile_x1 = tile_x; - int tile_x2 = tile_x + width; - int tile_y1 = tile_y; - int tile_y2 = tile_y + height; - float vertices[8]; - float source_texcoords[8]; - GLfloat dst_xscale, dst_yscale, src_xscale, src_yscale; - glamor_pixmap_private *src_pixmap_priv; - glamor_pixmap_private *dst_pixmap_priv; - float wh[4]; - - src_pixmap_priv = glamor_get_pixmap_private(tile); - dst_pixmap_priv = glamor_get_pixmap_private(pixmap); - - glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); - pixmap_priv_get_dest_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale); - pixmap_priv_get_scale(src_pixmap_priv, &src_xscale, &src_yscale); - glamor_make_current(glamor_priv); - glUseProgram(glamor_priv->tile_prog); - - glamor_pixmap_fbo_fix_wh_ratio(wh, src_pixmap_priv); - glUniform2fv(glamor_priv->tile_wh, 1, wh); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, src_pixmap_priv->base.fbo->tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glamor_set_repeat_normalize_tcoords - (src_pixmap_priv, RepeatNormal, - src_xscale, src_yscale, - tile_x1, tile_y1, - tile_x2, tile_y2, glamor_priv->yInverted, source_texcoords); - - glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE, - 2 * sizeof(float), source_texcoords); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - - glamor_set_normalize_vcoords(dst_pixmap_priv, dst_xscale, dst_yscale, - x1, y1, - x2, y2, glamor_priv->yInverted, vertices); - - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, - 2 * sizeof(float), vertices); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - - glamor_priv->state = RENDER_STATE; - glamor_priv->render_idle_cnt = 0; -} - -Bool -glamor_tile(PixmapPtr pixmap, PixmapPtr tile, - int x, int y, int width, int height, - unsigned char alu, unsigned long planemask, int tile_x, int tile_y) -{ - ScreenPtr screen = pixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_private *dst_pixmap_priv; - glamor_pixmap_private *src_pixmap_priv; - - dst_pixmap_priv = glamor_get_pixmap_private(pixmap); - src_pixmap_priv = glamor_get_pixmap_private(tile); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_pixmap_priv)) - return FALSE; - - if (glamor_priv->tile_prog == 0) { - glamor_fallback("Tiling unsupported\n"); - goto fail; - } - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(src_pixmap_priv)) { - /* XXX dynamic uploading candidate. */ - glamor_fallback("Non-texture tile pixmap\n"); - goto fail; - } - - if (!glamor_set_planemask(pixmap, planemask)) { - glamor_fallback("unsupported planemask %lx\n", planemask); - goto fail; - } - - glamor_make_current(glamor_priv); - if (!glamor_set_alu(screen, alu)) { - glamor_fallback("unsupported alu %x\n", alu); - goto fail; - } - - if (dst_pixmap_priv->type == GLAMOR_TEXTURE_LARGE - || src_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - glamor_pixmap_clipped_regions *clipped_dst_regions; - int n_dst_region, i, j, k; - BoxRec box; - RegionRec region; - - box.x1 = x; - box.y1 = y; - box.x2 = x + width; - box.y2 = y + height; - RegionInitBoxes(®ion, &box, 1); - clipped_dst_regions = glamor_compute_clipped_regions(dst_pixmap_priv, - ®ion, - &n_dst_region, 0, - 0, 0); - for (i = 0; i < n_dst_region; i++) { - int n_src_region; - glamor_pixmap_clipped_regions *clipped_src_regions; - BoxPtr current_boxes; - int n_current_boxes; - - SET_PIXMAP_FBO_CURRENT(dst_pixmap_priv, - clipped_dst_regions[i].block_idx); - - if (src_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - RegionTranslate(clipped_dst_regions[i].region, - tile_x - x, tile_y - y); - DEBUGF("tiled a large src pixmap. %dx%d \n", - tile->drawable.width, tile->drawable.height); - clipped_src_regions = - glamor_compute_clipped_regions(src_pixmap_priv, - clipped_dst_regions[i]. - region, &n_src_region, 1, 0, - 0); - DEBUGF("got %d src regions %d \n", n_src_region); - for (j = 0; j < n_src_region; j++) { - - SET_PIXMAP_FBO_CURRENT(src_pixmap_priv, - clipped_src_regions[j].block_idx); - - RegionTranslate(clipped_src_regions[j].region, - x - tile_x, y - tile_y); - current_boxes = RegionRects(clipped_src_regions[j].region); - n_current_boxes = - RegionNumRects(clipped_src_regions[j].region); - for (k = 0; k < n_current_boxes; k++) { - DEBUGF - ("Tile on %d %d %d %d dst block id %d tile block id %d tilex %d tiley %d\n", - current_boxes[k].x1, current_boxes[k].y1, - current_boxes[k].x2 - current_boxes[k].x1, - current_boxes[k].y2 - current_boxes[k].y1, - clipped_dst_regions[i].block_idx, - clipped_src_regions[j].block_idx, - (tile_x + (current_boxes[k].x1 - x)), - tile_y + (current_boxes[k].y1 - y)); - - _glamor_tile(pixmap, tile, - current_boxes[k].x1, current_boxes[k].y1, - current_boxes[k].x2 - current_boxes[k].x1, - current_boxes[k].y2 - current_boxes[k].y1, - (tile_x + (current_boxes[k].x1 - x)), - (tile_y + (current_boxes[k].y1 - y))); - } - - RegionDestroy(clipped_src_regions[j].region); - } - free(clipped_src_regions); - } - else { - current_boxes = RegionRects(clipped_dst_regions[i].region); - n_current_boxes = RegionNumRects(clipped_dst_regions[i].region); - for (k = 0; k < n_current_boxes; k++) { - _glamor_tile(pixmap, tile, - current_boxes[k].x1, current_boxes[k].y1, - current_boxes[k].x2 - current_boxes[k].x1, - current_boxes[k].y2 - current_boxes[k].y1, - (tile_x + (current_boxes[k].x1 - x)), - (tile_y + (current_boxes[k].y1 - y))); - } - } - RegionDestroy(clipped_dst_regions[i].region); - } - free(clipped_dst_regions); - RegionUninit(®ion); - } - else - _glamor_tile(pixmap, tile, x, y, width, height, tile_x, tile_y); - - glamor_set_alu(screen, GXcopy); - return TRUE; - fail: - return FALSE; - -} diff --git a/xserver/glamor/glamor_transfer.c b/xserver/glamor/glamor_transfer.c index ad875c962..aa5e8616e 100644 --- a/xserver/glamor/glamor_transfer.c +++ b/xserver/glamor/glamor_transfer.c @@ -72,11 +72,10 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_make_current(glamor_priv); - 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); - glPixelStorei(GL_UNPACK_ROW_LENGTH, byte_stride / bytes_per_pixel); + + 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); @@ -90,43 +89,39 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, while (nbox--) { /* compute drawable coordinates */ - int x1 = boxes->x1 + dx_dst; - int x2 = boxes->x2 + dx_dst; - int y1 = boxes->y1 + dy_dst; - int y2 = boxes->y2 + dy_dst; + int x1 = MAX(boxes->x1 + dx_dst, box->x1); + int x2 = MIN(boxes->x2 + dx_dst, box->x2); + int y1 = MAX(boxes->y1 + dy_dst, box->y1); + int y2 = MIN(boxes->y2 + dy_dst, box->y2); + + size_t ofs = (y1 - dy_dst + dy_src) * byte_stride; + ofs += (x1 - dx_dst + dx_src) * bytes_per_pixel; boxes++; - if (x1 < box->x1) - x1 = box->x1; - if (box->x2 < x2) - x2 = box->x2; - - if (x2 <= x1) + if (x2 <= x1 || y2 <= y1) continue; - if (y1 < box->y1) - y1 = box->y1; - if (box->y2 < y2) - y2 = box->y2; - - if (y2 <= y1) - continue; - - glPixelStorei(GL_UNPACK_SKIP_ROWS, y1 - dy_dst + dy_src); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1 - dx_dst + dx_src); - - glTexSubImage2D(GL_TEXTURE_2D, 0, - x1 - box->x1, y1 - box->y1, - x2 - x1, y2 - y1, - format, type, - bits); + if (glamor_priv->has_unpack_subimage || + x2 - x1 == byte_stride / bytes_per_pixel) { + glTexSubImage2D(GL_TEXTURE_2D, 0, + x1 - box->x1, y1 - box->y1, + x2 - x1, y2 - y1, + format, type, + bits + ofs); + } else { + for (; y1 < y2; y1++, ofs += byte_stride) + glTexSubImage2D(GL_TEXTURE_2D, 0, + x1 - box->x1, y1 - box->y1, + x2 - x1, 1, + format, type, + bits + ofs); + } } } - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + if (glamor_priv->has_unpack_subimage) + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); } /* @@ -182,7 +177,8 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_make_current(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); - glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel); + 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); @@ -190,41 +186,34 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, BoxPtr boxes = in_boxes; int nbox = in_nbox; - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->fb); + glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); while (nbox--) { /* compute drawable coordinates */ - int x1 = boxes->x1 + dx_src; - int x2 = boxes->x2 + dx_src; - int y1 = boxes->y1 + dy_src; - int y2 = boxes->y2 + dy_src; + int x1 = MAX(boxes->x1 + dx_src, box->x1); + int x2 = MIN(boxes->x2 + dx_src, box->x2); + int y1 = MAX(boxes->y1 + dy_src, box->y1); + int y2 = MIN(boxes->y2 + dy_src, box->y2); + size_t ofs = (y1 - dy_src + dy_dst) * byte_stride; + ofs += (x1 - dx_src + dx_dst) * bytes_per_pixel; boxes++; - if (x1 < box->x1) - x1 = box->x1; - if (box->x2 < x2) - x2 = box->x2; - - if (y1 < box->y1) - y1 = box->y1; - if (box->y2 < y2) - y2 = box->y2; - - if (x2 <= x1) - continue; - if (y2 <= y1) + if (x2 <= x1 || y2 <= y1) continue; - glPixelStorei(GL_PACK_SKIP_PIXELS, x1 - dx_src + dx_dst); - glPixelStorei(GL_PACK_SKIP_ROWS, y1 - dy_src + dy_dst); - glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits); + if (glamor_priv->has_pack_subimage || + x2 - x1 == byte_stride / bytes_per_pixel) { + glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits + ofs); + } else { + for (; y1 < y2; y1++, ofs += byte_stride) + glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, 1, format, type, bits + ofs); + } } } - glPixelStorei(GL_PACK_ROW_LENGTH, 0); - glPixelStorei(GL_PACK_SKIP_ROWS, 0); - glPixelStorei(GL_PACK_SKIP_PIXELS, 0); + if (glamor_priv->has_pack_subimage) + glPixelStorei(GL_PACK_ROW_LENGTH, 0); } /* diff --git a/xserver/glamor/glamor_transform.c b/xserver/glamor/glamor_transform.c index d6ba56421..c1df56018 100644 --- a/xserver/glamor/glamor_transform.c +++ b/xserver/glamor/glamor_transform.c @@ -198,6 +198,64 @@ glamor_set_tiled(PixmapPtr pixmap, size_uniform); } +static PixmapPtr +glamor_get_stipple_pixmap(GCPtr gc) +{ + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + ScreenPtr screen = gc->pScreen; + PixmapPtr bitmap; + PixmapPtr pixmap; + GCPtr scratch_gc; + ChangeGCVal changes[2]; + + if (gc_priv->stipple) + return gc_priv->stipple; + + bitmap = gc->stipple; + if (!bitmap) + goto bail; + + pixmap = glamor_create_pixmap(screen, + bitmap->drawable.width, + bitmap->drawable.height, + 8, GLAMOR_CREATE_NO_LARGE); + if (!pixmap) + goto bail; + + scratch_gc = GetScratchGC(8, screen); + if (!scratch_gc) + goto bail_pixmap; + + changes[0].val = 0xff; + changes[1].val = 0x00; + if (ChangeGC(NullClient, scratch_gc, + GCForeground|GCBackground, changes) != Success) + goto bail_gc; + ValidateGC(&pixmap->drawable, scratch_gc); + + (*scratch_gc->ops->CopyPlane)(&bitmap->drawable, + &pixmap->drawable, + scratch_gc, + 0, 0, + bitmap->drawable.width, + bitmap->drawable.height, + 0, 0, 0x1); + + FreeScratchGC(scratch_gc); + gc_priv->stipple = pixmap; + + glamor_track_stipple(gc); + + return pixmap; + +bail_gc: + FreeScratchGC(scratch_gc); +bail_pixmap: + glamor_destroy_pixmap(pixmap); +bail: + return NULL; +} + Bool glamor_set_stippled(PixmapPtr pixmap, GCPtr gc, @@ -205,11 +263,19 @@ glamor_set_stippled(PixmapPtr pixmap, GLint offset_uniform, GLint size_uniform) { + PixmapPtr stipple; + + stipple = glamor_get_stipple_pixmap(gc); + if (!stipple) + return FALSE; + if (!glamor_set_solid(pixmap, gc, TRUE, fg_uniform)) return FALSE; - if (!glamor_set_texture(pixmap, gc->stipple, gc->patOrg.x, gc->patOrg.y, offset_uniform, size_uniform)) - return FALSE; - - return TRUE; + return glamor_set_texture(pixmap, + stipple, + -gc->patOrg.x, + -gc->patOrg.y, + offset_uniform, + size_uniform); } diff --git a/xserver/glamor/glamor_trapezoid.c b/xserver/glamor/glamor_trapezoid.c index 4aba469af..f8bf6c97f 100644 --- a/xserver/glamor/glamor_trapezoid.c +++ b/xserver/glamor/glamor_trapezoid.c @@ -36,1532 +36,6 @@ #include "mipict.h" #include "fbpict.h" -static xFixed -_glamor_linefixedX(xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -static xFixed -_glamor_linefixedY(xLineFixed *l, xFixed x, Bool ceil) -{ - xFixed dy = l->p2.y - l->p1.y; - xFixed_32_32 ey = (xFixed_32_32) (x - l->p1.x) * dy; - xFixed dx = l->p2.x - l->p1.x; - - if (ceil) - ey += (dx - 1); - return l->p1.y + (xFixed) (ey / dx); -} - -#ifdef GLAMOR_TRAPEZOID_SHADER - -#define GLAMOR_VERTEX_TOP_BOTTOM (GLAMOR_VERTEX_SOURCE + 1) -#define GLAMOR_VERTEX_LEFT_PARAM (GLAMOR_VERTEX_SOURCE + 2) -#define GLAMOR_VERTEX_RIGHT_PARAM (GLAMOR_VERTEX_SOURCE + 3) - -#define DEBUG_CLIP_VTX 0 - -#define POINT_INSIDE_CLIP_RECT(point, rect) \ - (point[0] >= IntToxFixed(rect->x1) \ - && point[0] <= IntToxFixed(rect->x2) \ - && point[1] >= IntToxFixed(rect->y1) \ - && point[1] <= IntToxFixed(rect->y2)) - -static xFixed -_glamor_lines_crossfixedY(xLineFixed *l, xLineFixed *r) -{ - xFixed dx1 = l->p2.x - l->p1.x; - xFixed dx2 = r->p2.x - r->p1.x; - xFixed dy1 = l->p2.y - l->p1.y; - xFixed dy2 = r->p2.y - r->p1.y; - xFixed_32_32 tmp = (xFixed_32_32) dy2 * dy1; - xFixed_32_32 dividend1 = (tmp >> 32) * (l->p1.x - r->p1.x); - xFixed_32_32 dividend2; - xFixed_32_32 dividend3; - xFixed_32_32 divisor; - - tmp = (xFixed_32_32) dx1 *dy2; - - dividend2 = (tmp >> 32) * l->p1.y; - tmp = (xFixed_32_32) dy1 *dx2; - - dividend3 = (tmp >> 32) * r->p1.y; - divisor = ((xFixed_32_32) dx1 * (xFixed_32_32) dy2 - - (xFixed_32_32) dy1 * (xFixed_32_32) dx2) >> 32; - - if (divisor) - return (xFixed) ((dividend2 - dividend1 - dividend3) / divisor); - - return 0xFFFFFFFF; -} - -static Bool -point_inside_trapezoid(int point[2], xTrapezoid *trap, xFixed cut_y) -{ - int ret = TRUE; - int tmp; - - if (point[1] > trap->bottom) { - ret = FALSE; - if (DEBUG_CLIP_VTX) { - ErrorF("Out of Trap bottom, point[1] = %d(0x%x)), " - "bottom = %d(0x%x)\n", - (unsigned int) xFixedToInt(point[1]), point[1], - (unsigned int) xFixedToInt(trap->bottom), - (unsigned int) trap->bottom); - } - - return ret; - } - - if (point[1] < trap->top) { - ret = FALSE; - if (DEBUG_CLIP_VTX) { - ErrorF("Out of Trap top, point[1] = %d(0x%x)), " - "top = %d(0x%x)\n", - (unsigned int) xFixedToInt(point[1]), point[1], - (unsigned int) xFixedToInt(trap->top), - (unsigned int) trap->top); - } - - return ret; - } - - tmp = _glamor_linefixedX(&trap->left, point[1], FALSE); - if (point[0] < tmp) { - ret = FALSE; - - if (abs(cut_y - trap->top) < pixman_fixed_1_minus_e && - abs(point[1] - trap->top) < pixman_fixed_1_minus_e && - tmp - point[0] < pixman_fixed_1_minus_e) { - ret = TRUE; - } - else if (abs(cut_y - trap->bottom) < pixman_fixed_1_minus_e && - point[1] - trap->bottom < pixman_fixed_1_minus_e && - tmp - point[0] < pixman_fixed_1_minus_e) { - ret = TRUE; - } - - if (DEBUG_CLIP_VTX && !ret) { - ErrorF("Out of Trap left, point[0] = %d(0x%x)), " - "left = %d(0x%x)\n", - (unsigned int) xFixedToInt(point[0]), point[0], - (unsigned int) xFixedToInt(tmp), (unsigned int) tmp); - } - - if (!ret) - return ret; - } - - tmp = _glamor_linefixedX(&trap->right, point[1], TRUE); - if (point[0] > tmp) { - ret = FALSE; - - if (abs(cut_y - trap->top) < pixman_fixed_1_minus_e && - abs(point[1] - trap->top) < pixman_fixed_1_minus_e && - point[0] - tmp < pixman_fixed_1_minus_e) { - ret = TRUE; - } - else if (abs(cut_y - trap->bottom) < pixman_fixed_1_minus_e && - abs(point[1] - trap->bottom) < pixman_fixed_1_minus_e && - point[0] - tmp < pixman_fixed_1_minus_e) { - ret = TRUE; - } - - if (DEBUG_CLIP_VTX && !ret) { - ErrorF("Out of Trap right, point[0] = %d(0x%x)), " - "right = %d(0x%x)\n", - (unsigned int) xFixedToInt(point[0]), point[0], - (unsigned int) xFixedToInt(tmp), (unsigned int) tmp); - } - - if (!ret) - return ret; - } - - return ret; -} - -static void -glamor_emit_composite_vert(ScreenPtr screen, - float *vb, - const float *src_coords, - const float *mask_coords, - const float *dst_coords, int i) -{ - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - int j = 0; - - vb += i * glamor_priv->vb_stride / sizeof(float); - - vb[j++] = dst_coords[i * 2 + 0]; - vb[j++] = dst_coords[i * 2 + 1]; - if (glamor_priv->has_source_coords) { - vb[j++] = src_coords[i * 2 + 0]; - vb[j++] = src_coords[i * 2 + 1]; - } - if (glamor_priv->has_mask_coords) { - vb[j++] = mask_coords[i * 2 + 0]; - vb[j++] = mask_coords[i * 2 + 1]; - } - - glamor_priv->render_nr_verts++; -} - -static void -glamor_emit_composite_triangle(ScreenPtr screen, - float *vb, - const float *src_coords, - const float *mask_coords, - const float *dst_coords) -{ - glamor_emit_composite_vert(screen, vb, - src_coords, mask_coords, dst_coords, 0); - glamor_emit_composite_vert(screen, vb, - src_coords, mask_coords, dst_coords, 1); - glamor_emit_composite_vert(screen, vb, - src_coords, mask_coords, dst_coords, 2); -} - -static void -glamor_flush_composite_triangles(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - - glamor_make_current(glamor_priv); - glamor_put_vbo_space(screen); - - if (!glamor_priv->render_nr_verts) - return; - - glDrawArrays(GL_TRIANGLES, 0, glamor_priv->render_nr_verts); -} - -static Bool -_glamor_clip_trapezoid_vertex(xTrapezoid *trap, BoxPtr pbox, - int vertex[6], int *num) -{ - xFixed edge_cross_y = 0xFFFFFFFF; - int tl[2]; - int bl[2]; - int tr[2]; - int br[2]; - int left_cut_top[2]; - int left_cut_left[2]; - int left_cut_right[2]; - int left_cut_bottom[2]; - int right_cut_top[2]; - int right_cut_left[2]; - int right_cut_right[2]; - int right_cut_bottom[2]; - int tmp[2]; - int tmp_vtx[20 * 2]; - float tmp_vtx_slope[20]; - BoxRec trap_bound; - int i = 0; - int vertex_num = 0; - - if (DEBUG_CLIP_VTX) { - ErrorF - ("The parameter of xTrapezoid is:\ntop: %d 0x%x\tbottom: %d 0x%x\n" - "left: p1 (%d 0x%x, %d 0x%x)\tp2 (%d 0x%x, %d 0x%x)\n" - "right: p1 (%d 0x%x, %d 0x%x)\tp2 (%d 0x%x, %d 0x%x)\n", - xFixedToInt(trap->top), (unsigned int) trap->top, - xFixedToInt(trap->bottom), (unsigned int) trap->bottom, - xFixedToInt(trap->left.p1.x), (unsigned int) trap->left.p1.x, - xFixedToInt(trap->left.p1.y), (unsigned int) trap->left.p1.y, - xFixedToInt(trap->left.p2.x), (unsigned int) trap->left.p2.x, - xFixedToInt(trap->left.p2.y), (unsigned int) trap->left.p2.y, - xFixedToInt(trap->right.p1.x), (unsigned int) trap->right.p1.x, - xFixedToInt(trap->right.p1.y), (unsigned int) trap->right.p1.y, - xFixedToInt(trap->right.p2.x), (unsigned int) trap->right.p2.x, - xFixedToInt(trap->right.p2.y), (unsigned int) trap->right.p2.y); - } - - miTrapezoidBounds(1, trap, &trap_bound); - if (DEBUG_CLIP_VTX) - ErrorF("The bounds for this traps is: bounds.x1 = %d, bounds.x2 = %d, " - "bounds.y1 = %d, bounds.y2 = %d\n", trap_bound.x1, trap_bound.x2, - trap_bound.y1, trap_bound.y2); - - if (trap_bound.x1 > pbox->x2 || trap_bound.x2 < pbox->x1) - return FALSE; - if (trap_bound.y1 > pbox->y2 || trap_bound.y2 < pbox->y1) - return FALSE; - -#define IS_TRAP_EDGE_VERTICAL(edge) \ - (edge->p1.x == edge->p2.x) - -#define CACULATE_CUT_VERTEX(vtx, cal_x, ceil, vh_edge, edge) \ - do { \ - if(cal_x) { \ - vtx[1] = (vh_edge); \ - vtx[0] = (_glamor_linefixedX( \ - edge, vh_edge, ceil)); \ - if(DEBUG_CLIP_VTX) \ - ErrorF("The intersection point of line y=%d and " \ - "line of p1:(%d,%d) -- p2 (%d,%d) " \ - "is (%d, %d)\n", \ - xFixedToInt(vh_edge), \ - xFixedToInt(edge->p1.x), \ - xFixedToInt(edge->p1.y), \ - xFixedToInt(edge->p2.x), \ - xFixedToInt(edge->p2.y), \ - xFixedToInt(vtx[0]), \ - xFixedToInt(vtx[1])); \ - } else { \ - vtx[0] = (vh_edge); \ - vtx[1] = (_glamor_linefixedY( \ - edge, vh_edge, ceil)); \ - if(DEBUG_CLIP_VTX) \ - ErrorF("The intersection point of line x=%d and " \ - "line of p1:(%d,%d) -- p2 (%d,%d) " \ - "is (%d, %d)\n", \ - xFixedToInt(vh_edge), \ - xFixedToInt(edge->p1.x), \ - xFixedToInt(edge->p1.y), \ - xFixedToInt(edge->p2.x), \ - xFixedToInt(edge->p2.y), \ - xFixedToInt(vtx[0]), \ - xFixedToInt(vtx[1])); \ - } \ - } while(0) - -#define ADD_VERTEX_IF_INSIDE(vtx) \ - if(POINT_INSIDE_CLIP_RECT(vtx, pbox) \ - && point_inside_trapezoid(vtx, trap, edge_cross_y)){ \ - tmp_vtx[vertex_num] = xFixedToInt(vtx[0]); \ - tmp_vtx[vertex_num + 1] = xFixedToInt(vtx[1]); \ - vertex_num += 2; \ - if(DEBUG_CLIP_VTX) \ - ErrorF("@ Point: (%d, %d) is inside " \ - "the Rect and Trapezoid\n", \ - xFixedToInt(vtx[0]), \ - xFixedToInt(vtx[1])); \ - } else if(DEBUG_CLIP_VTX){ \ - ErrorF("X Point: (%d, %d) is outside " \ - "the Rect and Trapezoid\t", \ - xFixedToInt(vtx[0]), \ - xFixedToInt(vtx[1])); \ - if(POINT_INSIDE_CLIP_RECT(vtx, pbox)) \ - ErrorF("The Point is outside " \ - "the Trapezoid\n"); \ - else \ - ErrorF("The Point is outside " \ - "the Rect\n"); \ - } - - /*Trap's right edge cut right edge. */ - if ((!IS_TRAP_EDGE_VERTICAL((&trap->left))) || - (!IS_TRAP_EDGE_VERTICAL((&trap->right)))) { - edge_cross_y = _glamor_lines_crossfixedY((&trap->left), (&trap->right)); - if (DEBUG_CLIP_VTX) { - ErrorF("Trap's left edge cut right edge at %d(0x%x), " - "trap_top = %x, trap_bottom = %x\n", - xFixedToInt(edge_cross_y), edge_cross_y, - (unsigned int) trap->top, (unsigned int) trap->bottom); - } - } - - /*Trap's TopLeft, BottomLeft, TopRight and BottomRight. */ - CACULATE_CUT_VERTEX(tl, 1, FALSE, trap->top, (&trap->left)); - CACULATE_CUT_VERTEX(bl, 1, FALSE, trap->bottom, (&trap->left)); - CACULATE_CUT_VERTEX(tr, 1, TRUE, trap->top, (&trap->right)); - CACULATE_CUT_VERTEX(br, 1, TRUE, trap->bottom, (&trap->right)); - - if (DEBUG_CLIP_VTX) - ErrorF("Trap's TopLeft, BottomLeft, TopRight and BottomRight\n"); - if (DEBUG_CLIP_VTX) - ErrorF("Caculate the vertex of trapezoid:\n" - " (%3d, %3d)-------------------------(%3d, %3d)\n" - " / \\ \n" - " / \\ \n" - " / \\ \n" - " (%3d, %3d)---------------------------------(%3d, %3d)\n" - "Clip with rect:\n" - " (%3d, %3d)------------------------(%3d, %3d) \n" - " | | \n" - " | | \n" - " | | \n" - " (%3d, %3d)------------------------(%3d, %3d) \n", - xFixedToInt(tl[0]), xFixedToInt(tl[1]), xFixedToInt(tr[0]), - xFixedToInt(tr[1]), xFixedToInt(bl[0]), xFixedToInt(bl[1]), - xFixedToInt(br[0]), xFixedToInt(br[1]), - pbox->x1, pbox->y1, pbox->x2, pbox->y1, pbox->x1, pbox->y2, - pbox->x2, pbox->y2); - - ADD_VERTEX_IF_INSIDE(tl); - ADD_VERTEX_IF_INSIDE(bl); - ADD_VERTEX_IF_INSIDE(tr); - ADD_VERTEX_IF_INSIDE(br); - - /*Trap's left edge cut Rect. */ - if (DEBUG_CLIP_VTX) - ErrorF("Trap's left edge cut Rect\n"); - CACULATE_CUT_VERTEX(left_cut_top, 1, FALSE, IntToxFixed(pbox->y1), - (&trap->left)); - ADD_VERTEX_IF_INSIDE(left_cut_top); - if (!IS_TRAP_EDGE_VERTICAL((&trap->left))) { - CACULATE_CUT_VERTEX(left_cut_left, 0, FALSE, IntToxFixed(pbox->x1), - (&trap->left)); - ADD_VERTEX_IF_INSIDE(left_cut_left); - } - CACULATE_CUT_VERTEX(left_cut_bottom, 1, FALSE, IntToxFixed(pbox->y2), - (&trap->left)); - ADD_VERTEX_IF_INSIDE(left_cut_bottom); - if (!IS_TRAP_EDGE_VERTICAL((&trap->left))) { - CACULATE_CUT_VERTEX(left_cut_right, 0, FALSE, IntToxFixed(pbox->x2), - (&trap->left)); - ADD_VERTEX_IF_INSIDE(left_cut_right); - } - - /*Trap's right edge cut Rect. */ - if (DEBUG_CLIP_VTX) - ErrorF("Trap's right edge cut Rect\n"); - CACULATE_CUT_VERTEX(right_cut_top, 1, TRUE, IntToxFixed(pbox->y1), - (&trap->right)); - ADD_VERTEX_IF_INSIDE(right_cut_top); - if (!IS_TRAP_EDGE_VERTICAL((&trap->right))) { - CACULATE_CUT_VERTEX(right_cut_left, 0, TRUE, IntToxFixed(pbox->x1), - (&trap->right)); - ADD_VERTEX_IF_INSIDE(right_cut_left); - } - CACULATE_CUT_VERTEX(right_cut_bottom, 1, TRUE, IntToxFixed(pbox->y2), - (&trap->right)); - ADD_VERTEX_IF_INSIDE(right_cut_bottom); - if (!IS_TRAP_EDGE_VERTICAL((&trap->right))) { - CACULATE_CUT_VERTEX(right_cut_right, 0, TRUE, IntToxFixed(pbox->x2), - (&trap->right)); - ADD_VERTEX_IF_INSIDE(right_cut_right); - } - - /* Trap's top cut Left and Right of rect. */ - if (DEBUG_CLIP_VTX) - ErrorF("Trap's top cut Left and Right of rect\n"); - tmp[0] = IntToxFixed(pbox->x1); - tmp[1] = trap->top; - ADD_VERTEX_IF_INSIDE(tmp); - tmp[0] = IntToxFixed(pbox->x2); - tmp[1] = trap->top; - ADD_VERTEX_IF_INSIDE(tmp); - - /* Trap's bottom cut Left and Right of rect. */ - if (DEBUG_CLIP_VTX) - ErrorF("Trap's bottom cut Left and Right of rect\n"); - tmp[0] = IntToxFixed(pbox->x1); - tmp[1] = trap->bottom; - ADD_VERTEX_IF_INSIDE(tmp); - tmp[0] = IntToxFixed(pbox->x2); - tmp[1] = trap->bottom; - ADD_VERTEX_IF_INSIDE(tmp); - - /* The orginal 4 vertex of rect. */ - if (DEBUG_CLIP_VTX) - ErrorF("The orginal 4 vertex of rect\n"); - tmp[0] = IntToxFixed(pbox->x1); - tmp[1] = IntToxFixed(pbox->y1); - ADD_VERTEX_IF_INSIDE(tmp); - tmp[0] = IntToxFixed(pbox->x1); - tmp[1] = IntToxFixed(pbox->y2); - ADD_VERTEX_IF_INSIDE(tmp); - tmp[0] = IntToxFixed(pbox->x2); - tmp[1] = IntToxFixed(pbox->y2); - ADD_VERTEX_IF_INSIDE(tmp); - tmp[0] = IntToxFixed(pbox->x2); - tmp[1] = IntToxFixed(pbox->y1); - ADD_VERTEX_IF_INSIDE(tmp); - - if (DEBUG_CLIP_VTX) { - ErrorF("\nThe candidate vertex number is %d\n", vertex_num / 2); - for (i = 0; i < vertex_num / 2; i++) { - ErrorF("(%d, %d) ", tmp_vtx[2 * i], tmp_vtx[2 * i + 1]); - } - ErrorF("\n"); - } - - /* Sort the vertex by X and then Y. */ - for (i = 0; i < vertex_num / 2; i++) { - int j; - - for (j = 0; j < vertex_num / 2 - i - 1; j++) { - if (tmp_vtx[2 * j] > tmp_vtx[2 * (j + 1)] - || (tmp_vtx[2 * j] == tmp_vtx[2 * (j + 1)] - && tmp_vtx[2 * j + 1] > tmp_vtx[2 * (j + 1) + 1])) { - tmp[0] = tmp_vtx[2 * j]; - tmp[1] = tmp_vtx[2 * j + 1]; - tmp_vtx[2 * j] = tmp_vtx[2 * (j + 1)]; - tmp_vtx[2 * j + 1] = tmp_vtx[2 * (j + 1) + 1]; - tmp_vtx[2 * (j + 1)] = tmp[0]; - tmp_vtx[2 * (j + 1) + 1] = tmp[1]; - } - } - - } - - if (DEBUG_CLIP_VTX) { - ErrorF("\nAfter sort vertex number is:\n"); - for (i = 0; i < vertex_num / 2; i++) { - ErrorF("(%d, %d) ", tmp_vtx[2 * i], tmp_vtx[2 * i + 1]); - } - ErrorF("\n"); - } - - memset(vertex, -1, 2 * 6); - *num = 0; - - for (i = 0; i < vertex_num / 2; i++) { - if (*num > 0 && vertex[2 * (*num - 1)] == tmp_vtx[2 * i] - && vertex[2 * (*num - 1) + 1] == tmp_vtx[2 * i + 1]) { - /*same vertex. */ - if (DEBUG_CLIP_VTX) - ErrorF("X Point:(%d, %d) discard\n", - tmp_vtx[2 * i], tmp_vtx[2 * i + 1]); - continue; - } - - (*num)++; - if (*num > 6) { - if (DEBUG_CLIP_VTX) - FatalError("Trapezoid clip with Rect can never have vtx" - "number bigger than 6\n"); - else { - ErrorF("Trapezoid clip with Rect can never have vtx" - "number bigger than 6\n"); - *num = 6; - break; - } - } - - vertex[2 * (*num - 1)] = tmp_vtx[2 * i]; - vertex[2 * (*num - 1) + 1] = tmp_vtx[2 * i + 1]; - if (DEBUG_CLIP_VTX) - ErrorF("@ Point:(%d, %d) select, num now is %d\n", - tmp_vtx[2 * i], tmp_vtx[2 * i + 1], *num); - } - - /* Now we need to arrange the vtx in the polygon's counter-clockwise - order. We first select the left and top point as the start point and - sort every vtx by the slope from vtx to the start vtx. */ - for (i = 1; i < *num; i++) { - tmp_vtx_slope[i] = (vertex[2 * i] != vertex[0] ? - (float) (vertex[2 * i + 1] - - vertex[1]) / (float) (vertex[2 * i] - - vertex[0]) - : (float) INT_MAX); - } - - if (DEBUG_CLIP_VTX) { - ErrorF("\nvtx number: %d, VTX and slope:\n", *num); - for (i = 0; i < *num; i++) { - ErrorF("(%d, %d):%f ", - vertex[2 * i], vertex[2 * i + 1], tmp_vtx_slope[i]); - } - ErrorF("\n"); - } - - /* Sort the vertex by slope. */ - for (i = 0; i < *num - 1; i++) { - int j; - float tmp_slope; - - for (j = 1; j < *num - i - 1; j++) { - if (tmp_vtx_slope[j] < tmp_vtx_slope[j + 1]) { - tmp_slope = tmp_vtx_slope[j]; - tmp_vtx_slope[j] = tmp_vtx_slope[j + 1]; - tmp_vtx_slope[j + 1] = tmp_slope; - tmp[0] = vertex[2 * j]; - tmp[1] = vertex[2 * j + 1]; - vertex[2 * j] = vertex[2 * (j + 1)]; - vertex[2 * j + 1] = vertex[2 * (j + 1) + 1]; - vertex[2 * (j + 1)] = tmp[0]; - vertex[2 * (j + 1) + 1] = tmp[1]; - } - } - } - - if (DEBUG_CLIP_VTX) { - ErrorF("\nBefore return, vtx number: %d, VTX and slope:\n", *num); - for (i = 0; i < *num; i++) { - ErrorF("(%d, %d):%f ", - vertex[2 * i], vertex[2 * i + 1], tmp_vtx_slope[i]); - } - ErrorF("\n"); - } - - return TRUE; -} - -static void * -glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts) -{ - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - int stride; - int vert_size; - char *vbo_offset; - void *vb; - - glamor_priv->render_nr_verts = 0; - - /* For GLAMOR_VERTEX_POS */ - glamor_priv->vb_stride = 2 * sizeof(float); - - /* For GLAMOR_GLAMOR_VERTEX_SOURCE */ - glamor_priv->vb_stride += 2 * sizeof(float); - - /* For GLAMOR_VERTEX_TOP_BOTTOM */ - glamor_priv->vb_stride += 2 * sizeof(float); - - /* For GLAMOR_VERTEX_LEFT_PARAM */ - glamor_priv->vb_stride += 4 * sizeof(float); - - /* For GLAMOR_VERTEX_RIGHT_PARAM */ - glamor_priv->vb_stride += 4 * sizeof(float); - - vert_size = n_verts * glamor_priv->vb_stride; - - glamor_make_current(glamor_priv); - - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDisableVertexAttribArray(GLAMOR_VERTEX_TOP_BOTTOM); - glDisableVertexAttribArray(GLAMOR_VERTEX_LEFT_PARAM); - glDisableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - - vb = glamor_get_vbo_space(screen, vert_size, &vbo_offset); - - /* Set the vertex pointer. */ - glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, - GL_FALSE, glamor_priv->vb_stride, - vbo_offset); - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - stride = 2; - - glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, - GL_FALSE, glamor_priv->vb_stride, - vbo_offset + stride * sizeof(float)); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - stride += 2; - - glVertexAttribPointer(GLAMOR_VERTEX_TOP_BOTTOM, 2, GL_FLOAT, - GL_FALSE, glamor_priv->vb_stride, - vbo_offset + stride * sizeof(float)); - glEnableVertexAttribArray(GLAMOR_VERTEX_TOP_BOTTOM); - stride += 2; - - glVertexAttribPointer(GLAMOR_VERTEX_LEFT_PARAM, 4, GL_FLOAT, - GL_FALSE, glamor_priv->vb_stride, - vbo_offset + stride * sizeof(float)); - glEnableVertexAttribArray(GLAMOR_VERTEX_LEFT_PARAM); - stride += 4; - - glVertexAttribPointer(GLAMOR_VERTEX_RIGHT_PARAM, 4, GL_FLOAT, - GL_FALSE, glamor_priv->vb_stride, - vbo_offset + stride * sizeof(float)); - glEnableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - - return vb; -} - -static Bool -_glamor_trapezoids_with_shader(CARD8 op, - PicturePtr src, PicturePtr dst, - PictFormatPtr mask_format, INT16 x_src, - INT16 y_src, int ntrap, xTrapezoid * traps) -{ - ScreenPtr screen = dst->pDrawable->pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - struct shader_key key; - glamor_composite_shader *shader = NULL; - struct blendinfo op_info; - PictFormatShort saved_source_format = 0; - PixmapPtr source_pixmap = NULL; - PixmapPtr dest_pixmap = NULL; - glamor_pixmap_private *source_pixmap_priv = NULL; - glamor_pixmap_private *dest_pixmap_priv = NULL; - glamor_pixmap_private *temp_src_priv = NULL; - int x_temp_src, y_temp_src; - int src_width, src_height; - int source_x_off, source_y_off; - GLfloat src_xscale = 1, src_yscale = 1; - int x_dst, y_dst; - int dest_x_off, dest_y_off; - GLfloat dst_xscale, dst_yscale; - BoxRec bounds; - PicturePtr temp_src = src; - int vert_stride = 3; - int ntriangle_per_loop; - int nclip_rect; - int mclip_rect; - int clip_processed; - int clipped_vtx[6 * 2]; - RegionRec region; - BoxPtr box = NULL; - BoxPtr pbox = NULL; - int traps_count = 0; - int traps_not_completed = 0; - xTrapezoid *ptrap = NULL; - int nbox; - float src_matrix[9]; - Bool ret = FALSE; - - /* If a mask format wasn't provided, we get to choose, but behavior should - * be as if there was no temporary mask the traps were accumulated into. - */ - if (!mask_format) { - if (dst->polyEdge == PolyEdgeSharp) - mask_format = PictureMatchFormat(screen, 1, PICT_a1); - else - mask_format = PictureMatchFormat(screen, 8, PICT_a8); - for (; ntrap; ntrap--, traps++) - glamor_trapezoids(op, src, dst, mask_format, x_src, - y_src, 1, traps); - return TRUE; - } - - miTrapezoidBounds(ntrap, traps, &bounds); - DEBUGF("The bounds for all traps is: bounds.x1 = %d, bounds.x2 = %d, " - "bounds.y1 = %d, bounds.y2 = %d\n", bounds.x1, bounds.x2, - bounds.y1, bounds.y2); - - /* No area need to render. */ - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return TRUE; - - dest_pixmap = glamor_get_drawable_pixmap(dst->pDrawable); - dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv) - || dest_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { - /* Currently. Always fallback to cpu if destination is in CPU memory. */ - ret = FALSE; - DEBUGF("dst pixmap has no FBO.\n"); - goto TRAPEZOID_OUT; - } - - if (src->pDrawable) { - source_pixmap = glamor_get_drawable_pixmap(src->pDrawable); - source_pixmap_priv = glamor_get_pixmap_private(source_pixmap); - temp_src_priv = source_pixmap_priv; - if (source_pixmap_priv - && (source_pixmap_priv->type == GLAMOR_DRM_ONLY - || source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE)) { - ret = FALSE; - goto TRAPEZOID_OUT; - } - } - - x_dst = bounds.x1; - y_dst = bounds.y1; - - src_width = bounds.x2 - bounds.x1; - src_height = bounds.y2 - bounds.y1; - - x_temp_src = x_src + bounds.x1 - (traps[0].left.p1.x >> 16); - y_temp_src = y_src + bounds.y1 - (traps[0].left.p1.y >> 16); - - if ((!src->pDrawable && (src->pSourcePict->type != SourcePictTypeSolidFill)) //1. The Gradient case. - /* 2. Has no fbo but can upload. */ - || (src->pDrawable && !GLAMOR_PIXMAP_PRIV_HAS_FBO(source_pixmap_priv) - && ((src_width * src_height * 4 < - source_pixmap->drawable.width * source_pixmap->drawable.height) - || !glamor_check_fbo_size(glamor_priv, - source_pixmap->drawable.width, - source_pixmap->drawable.height)))) { - - if (!glamor_check_fbo_size(glamor_priv, src_width, src_height)) { - ret = FALSE; - goto TRAPEZOID_OUT; - } - temp_src = glamor_convert_gradient_picture(screen, src, - x_src, y_src, - src_width, src_height); - if (!temp_src) { - temp_src = src; - ret = FALSE; - DEBUGF("Convert gradient picture failed\n"); - goto TRAPEZOID_OUT; - } - temp_src_priv = - glamor_get_pixmap_private((PixmapPtr) temp_src->pDrawable); - x_temp_src = y_temp_src = 0; - } - - x_dst += dst->pDrawable->x; - y_dst += dst->pDrawable->y; - if (temp_src->pDrawable) { - x_temp_src += temp_src->pDrawable->x; - y_temp_src += temp_src->pDrawable->y; - } - - if (!miComputeCompositeRegion(®ion, - temp_src, NULL, dst, - x_temp_src, y_temp_src, - 0, 0, x_dst, y_dst, src_width, src_height)) { - DEBUGF("All the regions are clipped out, do nothing\n"); - goto TRAPEZOID_OUT; - } - - glamor_make_current(glamor_priv); - - box = REGION_RECTS(®ion); - nbox = REGION_NUM_RECTS(®ion); - pbox = box; - - ret = glamor_composite_choose_shader(op, temp_src, NULL, dst, - temp_src_priv, NULL, dest_pixmap_priv, - &key, &shader, &op_info, - &saved_source_format); - if (ret == FALSE) { - DEBUGF("can not set the shader program for composite\n"); - goto TRAPEZOID_RESET_GL; - } - glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv); - glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info); - glamor_priv->has_source_coords = key.source != SHADER_SOURCE_SOLID; - glamor_priv->has_mask_coords = (key.mask != SHADER_MASK_NONE && - key.mask != SHADER_MASK_SOLID); - - glamor_get_drawable_deltas(dst->pDrawable, dest_pixmap, - &dest_x_off, &dest_y_off); - - pixmap_priv_get_dest_scale(dest_pixmap_priv, &dst_xscale, &dst_yscale); - - if (glamor_priv->has_source_coords) { - source_pixmap = glamor_get_drawable_pixmap(temp_src->pDrawable); - source_pixmap_priv = glamor_get_pixmap_private(source_pixmap); - glamor_get_drawable_deltas(temp_src->pDrawable, - source_pixmap, &source_x_off, &source_y_off); - pixmap_priv_get_scale(source_pixmap_priv, &src_xscale, &src_yscale); - glamor_picture_get_matrixf(temp_src, src_matrix); - vert_stride += 3; - } - - if (glamor_priv->has_mask_coords) { - DEBUGF("Should never have mask coords here!\n"); - ret = FALSE; - goto TRAPEZOID_RESET_GL; - } - - /* A trapezoid clip with a rectangle will at most generate a hexagon, - which can be devided into 4 triangles to render. */ - ntriangle_per_loop = - (vert_stride * nbox * ntrap * 4) > - GLAMOR_COMPOSITE_VBO_VERT_CNT ? (GLAMOR_COMPOSITE_VBO_VERT_CNT / - vert_stride) : nbox * ntrap * 4; - ntriangle_per_loop = (ntriangle_per_loop / 4) * 4; - - nclip_rect = nbox; - while (nclip_rect) { - float *vb; - - mclip_rect = (nclip_rect * ntrap * 4) > ntriangle_per_loop ? - (ntriangle_per_loop / (4 * ntrap)) : nclip_rect; - - if (!mclip_rect) { /* Maybe too many traps. */ - mclip_rect = 1; - ptrap = traps; - traps_count = ntriangle_per_loop / 4; - traps_not_completed = ntrap - traps_count; - } - else { - traps_count = ntrap; - ptrap = traps; - traps_not_completed = 0; - } - - NTRAPS_LOOP_AGAIN: - - vb = glamor_setup_composite_vbo(screen, - (mclip_rect * traps_count * - 4 * vert_stride)); - clip_processed = mclip_rect; - - while (mclip_rect--) { - while (traps_count--) { - int vtx_num; - int i; - float vertices[3 * 2], source_texcoords[3 * 2]; - - DEBUGF - ("In loop of render trapezoid, nclip_rect = %d, mclip_rect = %d, " - "clip_processed = %d, traps_count = %d, traps_not_completed = %d\n", - nclip_rect, mclip_rect, clip_processed, traps_count, - traps_not_completed); - - if (_glamor_clip_trapezoid_vertex - (ptrap, pbox, clipped_vtx, &vtx_num)) { - for (i = 0; i < vtx_num - 2; i++) { - int clipped_vtx_tmp[3 * 2]; - - clipped_vtx_tmp[0] = clipped_vtx[0]; - clipped_vtx_tmp[1] = clipped_vtx[1]; - clipped_vtx_tmp[2] = clipped_vtx[(i + 1) * 2]; - clipped_vtx_tmp[3] = clipped_vtx[(i + 1) * 2 + 1]; - clipped_vtx_tmp[4] = clipped_vtx[(i + 2) * 2]; - clipped_vtx_tmp[5] = clipped_vtx[(i + 2) * 2 + 1]; - glamor_set_normalize_tri_vcoords(dst_xscale, dst_yscale, - clipped_vtx_tmp, - glamor_priv->yInverted, - vertices); - DEBUGF("vertices of triangle: (%f X %f), (%f X %f), " - "(%f X %f)\n", vertices[0], vertices[1], - vertices[2], vertices[3], vertices[4], - vertices[5]); - - if (key.source != SHADER_SOURCE_SOLID) { - if (src->transform) { - glamor_set_transformed_normalize_tri_tcoords - (source_pixmap_priv, src_matrix, src_xscale, - src_yscale, clipped_vtx_tmp, - glamor_priv->yInverted, source_texcoords); - } - else { - glamor_set_normalize_tri_tcoords(src_xscale, - src_yscale, - clipped_vtx_tmp, - glamor_priv-> - yInverted, - source_texcoords); - } - - DEBUGF("source_texcoords of triangle: (%f X %f), " - "(%f X %f), (%f X %f)\n", - source_texcoords[0], source_texcoords[1], - source_texcoords[2], source_texcoords[3], - source_texcoords[4], source_texcoords[5]); - } - - glamor_emit_composite_triangle(screen, vb, - source_texcoords, - NULL, vertices); - vb += 3 * glamor_priv->vb_stride / sizeof(float); - } - } - - ptrap++; - } - - if (traps_not_completed) { /* one loop of ntraps not completed */ - mclip_rect = 1; - traps_count = traps_not_completed > (ntriangle_per_loop / 4) ? - (ntriangle_per_loop / 4) : traps_not_completed; - traps_not_completed -= traps_count; - glamor_flush_composite_triangles(screen); - goto NTRAPS_LOOP_AGAIN; - } - else { - ptrap = traps; - traps_count = ntrap; - } - - pbox++; - } - - glamor_flush_composite_triangles(screen); - - nclip_rect -= clip_processed; - } - - ret = TRUE; - - TRAPEZOID_RESET_GL: - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDisableVertexAttribArray(GLAMOR_VERTEX_MASK); - glDisable(GL_BLEND); - - TRAPEZOID_OUT: - if (box) { - REGION_UNINIT(dst->pDrawable->pScreen, ®ion); - } - - if (temp_src != src) { - FreePicture(temp_src, 0); - } - else { - if (saved_source_format) { - src->format = saved_source_format; - } - } - - return ret; -} - -void -glamor_init_trapezoid_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - GLint fs_prog, vs_prog; - - const char *trapezoid_vs = - GLAMOR_DEFAULT_PRECISION - "attribute vec4 v_position;\n" - "attribute vec2 v_texcoord;\n" - /* v_top_bottom, v_left_param and v_right_param contain the - constant value for all the vertex of one rect. Using uniform - is more suitable but we need to reset the uniform variables - for every rect rendering and can not use the vbo, which causes - performance loss. So we set these attributes to same value - for every vertex of one rect and so it is also a constant in FS */ - "attribute vec2 v_top_bottom;\n" - "attribute vec4 v_left_param;\n" - "attribute vec4 v_right_param;\n" - "\n" - "varying vec2 source_texture;\n" - "varying float trap_top;\n" - "varying float trap_bottom;\n" - "varying float trap_left_x;\n" - "varying float trap_left_y;\n" - "varying float trap_left_slope;\n" - "varying float trap_left_vertical_f;\n" - "varying float trap_right_x;\n" - "varying float trap_right_y;\n" - "varying float trap_right_slope;\n" - "varying float trap_right_vertical_f;\n" - "\n" - "void main()\n" - "{\n" - " gl_Position = v_position;\n" - " source_texture = v_texcoord.xy;\n" - " trap_top = v_top_bottom.x;\n" - " trap_bottom = v_top_bottom.y;\n" - " \n" - " trap_left_x = v_left_param.x;\n" - " trap_left_y = v_left_param.y;\n" - " trap_left_slope = v_left_param.z;\n" - " trap_left_vertical_f = v_left_param.w;\n" - " \n" - " trap_right_x = v_right_param.x;\n" - " trap_right_y = v_right_param.y;\n" - " trap_right_slope = v_right_param.z;\n" - " trap_right_vertical_f = v_right_param.w;\n" - "}\n"; - - /* - * Because some GL fill function do not support the MultSample - * anti-alias, we need to do the MSAA here. This manner like - * pixman, will caculate the value of area in trapezoid dividing - * the totol area for each pixel, as follow: - | - ----+------------------------------------------------------> - | - | ------------- - | / \ - | / \ - | / \ - | / +----------------+ - | / |.....\ | - | / |......\ | - | / |.......\ | - | / |........\ | - | /-------------------+---------\ | - | | | - | | | - | +----------------+ - | - \|/ - - */ - const char *trapezoid_fs = - GLAMOR_DEFAULT_PRECISION - "varying vec2 source_texture; \n" - "varying float trap_top; \n" - "varying float trap_bottom; \n" - "varying float trap_left_x; \n" - "varying float trap_left_y; \n" - "varying float trap_left_slope; \n" - "varying float trap_left_vertical_f; \n" - "varying float trap_right_x; \n" - "varying float trap_right_y; \n" - "varying float trap_right_slope; \n" - "varying float trap_right_vertical_f; \n" - "float x_per_pix = 1.0;" - "float y_per_pix = 1.0;" - "\n" - "float get_alpha_val() \n" - "{ \n" - " float x_up_cut_left; \n" - " float x_bottom_cut_left; \n" - " float x_up_cut_right; \n" - " float x_bottom_cut_right; \n" - " bool trap_left_vertical;\n" - " bool trap_right_vertical;\n" - " if (abs(trap_left_vertical_f - 1.0) <= 0.0001)\n" - " trap_left_vertical = true;\n" - " else\n" - " trap_left_vertical = false;\n" - " if (abs(trap_right_vertical_f - 1.0) <= 0.0001)\n" - " trap_right_vertical = true;\n" - " else\n" - " trap_right_vertical = false;\n" - " \n" - " if(trap_left_vertical == true) { \n" - " x_up_cut_left = trap_left_x; \n" - " x_bottom_cut_left = trap_left_x; \n" - " } else { \n" - " x_up_cut_left = trap_left_x \n" - " + (source_texture.y - y_per_pix/2.0 - trap_left_y) \n" - " / trap_left_slope; \n" - " x_bottom_cut_left = trap_left_x \n" - " + (source_texture.y + y_per_pix/2.0 - trap_left_y) \n" - " / trap_left_slope; \n" - " } \n" - " \n" - " if(trap_right_vertical == true) { \n" - " x_up_cut_right = trap_right_x; \n" - " x_bottom_cut_right = trap_right_x; \n" - " } else { \n" - " x_up_cut_right = trap_right_x \n" - " + (source_texture.y - y_per_pix/2.0 - trap_right_y) \n" - " / trap_right_slope; \n" - " x_bottom_cut_right = trap_right_x \n" - " + (source_texture.y + y_per_pix/2.0 - trap_right_y) \n" - " / trap_right_slope; \n" - " } \n" - " \n" - " if((x_up_cut_left <= source_texture.x - x_per_pix/2.0) && \n" - " (x_bottom_cut_left <= source_texture.x - x_per_pix/2.0) && \n" - " (x_up_cut_right >= source_texture.x + x_per_pix/2.0) && \n" - " (x_bottom_cut_right >= source_texture.x + x_per_pix/2.0) && \n" - " (trap_top <= source_texture.y - y_per_pix/2.0) && \n" - " (trap_bottom >= source_texture.y + y_per_pix/2.0)) { \n" - // The complete inside case. - " return 1.0; \n" - " } else if((trap_top > source_texture.y + y_per_pix/2.0) || \n" - " (trap_bottom < source_texture.y - y_per_pix/2.0)) { \n" - // The complete outside. Above the top or Below the bottom. - " return 0.0; \n" - " } else { \n" - " if((x_up_cut_right < source_texture.x - x_per_pix/2.0 && \n" - " x_bottom_cut_right < source_texture.x - x_per_pix/2.0) \n" - " || (x_up_cut_left > source_texture.x + x_per_pix/2.0 && \n" - " x_bottom_cut_left > source_texture.x + x_per_pix/2.0)) { \n" - // The complete outside. At Left or Right of the trapezoide. - " return 0.0; \n" - " } \n" - " } \n" - // Get here, the pix is partly inside the trapezoid. - " { \n" - " float percent = 0.0; \n" - " float up = (source_texture.y - y_per_pix/2.0) >= trap_top ? \n" - " (source_texture.y - y_per_pix/2.0) : trap_top; \n" - " float bottom = (source_texture.y + y_per_pix/2.0) <= trap_bottom ? \n" - " (source_texture.y + y_per_pix/2.0) : trap_bottom; \n" - " float left = source_texture.x - x_per_pix/2.0; \n" - " float right = source_texture.x + x_per_pix/2.0; \n" - " \n" - " percent = (bottom - up) / y_per_pix; \n" - " \n" - " if(trap_left_vertical == true) { \n" - " if(trap_left_x > source_texture.x - x_per_pix/2.0 && \n" - " trap_left_x < source_texture.x + x_per_pix/2.0) \n" - " left = trap_left_x; \n" - " } \n" - " if(trap_right_vertical == true) { \n" - " if(trap_right_x > source_texture.x - x_per_pix/2.0 && \n" - " trap_right_x < source_texture.x + x_per_pix/2.0) \n" - " right = trap_right_x; \n" - " } \n" - " if((up >= bottom) || (left >= right)) \n" - " return 0.0; \n" - " \n" - " percent = percent * ((right - left)/x_per_pix); \n" - " if(trap_left_vertical == true && trap_right_vertical == true) \n" - " return percent; \n" - " \n" - " if(trap_left_vertical != true) { \n" - " float area; \n" - // the slope should never be 0.0 here - " float up_x = trap_left_x + (up - trap_left_y)/trap_left_slope; \n" - " float bottom_x = trap_left_x + (bottom - trap_left_y)/trap_left_slope; \n" - " if(trap_left_slope < 0.0 && up_x > left) { \n" - /* case 1 - | - ----+-------------------------------------> - | / - | / - | +---/--------+ - | | /.........| - | | /..........| - | |/...........| - | /............| - | /|............| - | +------------+ - | - \|/ - */ - " float left_y = trap_left_y + trap_left_slope*(left - trap_left_x); \n" - " if((up_x > left) && (left_y > up)) { \n" - " area = 0.5 * (up_x - left) * (left_y - up); \n" - " if(up_x > right) { \n" - " float right_y = trap_left_y \n" - " + trap_left_slope*(right - trap_left_x); \n" - " area = area - 0.5 * (up_x - right) * (right_y - up); \n" - " } \n" - " if(left_y > bottom) { \n" - " area = area - 0.5 * (bottom_x - left) * (left_y - bottom); \n" - " } \n" - " } else { \n" - " area = 0.0; \n" - " } \n" - " percent = percent * (1.0 - (area/((right-left)*(bottom-up)))); \n" - " } else if(trap_left_slope > 0.0 && bottom_x > left) { \n" - /* case 2 - | - ----+-------------------------------------> - | \ - | \ - | +\-----------+ - | | \..........| - | | \.........| - | | \........| - | | \.......| - | | \......| - | +------\-----+ - | \ - | \ - \|/ - */ - " float right_y = trap_left_y + trap_left_slope*(right - trap_left_x); \n" - " if((up_x < right) && (right_y > up)) { \n" - " area = 0.5 * (right - up_x) * (right_y - up); \n" - " if(up_x < left) { \n" - " float left_y = trap_left_y \n" - " + trap_left_slope*(left - trap_left_x); \n" - " area = area - 0.5 * (left - up_x) * (left_y - up); \n" - " } \n" - " if(right_y > bottom) { \n" - " area = area - 0.5 * (right - bottom_x) * (right_y - bottom); \n" - " } \n" - " } else { \n" - " area = 0.0; \n" - " } \n" - " percent = percent * (area/((right-left)*(bottom-up))); \n" - " } \n" - " } \n" - " \n" - " if(trap_right_vertical != true) { \n" - " float area; \n" - // the slope should never be 0.0 here - " float up_x = trap_right_x + (up - trap_right_y)/trap_right_slope; \n" - " float bottom_x = trap_right_x + (bottom - trap_right_y)/trap_right_slope; \n" - " if(trap_right_slope < 0.0 && bottom_x < right) { \n" - /* case 3 - | - ----+-------------------------------------> - | / - | +--------/---+ - | |......./ | - | |....../ | - | |...../ | - | |..../ | - | |.../ | - | +--/---------+ - | / - | - \|/ - */ - " float left_y = trap_right_y + trap_right_slope*(left - trap_right_x); \n" - " if((up_x > left) && (left_y > up)) { \n" - " area = 0.5 * (up_x - left) * (left_y - up); \n" - " if(up_x > right) { \n" - " float right_y = trap_right_y \n" - " + trap_right_slope*(right - trap_right_x); \n" - " area = area - 0.5 * (up_x - right) * (right_y - up); \n" - " } \n" - " if(left_y > bottom) { \n" - " area = area - 0.5 * (bottom_x - left) * (left_y - bottom); \n" - " } \n" - " } else { \n" - " area = 0.0; \n" - " } \n" - " percent = percent * (area/((right-left)*(bottom-up))); \n" - " } else if(trap_right_slope > 0.0 && up_x < right) { \n" - /* case 4 - | - ----+-------------------------------------> - | \ - | +--------\---+ - | |.........\ | - | |..........\ | - | |...........\| - | |............\ - | |............|\ - | +------------+ \ - | \ - | - \|/ - */ - " float right_y = trap_right_y + trap_right_slope*(right - trap_right_x); \n" - " if((up_x < right) && (right_y > up)) { \n" - " area = 0.5 * (right - up_x) * (right_y - up); \n" - " if(up_x < left) { \n" - " float left_y = trap_right_y \n" - " + trap_right_slope*(left - trap_right_x); \n" - " area = area - 0.5 * (left - up_x) * (left_y - up); \n" - " } \n" - " if(right_y > bottom) { \n" - " area = area - 0.5 * (right - bottom_x) * (right_y - bottom); \n" - " } \n" - " } else { \n" - " area = 0.0; \n" - " } \n" - " percent = percent * (1.0 - (area/((right-left)*(bottom-up)))); \n" - " } \n" - " } \n" - " \n" - " return percent; \n" - " } \n" - "} \n" - "\n" - "void main() \n" - "{ \n" - " float alpha_val = get_alpha_val(); \n" - " gl_FragColor = vec4(0.0, 0.0, 0.0, alpha_val); \n" - "}\n"; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - - glamor_priv->trapezoid_prog = glCreateProgram(); - - vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, trapezoid_vs); - fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, trapezoid_fs); - - glAttachShader(glamor_priv->trapezoid_prog, vs_prog); - glAttachShader(glamor_priv->trapezoid_prog, fs_prog); - - glBindAttribLocation(glamor_priv->trapezoid_prog, - GLAMOR_VERTEX_POS, "v_positionsition"); - glBindAttribLocation(glamor_priv->trapezoid_prog, - GLAMOR_VERTEX_SOURCE, "v_texcoord"); - glBindAttribLocation(glamor_priv->trapezoid_prog, - GLAMOR_VERTEX_TOP_BOTTOM, "v_top_bottom"); - glBindAttribLocation(glamor_priv->trapezoid_prog, - GLAMOR_VERTEX_LEFT_PARAM, "v_left_param"); - glBindAttribLocation(glamor_priv->trapezoid_prog, - GLAMOR_VERTEX_RIGHT_PARAM, "v_right_param"); - - glamor_link_glsl_prog(screen, glamor_priv->trapezoid_prog, "trapezoid"); -} - -void -glamor_fini_trapezoid_shader(ScreenPtr screen) -{ - glamor_screen_private *glamor_priv; - - glamor_priv = glamor_get_screen_private(screen); - glamor_make_current(glamor_priv); - glDeleteProgram(glamor_priv->trapezoid_prog); -} - -static Bool -_glamor_generate_trapezoid_with_shader(ScreenPtr screen, PicturePtr picture, - xTrapezoid *traps, int ntrap, - BoxRec *bounds) -{ - glamor_screen_private *glamor_priv; - glamor_pixmap_private *pixmap_priv; - PixmapPtr pixmap = NULL; - GLint trapezoid_prog; - GLfloat xscale, yscale; - float left_slope, right_slope; - xTrapezoid *ptrap; - BoxRec one_trap_bound; - int nrect_max; - int i, j; - float params[4]; - - glamor_priv = glamor_get_screen_private(screen); - trapezoid_prog = glamor_priv->trapezoid_prog; - - pixmap = glamor_get_drawable_pixmap(picture->pDrawable); - pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) - || pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { /* should always have here. */ - DEBUGF("GLAMOR_PIXMAP_PRIV_HAS_FBO check failed, fallback\n"); - return FALSE; - } - - /* First, clear all to zero */ - if (!glamor_solid(pixmap, 0, 0, pixmap_priv->base.pixmap->drawable.width, - pixmap_priv->base.pixmap->drawable.height, - GXclear, 0xFFFFFFFF, 0)) { - DEBUGF("glamor_solid failed, fallback\n"); - return FALSE; - } - - glamor_make_current(glamor_priv); - - glamor_set_destination_pixmap_priv_nc(pixmap_priv); - - pixmap_priv_get_dest_scale(pixmap_priv, (&xscale), (&yscale)); - - /* Now draw the Trapezoid mask. */ - glUseProgram(trapezoid_prog); - - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE); - - nrect_max = GLAMOR_COMPOSITE_VBO_VERT_CNT / (4 * GLAMOR_VERTEX_RIGHT_PARAM); - - for (i = 0; i < ntrap;) { - float *vertices; - int mrect; - int stride; - - mrect = (ntrap - i) > nrect_max ? nrect_max : (ntrap - i); - vertices = glamor_setup_composite_vbo_for_trapezoid(screen, 4 * mrect); - stride = glamor_priv->vb_stride / sizeof(float); - - for (j = 0; j < mrect; j++) { - ptrap = traps + i + j; - - DEBUGF - ("--- The parameter of xTrapezoid is:\ntop: %d 0x%x\tbottom: %d 0x%x\n" - "left: p1 (%d 0x%x, %d 0x%x)\tp2 (%d 0x%x, %d 0x%x)\n" - "right: p1 (%d 0x%x, %d 0x%x)\tp2 (%d 0x%x, %d 0x%x)\n", - xFixedToInt(ptrap->top), ptrap->top, - xFixedToInt(ptrap->bottom), ptrap->bottom, - xFixedToInt(ptrap->left.p1.x), ptrap->left.p1.x, - xFixedToInt(ptrap->left.p1.y), ptrap->left.p1.y, - xFixedToInt(ptrap->left.p2.x), ptrap->left.p2.x, - xFixedToInt(ptrap->left.p2.y), ptrap->left.p2.y, - xFixedToInt(ptrap->right.p1.x), ptrap->right.p1.x, - xFixedToInt(ptrap->right.p1.y), ptrap->right.p1.y, - xFixedToInt(ptrap->right.p2.x), ptrap->right.p2.x, - xFixedToInt(ptrap->right.p2.y), ptrap->right.p2.y); - - miTrapezoidBounds(1, ptrap, &one_trap_bound); - - vertices += 2; - glamor_set_tcoords_ext((pixmap_priv->base.pixmap->drawable.width), - (pixmap_priv->base.pixmap->drawable.height), - (one_trap_bound.x1), (one_trap_bound.y1), - (one_trap_bound.x2), (one_trap_bound.y2), - glamor_priv->yInverted, vertices, stride); - DEBUGF("tex_vertices --> leftup : %f X %f, rightup: %f X %f," - "rightbottom: %f X %f, leftbottom : %f X %f\n", vertices[0], - vertices[1], vertices[1 * stride], vertices[1 * stride + 1], - vertices[2 * stride], vertices[2 * stride + 1], - vertices[3 * stride], vertices[3 * stride + 1]); - - /* Need to rebase. */ - one_trap_bound.x1 -= bounds->x1; - one_trap_bound.x2 -= bounds->x1; - one_trap_bound.y1 -= bounds->y1; - one_trap_bound.y2 -= bounds->y1; - - vertices -= 2; - - glamor_set_normalize_vcoords_ext(pixmap_priv, xscale, yscale, - one_trap_bound.x1, - one_trap_bound.y1, - one_trap_bound.x2, - one_trap_bound.y2, - glamor_priv->yInverted, vertices, - stride); - DEBUGF("vertices --> leftup : %f X %f, rightup: %f X %f," - "rightbottom: %f X %f, leftbottom : %f X %f\n", vertices[0], - vertices[1], vertices[1 * stride], vertices[1 * stride + 1], - vertices[2 * stride], vertices[2 * stride + 1], - vertices[3 * stride], vertices[3 * stride + 1]); - vertices += 4; - - /* Set the top and bottom. */ - params[0] = ((float) ptrap->top) / 65536; - params[1] = ((float) ptrap->bottom) / 65536; - glamor_set_const_ext(params, 2, vertices, 4, stride); - vertices += 2; - - /* Set the left params. */ - params[0] = ((float) ptrap->left.p1.x) / 65536; - params[1] = ((float) ptrap->left.p1.y) / 65536; - - if (ptrap->left.p1.x == ptrap->left.p2.x) { - left_slope = 0.0; - params[3] = 1.0; - } - else { - left_slope = ((float) (ptrap->left.p1.y - ptrap->left.p2.y)) - / ((float) (ptrap->left.p1.x - ptrap->left.p2.x)); - params[3] = 0.0; - } - params[2] = left_slope; - glamor_set_const_ext(params, 4, vertices, 4, stride); - vertices += 4; - - /* Set the left params. */ - params[0] = ((float) ptrap->right.p1.x) / 65536; - params[1] = ((float) ptrap->right.p1.y) / 65536; - - if (ptrap->right.p1.x == ptrap->right.p2.x) { - right_slope = 0.0; - params[3] = 1.0; - } - else { - right_slope = ((float) (ptrap->right.p1.y - ptrap->right.p2.y)) - / ((float) (ptrap->right.p1.x - ptrap->right.p2.x)); - params[3] = 0.0; - } - params[2] = right_slope; - glamor_set_const_ext(params, 4, vertices, 4, stride); - vertices += 4; - - DEBUGF("trap_top = %f, trap_bottom = %f, " - "trap_left_x = %f, trap_left_y = %f, left_slope = %f, " - "trap_right_x = %f, trap_right_y = %f, right_slope = %f\n", - ((float) ptrap->top) / 65536, - ((float) ptrap->bottom) / 65536, - ((float) ptrap->left.p1.x) / 65536, - ((float) ptrap->left.p1.y) / 65536, left_slope, - ((float) ptrap->right.p1.x) / 65536, - ((float) ptrap->right.p1.y) / 65536, right_slope); - - glamor_priv->render_nr_verts += 4; - vertices += 3 * stride; - } - - i += mrect; - - glamor_put_vbo_space(screen); - - /* Now rendering. */ - if (!glamor_priv->render_nr_verts) - continue; - - 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); - } - } - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glDisableVertexAttribArray(GLAMOR_VERTEX_TOP_BOTTOM); - glDisableVertexAttribArray(GLAMOR_VERTEX_LEFT_PARAM); - glDisableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - return TRUE; -} - -#endif /*GLAMOR_TRAPEZOID_SHADER */ - /** * Creates an appropriate picture for temp mask use. */ @@ -1569,7 +43,7 @@ static PicturePtr glamor_create_mask_picture(ScreenPtr screen, PicturePtr dst, PictFormatPtr pict_format, - CARD16 width, CARD16 height, int gpu) + CARD16 width, CARD16 height) { PixmapPtr pixmap; PicturePtr picture; @@ -1584,15 +58,9 @@ glamor_create_mask_picture(ScreenPtr screen, return 0; } - if (gpu) { - pixmap = glamor_create_pixmap(screen, width, height, - pict_format->depth, 0); - } - else { - pixmap = glamor_create_pixmap(screen, 0, 0, - pict_format->depth, - GLAMOR_CREATE_PIXMAP_CPU); - } + pixmap = glamor_create_pixmap(screen, 0, 0, + pict_format->depth, + GLAMOR_CREATE_PIXMAP_CPU); if (!pixmap) return 0; @@ -1602,61 +70,15 @@ glamor_create_mask_picture(ScreenPtr screen, return picture; } -static int -_glamor_trapezoid_bounds(int ntrap, xTrapezoid *traps, BoxPtr box) -{ - int has_large_trapezoid = 0; - - box->y1 = MAXSHORT; - box->y2 = MINSHORT; - box->x1 = MAXSHORT; - box->x2 = MINSHORT; - - for (; ntrap; ntrap--, traps++) { - INT16 x1, y1, x2, y2; - - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt(traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt(xFixedCeil(traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt(min - (_glamor_linefixedX(&traps->left, traps->top, FALSE), - _glamor_linefixedX(&traps->left, traps->bottom, - FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt(xFixedCeil - (max - (_glamor_linefixedX(&traps->right, traps->top, TRUE), - _glamor_linefixedX(&traps->right, traps->bottom, - TRUE)))); - if (x2 > box->x2) - box->x2 = x2; - - if (!has_large_trapezoid && (x2 - x1) > 256 && (y2 - y1) > 32) - has_large_trapezoid = 1; - } - - return has_large_trapezoid; -} - /** - * glamor_trapezoids will first try to create a trapezoid mask using shader, - * if failed, miTrapezoids will generate trapezoid mask accumulating in + * glamor_trapezoids will generate trapezoid mask accumulating in * system memory. */ -static Bool -_glamor_trapezoids(CARD8 op, - PicturePtr src, PicturePtr dst, - PictFormatPtr mask_format, INT16 x_src, INT16 y_src, - int ntrap, xTrapezoid *traps, Bool fallback) +void +glamor_trapezoids(CARD8 op, + PicturePtr src, PicturePtr dst, + PictFormatPtr mask_format, INT16 x_src, INT16 y_src, + int ntrap, xTrapezoid *traps) { ScreenPtr screen = dst->pDrawable->pScreen; BoxRec bounds; @@ -1666,8 +88,6 @@ _glamor_trapezoids(CARD8 op, int width, height, stride; PixmapPtr pixmap; pixman_image_t *image = NULL; - int ret = 0; - int has_large_trapezoid; /* If a mask format wasn't provided, we get to choose, but behavior should * be as if there was no temporary mask the traps were accumulated into. @@ -1680,16 +100,13 @@ _glamor_trapezoids(CARD8 op, for (; ntrap; ntrap--, traps++) glamor_trapezoids(op, src, dst, mask_format, x_src, y_src, 1, traps); - return TRUE; + return; } - has_large_trapezoid = _glamor_trapezoid_bounds(ntrap, traps, &bounds); - DEBUGF("The bounds for all traps is: bounds.x1 = %d, bounds.x2 = %d, " - "bounds.y1 = %d, bounds.y2 = %d, ---- ntrap = %d\n", bounds.x1, - bounds.x2, bounds.y1, bounds.y2, ntrap); + miTrapezoidBounds(ntrap, traps, &bounds); if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return TRUE; + return; x_dst = traps[0].left.p1.x >> 16; y_dst = traps[0].left.p1.y >> 16; @@ -1698,85 +115,34 @@ _glamor_trapezoids(CARD8 op, height = bounds.y2 - bounds.y1; stride = PixmapBytePad(width, mask_format->depth); -#ifdef GLAMOR_TRAPEZOID_SHADER - /* We seperate the render to two paths. - Some GL implemetation do not implement the Anti-Alias for triangles - and polygen's filling. So when the edge is not vertical or horizontal, - sawtooth will be obvious. The trapezoid is widely used to render wide - lines and circles. In these case, the line or circle will be divided - into a large number of small trapezoids to approximate it, so the sawtooth - at the edge will cause the result not be acceptable. - When the depth of the mask is 1, there is no Anti-Alias needed, so we - use the clip logic to generate the result directly(fast path). - When the depth is not 1, AA is needed and we use a shader to generate - a temp mask pixmap. - */ - if (mask_format->depth == 1) { - ret = _glamor_trapezoids_with_shader(op, src, dst, mask_format, - x_src, y_src, ntrap, traps); - if (ret) - return TRUE; + picture = glamor_create_mask_picture(screen, dst, mask_format, + width, height); + if (!picture) + return; + + image = pixman_image_create_bits(picture->format, + width, height, NULL, stride); + if (!image) { + FreePicture(picture, 0); + return; } - else { - if (has_large_trapezoid || ntrap > 256) { - /* The shader speed is relative slower than pixman when generating big chunk - trapezoid mask. We fallback to pixman to improve the performance. */ - ; - } - else if (dst->polyMode == PolyModeImprecise) { - /* The precise mode is that we sample the trapezoid on the centre points of - an (2*n+1)x(2*n-1) subpixel grid. It is computationally expensive in shader - and we use inside area ratio to replace it if the polymode == Imprecise. */ - picture = glamor_create_mask_picture(screen, dst, mask_format, - width, height, 1); - if (!picture) - return TRUE; - ret = - _glamor_generate_trapezoid_with_shader(screen, picture, traps, - ntrap, &bounds); + for (; ntrap; ntrap--, traps++) + pixman_rasterize_trapezoid(image, + (pixman_trapezoid_t *) traps, + -bounds.x1, -bounds.y1); - if (!ret) - FreePicture(picture, 0); - } - } -#endif + pixmap = glamor_get_drawable_pixmap(picture->pDrawable); - if (!ret) { - DEBUGF("Fallback to sw rasterize of trapezoid\n"); - - picture = glamor_create_mask_picture(screen, dst, mask_format, - width, height, 0); - if (!picture) - return TRUE; - - image = pixman_image_create_bits(picture->format, - width, height, NULL, stride); - if (!image) { - FreePicture(picture, 0); - return TRUE; - } - - for (; ntrap; ntrap--, traps++) - pixman_rasterize_trapezoid(image, - (pixman_trapezoid_t *) traps, - -bounds.x1, -bounds.y1); - - pixmap = glamor_get_drawable_pixmap(picture->pDrawable); - - screen->ModifyPixmapHeader(pixmap, width, height, - mask_format->depth, - BitsPerPixel(mask_format->depth), - PixmapBytePad(width, - mask_format->depth), - pixman_image_get_data(image)); - } + screen->ModifyPixmapHeader(pixmap, width, height, + mask_format->depth, + BitsPerPixel(mask_format->depth), + PixmapBytePad(width, + mask_format->depth), + pixman_image_get_data(image)); x_rel = bounds.x1 + x_src - x_dst; y_rel = bounds.y1 + y_src - y_dst; - DEBUGF("x_src = %d, y_src = %d, x_dst = %d, y_dst = %d, " - "x_rel = %d, y_rel = %d\n", x_src, y_src, x_dst, - y_dst, x_rel, y_rel); CompositePicture(op, src, picture, dst, x_rel, y_rel, @@ -1788,19 +154,6 @@ _glamor_trapezoids(CARD8 op, pixman_image_unref(image); FreePicture(picture, 0); - return TRUE; -} - -void -glamor_trapezoids(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, TRUE); } Bool @@ -1811,8 +164,9 @@ glamor_trapezoids_nf(CARD8 op, { DEBUGF("x_src = %d, y_src = %d, ntrap = %d\n", x_src, y_src, ntrap); - return _glamor_trapezoids(op, src, dst, mask_format, x_src, - y_src, ntrap, traps, FALSE); + glamor_trapezoids(op, src, dst, mask_format, x_src, + y_src, ntrap, traps); + return TRUE; } #endif /* RENDER */ diff --git a/xserver/glamor/glamor_utils.c b/xserver/glamor/glamor_utils.c new file mode 100644 index 000000000..f06896096 --- /dev/null +++ b/xserver/glamor/glamor_utils.c @@ -0,0 +1,79 @@ +/* + * 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 "glamor_priv.h" + +void +glamor_solid_boxes(PixmapPtr pixmap, + BoxPtr box, int nbox, unsigned long fg_pixel) +{ + DrawablePtr drawable = &pixmap->drawable; + GCPtr gc; + xRectangle *rect; + int n; + + rect = malloc(nbox * sizeof (xRectangle)); + if (!rect) + return; + for (n = 0; n < nbox; n++) { + rect[n].x = box[n].x1; + rect[n].y = box[n].y1; + rect[n].width = box[n].x2 - box[n].x1; + rect[n].height = box[n].y2 - box[n].y1; + } + + gc = GetScratchGC(drawable->depth, drawable->pScreen); + if (gc) { + ChangeGCVal vals[1]; + + vals[0].val = fg_pixel; + ChangeGC(NullClient, gc, GCForeground, vals); + ValidateGC(drawable, gc); + gc->ops->PolyFillRect(drawable, gc, nbox, rect); + FreeScratchGC(gc); + } + free(rect); +} + +void +glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, + unsigned long fg_pixel) +{ + DrawablePtr drawable = &pixmap->drawable; + GCPtr gc; + ChangeGCVal vals[1]; + xRectangle rect; + + vals[0].val = fg_pixel; + gc = GetScratchGC(drawable->depth, drawable->pScreen); + if (!gc) + return; + ChangeGC(NullClient, gc, GCForeground, vals); + ValidateGC(drawable, gc); + rect.x = x; + rect.y = y; + rect.width = width; + rect.height = height; + gc->ops->PolyFillRect(drawable, gc, 1, &rect); + FreeScratchGC(gc); +} + diff --git a/xserver/glamor/glamor_utils.h b/xserver/glamor/glamor_utils.h index 4c1581ef5..c15d17ca3 100644 --- a/xserver/glamor/glamor_utils.h +++ b/xserver/glamor/glamor_utils.h @@ -32,6 +32,8 @@ #ifndef __GLAMOR_UTILS_H__ #define __GLAMOR_UTILS_H__ +#include "glamor_prepare.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) @@ -311,21 +313,17 @@ } while(0) #define _glamor_set_normalize_tpoint(xscale, yscale, _tx_, _ty_, \ - texcoord, yInverted) \ + texcoord) \ do { \ (texcoord)[0] = t_from_x_coord_x(xscale, _tx_); \ - if (_X_LIKELY(yInverted)) \ - (texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_);\ - else \ - (texcoord)[1] = t_from_x_coord_y(yscale, _ty_); \ + (texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_); \ DEBUGF("normalized point tx %f ty %f \n", (texcoord)[0], \ (texcoord)[1]); \ } while(0) #define glamor_set_transformed_point(priv, matrix, xscale, \ yscale, texcoord, \ - x, y, \ - yInverted) \ + x, y) \ do { \ float tx, ty; \ int fbo_x_off, fbo_y_off; \ @@ -337,10 +335,7 @@ tx += fbo_x_off; \ ty += fbo_y_off; \ (texcoord)[0] = t_from_x_coord_x(xscale, tx); \ - if (_X_LIKELY(yInverted)) \ - (texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \ - else \ - (texcoord)[1] = t_from_x_coord_y(yscale, ty); \ + (texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \ DEBUGF("normalized tx %f ty %f \n", (texcoord)[0], (texcoord)[1]); \ } while(0) @@ -349,18 +344,14 @@ xscale, \ yscale, \ vtx, \ - yInverted, \ texcoords) \ do { \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords, (vtx)[0], (vtx)[1], \ - yInverted); \ + texcoords, (vtx)[0], (vtx)[1]); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+2, (vtx)[2], (vtx)[3], \ - yInverted); \ + texcoords+2, (vtx)[2], (vtx)[3]); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords+4, (vtx)[4], (vtx)[5], \ - yInverted); \ + texcoords+4, (vtx)[4], (vtx)[5]); \ } while (0) #define glamor_set_transformed_normalize_tcoords_ext( priv, \ @@ -368,21 +359,17 @@ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ - yInverted, texcoords, \ + texcoords, \ stride) \ do { \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords, tx1, ty1, \ - yInverted); \ + texcoords, tx1, ty1); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords + 1 * stride, tx2, ty1, \ - yInverted); \ + texcoords + 1 * stride, tx2, ty1); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords + 2 * stride, tx2, ty2, \ - yInverted); \ + texcoords + 2 * stride, tx2, ty2); \ glamor_set_transformed_point(priv, matrix, xscale, yscale, \ - texcoords + 3 * stride, tx1, ty2, \ - yInverted); \ + texcoords + 3 * stride, tx1, ty2); \ } while (0) #define glamor_set_transformed_normalize_tcoords( priv, \ @@ -390,35 +377,31 @@ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ - yInverted, texcoords) \ + texcoords) \ do { \ glamor_set_transformed_normalize_tcoords_ext( priv, \ matrix, \ xscale, \ yscale, \ tx1, ty1, tx2, ty2, \ - yInverted, texcoords, \ + texcoords, \ 2); \ } while (0) #define glamor_set_normalize_tri_tcoords(xscale, \ yscale, \ vtx, \ - yInverted, \ texcoords) \ do { \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[0], (vtx)[1], \ - texcoords, \ - yInverted); \ + texcoords); \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[2], (vtx)[3], \ - texcoords+2, \ - yInverted); \ + texcoords+2); \ _glamor_set_normalize_tpoint(xscale, yscale, \ (vtx)[4], (vtx)[5], \ - texcoords+4, \ - yInverted); \ + texcoords+4); \ } while (0) #define glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \ @@ -428,14 +411,13 @@ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ - yInverted, \ texcoords, \ stride) \ do { \ if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) { \ glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, \ yscale, _x1_, _y1_, \ - _x2_, _y2_, yInverted, \ + _x2_, _y2_, \ texcoords, stride); \ } else { \ float tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4; \ @@ -462,13 +444,13 @@ DEBUGF("repeat transformed %f %f %f %f %f %f %f %f\n", ttx1, tty1, \ ttx2, tty2, ttx3, tty3, ttx4, tty4); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx1, tty1, \ - texcoords, yInverted); \ + texcoords); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx2, tty2, \ - texcoords + 1 * stride, yInverted); \ + texcoords + 1 * stride); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx3, tty3, \ - texcoords + 2 * stride, yInverted); \ + texcoords + 2 * stride); \ _glamor_set_normalize_tpoint(xscale, yscale, ttx4, tty4, \ - texcoords + 3 * stride, yInverted); \ + texcoords + 3 * stride); \ } \ } while (0) @@ -479,7 +461,6 @@ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ - yInverted, \ texcoords) \ do { \ glamor_set_repeat_transformed_normalize_tcoords_ext( priv, \ @@ -489,14 +470,13 @@ yscale, \ _x1_, _y1_, \ _x2_, _y2_, \ - yInverted, \ texcoords, \ 2); \ } while (0) #define _glamor_set_normalize_tcoords(xscale, yscale, tx1, \ ty1, tx2, ty2, \ - yInverted, vertices, stride) \ + vertices, stride) \ do { \ /* vertices may be write-only, so we use following \ * temporary variable. */ \ @@ -505,21 +485,15 @@ (vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \ (vertices)[2 * stride] = _t2_; \ (vertices)[3 * stride] = _t0_; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \ - (vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2);\ - } \ - else { \ - (vertices)[1] = _t1_ = t_from_x_coord_y(yscale, ty1); \ - (vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y(yscale, ty2);\ - } \ + (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 * stride + 1] = _t1_; \ (vertices)[3 * stride + 1] = _t5_; \ } while(0) #define glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices, stride) \ + vertices, stride) \ do { \ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \ float tx1, tx2, ty1, ty2; \ @@ -530,26 +504,26 @@ ty1 = y1 + fbo_y_off; \ ty2 = y2 + fbo_y_off; \ _glamor_set_normalize_tcoords(xscale, yscale, tx1, ty1, \ - tx2, ty2, yInverted, vertices, \ + tx2, ty2, vertices, \ stride); \ } else \ _glamor_set_normalize_tcoords(xscale, yscale, x1, y1, \ - x2, y2, yInverted, vertices, stride);\ + x2, y2, vertices, stride); \ } while(0) #define glamor_set_normalize_tcoords(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices) \ + vertices) \ do { \ glamor_set_normalize_tcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices, 2); \ + vertices, 2); \ } while(0) #define glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ - yInverted, vertices, stride)\ + vertices, stride) \ do { \ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \ float tx1, tx2, ty1, ty2; \ @@ -564,130 +538,99 @@ _x1_, _y1_, _x2_, _y2_); \ } \ _glamor_set_normalize_tcoords(xscale, yscale, tx1, ty1, \ - tx2, ty2, yInverted, vertices, \ + tx2, ty2, vertices, \ stride); \ } else \ _glamor_set_normalize_tcoords(xscale, yscale, _x1_, _y1_, \ - _x2_, _y2_, yInverted, vertices, \ + _x2_, _y2_, vertices, \ stride); \ } while(0) #define glamor_set_repeat_normalize_tcoords(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ - yInverted, vertices) \ + vertices) \ do { \ glamor_set_repeat_normalize_tcoords_ext(priv, repeat_type, \ xscale, yscale, \ _x1_, _y1_, _x2_, _y2_, \ - yInverted, vertices, 2); \ + vertices, 2); \ } while(0) #define glamor_set_normalize_tcoords_tri_stripe(xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices) \ + vertices) \ do { \ (vertices)[0] = t_from_x_coord_x(xscale, x1); \ (vertices)[2] = t_from_x_coord_x(xscale, x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \ - (vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \ - } \ - else { \ - (vertices)[1] = t_from_x_coord_y(yscale, y1); \ - (vertices)[7] = t_from_x_coord_y(yscale, y2); \ - } \ + (vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \ + (vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) -#define glamor_set_tcoords(width, height, x1, y1, x2, y2, \ - yInverted, vertices) \ +#define glamor_set_tcoords(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ (vertices)[2] = (x2); \ (vertices)[4] = (vertices)[2]; \ (vertices)[6] = (vertices)[0]; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = (y1); \ - (vertices)[5] = (y2); \ - } \ - else { \ - (vertices)[1] = height - (y2); \ - (vertices)[5] = height - (y1); \ - } \ + (vertices)[1] = (y1); \ + (vertices)[5] = (y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[7] = (vertices)[5]; \ } while(0) -#define glamor_set_tcoords_ext(width, height, x1, y1, x2, y2, \ - yInverted, vertices, stride) \ +#define glamor_set_tcoords_ext(x1, y1, x2, y2, vertices, stride) \ do { \ (vertices)[0] = (x1); \ (vertices)[1*stride] = (x2); \ (vertices)[2*stride] = (vertices)[1*stride]; \ (vertices)[3*stride] = (vertices)[0]; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = (y1); \ - (vertices)[2*stride + 1] = (y2); \ - } \ - else { \ - (vertices)[1] = height - (y2); \ - (vertices)[2*stride + 1] = height - (y1); \ - } \ + (vertices)[1] = (y1); \ + (vertices)[2*stride + 1] = (y2); \ (vertices)[1*stride + 1] = (vertices)[1]; \ (vertices)[3*stride + 1] = (vertices)[2*stride + 1]; \ } while(0) #define glamor_set_normalize_one_vcoord(xscale, yscale, x, y, \ - yInverted, vertices) \ + vertices) \ do { \ (vertices)[0] = v_from_x_coord_x(xscale, x); \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \ - } else { \ - (vertices)[1] = v_from_x_coord_y(yscale, y); \ - } \ + (vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \ } while(0) #define glamor_set_normalize_tri_vcoords(xscale, yscale, vtx, \ - yInverted, vertices) \ + vertices) \ do { \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[0], (vtx)[1], \ - yInverted, vertices); \ + vertices); \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[2], (vtx)[3], \ - yInverted, vertices+2); \ + vertices+2); \ glamor_set_normalize_one_vcoord(xscale, yscale, \ (vtx)[4], (vtx)[5], \ - yInverted, vertices+4); \ + vertices+4); \ } while(0) -#define glamor_set_tcoords_tri_strip(width, height, x1, y1, x2, y2, \ - yInverted, vertices) \ +#define glamor_set_tcoords_tri_strip(x1, y1, x2, y2, vertices) \ do { \ (vertices)[0] = (x1); \ (vertices)[2] = (x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = (y1); \ - (vertices)[7] = (y2); \ - } \ - else { \ - (vertices)[1] = height - (y2); \ - (vertices)[7] = height - (y1); \ - } \ + (vertices)[1] = (y1); \ + (vertices)[7] = (y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) #define glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices, stride) \ + vertices, stride) \ do { \ int fbo_x_off, fbo_y_off; \ /* vertices may be write-only, so we use following \ @@ -699,29 +642,22 @@ x2 + fbo_x_off); \ (vertices)[2 * stride] = _t2_; \ (vertices)[3 * stride] = _t0_; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \ - y1 + fbo_y_off); \ - (vertices)[2 * stride + 1] = _t5_ = \ - v_from_x_coord_y_inverted(yscale, \ - y2 + fbo_y_off); \ - } \ - else { \ - (vertices)[1] = _t1_ = v_from_x_coord_y(yscale, y1 + fbo_y_off); \ - (vertices)[2 * stride + 1] = _t5_ = v_from_x_coord_y(yscale, \ - y2 + fbo_y_off); \ - } \ + (vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \ + y1 + fbo_y_off); \ + (vertices)[2 * stride + 1] = _t5_ = \ + v_from_x_coord_y_inverted(yscale, \ + y2 + fbo_y_off); \ (vertices)[1 * stride + 1] = _t1_; \ (vertices)[3 * stride + 1] = _t5_; \ } while(0) #define glamor_set_normalize_vcoords(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices) \ + vertices) \ do { \ glamor_set_normalize_vcoords_ext(priv, xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices, 2); \ + vertices, 2); \ } while(0) #define glamor_set_const_ext(params, nparam, vertices, nverts, stride) \ @@ -736,44 +672,30 @@ #define glamor_set_normalize_vcoords_tri_strip(xscale, yscale, \ x1, y1, x2, y2, \ - yInverted, vertices) \ + vertices) \ do { \ (vertices)[0] = v_from_x_coord_x(xscale, x1); \ (vertices)[2] = v_from_x_coord_x(xscale, x2); \ (vertices)[6] = (vertices)[2]; \ (vertices)[4] = (vertices)[0]; \ - if (_X_LIKELY(yInverted)) { \ - (vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \ - (vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \ - } \ - else { \ - (vertices)[1] = v_from_x_coord_y(yscale, y1); \ - (vertices)[7] = v_from_x_coord_y(yscale, y2); \ - } \ + (vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \ + (vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \ (vertices)[3] = (vertices)[1]; \ (vertices)[5] = (vertices)[7]; \ } while(0) #define glamor_set_normalize_pt(xscale, yscale, x, y, \ - yInverted, pt) \ + pt) \ do { \ (pt)[0] = t_from_x_coord_x(xscale, x); \ - if (_X_LIKELY(yInverted)) { \ - (pt)[1] = t_from_x_coord_y_inverted(yscale, y); \ - } else { \ - (pt)[1] = t_from_x_coord_y(yscale, y); \ - } \ + (pt)[1] = t_from_x_coord_y_inverted(yscale, y); \ } while(0) #define glamor_set_circle_centre(width, height, x, y, \ - yInverted, c) \ + c) \ do { \ (c)[0] = (float)x; \ - if (_X_LIKELY(yInverted)) { \ - (c)[1] = (float)y; \ - } else { \ - (c)[1] = (float)height - (float)y; \ - } \ + (c)[1] = (float)y; \ } while(0) inline static void diff --git a/xserver/glamor/glamor_xv.c b/xserver/glamor/glamor_xv.c index 369b02b61..83e24adb2 100644 --- a/xserver/glamor/glamor_xv.c +++ b/xserver/glamor/glamor_xv.c @@ -36,12 +36,10 @@ #include #endif -#include "xf86xv.h" -#define GLAMOR_FOR_XORG #include "glamor_priv.h" #include -#include "fourcc.h" +#include "../hw/xfree86/common/fourcc.h" /* Reference color space transform data */ typedef struct tagREF_TRANSFORM { float RefLuma; @@ -90,7 +88,28 @@ static const char *xv_ps = GLAMOR_DEFAULT_PRECISION "gl_FragColor = temp1;\n" "}\n"; -void +#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) + +XvAttributeRec glamor_xv_attributes[] = { + {XvSettable | XvGettable, -1000, 1000, (char *)"XV_BRIGHTNESS"}, + {XvSettable | XvGettable, -1000, 1000, (char *)"XV_CONTRAST"}, + {XvSettable | XvGettable, -1000, 1000, (char *)"XV_SATURATION"}, + {XvSettable | XvGettable, -1000, 1000, (char *)"XV_HUE"}, + {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORSPACE"}, + {0, 0, 0, NULL} +}; +int glamor_xv_num_attributes = ARRAY_SIZE(glamor_xv_attributes) - 1; + +Atom glamorBrightness, glamorContrast, glamorSaturation, glamorHue, + glamorColorspace, glamorGamma; + +XvImageRec glamor_xv_images[] = { + XVIMAGE_YV12, + XVIMAGE_I420, +}; +int glamor_xv_num_images = ARRAY_SIZE(glamor_xv_images); + +static void glamor_init_xv_shader(ScreenPtr screen) { glamor_screen_private *glamor_priv; @@ -113,91 +132,63 @@ glamor_init_xv_shader(ScreenPtr screen) } #define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v)) -#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) -static Atom xvBrightness, xvContrast, xvSaturation, xvHue, xvColorspace, - xvGamma; - -#define NUM_ATTRIBUTES 5 -static XF86AttributeRec Attributes_glamor[NUM_ATTRIBUTES + 1] = { - {XvSettable | XvGettable, -1000, 1000, "XV_BRIGHTNESS"}, - {XvSettable | XvGettable, -1000, 1000, "XV_CONTRAST"}, - {XvSettable | XvGettable, -1000, 1000, "XV_SATURATION"}, - {XvSettable | XvGettable, -1000, 1000, "XV_HUE"}, - {XvSettable | XvGettable, 0, 1, "XV_COLORSPACE"}, - {0, 0, 0, NULL} -}; - -#define NUM_FORMATS 3 - -static XF86VideoFormatRec Formats[NUM_FORMATS] = { - {15, TrueColor}, {16, TrueColor}, {24, TrueColor} -}; - -#define NUM_IMAGES 2 - -static XF86ImageRec Images[NUM_IMAGES] = { - XVIMAGE_YV12, - XVIMAGE_I420, -}; +void +glamor_xv_stop_video(glamor_port_private *port_priv) +{ +} static void -glamor_xv_stop_video(ScrnInfoPtr pScrn, void *data, Bool cleanup) +glamor_xv_free_port_data(glamor_port_private *port_priv) { - glamor_port_private *port_priv = (glamor_port_private *) data; int i; - if (!cleanup) - return; - for (i = 0; i < 3; i++) { if (port_priv->src_pix[i]) { glamor_destroy_pixmap(port_priv->src_pix[i]); port_priv->src_pix[i] = NULL; } } + RegionUninit(&port_priv->clip); + RegionNull(&port_priv->clip); } -static int -glamor_xv_set_port_attribute(ScrnInfoPtr pScrn, - Atom attribute, INT32 value, void *data) +int +glamor_xv_set_port_attribute(glamor_port_private *port_priv, + Atom attribute, INT32 value) { - glamor_port_private *port_priv = (glamor_port_private *) data; - - if (attribute == xvBrightness) + if (attribute == glamorBrightness) port_priv->brightness = ClipValue(value, -1000, 1000); - else if (attribute == xvHue) + else if (attribute == glamorHue) port_priv->hue = ClipValue(value, -1000, 1000); - else if (attribute == xvContrast) + else if (attribute == glamorContrast) port_priv->contrast = ClipValue(value, -1000, 1000); - else if (attribute == xvSaturation) + else if (attribute == glamorSaturation) port_priv->saturation = ClipValue(value, -1000, 1000); - else if (attribute == xvGamma) + else if (attribute == glamorGamma) port_priv->gamma = ClipValue(value, 100, 10000); - else if (attribute == xvColorspace) + else if (attribute == glamorColorspace) port_priv->transform_index = ClipValue(value, 0, 1); else return BadMatch; return Success; } -static int -glamor_xv_get_port_attribute(ScrnInfoPtr pScrn, - Atom attribute, INT32 *value, void *data) +int +glamor_xv_get_port_attribute(glamor_port_private *port_priv, + Atom attribute, INT32 *value) { - glamor_port_private *port_priv = (glamor_port_private *) data; - - if (attribute == xvBrightness) + if (attribute == glamorBrightness) *value = port_priv->brightness; - else if (attribute == xvHue) + else if (attribute == glamorHue) *value = port_priv->hue; - else if (attribute == xvContrast) + else if (attribute == glamorContrast) *value = port_priv->contrast; - else if (attribute == xvSaturation) + else if (attribute == glamorSaturation) *value = port_priv->saturation; - else if (attribute == xvGamma) + else if (attribute == glamorGamma) *value = port_priv->gamma; - else if (attribute == xvColorspace) + else if (attribute == glamorColorspace) *value = port_priv->transform_index; else return BadMatch; @@ -205,20 +196,8 @@ glamor_xv_get_port_attribute(ScrnInfoPtr pScrn, return Success; } -static void -glamor_xv_query_best_size(ScrnInfoPtr pScrn, - Bool motion, - short vid_w, short vid_h, - short drw_w, short drw_h, - unsigned int *p_w, unsigned int *p_h, void *data) -{ - *p_w = drw_w; - *p_h = drw_h; -} - -static int -glamor_xv_query_image_attributes(ScrnInfoPtr pScrn, - int id, +int +glamor_xv_query_image_attributes(int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { @@ -229,15 +208,14 @@ glamor_xv_query_image_attributes(ScrnInfoPtr pScrn, switch (id) { case FOURCC_YV12: case FOURCC_I420: - *h = *h; - *w = *w; - size = *w; + *h = ALIGN(*h, 2); + size = ALIGN(*w, 4); if (pitches) pitches[0] = size; size *= *h; if (offsets) offsets[1] = size; - tmp = *w >> 1; + tmp = ALIGN(*w >> 1, 4); if (pitches) pitches[1] = pitches[2] = tmp; tmp *= (*h >> 1); @@ -258,8 +236,8 @@ static REF_TRANSFORM trans[2] = { {1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0} /* BT.709 */ }; -static void -glamor_display_textured_video(glamor_port_private *port_priv) +void +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); @@ -282,6 +260,9 @@ glamor_display_textured_video(glamor_port_private *port_priv) int ref = port_priv->transform_index; GLint uloc, sampler_loc; + if (!glamor_priv->xv_prog) + glamor_init_xv_shader(screen); + cont = RTFContrast(port_priv->contrast); bright = RTFBrightness(port_priv->brightness); gamma = (float) port_priv->gamma / 1000.0; @@ -361,6 +342,7 @@ glamor_display_textured_video(glamor_port_private *port_priv) GL_FALSE, 2 * sizeof(float), vertices); 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; @@ -381,32 +363,37 @@ glamor_display_textured_video(glamor_port_private *port_priv) glamor_set_normalize_vcoords(pixmap_priv, dst_xscale, dst_yscale, - dstx, + dstx - dstw, dsty, dstx + dstw, - dsty + dsth, - glamor_priv->yInverted, vertices); + dsty + dsth * 2, + vertices); glamor_set_normalize_tcoords(src_pixmap_priv[0], src_xscale[0], src_yscale[0], - srcx, + srcx - srcw, srcy, srcx + srcw, - srcy + srch, - glamor_priv->yInverted, texcoords); + srcy + srch * 2, + texcoords); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + glScissor(dstx, dsty, dstw, dsth); + glDrawArrays(GL_TRIANGLE_FAN, 0, 3); } + glDisable(GL_SCISSOR_TEST); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); DamageDamageRegion(port_priv->pDraw, &port_priv->clip); + + glamor_xv_free_port_data(port_priv); } -static int -glamor_xv_put_image(ScrnInfoPtr pScrn, +int +glamor_xv_put_image(glamor_port_private *port_priv, + DrawablePtr pDrawable, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, @@ -416,38 +403,15 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, short width, short height, Bool sync, - RegionPtr clipBoxes, void *data, DrawablePtr pDrawable) + RegionPtr clipBoxes) { - ScreenPtr screen = pDrawable->pScreen; - glamor_port_private *port_priv = (glamor_port_private *) data; - INT32 x1, x2, y1, y2; + ScreenPtr pScreen = pDrawable->pScreen; int srcPitch, srcPitch2; - BoxRec dstBox; int top, nlines; int s2offset, s3offset, tmp; s2offset = s3offset = srcPitch2 = 0; - /* Clip */ - x1 = src_x; - x2 = src_x + src_w; - y1 = src_y; - y2 = src_y + src_h; - - dstBox.x1 = drw_x; - dstBox.x2 = drw_x + drw_w; - dstBox.y1 = drw_y; - dstBox.y2 = drw_y + drw_h; - if (!xf86XVClipVideoHelper - (&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) - return Success; - - if ((x1 >= x2) || (y1 >= y2)) - return Success; - - srcPitch = width; - srcPitch2 = width >> 1; - if (!port_priv->src_pix[0] || (width != port_priv->src_pix_w || height != port_priv->src_pix_h)) { int i; @@ -457,11 +421,11 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, glamor_destroy_pixmap(port_priv->src_pix[i]); port_priv->src_pix[0] = - glamor_create_pixmap(screen, width, height, 8, 0); + glamor_create_pixmap(pScreen, width, height, 8, 0); port_priv->src_pix[1] = - glamor_create_pixmap(screen, width >> 1, height >> 1, 8, 0); + glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); port_priv->src_pix[2] = - glamor_create_pixmap(screen, width >> 1, height >> 1, 8, 0); + glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0); port_priv->src_pix_w = width; port_priv->src_pix_h = height; @@ -470,12 +434,14 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, return BadAlloc; } - top = (y1 >> 16) & ~1; - nlines = ((y2 + 0xffff) >> 16) - top; + top = (src_y) & ~1; + nlines = (src_y + src_h) - top; switch (id) { case FOURCC_YV12: case FOURCC_I420: + srcPitch = ALIGN(width, 4); + srcPitch2 = ALIGN(width >> 1, 4); s2offset = srcPitch * height; s3offset = s2offset + (srcPitch2 * ((height + 1) >> 1)); s2offset += ((top >> 1) * srcPitch2); @@ -486,18 +452,18 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, s3offset = tmp; } glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[0], - 0, 0, srcPitch, nlines, - port_priv->src_pix[0]->devKind, + 0, 0, width, nlines, + srcPitch, buf + (top * srcPitch), 0); glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[1], - 0, 0, srcPitch2, (nlines + 1) >> 1, - port_priv->src_pix[1]->devKind, + 0, 0, width >> 1, (nlines + 1) >> 1, + srcPitch2, buf + s2offset, 0); glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[2], - 0, 0, srcPitch2, (nlines + 1) >> 1, - port_priv->src_pix[2]->devKind, + 0, 0, width >> 1, (nlines + 1) >> 1, + srcPitch2, buf + s3offset, 0); break; default: @@ -505,13 +471,11 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, } if (pDrawable->type == DRAWABLE_WINDOW) - port_priv->pPixmap = (*screen->GetWindowPixmap) ((WindowPtr) pDrawable); + port_priv->pPixmap = pScreen->GetWindowPixmap((WindowPtr) pDrawable); else port_priv->pPixmap = (PixmapPtr) pDrawable; - if (!RegionEqual(&port_priv->clip, clipBoxes)) { - RegionCopy(&port_priv->clip, clipBoxes); - } + RegionCopy(&port_priv->clip, clipBoxes); port_priv->src_x = src_x; port_priv->src_y = src_y; @@ -524,83 +488,30 @@ glamor_xv_put_image(ScrnInfoPtr pScrn, port_priv->w = width; port_priv->h = height; port_priv->pDraw = pDrawable; - glamor_display_textured_video(port_priv); + glamor_xv_render(port_priv); return Success; } -static XF86VideoEncodingRec DummyEncodingGLAMOR[1] = { - { - 0, - "XV_IMAGE", - 8192, 8192, - {1, 1} - } -}; - -XF86VideoAdaptorPtr -glamor_xv_init(ScreenPtr screen, int num_texture_ports) +void +glamor_xv_init_port(glamor_port_private *port_priv) { - glamor_port_private *port_priv; - XF86VideoAdaptorPtr adapt; - int i; + port_priv->brightness = 0; + port_priv->contrast = 0; + port_priv->saturation = 0; + port_priv->hue = 0; + port_priv->gamma = 1000; + port_priv->transform_index = 0; - glamor_init_xv_shader(screen); - - adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports * - (sizeof(glamor_port_private) + sizeof(DevUnion))); - if (adapt == NULL) - return NULL; - - xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); - xvContrast = MAKE_ATOM("XV_CONTRAST"); - xvSaturation = MAKE_ATOM("XV_SATURATION"); - xvHue = MAKE_ATOM("XV_HUE"); - xvGamma = MAKE_ATOM("XV_GAMMA"); - xvColorspace = MAKE_ATOM("XV_COLORSPACE"); - - adapt->type = XvWindowMask | XvInputMask | XvImageMask; - adapt->flags = 0; - adapt->name = "GLAMOR Textured Video"; - adapt->nEncodings = 1; - adapt->pEncodings = DummyEncodingGLAMOR; - - adapt->nFormats = NUM_FORMATS; - adapt->pFormats = Formats; - adapt->nPorts = num_texture_ports; - adapt->pPortPrivates = (DevUnion *) (&adapt[1]); - - adapt->pAttributes = Attributes_glamor; - adapt->nAttributes = NUM_ATTRIBUTES; - - port_priv = - (glamor_port_private *) (&adapt->pPortPrivates[num_texture_ports]); - adapt->pImages = Images; - adapt->nImages = NUM_IMAGES; - adapt->PutVideo = NULL; - adapt->PutStill = NULL; - adapt->GetVideo = NULL; - adapt->GetStill = NULL; - adapt->StopVideo = glamor_xv_stop_video; - adapt->SetPortAttribute = glamor_xv_set_port_attribute; - adapt->GetPortAttribute = glamor_xv_get_port_attribute; - adapt->QueryBestSize = glamor_xv_query_best_size; - adapt->PutImage = glamor_xv_put_image; - adapt->ReputImage = NULL; - adapt->QueryImageAttributes = glamor_xv_query_image_attributes; - - for (i = 0; i < num_texture_ports; i++) { - glamor_port_private *pPriv = &port_priv[i]; - - pPriv->brightness = 0; - pPriv->contrast = 0; - pPriv->saturation = 0; - pPriv->hue = 0; - pPriv->gamma = 1000; - pPriv->transform_index = 0; - - REGION_NULL(pScreen, &pPriv->clip); - - adapt->pPortPrivates[i].ptr = (void *) (pPriv); - } - return adapt; + REGION_NULL(pScreen, &port_priv->clip); +} + +void +glamor_xv_core_init(ScreenPtr screen) +{ + glamorBrightness = MAKE_ATOM("XV_BRIGHTNESS"); + glamorContrast = MAKE_ATOM("XV_CONTRAST"); + glamorSaturation = MAKE_ATOM("XV_SATURATION"); + glamorHue = MAKE_ATOM("XV_HUE"); + glamorGamma = MAKE_ATOM("XV_GAMMA"); + glamorColorspace = MAKE_ATOM("XV_COLORSPACE"); } diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in index b05e41bf5..ab5fcd453 100644 --- a/xserver/glx/Makefile.in +++ b/xserver/glx/Makefile.in @@ -249,6 +249,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/glx/glxbyteorder.h b/xserver/glx/glxbyteorder.h index 73f0f7df7..aa88b44b9 100644 --- a/xserver/glx/glxbyteorder.h +++ b/xserver/glx/glxbyteorder.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2006, 2007 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL @@ -25,7 +25,7 @@ /** * \file glxbyteorder.h * Platform glue for handling byte-ordering issues in GLX protocol. - * + * * \author Ian Romanick */ #if !defined(__GLXBYTEORDER_H__) diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c index 336a873e7..f5f2babb8 100644 --- a/xserver/glx/glxcmds.c +++ b/xserver/glx/glxcmds.c @@ -198,6 +198,12 @@ __glXdirectContextDestroy(__GLXcontext * context) free(context); } +static int +__glXdirectContextLoseCurrent(__GLXcontext * context) +{ + return GL_TRUE; +} + _X_HIDDEN __GLXcontext * __glXdirectContextCreate(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext) @@ -209,6 +215,7 @@ __glXdirectContextCreate(__GLXscreen * screen, return NULL; context->destroy = __glXdirectContextDestroy; + context->loseCurrent = __glXdirectContextLoseCurrent; return context; } @@ -233,13 +240,13 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, LEGAL_NEW_RESOURCE(gcId, client); /* - ** Find the display list space that we want to share. + ** Find the display list space that we want to share. ** ** NOTE: In a multithreaded X server, we would need to keep a reference - ** count for each display list so that if one client detroyed a list that - ** another client was using, the list would not really be freed until it - ** was no longer in use. Since this sample implementation has no support - ** for multithreaded servers, we don't do this. + ** count for each display list so that if one client detroyed a list that + ** another client was using, the list would not really be freed until it + ** was no longer in use. Since this sample implementation has no support + ** for multithreaded servers, we don't do this. */ if (shareList == None) { shareglxc = 0; @@ -413,7 +420,9 @@ __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc) &glxc, &err)) return err; - FreeResourceByType(req->context, __glXContextRes, FALSE); + glxc->idExists = GL_FALSE; + if (!glxc->currentClient) + FreeResourceByType(req->context, __glXContextRes, FALSE); return Success; } @@ -992,7 +1001,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) buf[p++] = modes->level; assert(p == GLX_VIS_CONFIG_UNPAIRED); - /* + /* ** Add token/value pairs for extensions. */ buf[p++] = GLX_VISUAL_CAVEAT_EXT; @@ -1041,7 +1050,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) * and interface into the driver on the server-side to get GLXFBConfigs, * so we "invent" some based on the \c __GLXvisualConfig structures that * the driver does supply. - * + * * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX * is the same, so this routine pulls double duty. */ @@ -1907,44 +1916,55 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) { ClientPtr client = cl->client; xGLXGetDrawableAttributesReply reply; - __GLXdrawable *pGlxDraw; + __GLXdrawable *pGlxDraw = NULL; + DrawablePtr pDraw; CARD32 attributes[14]; - int numAttribs = 0, error; + int num = 0, error; if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, - DixGetAttrAccess, &pGlxDraw, &error)) - return error; + DixGetAttrAccess, &pGlxDraw, &error)) { + /* hack for GLX 1.2 naked windows */ + int err = dixLookupWindow((WindowPtr *)&pDraw, drawId, client, + DixGetAttrAccess); + if (err != Success) + return error; + } + if (pGlxDraw) + pDraw = pGlxDraw->pDraw; - attributes[0] = GLX_TEXTURE_TARGET_EXT; - attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : - GLX_TEXTURE_RECTANGLE_EXT; - numAttribs++; - attributes[2] = GLX_Y_INVERTED_EXT; - attributes[3] = GL_FALSE; - numAttribs++; - attributes[4] = GLX_EVENT_MASK; - attributes[5] = pGlxDraw->eventMask; - numAttribs++; - attributes[6] = GLX_WIDTH; - attributes[7] = pGlxDraw->pDraw->width; - numAttribs++; - attributes[8] = GLX_HEIGHT; - attributes[9] = pGlxDraw->pDraw->height; - numAttribs++; - attributes[10] = GLX_FBCONFIG_ID; - attributes[11] = pGlxDraw->config->fbconfigID; - numAttribs++; - if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) { - attributes[12] = GLX_PRESERVED_CONTENTS; - attributes[13] = GL_TRUE; - numAttribs++; + 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++; + 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++; + if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) { + attributes[2*num] = GLX_PRESERVED_CONTENTS; + attributes[2*num+1] = GL_TRUE; + num++; + } } reply = (xGLXGetDrawableAttributesReply) { .type = X_Reply, .sequenceNumber = client->sequence, - .length = numAttribs << 1, - .numAttribs = numAttribs + .length = num << 1, + .numAttribs = num }; if (client->swapped) { @@ -2521,13 +2541,16 @@ __glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, #if PRESENT static void -__glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, - uint64_t ust, uint64_t msc) +__glXpresentCompleteNotify(WindowPtr window, CARD8 present_kind, CARD8 present_mode, + CARD32 serial, uint64_t ust, uint64_t msc) { __GLXdrawable *drawable; int glx_type; int rc; + if (present_kind != PresentCompleteKindPixmap) + return; + rc = dixLookupResourceByType((void **) &drawable, window->drawable.id, __glXDrawableRes, serverClient, DixGetAttrAccess); @@ -2538,7 +2561,7 @@ __glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, glx_type = GLX_FLIP_COMPLETE_INTEL; else glx_type = GLX_BLIT_COMPLETE_INTEL; - + __glXsendSwapEvent(drawable, glx_type, ust, msc, serial); } diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c index c756bf570..bcd57a4a3 100644 --- a/xserver/glx/glxdri2.c +++ b/xserver/glx/glxdri2.c @@ -187,7 +187,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, glx_type = GLX_FLIP_COMPLETE_INTEL; break; } - + __glXsendSwapEvent(drawable, glx_type, ust, msc, sbc); } @@ -475,7 +475,7 @@ create_driver_context(__GLXDRIcontext * context, context->driContext = NULL; if (screen->dri2->base.version >= 3) { - uint32_t ctx_attribs[3 * 2]; + uint32_t ctx_attribs[4 * 2]; unsigned num_ctx_attribs = 0; unsigned dri_err = 0; unsigned major_ver; @@ -510,6 +510,8 @@ create_driver_context(__GLXDRIcontext * context, __DRI_CTX_ATTRIB_RESET_STRATEGY; ctx_attribs[num_ctx_attribs++] = reset; } + + assert(num_ctx_attribs <= ARRAY_SIZE(ctx_attribs)); } context->driContext = diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c index c30ce9aed..5d9aa0437 100644 --- a/xserver/glx/glxdriswrast.c +++ b/xserver/glx/glxdriswrast.c @@ -325,7 +325,7 @@ swrastGetDrawableInfo(__DRIdrawable * draw, DrawablePtr pDraw = drawable->base.pDraw; *x = pDraw->x; - *y = pDraw->x; + *y = pDraw->y; *w = pDraw->width; *h = pDraw->height; } diff --git a/xserver/glx/glxext.c b/xserver/glx/glxext.c index c2de3cedd..e41b881f2 100644 --- a/xserver/glx/glxext.c +++ b/xserver/glx/glxext.c @@ -66,6 +66,7 @@ static DevPrivateKeyRec glxClientPrivateKeyRec; ** Forward declarations. */ static int __glXDispatch(ClientPtr); +static GLboolean __glXFreeContext(__GLXcontext * cx); /* ** Called when the extension is reset. @@ -133,6 +134,9 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) next = c->next; if (c->currentClient && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { + /* flush the context */ + glFlush(); + c->hasUnflushedCommands = GL_FALSE; /* just force a re-bind the next time through */ (*c->loseCurrent) (c); lastGLContext = NULL; @@ -186,7 +190,7 @@ __glXRemoveFromContextList(__GLXcontext * cx) /* ** Free a context. */ -GLboolean +static GLboolean __glXFreeContext(__GLXcontext * cx) { if (cx->idExists || cx->currentClient) @@ -291,7 +295,7 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data) c->loseCurrent(c); lastGLContext = NULL; c->currentClient = NULL; - __glXFreeContext(c); + FreeResourceByType(c->id, __glXContextRes, FALSE); } } diff --git a/xserver/glx/glxext.h b/xserver/glx/glxext.h index 3f2dee696..cde0e1519 100644 --- a/xserver/glx/glxext.h +++ b/xserver/glx/glxext.h @@ -51,7 +51,6 @@ #define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 #endif -extern GLboolean __glXFreeContext(__GLXcontext * glxc); extern void __glXFlushContextCache(void); extern Bool __glXAddContext(__GLXcontext * cx); diff --git a/xserver/glx/glxscreens.c b/xserver/glx/glxscreens.c index 78769f401..b0ad3b7bc 100644 --- a/xserver/glx/glxscreens.c +++ b/xserver/glx/glxscreens.c @@ -155,7 +155,7 @@ static const char GLServerExtensions[] = "GL_SUN_slice_accum "; /* -** We have made the simplifying assuption that the same extensions are +** We have made the simplifying assuption that the same extensions are ** supported across all screens in a multi-screen system. */ unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; diff --git a/xserver/glx/glxscreens.h b/xserver/glx/glxscreens.h index c8119fd21..a90587732 100644 --- a/xserver/glx/glxscreens.h +++ b/xserver/glx/glxscreens.h @@ -56,7 +56,7 @@ struct __GLXconfig { /* GLX */ GLint visualID; - GLint visualType; /**< One of the GLX X visual types. (i.e., + GLint visualType; /**< One of the GLX X visual types. (i.e., * \c GLX_TRUE_COLOR, etc.) */ diff --git a/xserver/glx/indirect_dispatch.c b/xserver/glx/indirect_dispatch.c index f6cabefc8..24784e693 100644 --- a/xserver/glx/indirect_dispatch.c +++ b/xserver/glx/indirect_dispatch.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_dispatch.h b/xserver/glx/indirect_dispatch.h index e6e3fdacf..536be60ac 100644 --- a/xserver/glx/indirect_dispatch.h +++ b/xserver/glx/indirect_dispatch.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_dispatch_swap.c b/xserver/glx/indirect_dispatch_swap.c index c0bb64d5d..7ebcc6330 100644 --- a/xserver/glx/indirect_dispatch_swap.c +++ b/xserver/glx/indirect_dispatch_swap.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_program.c b/xserver/glx/indirect_program.c index 01562e619..5caee7b2a 100644 --- a/xserver/glx/indirect_program.c +++ b/xserver/glx/indirect_program.c @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005, 2006 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_reqsize.c b/xserver/glx/indirect_reqsize.c index 092a421cc..020aae2fe 100644 --- a/xserver/glx/indirect_reqsize.c +++ b/xserver/glx/indirect_reqsize.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_reqsize.h b/xserver/glx/indirect_reqsize.h index f0d88932e..632a85b1c 100644 --- a/xserver/glx/indirect_reqsize.h +++ b/xserver/glx/indirect_reqsize.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_size.h b/xserver/glx/indirect_size.h index fec7ed393..6a3d14cc4 100644 --- a/xserver/glx/indirect_size.h +++ b/xserver/glx/indirect_size.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_size_get.c b/xserver/glx/indirect_size_get.c index f87931193..7e81e6288 100644 --- a/xserver/glx/indirect_size_get.c +++ b/xserver/glx/indirect_size_get.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_size_get.h b/xserver/glx/indirect_size_get.h index 9b6203669..5af11d378 100644 --- a/xserver/glx/indirect_size_get.h +++ b/xserver/glx/indirect_size_get.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_table.c b/xserver/glx/indirect_table.c index 33e3d6a22..f0f0b83c8 100644 --- a/xserver/glx/indirect_table.c +++ b/xserver/glx/indirect_table.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005, 2006 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_table.h b/xserver/glx/indirect_table.h index a39dc4e3d..c0d6ee9f0 100644 --- a/xserver/glx/indirect_table.h +++ b/xserver/glx/indirect_table.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005, 2006 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_texture_compression.c b/xserver/glx/indirect_texture_compression.c index d2768f2df..1ebf7f3a2 100644 --- a/xserver/glx/indirect_texture_compression.c +++ b/xserver/glx/indirect_texture_compression.c @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005, 2006 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/indirect_util.c b/xserver/glx/indirect_util.c index cebb782bc..9ba28157c 100644 --- a/xserver/glx/indirect_util.c +++ b/xserver/glx/indirect_util.c @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL @@ -210,7 +210,7 @@ get_decode_index(const struct __glXDispatchInfo *dispatch_info, unsigned opcode) unsigned child_index; /* Calculate the slice of bits used by this node. - * + * * If remaining_bits = 8 and tree[index] = 3, the mask of just the * remaining bits is 0x00ff and the mask for the remaining bits after * this node is 0x001f. By taking 0x00ff & ~0x001f, we get 0x00e0. diff --git a/xserver/glx/indirect_util.h b/xserver/glx/indirect_util.h index 0e65075bf..f5db262c0 100644 --- a/xserver/glx/indirect_util.h +++ b/xserver/glx/indirect_util.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005 * 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, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/xserver/glx/rensize.c b/xserver/glx/rensize.c index a53246731..6bfe99b2a 100644 --- a/xserver/glx/rensize.c +++ b/xserver/glx/rensize.c @@ -121,12 +121,12 @@ __glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen) /** * Calculate the size of an image. - * + * * The size of an image sent to the server from the client or sent from the * server to the client is calculated. The size is based on the dimensions * of the image, the type of pixel data, padding in the image, and the * alignment requirements of the image. - * + * * \param format Format of the pixels. Same as the \c format parameter * to \c glTexImage1D * \param type Type of the pixel data. Same as the \c type parameter diff --git a/xserver/hw/Makefile.in b/xserver/hw/Makefile.in index 9fba38116..05af07f58 100644 --- a/xserver/hw/Makefile.in +++ b/xserver/hw/Makefile.in @@ -237,6 +237,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in index 814cddf65..2f69afbd7 100644 --- a/xserver/hw/dmx/Makefile.in +++ b/xserver/hw/dmx/Makefile.in @@ -297,6 +297,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/config/Canvas.c b/xserver/hw/dmx/config/Canvas.c index 103103346..3662fe857 100644 --- a/xserver/hw/dmx/config/Canvas.c +++ b/xserver/hw/dmx/config/Canvas.c @@ -9,7 +9,7 @@ * * 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 diff --git a/xserver/hw/dmx/config/Makefile.in b/xserver/hw/dmx/config/Makefile.in index 3e147796a..8b4f03391 100644 --- a/xserver/hw/dmx/config/Makefile.in +++ b/xserver/hw/dmx/config/Makefile.in @@ -312,6 +312,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/config/dmxprint.c b/xserver/hw/dmx/config/dmxprint.c index 3145fb56a..9dec52b5c 100644 --- a/xserver/hw/dmx/config/dmxprint.c +++ b/xserver/hw/dmx/config/dmxprint.c @@ -35,7 +35,7 @@ * * This file provides support routines and helper functions to be used * to pretty-print DMX configurations. - * + * * Because the DMX configuration file parsing should be capable of being * used in a stand-alone fashion (i.e., independent from the DMX server * source tree), no dependencies on other DMX routines are made. */ diff --git a/xserver/hw/dmx/config/man/Makefile.in b/xserver/hw/dmx/config/man/Makefile.in index 17ff0ea1a..98146644b 100644 --- a/xserver/hw/dmx/config/man/Makefile.in +++ b/xserver/hw/dmx/config/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/dmxgc.c b/xserver/hw/dmx/dmxgc.c index 2d61ea2f7..234316797 100644 --- a/xserver/hw/dmx/dmxgc.c +++ b/xserver/hw/dmx/dmxgc.c @@ -391,13 +391,10 @@ dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) pGC->funcs->ChangeClip(pGC, type, pvalue, nrects); /* Set the client clip on the back-end server */ - switch (pGC->clientClipType) { - case CT_NONE: + if (!pGC->clientClip) { if (dmxScreen->beDisplay) XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None); - break; - - case CT_REGION: + } else { if (dmxScreen->beDisplay) { nRects = RegionNumRects((RegionPtr) pGC->clientClip); pRects = malloc(nRects * sizeof(*pRects)); @@ -416,11 +413,6 @@ dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) free(pRects); } - break; - - case CT_PIXMAP: - /* Condensed down to REGION in the mi code */ - break; } DMX_GC_FUNC_EPILOGUE(pGC); diff --git a/xserver/hw/dmx/dmxgcops.c b/xserver/hw/dmx/dmxgcops.c index aa7c8eb54..0ebd69a0e 100644 --- a/xserver/hw/dmx/dmxgcops.c +++ b/xserver/hw/dmx/dmxgcops.c @@ -179,7 +179,7 @@ dmxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (DMX_GCOPS_OFFSCREEN(pSrc) || DMX_GCOPS_OFFSCREEN(pDst)) return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h, - dstx, dsty, 0L); + dstx, dsty); DMX_GCOPS_SET_DRAWABLE(pSrc, srcDraw); DMX_GCOPS_SET_DRAWABLE(pDst, dstDraw); @@ -188,7 +188,7 @@ dmxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, srcx, srcy, w, h, dstx, dsty); dmxSync(dmxScreen, FALSE); - return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, 0L); + return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); } /** Copy plane number \a bitPlane from \a pSrc drawable to \a pDst @@ -206,7 +206,7 @@ dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (DMX_GCOPS_OFFSCREEN(pSrc) || DMX_GCOPS_OFFSCREEN(pDst)) return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, width, height, - dstx, dsty, bitPlane); + dstx, dsty); DMX_GCOPS_SET_DRAWABLE(pSrc, srcDraw); DMX_GCOPS_SET_DRAWABLE(pDst, dstDraw); @@ -216,7 +216,7 @@ dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, dmxSync(dmxScreen, FALSE); return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, width, height, - dstx, dsty, bitPlane); + dstx, dsty); } /** Render list of points, \a pptInit in \a pDrawable on the back-end diff --git a/xserver/hw/dmx/dmxpict.h b/xserver/hw/dmx/dmxpict.h index 080da3bef..f36eca373 100644 --- a/xserver/hw/dmx/dmxpict.h +++ b/xserver/hw/dmx/dmxpict.h @@ -34,7 +34,7 @@ /** \file * This file provides access to the externally visible RENDER support * functions, global variables and macros for DMX. - * + * * FIXME: Move function definitions for non-externally visible function * to .c file. */ diff --git a/xserver/hw/dmx/dmxwindow.c b/xserver/hw/dmx/dmxwindow.c index 1c235273c..c75373534 100644 --- a/xserver/hw/dmx/dmxwindow.c +++ b/xserver/hw/dmx/dmxwindow.c @@ -772,7 +772,7 @@ dmxWindowExposurePredicate(Display * dpy, XEvent * ev, XPointer ptr) * in DMX, the events that are generated by the back-end server are * redundant, so we eat them here. */ void -dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed) +dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn) { ScreenPtr pScreen = pWindow->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; @@ -799,7 +799,7 @@ dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed) #if 1 if (pScreen->WindowExposures) - pScreen->WindowExposures(pWindow, prgn, other_exposed); + pScreen->WindowExposures(pWindow, prgn); #endif DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); } diff --git a/xserver/hw/dmx/dmxwindow.h b/xserver/hw/dmx/dmxwindow.h index c6b2efee6..dda6538d1 100644 --- a/xserver/hw/dmx/dmxwindow.h +++ b/xserver/hw/dmx/dmxwindow.h @@ -73,8 +73,7 @@ extern Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask); extern Bool dmxRealizeWindow(WindowPtr pWindow); extern Bool dmxUnrealizeWindow(WindowPtr pWindow); extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib); -extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, - RegionPtr other_exposed); +extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn); extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/xserver/hw/dmx/doc/Makefile.in b/xserver/hw/dmx/doc/Makefile.in index b72bc4ceb..f2120855e 100644 --- a/xserver/hw/dmx/doc/Makefile.in +++ b/xserver/hw/dmx/doc/Makefile.in @@ -242,6 +242,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -491,6 +492,7 @@ top_srcdir = @top_srcdir@ # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @@ -700,13 +702,13 @@ uninstall-am: mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/hw/dmx/doxygen/Makefile.in b/xserver/hw/dmx/doxygen/Makefile.in index ce42f5073..8b7c73849 100644 --- a/xserver/hw/dmx/doxygen/Makefile.in +++ b/xserver/hw/dmx/doxygen/Makefile.in @@ -223,6 +223,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/examples/Makefile.in b/xserver/hw/dmx/examples/Makefile.in index d1fe91042..216d23f4f 100644 --- a/xserver/hw/dmx/examples/Makefile.in +++ b/xserver/hw/dmx/examples/Makefile.in @@ -337,6 +337,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/glxProxy/Makefile.in b/xserver/hw/dmx/glxProxy/Makefile.in index 84069a014..bb5f33b78 100644 --- a/xserver/hw/dmx/glxProxy/Makefile.in +++ b/xserver/hw/dmx/glxProxy/Makefile.in @@ -243,6 +243,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/glxProxy/glxcmds.c b/xserver/hw/dmx/glxProxy/glxcmds.c index 23c3366bd..fb4d5acce 100644 --- a/xserver/hw/dmx/glxProxy/glxcmds.c +++ b/xserver/hw/dmx/glxProxy/glxcmds.c @@ -188,7 +188,7 @@ CreateContext(__GLXclientState * cl, #endif /* - ** Find the display list space that we want to share. + ** Find the display list space that we want to share. ** */ if (shareList == None) { @@ -1751,7 +1751,7 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc) buf[p++] = pGlxVisual->stencilSize; buf[p++] = pGlxVisual->auxBuffers; buf[p++] = pGlxVisual->level; - /* + /* ** Add token/value pairs for extensions. */ buf[p++] = GLX_VISUAL_CAVEAT_EXT; @@ -3087,7 +3087,7 @@ __glXCreateWindow(__GLXclientState * cl, GLbyte * pc) void *val; /* - ** Check if windowId is valid + ** Check if windowId is valid */ rc = dixLookupDrawable(&pDraw, windowId, client, M_DRAWABLE_WINDOW, DixAddAccess); @@ -3112,7 +3112,7 @@ __glXCreateWindow(__GLXclientState * cl, GLbyte * pc) visId = pGlxFBConfig->associatedVisualId; /* - ** Check if the fbconfig supports rendering to windows + ** Check if the fbconfig supports rendering to windows */ if (!(pGlxFBConfig->drawableType & GLX_WINDOW_BIT)) { return BadMatch; @@ -3134,7 +3134,7 @@ __glXCreateWindow(__GLXclientState * cl, GLbyte * pc) } /* - ** Check if color buffer depth of fbconfig matches depth + ** Check if color buffer depth of fbconfig matches depth ** of window. */ if (pVisual->nplanes != pDraw->depth) { @@ -3144,7 +3144,7 @@ __glXCreateWindow(__GLXclientState * cl, GLbyte * pc) else /* ** The window was created with no visual that corresponds - ** to fbconfig + ** to fbconfig */ return BadMatch; @@ -3561,7 +3561,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) return __glXBadDrawable; } - /* if the drawable is a window or GLXWindow - + /* if the drawable is a window or GLXWindow - * we need to find the base id on the back-end server */ if (!be_drawable) { @@ -3723,7 +3723,7 @@ __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) return __glXBadDrawable; } - /* if the drawable is a window or GLXWindow - + /* if the drawable is a window or GLXWindow - * we need to find the base id on the back-end server */ if (!be_drawable) { diff --git a/xserver/hw/dmx/glxProxy/glxsingle.c b/xserver/hw/dmx/glxProxy/glxsingle.c index 679a302ea..034497315 100644 --- a/xserver/hw/dmx/glxProxy/glxsingle.c +++ b/xserver/hw/dmx/glxProxy/glxsingle.c @@ -233,7 +233,7 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) dmxScreen = &dmxScreens[glxc->pScreen->myNum]; dpy = GetBackEndDisplay(cl, glxc->pScreen->myNum); - /* + /* * send the request to the first back-end server */ LockDisplay(dpy); @@ -329,7 +329,7 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) pc += sz_xGLXSingleReq; buf_size = (req->length << 2) - sz_xGLXSingleReq; - /* + /* * send the request to the first back-end server(s) */ for (s = to_screen; s >= from_screen; s--) { diff --git a/xserver/hw/dmx/glxProxy/glxvendor.c b/xserver/hw/dmx/glxProxy/glxvendor.c index b475daf0f..fc8aff0cc 100644 --- a/xserver/hw/dmx/glxProxy/glxvendor.c +++ b/xserver/hw/dmx/glxProxy/glxvendor.c @@ -220,7 +220,7 @@ __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) dmxScreen = &dmxScreens[glxc->pScreen->myNum]; dpy = GetBackEndDisplay(cl, glxc->pScreen->myNum); - /* + /* * send the request to the first back-end server */ LockDisplay(dpy); @@ -311,7 +311,7 @@ __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) pc += sz_xGLXVendorPrivateReq; buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq; - /* + /* * send the request to the first back-end server(s) */ for (s = to_screen; s >= from_screen; s--) { diff --git a/xserver/hw/dmx/input/ChkNotMaskEv.c b/xserver/hw/dmx/input/ChkNotMaskEv.c index bde04ae23..8411af8a7 100644 --- a/xserver/hw/dmx/input/ChkNotMaskEv.c +++ b/xserver/hw/dmx/input/ChkNotMaskEv.c @@ -16,7 +16,7 @@ * OPEN GROUP 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 Open Group 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 Open Group. diff --git a/xserver/hw/dmx/input/Makefile.in b/xserver/hw/dmx/input/Makefile.in index a0b08fbfd..cdd60560a 100644 --- a/xserver/hw/dmx/input/Makefile.in +++ b/xserver/hw/dmx/input/Makefile.in @@ -258,6 +258,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/dmx/input/lnx-keyboard.c b/xserver/hw/dmx/input/lnx-keyboard.c index 1a4d01f36..0aa62f452 100644 --- a/xserver/hw/dmx/input/lnx-keyboard.c +++ b/xserver/hw/dmx/input/lnx-keyboard.c @@ -65,19 +65,19 @@ * 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 names of Orest Zborowski and David Dawes - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Orest Zborowski and David Dawes + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Orest Zborowski - * and David Dawes make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * and David Dawes make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES 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 + * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES 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. * */ diff --git a/xserver/hw/dmx/input/lnx-ms.c b/xserver/hw/dmx/input/lnx-ms.c index 210f6de22..621f0fecc 100644 --- a/xserver/hw/dmx/input/lnx-ms.c +++ b/xserver/hw/dmx/input/lnx-ms.c @@ -17,7 +17,7 @@ * * 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 diff --git a/xserver/hw/dmx/man/Makefile.in b/xserver/hw/dmx/man/Makefile.in index 680f8f42a..290e41513 100644 --- a/xserver/hw/dmx/man/Makefile.in +++ b/xserver/hw/dmx/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/kdrive/Makefile.in b/xserver/hw/kdrive/Makefile.in index 6225a23b5..5d72a30c5 100644 --- a/xserver/hw/kdrive/Makefile.in +++ b/xserver/hw/kdrive/Makefile.in @@ -237,6 +237,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/kdrive/ephyr/Makefile.am b/xserver/hw/kdrive/ephyr/Makefile.am index 00a53d0df..155e11eb3 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.am +++ b/xserver/hw/kdrive/ephyr/Makefile.am @@ -35,9 +35,14 @@ XV_SRCS = ephyrvideo.c endif if GLAMOR +if XV +GLAMOR_XV_SRCS = ephyr_glamor_xv.c +endif + GLAMOR_SRCS = \ ephyr_glamor_glx.c \ ephyr_glamor_glx.h \ + $(GLAMOR_XV_SRCS) \ $() endif @@ -63,6 +68,7 @@ Xephyr_SOURCES = \ ephyr_draw.c \ os.c \ ephyrinit.c \ + ephyrcursor.c \ hostx.c \ hostx.h \ $(XV_SRCS) \ diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in index 1cf0570e5..a299e9739 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.in +++ b/xserver/hw/kdrive/ephyr/Makefile.in @@ -98,17 +98,19 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__Xephyr_SOURCES_DIST = ephyr.c ephyr.h ephyrlog.h ephyr_draw.c os.c \ - ephyrinit.c hostx.c hostx.h ephyrvideo.c ephyrdriext.c \ - ephyrdriext.h ephyrdri.c ephyrdri.h ephyrglxext.c \ - ephyrglxext.h ephyrhostglx.c ephyrhostglx.h ephyr_glamor_glx.c \ - ephyr_glamor_glx.h + ephyrinit.c ephyrcursor.c hostx.c hostx.h ephyrvideo.c \ + ephyrdriext.c ephyrdriext.h ephyrdri.c ephyrdri.h \ + ephyrglxext.c ephyrglxext.h ephyrhostglx.c ephyrhostglx.h \ + ephyr_glamor_glx.c ephyr_glamor_glx.h ephyr_glamor_xv.c @XV_TRUE@am__objects_1 = ephyrvideo.$(OBJEXT) @DRI_TRUE@am__objects_2 = ephyrdriext.$(OBJEXT) ephyrdri.$(OBJEXT) \ @DRI_TRUE@ ephyrglxext.$(OBJEXT) ephyrhostglx.$(OBJEXT) -@GLAMOR_TRUE@am__objects_3 = ephyr_glamor_glx.$(OBJEXT) +@GLAMOR_TRUE@@XV_TRUE@am__objects_3 = ephyr_glamor_xv.$(OBJEXT) +@GLAMOR_TRUE@am__objects_4 = ephyr_glamor_glx.$(OBJEXT) \ +@GLAMOR_TRUE@ $(am__objects_3) am_Xephyr_OBJECTS = ephyr.$(OBJEXT) ephyr_draw.$(OBJEXT) os.$(OBJEXT) \ - ephyrinit.$(OBJEXT) hostx.$(OBJEXT) $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) + ephyrinit.$(OBJEXT) ephyrcursor.$(OBJEXT) hostx.$(OBJEXT) \ + $(am__objects_1) $(am__objects_2) $(am__objects_4) Xephyr_OBJECTS = $(am_Xephyr_OBJECTS) @GLAMOR_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/glamor/libglamor.la \ @GLAMOR_TRUE@ $(top_builddir)/glamor/libglamor_egl_stubs.la @@ -309,6 +311,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -551,9 +554,11 @@ AM_CPPFLAGS = @KDRIVE_INCS@ @KDRIVE_CFLAGS@ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/glamor \ -I$(top_srcdir)/exa $(am__append_1) @XV_TRUE@XV_SRCS = ephyrvideo.c +@GLAMOR_TRUE@@XV_TRUE@GLAMOR_XV_SRCS = ephyr_glamor_xv.c @GLAMOR_TRUE@GLAMOR_SRCS = \ @GLAMOR_TRUE@ ephyr_glamor_glx.c \ @GLAMOR_TRUE@ ephyr_glamor_glx.h \ +@GLAMOR_TRUE@ $(GLAMOR_XV_SRCS) \ @GLAMOR_TRUE@ $() @DRI_TRUE@DRI_SRCS = \ @@ -574,6 +579,7 @@ Xephyr_SOURCES = \ ephyr_draw.c \ os.c \ ephyrinit.c \ + ephyrcursor.c \ hostx.c \ hostx.h \ $(XV_SRCS) \ @@ -687,6 +693,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_draw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_glx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyr_glamor_xv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrcursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdri.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrdriext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ephyrglxext.Po@am__quote@ diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c index def50d8d8..164ebdcba 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.c +++ b/xserver/hw/kdrive/ephyr/ephyr.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -68,6 +68,7 @@ typedef struct _EphyrInputPrivate { Bool EphyrWantGrayScale = 0; Bool EphyrWantResize = 0; +Bool EphyrWantNoHostGrab = 0; Bool host_has_extension(xcb_extension_t *extension) @@ -111,13 +112,16 @@ Bool ephyrScreenInitialize(KdScreenInfo *screen) { EphyrScrPriv *scrpriv = screen->driver; + int x = 0, y = 0; int width = 640, height = 480; CARD32 redMask, greenMask, blueMask; - if (hostx_want_screen_size(screen, &width, &height) + if (hostx_want_screen_geometry(screen, &width, &height, &x, &y) || !screen->width || !screen->height) { screen->width = width; screen->height = height; + screen->x = x; + screen->y = y; } if (EphyrWantGrayScale) @@ -242,7 +246,8 @@ ephyrMapFramebuffer(KdScreenInfo * screen) buffer_height = ephyrBufferHeight(screen); priv->base = - hostx_screen_init(screen, screen->width, screen->height, buffer_height, + hostx_screen_init(screen, screen->x, screen->y, + screen->width, screen->height, buffer_height, &priv->bytes_per_line, &screen->fb.bitsPerPixel); if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) { @@ -308,8 +313,8 @@ ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf) EPHYR_LOG("slow paint"); /* FIXME: Slow Rotated/Reflected updates could be much - * much faster efficiently updating via tranforming - * pBuf->pDamage regions + * much faster efficiently updating via tranforming + * pBuf->pDamage regions */ shadowUpdateRotatePacked(pScreen, pBuf); hostx_paint_rect(screen, 0, 0, 0, 0, screen->width, screen->height); @@ -530,7 +535,7 @@ ephyrRandRSetConfig(ScreenPtr pScreen, goto bail4; } else { - /* Without shadow fb ( non rotated ) we need + /* Without shadow fb ( non rotated ) we need * to use damage to efficiently update display * via signal regions what to copy from 'fb'. */ @@ -645,12 +650,18 @@ ephyrInitScreen(ScreenPtr pScreen) EPHYR_LOG("pScreen->myNum:%d\n", pScreen->myNum); hostx_set_screen_number(screen, pScreen->myNum); - hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); + if (EphyrWantNoHostGrab) { + hostx_set_win_title(screen, "xephyr"); + } else { + hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); + } pScreen->CreateColormap = ephyrCreateColormap; #ifdef XV if (!ephyrNoXV) { - if (!ephyrInitVideo(pScreen)) { + if (ephyr_glamor) + ephyr_glamor_xv_init(pScreen); + else if (!ephyrInitVideo(pScreen)) { EPHYR_LOG_ERROR("failed to initialize xvideo\n"); } else { @@ -676,7 +687,7 @@ ephyrInitScreen(ScreenPtr pScreen) Bool ephyrFinishInitScreen(ScreenPtr pScreen) { - /* FIXME: Calling this even if not using shadow. + /* FIXME: Calling this even if not using shadow. * Seems harmless enough. But may be safer elsewhere. */ if (!shadowSetup(pScreen)) @@ -756,7 +767,13 @@ ephyrScreenFini(KdScreenInfo * screen) } } -/* +void +ephyrCloseScreen(ScreenPtr pScreen) +{ + ephyrUnsetInternalDamage(pScreen); +} + +/* * Port of Mark McLoughlin's Xnest fix for focus in + modifier bug. * See https://bugs.freedesktop.org/show_bug.cgi?id=3030 */ @@ -789,7 +806,11 @@ ephyrUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { - if (key_is_down(pDev, key, KEY_PROCESSED)) + if (mask == XCB_MOD_MASK_LOCK) { + KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); + KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); + } + else if (key_is_down(pDev, key, KEY_PROCESSED)) KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); if (--count == 0) @@ -803,6 +824,8 @@ ephyrUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); + if (mask == XCB_MOD_MASK_LOCK) + KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); break; } } @@ -866,7 +889,7 @@ ephyrExposePairedWindow(int a_remote) screen = pair->local->drawable.pScreen; RegionNull(®); RegionCopy(®, &pair->local->clipList); - screen->WindowExposures(pair->local, ®, NullRegion); + screen->WindowExposures(pair->local, ®); RegionUninit(®); } #endif /* XF86DRI */ @@ -1080,12 +1103,13 @@ ephyrProcessKeyRelease(xcb_generic_event_t *xev) if (!keysyms) keysyms = xcb_key_symbols_alloc(conn); - if (((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L + if (!EphyrWantNoHostGrab && + (((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_L || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Shift_R) && (key->state & XCB_MOD_MASK_CONTROL)) || ((xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_L || xcb_key_symbols_get_keysym(keysyms, key->detail, 0) == XK_Control_R) - && (key->state & XCB_MOD_MASK_SHIFT))) { + && (key->state & XCB_MOD_MASK_SHIFT)))) { KdScreenInfo *screen = screen_from_window(key->event); EphyrScrPriv *scrpriv = screen->driver; @@ -1274,7 +1298,7 @@ ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs) if (p > max) max = p; - hostx_set_cmap_entry(p, + hostx_set_cmap_entry(pScreen, p, pdefs->red >> 8, pdefs->green >> 8, pdefs->blue >> 8); pdefs++; diff --git a/xserver/hw/kdrive/ephyr/ephyr.h b/xserver/hw/kdrive/ephyr/ephyr.h index 34ce4601b..18bfe11ff 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.h +++ b/xserver/hw/kdrive/ephyr/ephyr.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -73,13 +73,17 @@ typedef struct _ephyrScrPriv { xcb_window_t win_pre_existing; /* Set via -parent option like xnest */ xcb_window_t peer_win; /* Used for GL; should be at most one */ xcb_image_t *ximg; + Bool win_explicit_position; + int win_x, win_y; int win_width, win_height; int server_depth; + const char *output; /* Set via -output option */ unsigned char *fb_data; /* only used when host bpp != server bpp */ xcb_shm_segment_info_t shminfo; KdScreenInfo *screen; int mynum; /* Screen number */ + unsigned long cmap[256]; /** * Per-screen Xlib-using state for glamor (private to @@ -130,6 +134,9 @@ void void ephyrScreenFini(KdScreenInfo * screen); +void +ephyrCloseScreen(ScreenPtr pScreen); + void ephyrCardFini(KdCardInfo * card); @@ -191,8 +198,6 @@ extern KdOsFuncs EphyrOsFuncs; extern Bool ephyrCursorInit(ScreenPtr pScreen); -extern void ephyrCursorEnable(ScreenPtr pScreen); - extern int ephyrBufferHeight(KdScreenInfo * screen); /* ephyr_draw.c */ @@ -221,4 +226,14 @@ void ephyr_glamor_host_paint_rect(ScreenPtr pScreen); Bool ephyrInitVideo(ScreenPtr pScreen); +/* ephyr_glamor_xv.c */ +#ifdef GLAMOR +void ephyr_glamor_xv_init(ScreenPtr screen); +#else /* !GLAMOR */ +static inline void +ephyr_glamor_xv_init(ScreenPtr screen) +{ +} +#endif /* !GLAMOR */ + #endif diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c index eaf565496..8fe751693 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c +++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_glx.c @@ -52,6 +52,7 @@ static Display *dpy; static XVisualInfo *visual_info; static GLXFBConfig fb_config; +Bool ephyr_glamor_gles2; /** @} */ /** @@ -145,6 +146,10 @@ ephyr_glamor_setup_texturing_shader(struct ephyr_glamor *glamor) "}\n"; const char *fs_source = + "#ifdef GL_ES\n" + "precision mediump float;\n" + "#endif\n" + "\n" "varying vec2 t;\n" "uniform sampler2D s; /* initially 0 */\n" "\n" @@ -276,7 +281,24 @@ ephyr_glamor_glx_screen_init(xcb_window_t win) glx_win = glXCreateWindow(dpy, fb_config, win, NULL); - ctx = glXCreateContext(dpy, visual_info, NULL, True); + if (ephyr_glamor_gles2) { + static const int context_attribs[] = { + GLX_CONTEXT_MAJOR_VERSION_ARB, 2, + GLX_CONTEXT_MINOR_VERSION_ARB, 0, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES_PROFILE_BIT_EXT, + 0, + }; + if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy), + "GLX_EXT_create_context_es2_profile")) { + ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True, + context_attribs); + } else { + FatalError("Xephyr -glamor_gles2 rquires " + "GLX_EXT_create_context_es2_profile\n"); + } + } else { + ctx = glXCreateContext(dpy, visual_info, NULL, True); + } if (ctx == NULL) FatalError("glXCreateContext failed\n"); diff --git a/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c b/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c new file mode 100644 index 000000000..b9c3464d8 --- /dev/null +++ b/xserver/hw/kdrive/ephyr/ephyr_glamor_xv.c @@ -0,0 +1,161 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "kdrive.h" +#include "kxv.h" +#include "ephyr.h" +#include "glamor_priv.h" + +#include +#include "fourcc.h" + +#define NUM_FORMATS 3 + +static KdVideoFormatRec Formats[NUM_FORMATS] = { + {15, TrueColor}, {16, TrueColor}, {24, TrueColor} +}; + +static void +ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup) +{ + if (!cleanup) + return; + + glamor_xv_stop_video(data); +} + +static int +ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen, + Atom attribute, INT32 value, void *data) +{ + return glamor_xv_set_port_attribute(data, attribute, value); +} + +static int +ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen, + Atom attribute, INT32 *value, void *data) +{ + return glamor_xv_get_port_attribute(data, attribute, value); +} + +static void +ephyr_glamor_xv_query_best_size(KdScreenInfo *screen, + Bool motion, + short vid_w, short vid_h, + short drw_w, short drw_h, + unsigned int *p_w, unsigned int *p_h, + void *data) +{ + *p_w = drw_w; + *p_h = drw_h; +} + +static int +ephyr_glamor_xv_query_image_attributes(KdScreenInfo *screen, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets) +{ + return glamor_xv_query_image_attributes(id, w, h, pitches, offsets); +} + +static int +ephyr_glamor_xv_put_image(KdScreenInfo *screen, + DrawablePtr pDrawable, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + int id, + unsigned char *buf, + short width, + short height, + Bool sync, + RegionPtr clipBoxes, void *data) +{ + return glamor_xv_put_image(data, pDrawable, + src_x, src_y, + drw_x, drw_y, + src_w, src_h, + drw_w, drw_h, + id, buf, width, height, sync, clipBoxes); +} + +void +ephyr_glamor_xv_init(ScreenPtr screen) +{ + KdVideoAdaptorRec *adaptor; + glamor_port_private *port_privates; + KdVideoEncodingRec encoding = { + 0, + "XV_IMAGE", + /* These sizes should probably be GL_MAX_TEXTURE_SIZE instead + * of 2048, but our context isn't set up yet. + */ + 2048, 2048, + {1, 1} + }; + int i; + + glamor_xv_core_init(screen); + + adaptor = xnfcalloc(1, sizeof(*adaptor)); + + adaptor->name = "glamor textured video"; + adaptor->type = XvWindowMask | XvInputMask | XvImageMask; + adaptor->flags = 0; + adaptor->nEncodings = 1; + adaptor->pEncodings = &encoding; + + adaptor->pFormats = Formats; + adaptor->nFormats = NUM_FORMATS; + + adaptor->nPorts = 16; /* Some absurd number */ + port_privates = xnfcalloc(adaptor->nPorts, + sizeof(glamor_port_private)); + adaptor->pPortPrivates = xnfcalloc(adaptor->nPorts, + sizeof(glamor_port_private *)); + for (i = 0; i < adaptor->nPorts; i++) { + adaptor->pPortPrivates[i].ptr = &port_privates[i]; + glamor_xv_init_port(&port_privates[i]); + } + + adaptor->pAttributes = glamor_xv_attributes; + adaptor->nAttributes = glamor_xv_num_attributes; + + adaptor->pImages = glamor_xv_images; + adaptor->nImages = glamor_xv_num_images; + + adaptor->StopVideo = ephyr_glamor_xv_stop_video; + adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute; + adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute; + adaptor->QueryBestSize = ephyr_glamor_xv_query_best_size; + adaptor->PutImage = ephyr_glamor_xv_put_image; + adaptor->QueryImageAttributes = ephyr_glamor_xv_query_image_attributes; + + KdXVScreenInit(screen, adaptor, 1); +} diff --git a/xserver/hw/kdrive/ephyr/ephyrcursor.c b/xserver/hw/kdrive/ephyr/ephyrcursor.c new file mode 100644 index 000000000..852be33e0 --- /dev/null +++ b/xserver/hw/kdrive/ephyr/ephyrcursor.c @@ -0,0 +1,262 @@ +/* + * Copyright © 2014 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: + * Adam Jackson + */ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include "ephyr.h" +#include "ephyrlog.h" +#include "hostx.h" +#include "cursorstr.h" +#include +#include + +static DevPrivateKeyRec ephyrCursorPrivateKey; + +typedef struct _ephyrCursor { + xcb_cursor_t cursor; +} ephyrCursorRec, *ephyrCursorPtr; + +static ephyrCursorPtr +ephyrGetCursor(CursorPtr cursor) +{ + return dixGetPrivateAddr(&cursor->devPrivates, &ephyrCursorPrivateKey); +} + +static void +ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor) +{ + ephyrCursorPtr hw = ephyrGetCursor(cursor); + xcb_connection_t *conn = hostx_get_xcbconn(); + xcb_pixmap_t source, mask; + xcb_image_t *image; + xcb_gcontext_t gc; + int w = cursor->bits->width, h = cursor->bits->height; + uint32_t gcmask = XCB_GC_FUNCTION | + XCB_GC_PLANE_MASK | + XCB_GC_FOREGROUND | + XCB_GC_BACKGROUND | + XCB_GC_CLIP_MASK; + uint32_t val[] = { + XCB_GX_COPY, /* function */ + ~0, /* planemask */ + 1L, /* foreground */ + 0L, /* background */ + None, /* clipmask */ + }; + + source = xcb_generate_id(conn); + mask = xcb_generate_id(conn); + xcb_create_pixmap(conn, 1, source, scr->win, w, h); + xcb_create_pixmap(conn, 1, mask, scr->win, w, h); + + gc = xcb_generate_id(conn); + xcb_create_gc(conn, gc, source, gcmask, val); + + image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP, + 1, NULL, ~0, NULL); + image->data = cursor->bits->source; + xcb_image_put(conn, source, gc, image, 0, 0, 0); + xcb_image_destroy(image); + + image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_XY_BITMAP, + 1, NULL, ~0, NULL); + image->data = cursor->bits->mask; + xcb_image_put(conn, mask, gc, image, 0, 0, 0); + xcb_image_destroy(image); + + xcb_free_gc(conn, gc); + + hw->cursor = xcb_generate_id(conn); + xcb_create_cursor(conn, hw->cursor, source, mask, + cursor->foreRed, cursor->foreGreen, cursor->foreBlue, + cursor->backRed, cursor->backGreen, cursor->backBlue, + cursor->bits->xhot, cursor->bits->yhot); + + xcb_free_pixmap(conn, source); + xcb_free_pixmap(conn, mask); +} + +#ifdef ARGB_CURSOR +static xcb_render_pictformat_t +get_argb_format(void) +{ + static xcb_render_pictformat_t format; + if (format == None) { + xcb_connection_t *conn = hostx_get_xcbconn(); + xcb_render_query_pict_formats_cookie_t cookie; + xcb_render_query_pict_formats_reply_t *formats; + + cookie = xcb_render_query_pict_formats(conn); + formats = + xcb_render_query_pict_formats_reply(conn, cookie, NULL); + + format = + xcb_render_util_find_standard_format(formats, + XCB_PICT_STANDARD_ARGB_32)->id; + + free(formats); + } + + return format; +} + +static void +ephyrRealizeARGBCursor(EphyrScrPriv *scr, CursorPtr cursor) +{ + ephyrCursorPtr hw = ephyrGetCursor(cursor); + xcb_connection_t *conn = hostx_get_xcbconn(); + xcb_gcontext_t gc; + xcb_pixmap_t source; + xcb_render_picture_t picture; + xcb_image_t *image; + int w = cursor->bits->width, h = cursor->bits->height; + + /* dix' storage is PICT_a8r8g8b8 */ + source = xcb_generate_id(conn); + xcb_create_pixmap(conn, 32, source, scr->win, w, h); + + gc = xcb_generate_id(conn); + xcb_create_gc(conn, gc, source, 0, NULL); + image = xcb_image_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, + 32, NULL, ~0, NULL); + image->data = (void *)cursor->bits->argb; + xcb_image_put(conn, source, gc, image, 0, 0, 0); + xcb_free_gc(conn, gc); + xcb_image_destroy(image); + + picture = xcb_generate_id(conn); + xcb_render_create_picture(conn, picture, source, get_argb_format(), + 0, NULL); + xcb_free_pixmap(conn, source); + + hw->cursor = xcb_generate_id(conn); + xcb_render_create_cursor(conn, hw->cursor, picture, + cursor->bits->xhot, cursor->bits->yhot); + + xcb_render_free_picture(conn, picture); +} + +static Bool +can_argb_cursor(void) +{ + static const xcb_render_query_version_reply_t *v; + + if (!v) + v = xcb_render_util_query_version(hostx_get_xcbconn()); + + return v->major_version == 0 && v->minor_version >= 5; +} +#endif + +static Bool +ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) +{ + KdScreenPriv(screen); + 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); + } + return TRUE; +} + +static Bool +ephyrUnrealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) +{ + ephyrCursorPtr hw = ephyrGetCursor(cursor); + + if (hw->cursor) { + xcb_free_cursor(hostx_get_xcbconn(), hw->cursor); + hw->cursor = None; + } + + return TRUE; +} + +static void +ephyrSetCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor, int x, + int y) +{ + KdScreenPriv(screen); + KdScreenInfo *kscr = pScreenPriv->screen; + EphyrScrPriv *scr = kscr->driver; + uint32_t attr = None; + + if (cursor) + attr = ephyrGetCursor(cursor)->cursor; + else + attr = hostx_get_empty_cursor(); + + xcb_change_window_attributes(hostx_get_xcbconn(), scr->win, + XCB_CW_CURSOR, &attr); + xcb_flush(hostx_get_xcbconn()); +} + +static void +ephyrMoveCursor(DeviceIntPtr dev, ScreenPtr screen, int x, int y) +{ +} + +static Bool +ephyrDeviceCursorInitialize(DeviceIntPtr dev, ScreenPtr screen) +{ + return TRUE; +} + +static void +ephyrDeviceCursorCleanup(DeviceIntPtr dev, ScreenPtr screen) +{ +} + +miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { + ephyrRealizeCursor, + ephyrUnrealizeCursor, + ephyrSetCursor, + ephyrMoveCursor, + ephyrDeviceCursorInitialize, + ephyrDeviceCursorCleanup +}; + +Bool +ephyrCursorInit(ScreenPtr screen) +{ + if (!dixRegisterPrivateKey(&ephyrCursorPrivateKey, PRIVATE_CURSOR_BITS, + sizeof(ephyrCursorRec))) + return FALSE; + + miPointerInitialize(screen, + &EphyrPointerSpriteFuncs, + &ephyrPointerScreenFuncs, FALSE); + + return TRUE; +} diff --git a/xserver/hw/kdrive/ephyr/ephyrdri.c b/xserver/hw/kdrive/ephyr/ephyrdri.c index 16678fc5b..1e34301e1 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdri.c +++ b/xserver/hw/kdrive/ephyr/ephyrdri.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrdri.h b/xserver/hw/kdrive/ephyr/ephyrdri.h index 8f2d3026e..b312e62d9 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdri.h +++ b/xserver/hw/kdrive/ephyr/ephyrdri.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.c b/xserver/hw/kdrive/ephyr/ephyrdriext.c index 8368d1233..3d5cf7721 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.c +++ b/xserver/hw/kdrive/ephyr/ephyrdriext.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.h b/xserver/hw/kdrive/ephyr/ephyrdriext.h index 5808576fe..975571582 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.h +++ b/xserver/hw/kdrive/ephyr/ephyrdriext.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.c b/xserver/hw/kdrive/ephyr/ephyrglxext.c index 632a9c474..248689e6f 100644 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.c +++ b/xserver/hw/kdrive/ephyr/ephyrglxext.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.h b/xserver/hw/kdrive/ephyr/ephyrglxext.h index 053f8d303..8b4b3a248 100644 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.h +++ b/xserver/hw/kdrive/ephyr/ephyrglxext.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.c b/xserver/hw/kdrive/ephyr/ephyrhostglx.c index 007524d04..0b98cce71 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.c +++ b/xserver/hw/kdrive/ephyr/ephyrhostglx.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.h b/xserver/hw/kdrive/ephyr/ephyrhostglx.h index 309d0f2f7..f1eec5f0b 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.h +++ b/xserver/hw/kdrive/ephyr/ephyrhostglx.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c index fac84cd13..8fbaf1d44 100644 --- a/xserver/hw/kdrive/ephyr/ephyrinit.c +++ b/xserver/hw/kdrive/ephyr/ephyrinit.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -33,9 +33,10 @@ extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; extern Bool EphyrWantResize; +extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; -extern Bool ephyr_glamor; +extern Bool ephyr_glamor, ephyr_glamor_gles2; #ifdef GLXEXT extern Bool ephyrNoDRI; @@ -47,8 +48,17 @@ extern KdPointerDriver LinuxEvdevMouseDriver; extern KdKeyboardDriver LinuxEvdevKeyboardDriver; #endif +void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id); +void processOutputArg(const char *output, char *parent_id); void processScreenArg(const char *screen_size, char *parent_id); +int +main(int argc, char *argv[], char *envp[]) +{ + hostx_use_resname(basename(argv[0]), 0); + return dix_main(argc, argv, envp); +} + void InitCard(char *name) { @@ -134,10 +144,12 @@ ddxUseMsg(void) ErrorF("-parent Use existing window as Xephyr root win\n"); ErrorF("-sw-cursor Render cursors in software in Xephyr\n"); ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); + ErrorF("-output Attempt to run Xephyr fullscreen (restricted to given output geometry)\n"); ErrorF("-grayscale Simulate 8bit grayscale\n"); ErrorF("-resizeable Make Xephyr windows resizeable\n"); #ifdef GLAMOR ErrorF("-glamor Enable 2D acceleration using glamor\n"); + ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n"); #endif ErrorF ("-fakexa Simulate acceleration using software rendering\n"); @@ -149,11 +161,12 @@ ddxUseMsg(void) ErrorF("-name [name] define the name in the WM_CLASS property\n"); ErrorF ("-title [title] set the window title in the WM_NAME property\n"); + ErrorF("-no-host-grab Disable grabbing the keyboard and mouse.\n"); ErrorF("\n"); } void -processScreenArg(const char *screen_size, char *parent_id) +processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id) { KdCardInfo *card; @@ -163,6 +176,7 @@ processScreenArg(const char *screen_size, char *parent_id) if (card) { KdScreenInfo *screen; unsigned long p_id = 0; + Bool use_geometry; screen = KdScreenInfoAdd(card); KdParseScreen(screen, screen_size); @@ -173,14 +187,28 @@ processScreenArg(const char *screen_size, char *parent_id) if (parent_id) { p_id = strtol(parent_id, NULL, 0); } + + use_geometry = (strchr(screen_size, '+') != NULL); EPHYR_DBG("screen number:%d\n", screen->mynum); - hostx_add_screen(screen, p_id, screen->mynum); + hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output); } else { ErrorF("No matching card found!\n"); } } +void +processScreenArg(const char *screen_size, char *parent_id) +{ + processScreenOrOutputArg(screen_size, NULL, parent_id); +} + +void +processOutputArg(const char *output, char *parent_id) +{ + processScreenOrOutputArg("100x100+0+0", output, parent_id); +} + int ddxProcessArgument(int argc, char **argv, int i) { @@ -188,10 +216,6 @@ ddxProcessArgument(int argc, char **argv, int i) EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]); - if (i == 1) { - hostx_use_resname(basename(argv[0]), 0); - } - if (!strcmp(argv[i], "-parent")) { if (i + 1 < argc) { int j; @@ -222,6 +246,15 @@ ddxProcessArgument(int argc, char **argv, int i) UseMsg(); exit(1); } + else if (!strcmp(argv[i], "-output")) { + if (i + 1 < argc) { + processOutputArg(argv[i + 1], NULL); + return 2; + } + + UseMsg(); + exit(1); + } else if (!strcmp(argv[i], "-sw-cursor")) { hostx_use_sw_cursor(); return 1; @@ -251,6 +284,15 @@ ddxProcessArgument(int argc, char **argv, int i) ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } + else if (!strcmp (argv[i], "-glamor_gles2")) { + ephyr_glamor = TRUE; + ephyr_glamor_gles2 = TRUE; + ephyrFuncs.initAccel = ephyr_glamor_init; + ephyrFuncs.enableAccel = ephyr_glamor_enable; + ephyrFuncs.disableAccel = ephyr_glamor_disable; + ephyrFuncs.finiAccel = ephyr_glamor_fini; + return 1; + } #endif else if (!strcmp(argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit; @@ -323,6 +365,10 @@ ddxProcessArgument(int argc, char **argv, int i) return 2; } /* end Xnest compat */ + else if (!strcmp(argv[i], "-no-host-grab")) { + EphyrWantNoHostGrab = 1; + return 2; + } return KdProcessArgument(argc, argv, i); } @@ -332,77 +378,12 @@ OsVendorInit(void) { EPHYR_DBG("mark"); - if (hostx_want_host_cursor()) { + if (hostx_want_host_cursor()) ephyrFuncs.initCursor = &ephyrCursorInit; - ephyrFuncs.enableCursor = &ephyrCursorEnable; - } KdOsInit(&EphyrOsFuncs); } -/* 'Fake' cursor stuff, could be improved */ - -static Bool -ephyrRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) -{ - return TRUE; -} - -static Bool -ephyrUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) -{ - return TRUE; -} - -static void -ephyrSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, - int y) -{ - ; -} - -static void -ephyrMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) -{ - ; -} - -static Bool -ephyrDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) -{ - return TRUE; -} - -static void -ephyrDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) -{ -} - -miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { - ephyrRealizeCursor, - ephyrUnrealizeCursor, - ephyrSetCursor, - ephyrMoveCursor, - ephyrDeviceCursorInitialize, - ephyrDeviceCursorCleanup -}; - -Bool -ephyrCursorInit(ScreenPtr pScreen) -{ - miPointerInitialize(pScreen, - &EphyrPointerSpriteFuncs, - &ephyrPointerScreenFuncs, FALSE); - - return TRUE; -} - -void -ephyrCursorEnable(ScreenPtr pScreen) -{ - ; -} - KdCardFuncs ephyrFuncs = { ephyrCardInit, /* cardinit */ ephyrScreenInitialize, /* scrinit */ @@ -430,4 +411,6 @@ KdCardFuncs ephyrFuncs = { ephyrGetColors, /* getColors */ ephyrPutColors, /* putColors */ + + ephyrCloseScreen, /* closeScreen */ }; diff --git a/xserver/hw/kdrive/ephyr/ephyrlog.h b/xserver/hw/kdrive/ephyr/ephyrlog.h index 0da0a2518..43679e181 100644 --- a/xserver/hw/kdrive/ephyr/ephyrlog.h +++ b/xserver/hw/kdrive/ephyr/ephyrlog.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/ephyr/ephyrvideo.c b/xserver/hw/kdrive/ephyr/ephyrvideo.c index c6728351f..56a5ff1f8 100644 --- a/xserver/hw/kdrive/ephyr/ephyrvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrvideo.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2007 OpenedHand Ltd + * + * Copyright © 2007 OpenedHand Ltd * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -69,7 +69,7 @@ static Bool ephyrXVPrivSetAdaptorsHooks(EphyrXVPriv * a_this); static Bool ephyrXVPrivRegisterAdaptors(EphyrXVPriv * a_this, ScreenPtr a_screen); -static Bool ephyrXVPrivIsAttrValueValid(KdAttributePtr a_attrs, +static Bool ephyrXVPrivIsAttrValueValid(XvAttributePtr a_attrs, int a_attrs_len, const char *a_attr_name, int a_attr_value, Bool *a_is_valid); @@ -363,7 +363,7 @@ translate_xv_attributes(KdVideoAdaptorPtr adaptor, it = xcb_xv_query_port_attributes_attributes_iterator(reply); for (i = 0; i < reply->num_attributes; i++) { - KdAttributePtr attribute = &adaptor->pAttributes[i]; + XvAttributePtr attribute = &adaptor->pAttributes[i]; attribute->flags = it.data->flags; attribute->min_value = it.data->min; @@ -397,7 +397,7 @@ translate_xv_image_formats(KdVideoAdaptorPtr adaptor, return FALSE; adaptor->nImages = reply->num_formats; - adaptor->pImages = calloc(reply->num_formats, sizeof(KdImageRec)); + adaptor->pImages = calloc(reply->num_formats, sizeof(XvImageRec)); if (!adaptor->pImages) { free(reply); return FALSE; @@ -405,7 +405,7 @@ translate_xv_image_formats(KdVideoAdaptorPtr adaptor, formats = xcb_xv_list_image_formats_format(reply); for (i = 0; i < reply->num_formats; i++) { - KdImagePtr image = &adaptor->pImages[i]; + XvImagePtr image = &adaptor->pImages[i]; image->id = formats[i].id; image->type = formats[i].type; @@ -612,11 +612,7 @@ ephyrXVPrivSetAdaptorsHooks(EphyrXVPriv * a_this) static Bool ephyrXVPrivRegisterAdaptors(EphyrXVPriv * a_this, ScreenPtr a_screen) { - KdScreenPriv(a_screen); - KdScreenInfo *screen = pScreenPriv->screen; Bool is_ok = FALSE; - KdVideoAdaptorPtr *adaptors = NULL, *registered_adaptors = NULL; - int num_registered_adaptors = 0, i = 0, num_adaptors = 0; EPHYR_RETURN_VAL_IF_FAIL(a_this && a_screen, FALSE); @@ -624,38 +620,22 @@ ephyrXVPrivRegisterAdaptors(EphyrXVPriv * a_this, ScreenPtr a_screen) if (!a_this->num_adaptors) goto out; - num_registered_adaptors = - KdXVListGenericAdaptors(screen, ®istered_adaptors); - num_adaptors = num_registered_adaptors + a_this->num_adaptors; - adaptors = calloc(num_adaptors, sizeof(KdVideoAdaptorPtr)); - if (!adaptors) { - EPHYR_LOG_ERROR("failed to allocate adaptors tab\n"); - goto out; - } - memmove(adaptors, registered_adaptors, num_registered_adaptors); - for (i = 0; i < a_this->num_adaptors; i++) { - *(adaptors + num_registered_adaptors + i) = &a_this->adaptors[i]; - } - if (!KdXVScreenInit(a_screen, adaptors, num_adaptors)) { + if (!KdXVScreenInit(a_screen, a_this->adaptors, a_this->num_adaptors)) { EPHYR_LOG_ERROR("failed to register adaptors\n"); goto out; } - EPHYR_LOG("there are %d registered adaptors\n", num_adaptors); + EPHYR_LOG("there are %d registered adaptors\n", a_this->num_adaptors); is_ok = TRUE; out: - free(registered_adaptors); - registered_adaptors = NULL; - free(adaptors); - adaptors = NULL; EPHYR_LOG("leave\n"); return is_ok; } static Bool -ephyrXVPrivIsAttrValueValid(KdAttributePtr a_attrs, +ephyrXVPrivIsAttrValueValid(XvAttributePtr a_attrs, int a_attrs_len, const char *a_attr_name, int a_attr_value, Bool *a_is_valid) diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c index 435919e0a..71c1691c4 100644 --- a/xserver/hw/kdrive/ephyr/hostx.c +++ b/xserver/hw/kdrive/ephyr/hostx.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -51,6 +51,7 @@ #include #include #include +#include #ifdef XF86DRI #include #include @@ -70,6 +71,8 @@ struct EphyrHostXVars { xcb_visualtype_t *visual; Window winroot; xcb_gcontext_t gc; + xcb_render_pictformat_t argb_format; + xcb_cursor_t empty_cursor; int depth; Bool use_sw_cursor; Bool use_fullscreen; @@ -79,8 +82,6 @@ struct EphyrHostXVars { KdScreenInfo **screens; long damage_debug_msec; - - unsigned long cmap[256]; }; /* memset ( missing> ) instead of below */ @@ -104,12 +105,15 @@ static void #define host_depth_matches_server(_vars) (HostX.depth == (_vars)->server_depth) int -hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height) +hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y) { EphyrScrPriv *scrpriv = screen->driver; if (scrpriv && (scrpriv->win_pre_existing != None || + scrpriv->output != NULL || HostX.use_fullscreen == TRUE)) { + *x = scrpriv->win_x; + *y = scrpriv->win_y; *width = scrpriv->win_width; *height = scrpriv->win_height; return 1; @@ -119,7 +123,7 @@ hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height) } void -hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num) +hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output) { EphyrScrPriv *scrpriv = screen->driver; int index = HostX.n_screens; @@ -131,6 +135,8 @@ hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num) scrpriv->screen = screen; scrpriv->win_pre_existing = win_id; + scrpriv->win_explicit_position = use_geometry; + scrpriv->output = output; } void @@ -171,7 +177,7 @@ hostx_set_win_title(KdScreenInfo *screen, const char *extra_text) memset(buf, 0, BUF_LEN + 1); snprintf(buf, BUF_LEN, "Xephyr on %s.%d %s", - HostX.server_dpy_name, + HostX.server_dpy_name ? HostX.server_dpy_name : ":0", scrpriv->mynum, (extra_text != NULL) ? extra_text : ""); xcb_icccm_set_wm_name(HostX.conn, @@ -196,6 +202,12 @@ hostx_use_sw_cursor(void) HostX.use_sw_cursor = TRUE; } +xcb_cursor_t +hostx_get_empty_cursor(void) +{ + return HostX.empty_cursor; +} + int hostx_want_preexisting_window(KdScreenInfo *screen) { @@ -209,6 +221,119 @@ hostx_want_preexisting_window(KdScreenInfo *screen) } } +void +hostx_get_output_geometry(const char *output, + int *x, int *y, + int *width, int *height) +{ + int i, name_len = 0, output_found = FALSE; + char *name = NULL; + xcb_generic_error_t *error; + xcb_randr_query_version_cookie_t version_c; + xcb_randr_query_version_reply_t *version_r; + xcb_randr_get_screen_resources_cookie_t screen_resources_c; + xcb_randr_get_screen_resources_reply_t *screen_resources_r; + xcb_randr_output_t *randr_outputs; + xcb_randr_get_output_info_cookie_t output_info_c; + xcb_randr_get_output_info_reply_t *output_info_r; + xcb_randr_get_crtc_info_cookie_t crtc_info_c; + 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) + { + fprintf(stderr, "\nHost X server does not support RANDR extension (or it's disabled).\n"); + exit(1); + } + + /* Check RandR version */ + version_c = xcb_randr_query_version(HostX.conn, 1, 2); + version_r = xcb_randr_query_version_reply(HostX.conn, + version_c, + &error); + + if (error != NULL || version_r == NULL) + { + fprintf(stderr, "\nFailed to get RandR version supported by host X server.\n"); + exit(1); + } + else if (version_r->major_version < 1 || version_r->minor_version < 2) + { + free(version_r); + fprintf(stderr, "\nHost X server doesn't support RandR 1.2, needed for -output usage.\n"); + exit(1); + } + + free(version_r); + + /* Get list of outputs from screen resources */ + screen_resources_c = xcb_randr_get_screen_resources(HostX.conn, + HostX.winroot); + screen_resources_r = xcb_randr_get_screen_resources_reply(HostX.conn, + screen_resources_c, + NULL); + randr_outputs = xcb_randr_get_screen_resources_outputs(screen_resources_r); + + for (i = 0; !output_found && i < screen_resources_r->num_outputs; i++) + { + /* Get info on the output */ + output_info_c = xcb_randr_get_output_info(HostX.conn, + randr_outputs[i], + XCB_CURRENT_TIME); + output_info_r = xcb_randr_get_output_info_reply(HostX.conn, + output_info_c, + NULL); + + /* Get output name */ + name_len = xcb_randr_get_output_info_name_length(output_info_r); + name = malloc(name_len + 1); + strncpy(name, (char*)xcb_randr_get_output_info_name(output_info_r), name_len); + name[name_len] = '\0'; + + if (!strcmp(name, output)) + { + output_found = TRUE; + + /* Check if output is connected */ + if (output_info_r->crtc == XCB_NONE) + { + free(name); + free(output_info_r); + free(screen_resources_r); + fprintf(stderr, "\nOutput %s is currently disabled (or not connected).\n", output); + exit(1); + } + + /* Get CRTC from output info */ + crtc_info_c = xcb_randr_get_crtc_info(HostX.conn, + output_info_r->crtc, + XCB_CURRENT_TIME); + crtc_info_r = xcb_randr_get_crtc_info_reply(HostX.conn, + crtc_info_c, + NULL); + + /* Get CRTC geometry */ + *x = crtc_info_r->x; + *y = crtc_info_r->y; + *width = crtc_info_r->width; + *height = crtc_info_r->height; + + free(crtc_info_r); + } + + free(name); + free(output_info_r); + } + + free(screen_resources_r); + + if (!output_found) + { + fprintf(stderr, "\nOutput %s not available in host X server.\n", output); + exit(1); + } +} + void hostx_use_fullscreen(void) { @@ -287,9 +412,10 @@ hostx_set_title(char *title) int hostx_init(void) { - uint32_t attr; - xcb_cursor_t empty_cursor; + uint32_t attrs[2]; + uint32_t attr_mask = 0; xcb_pixmap_t cursor_pxm; + xcb_gcontext_t cursor_gc; uint16_t red, green, blue; uint32_t pixel; int index; @@ -298,8 +424,9 @@ hostx_init(void) size_t class_len; const xcb_query_extension_reply_t *shm_rep; xcb_screen_t *xscreen; + xcb_rectangle_t rect = { 0, 0, 1, 1 }; - attr = + attrs[0] = XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION @@ -307,6 +434,7 @@ hostx_init(void) | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY; + attr_mask |= XCB_CW_EVENT_MASK; EPHYR_DBG("mark"); #ifdef GLAMOR @@ -315,7 +443,7 @@ hostx_init(void) else #endif HostX.conn = xcb_connect(NULL, &HostX.screen); - if (xcb_connection_has_error(HostX.conn)) { + if (!HostX.conn || xcb_connection_has_error(HostX.conn)) { fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n"); exit(1); } @@ -325,9 +453,18 @@ hostx_init(void) HostX.gc = xcb_generate_id(HostX.conn); HostX.depth = xscreen->root_depth; #ifdef GLAMOR - if (ephyr_glamor) + if (ephyr_glamor) { HostX.visual = ephyr_glamor_get_visual(); - else + if (HostX.visual->visual_id != xscreen->root_visual) { + attrs[1] = xcb_generate_id(HostX.conn); + attr_mask |= XCB_CW_COLORMAP; + xcb_create_colormap(HostX.conn, + XCB_COLORMAP_ALLOC_NONE, + attrs[1], + HostX.winroot, + HostX.visual->visual_id); + } + } else #endif HostX.visual = xcb_aux_find_visual_by_id(xscreen,xscreen->root_visual); @@ -347,6 +484,8 @@ hostx_init(void) scrpriv->win = xcb_generate_id(HostX.conn); scrpriv->server_depth = HostX.depth; scrpriv->ximg = NULL; + scrpriv->win_x = 0; + scrpriv->win_y = 0; if (scrpriv->win_pre_existing != XCB_WINDOW_NONE) { xcb_get_geometry_reply_t *prewin_geom; @@ -379,9 +518,9 @@ hostx_init(void) scrpriv->win_height, 0, XCB_WINDOW_CLASS_COPY_FROM_PARENT, - XCB_COPY_FROM_PARENT, - XCB_CW_EVENT_MASK, - &attr); + HostX.visual->visual_id, + attr_mask, + attrs); } else { xcb_create_window(HostX.conn, @@ -391,9 +530,9 @@ hostx_init(void) 0,0,100,100, /* will resize */ 0, XCB_WINDOW_CLASS_COPY_FROM_PARENT, - XCB_COPY_FROM_PARENT, - XCB_CW_EVENT_MASK, - &attr); + HostX.visual->visual_id, + attr_mask, + attrs); hostx_set_win_title(screen, "(ctrl+shift grabs mouse and keyboard)"); @@ -404,6 +543,17 @@ hostx_init(void) hostx_set_fullscreen_hint(); } + else if (scrpriv->output) { + hostx_get_output_geometry(scrpriv->output, + &scrpriv->win_x, + &scrpriv->win_y, + &scrpriv->win_width, + &scrpriv->win_height); + + HostX.use_fullscreen = TRUE; + hostx_set_fullscreen_hint(); + } + tmpstr = getenv("RESOURCE_NAME"); if (tmpstr && (!ephyrResNameFromCmd)) @@ -451,18 +601,25 @@ hostx_init(void) xcb_change_gc(HostX.conn, HostX.gc, XCB_GC_FOREGROUND, &pixel); + cursor_pxm = xcb_generate_id(HostX.conn); + xcb_create_pixmap(HostX.conn, 1, cursor_pxm, HostX.winroot, 1, 1); + cursor_gc = xcb_generate_id(HostX.conn); + pixel = 0; + xcb_create_gc(HostX.conn, cursor_gc, cursor_pxm, + XCB_GC_FOREGROUND, &pixel); + xcb_poly_fill_rectangle(HostX.conn, cursor_pxm, cursor_gc, 1, &rect); + xcb_free_gc(HostX.conn, cursor_gc); + HostX.empty_cursor = xcb_generate_id(HostX.conn); + xcb_create_cursor(HostX.conn, + HostX.empty_cursor, + cursor_pxm, cursor_pxm, + 0,0,0, + 0,0,0, + 1,1); + xcb_free_pixmap(HostX.conn, cursor_pxm); if (!hostx_want_host_cursor ()) { CursorVisible = TRUE; /* Ditch the cursor, we provide our 'own' */ - cursor_pxm = xcb_generate_id(HostX.conn); - xcb_create_pixmap(HostX.conn, 1, cursor_pxm, HostX.winroot, 1, 1); - empty_cursor = xcb_generate_id(HostX.conn); - xcb_create_cursor(HostX.conn, - empty_cursor, - cursor_pxm, cursor_pxm, - 0,0,0, - 0,0,0, - 1,1); for (index = 0; index < HostX.n_screens; index++) { KdScreenInfo *screen = HostX.screens[index]; EphyrScrPriv *scrpriv = screen->driver; @@ -470,9 +627,8 @@ hostx_init(void) xcb_change_window_attributes(HostX.conn, scrpriv->win, XCB_CW_CURSOR, - &empty_cursor); + &HostX.empty_cursor); } - xcb_free_pixmap(HostX.conn, cursor_pxm); } /* Try to get share memory ximages for a little bit more speed */ @@ -593,9 +749,12 @@ hostx_calculate_color_shift(unsigned long mask) } void -hostx_set_cmap_entry(unsigned char idx, +hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx, unsigned char r, unsigned char g, unsigned char b) { + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; /* need to calculate the shifts for RGB because server could be BGR. */ /* XXX Not sure if this is correct for 8 on 16, but this works for 8 on 24.*/ static int rshift, bshift, gshift = 0; @@ -607,7 +766,7 @@ hostx_set_cmap_entry(unsigned char idx, gshift = hostx_calculate_color_shift(HostX.visual->green_mask); bshift = hostx_calculate_color_shift(HostX.visual->blue_mask); } - HostX.cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | + scrpriv->cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | ((g << gshift) & HostX.visual->green_mask) | ((b << bshift) & HostX.visual->blue_mask); } @@ -626,6 +785,7 @@ hostx_set_cmap_entry(unsigned char idx, */ void * hostx_screen_init(KdScreenInfo *screen, + int x, int y, int width, int height, int buffer_height, int *bytes_per_line, int *bits_per_pixel) { @@ -637,8 +797,8 @@ hostx_screen_init(KdScreenInfo *screen, exit(1); } - EPHYR_DBG("host_screen=%p wxh=%dx%d, buffer_height=%d", - host_screen, width, height, buffer_height); + EPHYR_DBG("host_screen=%p x=%d, y=%d, wxh=%dx%d, buffer_height=%d", + screen, x, y, width, height, buffer_height); if (scrpriv->ximg != NULL) { /* Free up the image data if previously used @@ -706,6 +866,11 @@ hostx_screen_init(KdScreenInfo *screen, ~0, NULL); + /* Match server byte order so that the image can be converted to + * the native byte order by xcb_image_put() before drawing */ + if (host_depth_matches_server(scrpriv)) + scrpriv->ximg->byte_order = IMAGE_BYTE_ORDER; + scrpriv->ximg->data = malloc(scrpriv->ximg->stride * buffer_height); } @@ -729,10 +894,25 @@ hostx_screen_init(KdScreenInfo *screen, xcb_map_window(HostX.conn, scrpriv->win); + /* Set explicit window position if it was informed in + * -screen option (WxH+X or WxH+X+Y). Otherwise, accept the + * position set by WM. + * The trick here is putting this code after xcb_map_window() call, + * so these values won't be overriden by WM. */ + if (scrpriv->win_explicit_position) + { + uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; + uint32_t values[2] = {x, y}; + xcb_configure_window(HostX.conn, scrpriv->win, mask, values); + } + + xcb_aux_sync(HostX.conn); scrpriv->win_width = width; scrpriv->win_height = height; + scrpriv->win_x = x; + scrpriv->win_y = y; #ifdef GLAMOR if (ephyr_glamor) { @@ -800,15 +980,15 @@ hostx_paint_rect(KdScreenInfo *screen, hostx_paint_debug_rect(screen, dx, dy, width, height); } - /* + /* * If the depth of the ephyr server is less than that of the host, * the kdrive fb does not point to the ximage data but to a buffer * ( fb_data ), we shift the various bits from this onto the XImage * so they match the host. * - * Note, This code is pretty new ( and simple ) so may break on - * endian issues, 32 bpp host etc. - * Not sure if 8bpp case is right either. + * Note, This code is pretty new ( and simple ) so may break on + * endian issues, 32 bpp host etc. + * Not sure if 8bpp case is right either. * ... and it will be slower than the matching depth case. */ @@ -843,7 +1023,7 @@ hostx_paint_rect(KdScreenInfo *screen, unsigned char pixel = *(unsigned char *) (scrpriv->fb_data + idx); xcb_image_put_pixel(scrpriv->ximg, x, y, - HostX.cmap[pixel]); + scrpriv->cmap[pixel]); break; } default: @@ -859,8 +1039,11 @@ hostx_paint_rect(KdScreenInfo *screen, sx, sy, dx, dy, width, height, FALSE); } else { - xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, scrpriv->ximg, - dx, dy, 0); + /* This is slow and could be done better */ + xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1); + xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0); + if (scrpriv->ximg != img) + xcb_image_destroy(img); } xcb_aux_sync(HostX.conn); @@ -1232,10 +1415,12 @@ ephyr_glamor_init(ScreenPtr screen) ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); - glamor_init(screen, - GLAMOR_USE_SCREEN | - GLAMOR_USE_PICTURE_SCREEN | - GLAMOR_INVERTED_Y_AXIS); + if (!glamor_init(screen, + GLAMOR_USE_SCREEN | + GLAMOR_USE_PICTURE_SCREEN)) { + FatalError("Failed to initialize glamor\n"); + return FALSE; + } return TRUE; } diff --git a/xserver/hw/kdrive/ephyr/hostx.h b/xserver/hw/kdrive/ephyr/hostx.h index e83323a0c..93aaa509c 100644 --- a/xserver/hw/kdrive/ephyr/hostx.h +++ b/xserver/hw/kdrive/ephyr/hostx.h @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,6 +29,7 @@ #include #include #include +#include #include "ephyr.h" #define EPHYR_WANT_DEBUG 0 @@ -74,7 +75,7 @@ typedef struct { } EphyrRect; int -hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height); +hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y); int hostx_want_host_cursor(void); @@ -82,6 +83,14 @@ int void hostx_use_sw_cursor(void); +xcb_cursor_t + hostx_get_empty_cursor(void); + +void + hostx_get_output_geometry(const char *output, + int *x, int *y, + int *width, int *height); + void hostx_use_fullscreen(void); @@ -107,7 +116,7 @@ int hostx_init(void); void -hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num); +hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output); void hostx_set_display_name(char *name); @@ -132,10 +141,11 @@ hostx_get_visual_masks(KdScreenInfo *screen, CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk); void -hostx_set_cmap_entry(unsigned char idx, +hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx, unsigned char r, unsigned char g, unsigned char b); void *hostx_screen_init(KdScreenInfo *screen, + int x, int y, int width, int height, int buffer_height, int *bytes_per_line, int *bits_per_pixel); diff --git a/xserver/hw/kdrive/ephyr/man/Makefile.in b/xserver/hw/kdrive/ephyr/man/Makefile.in index 52091f5b0..9d49b9c7b 100644 --- a/xserver/hw/kdrive/ephyr/man/Makefile.in +++ b/xserver/hw/kdrive/ephyr/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/kdrive/ephyr/man/Xephyr.man b/xserver/hw/kdrive/ephyr/man/Xephyr.man index f14f6c864..c04379035 100644 --- a/xserver/hw/kdrive/ephyr/man/Xephyr.man +++ b/xserver/hw/kdrive/ephyr/man/Xephyr.man @@ -63,6 +63,9 @@ improvement is negligible. .B -resizeable Allow the Xephyr window to be resized, even if not embedded into a parent window. By default, the Xephyr window has a fixed size. +.TP 8 +.B -no-host-grab +Disable grabbing the keyboard and mouse. .SH "SIGNALS" Send a SIGUSR1 to the server (e.g. pkill -USR1 Xephyr) to toggle the debugging mode. diff --git a/xserver/hw/kdrive/ephyr/os.c b/xserver/hw/kdrive/ephyr/os.c index 56b52d143..0dbcbb883 100644 --- a/xserver/hw/kdrive/ephyr/os.c +++ b/xserver/hw/kdrive/ephyr/os.c @@ -1,8 +1,8 @@ /* * Xephyr - A kdrive X server thats runs in a host X window. * Authored by Matthew Allum - * - * Copyright © 2004 Nokia + * + * Copyright © 2004 Nokia * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/xserver/hw/kdrive/fake/Makefile.am b/xserver/hw/kdrive/fake/Makefile.am index 14c99c3cc..d28bd2752 100644 --- a/xserver/hw/kdrive/fake/Makefile.am +++ b/xserver/hw/kdrive/fake/Makefile.am @@ -18,6 +18,7 @@ Xfake_SOURCES = \ Xfake_LDADD = \ libfake.la \ + @KDRIVE_MAIN_LIB@ \ @KDRIVE_LIBS@ Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/xserver/hw/kdrive/fake/Makefile.in b/xserver/hw/kdrive/fake/Makefile.in index 6648b29f7..28197670e 100644 --- a/xserver/hw/kdrive/fake/Makefile.in +++ b/xserver/hw/kdrive/fake/Makefile.in @@ -241,6 +241,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -495,6 +496,7 @@ Xfake_SOURCES = \ Xfake_LDADD = \ libfake.la \ + @KDRIVE_MAIN_LIB@ \ @KDRIVE_LIBS@ Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/xserver/hw/kdrive/fbdev/Makefile.am b/xserver/hw/kdrive/fbdev/Makefile.am index 7e8ba024c..d550c1391 100644 --- a/xserver/hw/kdrive/fbdev/Makefile.am +++ b/xserver/hw/kdrive/fbdev/Makefile.am @@ -16,6 +16,7 @@ Xfbdev_SOURCES = \ Xfbdev_LDADD = \ libfbdev.la \ + @KDRIVE_MAIN_LIB@ \ @KDRIVE_LIBS@ Xfbdev_DEPENDENCIES = \ diff --git a/xserver/hw/kdrive/fbdev/Makefile.in b/xserver/hw/kdrive/fbdev/Makefile.in index 90a1cb212..37be5f1e2 100644 --- a/xserver/hw/kdrive/fbdev/Makefile.in +++ b/xserver/hw/kdrive/fbdev/Makefile.in @@ -242,6 +242,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -493,6 +494,7 @@ libfbdev_la_SOURCES = \ @KDRIVEFBDEV_TRUE@Xfbdev_LDADD = \ @KDRIVEFBDEV_TRUE@ libfbdev.la \ +@KDRIVEFBDEV_TRUE@ @KDRIVE_MAIN_LIB@ \ @KDRIVEFBDEV_TRUE@ @KDRIVE_LIBS@ @KDRIVEFBDEV_TRUE@Xfbdev_DEPENDENCIES = \ diff --git a/xserver/hw/kdrive/linux/Makefile.in b/xserver/hw/kdrive/linux/Makefile.in index 694ca34ea..fd01608f6 100644 --- a/xserver/hw/kdrive/linux/Makefile.in +++ b/xserver/hw/kdrive/linux/Makefile.in @@ -243,6 +243,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/kdrive/src/Makefile.in b/xserver/hw/kdrive/src/Makefile.in index 37796b53c..b5bd50984 100644 --- a/xserver/hw/kdrive/src/Makefile.in +++ b/xserver/hw/kdrive/src/Makefile.in @@ -237,6 +237,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c index 9814fc66a..dddbe6e96 100644 --- a/xserver/hw/kdrive/src/kdrive.c +++ b/xserver/hw/kdrive/src/kdrive.c @@ -300,6 +300,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) screen->softCursor = kdSoftCursor; screen->origin = kdOrigin; screen->randr = RR_Rotate_0; + screen->x = 0; + screen->y = 0; screen->width = 0; screen->height = 0; screen->width_mm = 0; @@ -313,7 +315,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) return; for (i = 0; i < 2; i++) { - arg = KdParseFindNext(arg, "x/@XY", save, &delim); + arg = KdParseFindNext(arg, "x/+@XY", save, &delim); if (!save[0]) return; @@ -321,7 +323,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) mm = 0; if (delim == '/') { - arg = KdParseFindNext(arg, "x@XY", save, &delim); + arg = KdParseFindNext(arg, "x+@XY", save, &delim); if (!save[0]) return; mm = atoi(save); @@ -335,7 +337,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) screen->height = pixels; screen->height_mm = mm; } - if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' && + if (delim != 'x' && delim != '+' && delim != '@' && + delim != 'X' && delim != 'Y' && (delim != '\0' || i == 0)) return; } @@ -346,6 +349,18 @@ KdParseScreen(KdScreenInfo * screen, const char *arg) kdSoftCursor = FALSE; kdSubpixelOrder = SubPixelUnknown; + if (delim == '+') { + arg = KdParseFindNext(arg, "+@xXY", save, &delim); + if (save[0]) + screen->x = atoi(save); + } + + if (delim == '+') { + arg = KdParseFindNext(arg, "@xXY", save, &delim); + if (save[0]) + screen->y = atoi(save); + } + if (delim == '@') { arg = KdParseFindNext(arg, "xXY", save, &delim); if (save[0]) { @@ -425,7 +440,7 @@ KdUseMsg(void) { ErrorF("\nTinyX Device Dependent Usage:\n"); ErrorF - ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][@ROTATION][X][Y][xDEPTH/BPP[xFREQ]] Specify screen characteristics\n"); + ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][+[-]XOFFSET][+[-]YOFFSET][@ROTATION][X][Y][xDEPTH/BPP[xFREQ]] Specify screen characteristics\n"); ErrorF ("-rgba rgb/bgr/vrgb/vbgr/none Specify subpixel ordering for LCD panels\n"); ErrorF @@ -621,8 +636,12 @@ KdCloseScreen(ScreenPtr pScreen) KdCardInfo *card = pScreenPriv->card; Bool ret; + if (card->cfuncs->closeScreen) + (*card->cfuncs->closeScreen)(pScreen); + pScreenPriv->closed = TRUE; pScreen->CloseScreen = pScreenPriv->CloseScreen; + if (pScreen->CloseScreen) ret = (*pScreen->CloseScreen) (pScreen); else @@ -890,10 +909,6 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv) if (!(*card->cfuncs->finishInitScreen) (pScreen)) return FALSE; -#if 0 - fbInitValidateTree(pScreen); -#endif - /* * Wrap CloseScreen, the order now is: * KdCloseScreen diff --git a/xserver/hw/kdrive/src/kdrive.h b/xserver/hw/kdrive/src/kdrive.h index bec75cb6f..e1d2b5927 100644 --- a/xserver/hw/kdrive/src/kdrive.h +++ b/xserver/hw/kdrive/src/kdrive.h @@ -89,6 +89,8 @@ typedef struct _KdScreenInfo { ScreenPtr pScreen; void *driver; Rotation randr; /* rotation and reflection */ + int x; + int y; int width; int height; int rate; @@ -130,6 +132,7 @@ typedef struct _KdCardFuncs { void (*getColors) (ScreenPtr, int, xColorItem *); void (*putColors) (ScreenPtr, int, xColorItem *); + void (*closeScreen) (ScreenPtr); /* close ScreenRec */ } KdCardFuncs; #define KD_MAX_PSEUDO_DEPTH 8 @@ -327,19 +330,6 @@ typedef struct _KdPointerMatrix { int matrix[2][3]; } KdPointerMatrix; -/* - * This is the only completely portable way to - * compute this info. - */ - -#ifndef BitsPerPixel -#define BitsPerPixel(d) (\ - PixmapWidthPaddingInfo[d].notPower2 ? \ - (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \ - ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ - (PixmapWidthPaddingInfo[d].padRoundUp+1))) -#endif - extern DevPrivateKeyRec kdScreenPrivateKeyRec; #define kdScreenPrivateKey (&kdScreenPrivateKeyRec) diff --git a/xserver/hw/kdrive/src/kxv.c b/xserver/hw/kdrive/src/kxv.c index 9cc0edd8a..369db3332 100644 --- a/xserver/hw/kdrive/src/kxv.c +++ b/xserver/hw/kdrive/src/kxv.c @@ -56,54 +56,48 @@ of the copyright holder. #include "kxv.h" #include "fourcc.h" -/* XvScreenRec fields */ - -static Bool KdXVCloseScreen(ScreenPtr); -static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); - /* XvAdaptorRec fields */ -static int KdXVAllocatePort(unsigned long, XvPortPtr, XvPortPtr *); -static int KdXVFreePort(XvPortPtr); -static int KdXVPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int KdXVPutVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int KdXVPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int KdXVPutStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int KdXVGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int KdXVGetVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int KdXVGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int KdXVGetStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int KdXVStopVideo(ClientPtr, XvPortPtr, DrawablePtr); -static int KdXVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); -static int KdXVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); -static int KdXVQueryBestSize(ClientPtr, XvPortPtr, CARD8, +static int KdXVStopVideo(XvPortPtr, DrawablePtr); +static int KdXVSetPortAttribute(XvPortPtr, Atom, INT32); +static int KdXVGetPortAttribute(XvPortPtr, Atom, INT32 *); +static int KdXVQueryBestSize(XvPortPtr, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); -static int KdXVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int KdXVPutImage(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); -static int KdXVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, +static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr, CARD16 *, CARD16 *, int *, int *); /* ScreenRec fields */ -static Bool KdXVCreateWindow(WindowPtr pWin); static Bool KdXVDestroyWindow(WindowPtr pWin); -static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); +static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1); static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); +static Bool KdXVCloseScreen(ScreenPtr); /* misc */ -static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr *, int); +static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr, int); static DevPrivateKeyRec KdXVWindowKeyRec; #define KdXVWindowKey (&KdXVWindowKeyRec) static DevPrivateKey KdXvScreenKey; +static DevPrivateKeyRec KdXVScreenPrivateKey; static unsigned long KdXVGeneration = 0; static unsigned long PortResource = 0; @@ -111,54 +105,11 @@ static unsigned long PortResource = 0; dixLookupPrivate(&(pScreen)->devPrivates, KdXvScreenKey)) #define GET_KDXV_SCREEN(pScreen) \ - ((KdXVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr)) + ((KdXVScreenPtr)(dixGetPrivate(&pScreen->devPrivates, &KdXVScreenPrivateKey))) #define GET_KDXV_WINDOW(pWin) ((KdXVWindowPtr) \ dixLookupPrivate(&(pWin)->devPrivates, KdXVWindowKey)) -static KdXVInitGenericAdaptorPtr *GenDrivers = NULL; -static int NumGenDrivers = 0; - -int -KdXVRegisterGenericAdaptorDriver(KdXVInitGenericAdaptorPtr InitFunc) -{ - KdXVInitGenericAdaptorPtr *newdrivers; - -/* fprintf(stderr,"KdXVRegisterGenericAdaptorDriver\n"); */ - - newdrivers = realloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) * - (1 + NumGenDrivers)); - if (!newdrivers) - return 0; - GenDrivers = newdrivers; - - GenDrivers[NumGenDrivers++] = InitFunc; - - return 1; -} - -int -KdXVListGenericAdaptors(KdScreenInfo * screen, KdVideoAdaptorPtr ** adaptors) -{ - int i, j, n, num; - KdVideoAdaptorPtr *DrivAdap, *new; - - num = 0; - *adaptors = NULL; - for (i = 0; i < NumGenDrivers; i++) { - n = GenDrivers[i] (screen, &DrivAdap); - if (0 == n) - continue; - new = realloc(*adaptors, sizeof(KdVideoAdaptorPtr) * (num + n)); - if (NULL == new) - continue; - *adaptors = new; - for (j = 0; j < n; j++, num++) - (*adaptors)[num] = DrivAdap[j]; - } - return num; -} - KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen) { @@ -172,10 +123,9 @@ KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr) } Bool -KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) +KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) { KdXVScreenPtr ScreenPriv; - XvScreenPtr pxvs; /* fprintf(stderr,"KdXVScreenInit initializing %d adaptors\n",num); */ @@ -187,6 +137,8 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; + if (!dixRegisterPrivateKey(&KdXVScreenPrivateKey, PRIVATE_SCREEN, 0)) + return FALSE; if (Success != XvScreenInit(pScreen)) return FALSE; @@ -194,36 +146,23 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) KdXvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); - pxvs = GET_XV_SCREEN(pScreen); - - /* Anyone initializing the Xv layer must provide these two. - The Xv di layer calls them without even checking if they exist! */ - - pxvs->ddCloseScreen = KdXVCloseScreen; - pxvs->ddQueryAdaptors = KdXVQueryAdaptors; - - /* The Xv di layer provides us with a private hook so that we don't - have to allocate our own screen private. They also provide - a CloseScreen hook so that we don't have to wrap it. I'm not - sure that I appreciate that. */ - ScreenPriv = malloc(sizeof(KdXVScreenRec)); - pxvs->devPriv.ptr = (void *) ScreenPriv; + dixSetPrivate(&pScreen->devPrivates, &KdXVScreenPrivateKey, ScreenPriv); if (!ScreenPriv) return FALSE; - ScreenPriv->CreateWindow = pScreen->CreateWindow; ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->ClipNotify = pScreen->ClipNotify; + ScreenPriv->CloseScreen = pScreen->CloseScreen; /* fprintf(stderr,"XV: Wrapping screen funcs\n"); */ - pScreen->CreateWindow = KdXVCreateWindow; pScreen->DestroyWindow = KdXVDestroyWindow; pScreen->WindowExposures = KdXVWindowExposures; pScreen->ClipNotify = KdXVClipNotify; + pScreen->CloseScreen = KdXVCloseScreen; if (!KdXVInitAdaptors(pScreen, adaptors, num)) return FALSE; @@ -236,19 +175,6 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - free(pAdaptor->name); - - if (pAdaptor->pEncodings) { - XvEncodingPtr pEncode = pAdaptor->pEncodings; - - for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) { - free(pEncode->name); - } - free(pAdaptor->pEncodings); - } - - free(pAdaptor->pFormats); - if (pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; @@ -263,26 +189,13 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) free(pPriv); } } - free(pAdaptor->pPorts); } - if (pAdaptor->nAttributes) { - XvAttributePtr pAttribute = pAdaptor->pAttributes; - - for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) { - free(pAttribute->name); - } - - free(pAdaptor->pAttributes); - } - - free(pAdaptor->pImages); - - free(pAdaptor->devPriv.ptr); + XvFreeAdaptor(pAdaptor); } static Bool -KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) +KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr infoPtr, int number) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; @@ -295,15 +208,11 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) XvPortRecPrivatePtr portPriv; XvPortPtr pPort, pp; int numPort; - KdAttributePtr attributePtr; - XvAttributePtr pAttribute, pat; KdVideoFormatPtr formatPtr; XvFormatPtr pFormat, pf; int numFormat, totFormat; KdVideoEncodingPtr encodingPtr; XvEncodingPtr pEncode, pe; - KdImagePtr imagePtr; - XvImagePtr pImage, pi; int numVisuals; VisualPtr pVisual; int i; @@ -315,7 +224,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) return FALSE; for (pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { - adaptorPtr = infoPtr[na]; + adaptorPtr = &infoPtr[na]; if (!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute || !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize) @@ -349,8 +258,6 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) continue; pa->pScreen = pScreen; - pa->ddAllocatePort = KdXVAllocatePort; - pa->ddFreePort = KdXVFreePort; pa->ddPutVideo = KdXVPutVideo; pa->ddPutStill = KdXVPutStill; pa->ddGetVideo = KdXVGetVideo; @@ -381,26 +288,24 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) } if (adaptorPtr->nImages && - (pImage = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { - - for (i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; - i < adaptorPtr->nImages; i++, pi++, imagePtr++) { - memcpy(pi, imagePtr, sizeof(*pi)); - } + (pa->pImages = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + memcpy(pa->pImages, adaptorPtr->pImages, + adaptorPtr->nImages * sizeof(XvImageRec)); pa->nImages = adaptorPtr->nImages; - pa->pImages = pImage; } if (adaptorPtr->nAttributes && - (pAttribute = - calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { - for (pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = - 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) { - memcpy(pat, attributePtr, sizeof(*pat)); - pat->name = strdup(attributePtr->name); + (pa->pAttributes = calloc(adaptorPtr->nAttributes, + sizeof(XvAttributeRec)))) { + memcpy(pa->pAttributes, adaptorPtr->pAttributes, + adaptorPtr->nAttributes * sizeof(XvAttributeRec)); + + for (i = 0; i < adaptorPtr->nAttributes; i++) { + pa->pAttributes[i].name = + strdup(adaptorPtr->pAttributes[i].name); } + pa->nAttributes = adaptorPtr->nAttributes; - pa->pAttributes = pAttribute; } totFormat = adaptorPtr->nFormats; @@ -587,7 +492,7 @@ static void KdXVCopyClip(XvPortRecPrivatePtr portPriv, GCPtr pGC) { /* copy the new clip if it exists */ - if ((pGC->clientClipType == CT_REGION) && pGC->clientClip) { + if (pGC->clientClip) { if (!portPriv->clientClip) portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ @@ -637,10 +542,6 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetVideo) (portPriv->screen, portPriv->pDraw, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -717,22 +618,6 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutVideo) (portPriv->screen, portPriv->pDraw, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -809,22 +694,6 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->ReputImage) (portPriv->screen, portPriv->pDraw, WinBox.x1, WinBox.y1, &ClipRegion, @@ -920,23 +789,6 @@ KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) /**** ScreenRec fields ****/ -static Bool -KdXVCreateWindow(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); - int ret; - - pScreen->CreateWindow = ScreenPriv->CreateWindow; - ret = (*pScreen->CreateWindow) (pWin); - pScreen->CreateWindow = KdXVCreateWindow; - - if (ret) - dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL); - - return ret; -} - static Bool KdXVDestroyWindow(WindowPtr pWin) { @@ -970,7 +822,7 @@ KdXVDestroyWindow(WindowPtr pWin) } static void -KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) +KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1) { ScreenPtr pScreen = pWin->drawable.pScreen; KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); @@ -982,7 +834,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; - (*pScreen->WindowExposures) (pWin, reg1, reg2); + (*pScreen->WindowExposures) (pWin, reg1); pScreen->WindowExposures = KdXVWindowExposures; /* filter out XClearWindow/Area */ @@ -1101,10 +953,10 @@ KdXVCloseScreen(ScreenPtr pScreen) if (!ScreenPriv) return TRUE; - pScreen->CreateWindow = ScreenPriv->CreateWindow; pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; + pScreen->CloseScreen = ScreenPriv->CloseScreen; /* fprintf(stderr,"XV: Unwrapping screen funcs\n"); */ @@ -1115,19 +967,7 @@ KdXVCloseScreen(ScreenPtr pScreen) free(pxvs->pAdaptors); free(ScreenPriv); - return TRUE; -} - -static int -KdXVQueryAdaptors(ScreenPtr pScreen, - XvAdaptorPtr * p_pAdaptors, int *p_nAdaptors) -{ - XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); - - *p_nAdaptors = pxvs->nAdaptors; - *p_pAdaptors = pxvs->pAdaptors; - - return Success; + return pScreen->CloseScreen(pScreen); } static Bool @@ -1188,21 +1028,7 @@ KdXVDisable(ScreenPtr pScreen) /**** XvAdaptorRec fields ****/ static int -KdXVAllocatePort(unsigned long port, XvPortPtr pPort, XvPortPtr * ppPort) -{ - *ppPort = pPort; - return Success; -} - -static int -KdXVFreePort(XvPortPtr pPort) -{ - return Success; -} - -static int -KdXVPutVideo(ClientPtr client, - DrawablePtr pDraw, +KdXVPutVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1255,8 +1081,7 @@ KdXVPutVideo(ClientPtr client, } static int -KdXVPutStill(ClientPtr client, - DrawablePtr pDraw, +KdXVPutStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1312,21 +1137,6 @@ KdXVPutStill(ClientPtr client, goto PUT_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_STILL_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutStill) (portPriv->screen, pDraw, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1363,8 +1173,7 @@ KdXVPutStill(ClientPtr client, } static int -KdXVGetVideo(ClientPtr client, - DrawablePtr pDraw, +KdXVGetVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1417,8 +1226,7 @@ KdXVGetVideo(ClientPtr client, } static int -KdXVGetStill(ClientPtr client, - DrawablePtr pDraw, +KdXVGetStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1459,10 +1267,6 @@ KdXVGetStill(ClientPtr client, goto GET_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetStill) (portPriv->screen, pDraw, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1484,7 +1288,7 @@ KdXVGetStill(ClientPtr client, } static int -KdXVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) +KdXVStopVideo(XvPortPtr pPort, DrawablePtr pDraw) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1510,8 +1314,7 @@ KdXVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) } static int -KdXVSetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 value) +KdXVSetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1521,8 +1324,7 @@ KdXVSetPortAttribute(ClientPtr client, } static int -KdXVGetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 *p_value) +KdXVGetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 *p_value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1533,8 +1335,7 @@ KdXVGetPortAttribute(ClientPtr client, } static int -KdXVQueryBestSize(ClientPtr client, - XvPortPtr pPort, +KdXVQueryBestSize(XvPortPtr pPort, CARD8 motion, CARD16 vid_w, CARD16 vid_h, CARD16 drw_w, CARD16 drw_h, @@ -1551,8 +1352,7 @@ KdXVQueryBestSize(ClientPtr client, } static int -KdXVPutImage(ClientPtr client, - DrawablePtr pDraw, +KdXVPutImage(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, @@ -1610,21 +1410,6 @@ KdXVPutImage(ClientPtr client, goto PUT_IMAGE_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_IMAGE_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutImage) (portPriv->screen, pDraw, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, @@ -1662,8 +1447,7 @@ KdXVPutImage(ClientPtr client, } static int -KdXVQueryImageAttributes(ClientPtr client, - XvPortPtr pPort, +KdXVQueryImageAttributes(XvPortPtr pPort, XvImagePtr format, CARD16 *width, CARD16 *height, int *pitches, int *offsets) @@ -1819,44 +1603,3 @@ KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, } } } - -void -KXVPaintRegion(DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) -{ - GCPtr pGC; - ChangeGCVal val[2]; - xRectangle *rects, *r; - BoxPtr pBox = RegionRects(pRgn); - int nBox = RegionNumRects(pRgn); - - rects = malloc(nBox * sizeof(xRectangle)); - if (!rects) - goto bail0; - r = rects; - while (nBox--) { - r->x = pBox->x1 - pDraw->x; - r->y = pBox->y1 - pDraw->y; - r->width = pBox->x2 - pBox->x1; - r->height = pBox->y2 - pBox->y1; - r++; - pBox++; - } - - pGC = GetScratchGC(pDraw->depth, pDraw->pScreen); - if (!pGC) - goto bail1; - - val[0].val = fg; - val[1].val = IncludeInferiors; - ChangeGC(NullClient, pGC, GCForeground | GCSubwindowMode, val); - - ValidateGC(pDraw, pGC); - - (*pGC->ops->PolyFillRect) (pDraw, pGC, RegionNumRects(pRgn), rects); - - FreeScratchGC(pGC); - bail1: - free(rects); - bail0: - ; -} diff --git a/xserver/hw/kdrive/src/kxv.h b/xserver/hw/kdrive/src/kxv.h index 85a030ee9..b99729922 100644 --- a/xserver/hw/kdrive/src/kxv.h +++ b/xserver/hw/kdrive/src/kxv.h @@ -50,23 +50,10 @@ of the copyright holder. #include "../../Xext/xvdix.h" -#define VIDEO_NO_CLIPPING 0x00000001 -#define VIDEO_INVERT_CLIPLIST 0x00000002 #define VIDEO_OVERLAID_IMAGES 0x00000004 #define VIDEO_OVERLAID_STILLS 0x00000008 #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 -typedef XvImageRec KdImageRec, *KdImagePtr; - -typedef struct { - KdScreenInfo *screen; - int id; - unsigned short width, height; - int *pitches; /* bytes */ - int *offsets; /* in bytes from start of framebuffer */ - DevUnion devPrivate; -} KdSurfaceRec, *KdSurfacePtr; - typedef int (*PutVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, @@ -121,7 +108,7 @@ typedef enum { typedef struct { int id; - char *name; + const char *name; unsigned short width, height; XvRationalRec rate; } KdVideoEncodingRec, *KdVideoEncodingPtr; @@ -131,12 +118,10 @@ typedef struct { short class; } KdVideoFormatRec, *KdVideoFormatPtr; -typedef XvAttributeRec KdAttributeRec, *KdAttributePtr; - typedef struct { unsigned int type; int flags; - char *name; + const char *name; int nEncodings; KdVideoEncodingPtr pEncodings; int nFormats; @@ -144,9 +129,9 @@ typedef struct { int nPorts; DevUnion *pPortPrivates; int nAttributes; - KdAttributePtr pAttributes; + XvAttributePtr pAttributes; int nImages; - KdImagePtr pImages; + XvImagePtr pImages; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; @@ -161,16 +146,7 @@ typedef struct { } KdVideoAdaptorRec, *KdVideoAdaptorPtr; Bool - KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * Adaptors, int num); - -typedef int (*KdXVInitGenericAdaptorPtr) (KdScreenInfo * screen, - KdVideoAdaptorPtr ** Adaptors); - -int - KdXVRegisterGenericAdaptorDriver(KdXVInitGenericAdaptorPtr InitFunc); - -int - KdXVListGenericAdaptors(KdScreenInfo * screen, KdVideoAdaptorPtr ** Adaptors); + KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num); void @@ -185,9 +161,6 @@ KdXVCopyPlanarData(KdScreenInfo * screen, CARD8 *src, CARD8 *dst, int randr, int srcH, int height, int top, int left, int h, int w, int id); -void - KXVPaintRegion(DrawablePtr pDraw, RegionPtr pRgn, Pixel fg); - KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen); void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr); @@ -199,10 +172,10 @@ void KdXVDisable(ScreenPtr); /*** These are DDX layer privates ***/ typedef struct { - CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; + CloseScreenProcPtr CloseScreen; } KdXVScreenRec, *KdXVScreenPtr; typedef struct { diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c index 9c4926462..bcaaa85e4 100644 --- a/xserver/hw/vfb/InitOutput.c +++ b/xserver/hw/vfb/InitOutput.c @@ -380,26 +380,10 @@ ddxProcessArgument(int argc, char *argv[], int i) return 0; } -static DevPrivateKeyRec cmapScrPrivateKeyRec; - -#define cmapScrPrivateKey (&cmapScrPrivateKeyRec) - -#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey)) -#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c)) - -static int -vfbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps) -{ - /* By the time we are processing requests, we can guarantee that there - * is always a colormap installed */ - *pmaps = GetInstalledColormap(pScreen)->mid; - return 1; -} - static void vfbInstallColormap(ColormapPtr pmap) { - ColormapPtr oldpmap = GetInstalledColormap(pmap->pScreen); + ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen); if (pmap != oldpmap) { int entries; @@ -410,11 +394,7 @@ vfbInstallColormap(ColormapPtr pmap) xColorItem *defs; int i; - if (oldpmap != (ColormapPtr) None) - WalkTree(pmap->pScreen, TellLostMap, (char *) &oldpmap->mid); - /* Install pmap */ - SetInstalledColormap(pmap->pScreen, pmap); - WalkTree(pmap->pScreen, TellGainedMap, (char *) &pmap->mid); + miInstallColormap(pmap); entries = pmap->pVisual->ColormapEntries; pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader; @@ -451,29 +431,13 @@ vfbInstallColormap(ColormapPtr pmap) } } -static void -vfbUninstallColormap(ColormapPtr pmap) -{ - ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen); - - if (pmap == curpmap) { - if (pmap->mid != pmap->pScreen->defColormap) { - dixLookupResourceByType((void **) &curpmap, - pmap->pScreen->defColormap, - RT_COLORMAP, serverClient, - DixInstallAccess); - (*pmap->pScreen->InstallColormap) (curpmap); - } - } -} - static void vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs) { XWDColor *pXWDCmap; int i; - if (pmap != GetInstalledColormap(pmap->pScreen)) { + if (pmap != GetInstalledmiColormap(pmap->pScreen)) { return; } @@ -761,17 +725,9 @@ static Bool vfbCloseScreen(ScreenPtr pScreen) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; - int i; pScreen->CloseScreen = pvfb->closeScreen; - /* - * XXX probably lots of stuff to clean. For now, - * clear installed colormaps so that server reset works correctly. - */ - for (i = 0; i < screenInfo.numScreens; i++) - SetInstalledColormap(screenInfo.screens[i], NULL); - /* * fb overwrites miCloseScreen, so do this here */ @@ -790,9 +746,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) int ret; char *pbits; - if (!dixRegisterPrivateKey(&cmapScrPrivateKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - if (dpix == 0) dpix = 100; @@ -859,8 +812,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) return FALSE; pScreen->InstallColormap = vfbInstallColormap; - pScreen->UninstallColormap = vfbUninstallColormap; - pScreen->ListInstalledColormaps = vfbListInstalledColormaps; pScreen->SaveScreen = vfbSaveScreen; pScreen->StoreColors = vfbStoreColors; diff --git a/xserver/hw/vfb/Makefile.in b/xserver/hw/vfb/Makefile.in index 768de33a6..50855df78 100644 --- a/xserver/hw/vfb/Makefile.in +++ b/xserver/hw/vfb/Makefile.in @@ -280,6 +280,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/vfb/man/Makefile.in b/xserver/hw/vfb/man/Makefile.in index 481cfffbf..143b72b30 100644 --- a/xserver/hw/vfb/man/Makefile.in +++ b/xserver/hw/vfb/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/Makefile.am b/xserver/hw/xfree86/Makefile.am index c5992c372..27f2cc6cb 100644 --- a/xserver/hw/xfree86/Makefile.am +++ b/xserver/hw/xfree86/Makefile.am @@ -38,12 +38,12 @@ SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ - $(GLAMOR_EGL_SUBDIR) + $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ - utils doc man glamor_egl + utils doc man glamor_egl drivers bin_PROGRAMS = Xorg nodist_Xorg_SOURCES = sdksyms.c @@ -106,7 +106,7 @@ if INSTALL_SETUID endif if SUID_WRAPPER $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) - mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin + mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap endif diff --git a/xserver/hw/xfree86/Makefile.in b/xserver/hw/xfree86/Makefile.in index 8ec9162f2..d390ae34f 100644 --- a/xserver/hw/xfree86/Makefile.in +++ b/xserver/hw/xfree86/Makefile.in @@ -287,6 +287,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -539,12 +540,12 @@ SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ - $(GLAMOR_EGL_SUBDIR) + $(GLAMOR_EGL_SUBDIR) drivers DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ - utils doc man glamor_egl + utils doc man glamor_egl drivers nodist_Xorg_SOURCES = sdksyms.c AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ @@ -1098,7 +1099,7 @@ install-exec-hook: @INSTALL_SETUID_TRUE@ chown root $(DESTDIR)$(bindir)/Xorg @INSTALL_SETUID_TRUE@ chmod u+s $(DESTDIR)$(bindir)/Xorg @SUID_WRAPPER_TRUE@ $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR) -@SUID_WRAPPER_TRUE@ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin +@SUID_WRAPPER_TRUE@ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg @SUID_WRAPPER_TRUE@ ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg @SUID_WRAPPER_TRUE@ -chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap diff --git a/xserver/hw/xfree86/Xorg.sh.in b/xserver/hw/xfree86/Xorg.sh.in index cef4859c8..481413523 100644 --- a/xserver/hw/xfree86/Xorg.sh.in +++ b/xserver/hw/xfree86/Xorg.sh.in @@ -1,11 +1,11 @@ #!/bin/sh # -# Execute Xorg.wrap if it exists otherwise execute Xorg.bin directly. +# Execute Xorg.wrap if it exists otherwise execute Xorg directly. # This allows distros to put the suid wrapper in a separate package. basedir=@SUID_WRAPPER_DIR@ if [ -x "$basedir"/Xorg.wrap ]; then exec "$basedir"/Xorg.wrap "$@" else - exec "$basedir"/Xorg.bin "$@" + exec "$basedir"/Xorg "$@" fi diff --git a/xserver/hw/xfree86/common/Makefile.am b/xserver/hw/xfree86/common/Makefile.am index 7a2b4bc1e..54e7f4d0a 100644 --- a/xserver/hw/xfree86/common/Makefile.am +++ b/xserver/hw/xfree86/common/Makefile.am @@ -103,4 +103,8 @@ if LNXACPI XORG_CFLAGS += -DHAVE_ACPI endif +if NEED_DBUS +XORG_CFLAGS += $(DBUS_CFLAGS) +endif + AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/xserver/hw/xfree86/common/Makefile.in b/xserver/hw/xfree86/common/Makefile.in index 67551387c..b30bd2bd8 100644 --- a/xserver/hw/xfree86/common/Makefile.in +++ b/xserver/hw/xfree86/common/Makefile.in @@ -52,6 +52,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @LNXACPI_TRUE@am__append_1 = -DHAVE_ACPI +@NEED_DBUS_TRUE@am__append_2 = $(DBUS_CFLAGS) subdir = hw/xfree86/common DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xf86Build.h.in \ @@ -296,6 +297,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -426,7 +428,7 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORG_CFLAGS = @XORG_CFLAGS@ $(am__append_1) +XORG_CFLAGS = @XORG_CFLAGS@ $(am__append_1) $(am__append_2) XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ diff --git a/xserver/hw/xfree86/common/compiler.h b/xserver/hw/xfree86/common/compiler.h index 141b974ca..e355926b5 100644 --- a/xserver/hw/xfree86/common/compiler.h +++ b/xserver/hw/xfree86/common/compiler.h @@ -79,8 +79,6 @@ #ifndef __inline__ #if defined(__GNUC__) /* gcc has __inline__ */ -#elif defined(__HIGHC__) -#define __inline__ _Inline #else #define __inline__ /**/ #endif @@ -88,8 +86,6 @@ #ifndef __inline #if defined(__GNUC__) /* gcc has __inline */ -#elif defined(__HIGHC__) -#define __inline _Inline #else #define __inline /**/ #endif @@ -98,9 +94,10 @@ #if !defined(__GNUC__) && !defined(__FUNCTION__) #define __FUNCTION__ __func__ /* C99 */ #endif -#if defined(NO_INLINE) || defined(DO_PROTOTYPES) + +#if defined(DO_PROTOTYPES) #if !defined(__arm__) -#if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) && !defined(__nds32__) \ +#if !defined(__sparc__) && !defined(__arm32__) && !defined(__nds32__) \ && !(defined(__alpha__) && defined(linux)) \ && !(defined(__ia64__) && defined(linux)) \ && !(defined(__mips64) && defined(linux)) \ @@ -131,33 +128,12 @@ extern _X_EXPORT void xf86WriteMmio16Be (void *, unsigned long, unsigned int); extern _X_EXPORT void xf86WriteMmio16Le (void *, unsigned long, unsigned int); extern _X_EXPORT void xf86WriteMmio32Be (void *, unsigned long, unsigned int); extern _X_EXPORT void xf86WriteMmio32Le (void *, unsigned long, unsigned int); -extern _X_EXPORT void xf86WriteMmio8NB (void *, unsigned long, unsigned int); -extern _X_EXPORT void xf86WriteMmio16BeNB (void *, unsigned long, unsigned int); -extern _X_EXPORT void xf86WriteMmio16LeNB (void *, unsigned long, unsigned int); -extern _X_EXPORT void xf86WriteMmio32BeNB (void *, unsigned long, unsigned int); -extern _X_EXPORT void xf86WriteMmio32LeNB (void *, unsigned long, unsigned int); #endif /* _SUNPRO_C */ #endif /* __sparc__, __arm32__, __alpha__, __nds32__ */ #endif /* __arm__ */ -#if defined(__powerpc__) && !defined(__OpenBSD__) -extern unsigned long ldq_u(unsigned long *); -extern unsigned long ldl_u(unsigned int *); -extern unsigned long ldw_u(unsigned short *); -extern void stq_u(unsigned long, unsigned long *); -extern void stl_u(unsigned long, unsigned int *); -extern void stw_u(unsigned long, unsigned short *); -extern void mem_barrier(void); -extern void write_mem_barrier(void); -extern void stl_brx(unsigned long, volatile unsigned char *, int); -extern void stw_brx(unsigned short, volatile unsigned char *, int); -extern unsigned long ldl_brx(volatile unsigned char *, int); -extern unsigned short ldw_brx(volatile unsigned char *, int); -#endif /* __powerpc__ && !__OpenBSD */ - #endif /* NO_INLINE || DO_PROTOTYPES */ -#ifndef NO_INLINE #ifdef __GNUC__ #ifdef __i386__ @@ -210,14 +186,7 @@ extern unsigned short ldw_brx(volatile unsigned char *, int); #elif defined __powerpc__ -#if defined(linux) && defined(__powerpc64__) -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) -#include -#endif -#endif /* defined(linux) && defined(__powerpc64__) */ - -#ifndef eieio /* We deal with arch-specific eieio() routines above... */ +#ifndef eieio #define eieio() __asm__ __volatile__ ("eieio" ::: "memory") #endif /* eieio */ #define mem_barrier() eieio() @@ -230,7 +199,10 @@ extern unsigned short ldw_brx(volatile unsigned char *, int); #define write_mem_barrier() /* XXX: nop for now */ #endif #endif /* __GNUC__ */ -#endif /* NO_INLINE */ + +#ifndef barrier +#define barrier() +#endif #ifndef mem_barrier #define mem_barrier() /* NOP */ @@ -240,133 +212,8 @@ extern unsigned short ldw_brx(volatile unsigned char *, int); #define write_mem_barrier() /* NOP */ #endif -#ifndef NO_INLINE #ifdef __GNUC__ - -/* Define some packed structures to use with unaligned accesses */ - -struct __una_u64 { - uint64_t x __attribute__ ((packed)); -}; -struct __una_u32 { - uint32_t x __attribute__ ((packed)); -}; -struct __una_u16 { - uint16_t x __attribute__ ((packed)); -}; - -/* Elemental unaligned loads */ - -static __inline__ uint64_t -ldq_u(uint64_t * p) -{ - const struct __una_u64 *ptr = (const struct __una_u64 *) p; - - return ptr->x; -} - -static __inline__ uint32_t -ldl_u(uint32_t * p) -{ - const struct __una_u32 *ptr = (const struct __una_u32 *) p; - - return ptr->x; -} - -static __inline__ uint16_t -ldw_u(uint16_t * p) -{ - const struct __una_u16 *ptr = (const struct __una_u16 *) p; - - return ptr->x; -} - -/* Elemental unaligned stores */ - -static __inline__ void -stq_u(uint64_t val, uint64_t * p) -{ - struct __una_u64 *ptr = (struct __una_u64 *) p; - - ptr->x = val; -} - -static __inline__ void -stl_u(uint32_t val, uint32_t * p) -{ - struct __una_u32 *ptr = (struct __una_u32 *) p; - - ptr->x = val; -} - -static __inline__ void -stw_u(uint16_t val, uint16_t * p) -{ - struct __una_u16 *ptr = (struct __una_u16 *) p; - - ptr->x = val; -} -#else /* !__GNUC__ */ - -#include /* needed for memmove */ - -static __inline__ uint64_t -ldq_u(uint64_t * p) -{ - uint64_t ret; - - memmove(&ret, p, sizeof(*p)); - return ret; -} - -static __inline__ uint32_t -ldl_u(uint32_t * p) -{ - uint32_t ret; - - memmove(&ret, p, sizeof(*p)); - return ret; -} - -static __inline__ uint16_t -ldw_u(uint16_t * p) -{ - uint16_t ret; - - memmove(&ret, p, sizeof(*p)); - return ret; -} - -static __inline__ void -stq_u(uint64_t val, uint64_t * p) -{ - uint64_t tmp = val; - - memmove(p, &tmp, sizeof(*p)); -} - -static __inline__ void -stl_u(uint32_t val, uint32_t * p) -{ - uint32_t tmp = val; - - memmove(p, &tmp, sizeof(*p)); -} - -static __inline__ void -stw_u(uint16_t val, uint16_t * p) -{ - uint16_t tmp = val; - - memmove(p, &tmp, sizeof(*p)); -} - -#endif /* __GNUC__ */ -#endif /* NO_INLINE */ - -#ifndef NO_INLINE -#ifdef __GNUC__ -#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && (defined(__alpha__)) +#if defined(__alpha__) #ifdef linux /* for Linux on Alpha, we use the LIBC _inx/_outx routines */ @@ -439,7 +286,7 @@ extern _X_EXPORT unsigned int inl(unsigned int port); #include #endif /* __NetBSD__ */ -#elif (defined(linux) || defined(__FreeBSD__)) && defined(__amd64__) +#elif defined(__amd64__) #include @@ -488,7 +335,7 @@ inl(unsigned short port) return ret; } -#elif (defined(linux) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) +#elif defined(__sparc__) #ifndef ASI_PL #define ASI_PL 0x88 @@ -671,56 +518,6 @@ xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset, barrier(); } -static __inline__ void -xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("stba %0, [%1] %2": /* No outputs */ - :"r"(val), "r"(addr), "i"(ASI_PL)); -} - -static __inline__ void -xf86WriteMmio16BeNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("sth %0, [%1]": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -xf86WriteMmio16LeNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("stha %0, [%1] %2": /* No outputs */ - :"r"(val), "r"(addr), "i"(ASI_PL)); -} - -static __inline__ void -xf86WriteMmio32BeNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("st %0, [%1]": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("sta %0, [%1] %2": /* No outputs */ - :"r"(val), "r"(addr), "i"(ASI_PL)); -} - #elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__)) #if defined(__arm32__) || defined(__mips64__) #define PORT_SIZE long @@ -800,7 +597,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, #endif /* !linux */ #endif /* __mips__ */ -#elif (defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__) +#elif defined(__powerpc__) #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) @@ -859,60 +656,13 @@ xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset) } static __inline__ void -xf86WriteMmioNB8(__volatile__ void *base, const unsigned long offset, - const unsigned char val) +xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, + const unsigned char val) { __asm__ __volatile__("stbx %1,%2,%3\n\t":"=m" (*((volatile unsigned char *) base + offset)) :"r"(val), "b"(base), "r"(offset)); -} - -static __inline__ void -xf86WriteMmioNB16Le(__volatile__ void *base, const unsigned long offset, - const unsigned short val) -{ - __asm__ - __volatile__("sthbrx %1,%2,%3\n\t":"=m" - (*((volatile unsigned char *) base + offset)) - :"r"(val), "b"(base), "r"(offset)); -} - -static __inline__ void -xf86WriteMmioNB16Be(__volatile__ void *base, const unsigned long offset, - const unsigned short val) -{ - __asm__ - __volatile__("sthx %1,%2,%3\n\t":"=m" - (*((volatile unsigned char *) base + offset)) - :"r"(val), "b"(base), "r"(offset)); -} - -static __inline__ void -xf86WriteMmioNB32Le(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - __asm__ - __volatile__("stwbrx %1,%2,%3\n\t":"=m" - (*((volatile unsigned char *) base + offset)) - :"r"(val), "b"(base), "r"(offset)); -} - -static __inline__ void -xf86WriteMmioNB32Be(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - __asm__ - __volatile__("stwx %1,%2,%3\n\t":"=m" - (*((volatile unsigned char *) base + offset)) - :"r"(val), "b"(base), "r"(offset)); -} - -static __inline__ void -xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, - const unsigned char val) -{ - xf86WriteMmioNB8(base, offset, val); eieio(); } @@ -920,7 +670,10 @@ static __inline__ void xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset, const unsigned short val) { - xf86WriteMmioNB16Le(base, offset, val); + __asm__ + __volatile__("sthbrx %1,%2,%3\n\t":"=m" + (*((volatile unsigned char *) base + offset)) + :"r"(val), "b"(base), "r"(offset)); eieio(); } @@ -928,7 +681,10 @@ static __inline__ void xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset, const unsigned short val) { - xf86WriteMmioNB16Be(base, offset, val); + __asm__ + __volatile__("sthx %1,%2,%3\n\t":"=m" + (*((volatile unsigned char *) base + offset)) + :"r"(val), "b"(base), "r"(offset)); eieio(); } @@ -936,7 +692,10 @@ static __inline__ void xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset, const unsigned int val) { - xf86WriteMmioNB32Le(base, offset, val); + __asm__ + __volatile__("stwbrx %1,%2,%3\n\t":"=m" + (*((volatile unsigned char *) base + offset)) + :"r"(val), "b"(base), "r"(offset)); eieio(); } @@ -944,7 +703,10 @@ static __inline__ void xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, const unsigned int val) { - xf86WriteMmioNB32Be(base, offset, val); + __asm__ + __volatile__("stwx %1,%2,%3\n\t":"=m" + (*((volatile unsigned char *) base + offset)) + :"r"(val), "b"(base), "r"(offset)); eieio(); } @@ -1030,12 +792,9 @@ xf_outl(unsigned short port, unsigned int val) /* * Assume all port access are aligned. We need to revise this implementation - * if there is unaligned port access. For ldq_u, ldl_u, ldw_u, stq_u, stl_u and - * stw_u, they are assumed unaligned. + * if there is unaligned port access. */ -#define barrier() /* no barrier */ - #define PORT_SIZE long static __inline__ unsigned char @@ -1052,13 +811,6 @@ xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, barrier(); } -static __inline__ void -xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - *(volatile unsigned char *) ((unsigned char *) base + offset) = val; -} - static __inline__ unsigned short xf86ReadMmio16Swap(__volatile__ void *base, const unsigned long offset) { @@ -1097,23 +849,6 @@ xf86WriteMmio16(__volatile__ void *base, const unsigned long offset, barrier(); } -static __inline__ void -xf86WriteMmio16SwapNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("wsbh %0, %0;\n\t" "shi %0, [%1];\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -xf86WriteMmio16NB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - *(volatile unsigned short *) ((unsigned char *) base + offset) = val; -} - static __inline__ unsigned int xf86ReadMmio32Swap(__volatile__ void *base, const unsigned long offset) { @@ -1153,23 +888,6 @@ xf86WriteMmio32(__volatile__ void *base, const unsigned long offset, barrier(); } -static __inline__ void -xf86WriteMmio32SwapNB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - unsigned long addr = ((unsigned long) base) + offset; - - __asm__ __volatile__("wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t" "swi %0, [%1];\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -xf86WriteMmio32NB(__volatile__ void *base, const unsigned long offset, - const unsigned int val) -{ - *(volatile unsigned int *) ((unsigned char *) base + offset) = val; -} - #if defined(NDS32_MMIO_SWAP) static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) @@ -1207,50 +925,6 @@ inl(unsigned PORT_SIZE port) return xf86ReadMmio32Swap(IOPortBase, port); } -static __inline__ unsigned long -ldq_u(unsigned long *p) -{ - unsigned long addr = (unsigned long) p; - unsigned int ret; - - __asm__ __volatile__("lmw.bi %0, [%1], %0, 0;\n\t" - "wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t":"=r"(ret) - :"r"(addr)); - - return ret; -} - -static __inline__ unsigned long -ldl_u(unsigned int *p) -{ - unsigned long addr = (unsigned long) p; - unsigned int ret; - - __asm__ __volatile__("lmw.bi %0, [%1], %0, 0;\n\t" - "wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t":"=r"(ret) - :"r"(addr)); - - return ret; -} - -static __inline__ void -stq_u(unsigned long val, unsigned long *p) -{ - unsigned long addr = (unsigned long) p; - - __asm__ __volatile__("wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t" "smw.bi %0, [%1], %0, 0;\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -stl_u(unsigned long val, unsigned int *p) -{ - unsigned long addr = (unsigned long) p; - - __asm__ __volatile__("wsbh %0, %0;\n\t" "rotri %0, %0, 16;\n\t" "smw.bi %0, [%1], %0, 0;\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} - #else /* !NDS32_MMIO_SWAP */ static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) @@ -1291,124 +965,9 @@ inl(unsigned PORT_SIZE port) return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port))); } -static __inline__ unsigned long -ldq_u(unsigned long *p) -{ - unsigned long addr = (unsigned long) p; - unsigned int ret; - - __asm__ __volatile__("lmw.bi %0, [%1], %0, 0;\n\t":"=r"(ret) - :"r"(addr)); - - return ret; -} - -static __inline__ unsigned long -ldl_u(unsigned int *p) -{ - unsigned long addr = (unsigned long) p; - unsigned int ret; - - __asm__ __volatile__("lmw.bi %0, [%1], %0, 0;\n\t":"=r"(ret) - :"r"(addr)); - - return ret; -} - -static __inline__ void -stq_u(unsigned long val, unsigned long *p) -{ - unsigned long addr = (unsigned long) p; - - __asm__ __volatile__("smw.bi %0, [%1], %0, 0;\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} - -static __inline__ void -stl_u(unsigned long val, unsigned int *p) -{ - unsigned long addr = (unsigned long) p; - - __asm__ __volatile__("smw.bi %0, [%1], %0, 0;\n\t": /* No outputs */ - :"r"(val), "r"(addr)); -} #endif /* NDS32_MMIO_SWAP */ -#if (((X_BYTE_ORDER == X_BIG_ENDIAN) && !defined(NDS32_MMIO_SWAP)) || ((X_BYTE_ORDER != X_BIG_ENDIAN) && defined(NDS32_MMIO_SWAP))) -#define ldw_u(p) ((*(unsigned char *)(p)) << 8 | \ - (*((unsigned char *)(p)+1))) -#define stw_u(v,p) (*(unsigned char *)(p)) = ((v) >> 8); \ - (*((unsigned char *)(p)+1)) = (v) -#else -#define ldw_u(p) ((*(unsigned char *)(p)) | \ - (*((unsigned char *)(p)+1)<<8)) -#define stw_u(v,p) (*(unsigned char *)(p)) = (v); \ - (*((unsigned char *)(p)+1)) = ((v) >> 8) -#endif - -#define mem_barrier() /* XXX: nop for now */ -#define write_mem_barrier() /* XXX: nop for now */ - -#else /* ix86 */ - -#if !defined(__SUNPRO_C) -#if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && \ - !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && \ - !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__) && \ - !defined(__xtensa__) -#ifdef GCCUSESGAS - -/* - * If gcc uses gas rather than the native assembler, the syntax of these - * inlines has to be different. DHD - */ - -static __inline__ void -outb(unsigned short port, unsigned char val) -{ - __asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port)); -} - -static __inline__ void -outw(unsigned short port, unsigned short val) -{ - __asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port)); -} - -static __inline__ void -outl(unsigned short port, unsigned int val) -{ - __asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port)); -} - -static __inline__ unsigned int -inb(unsigned short port) -{ - unsigned char ret; - __asm__ __volatile__("inb %1,%0":"=a"(ret):"d"(port)); - - return ret; -} - -static __inline__ unsigned int -inw(unsigned short port) -{ - unsigned short ret; - __asm__ __volatile__("inw %1,%0":"=a"(ret):"d"(port)); - - return ret; -} - -static __inline__ unsigned int -inl(unsigned short port) -{ - unsigned int ret; - __asm__ __volatile__("inl %1,%0":"=a"(ret):"d"(port)); - - return ret; -} - -#else /* GCCUSESGAS */ +#elif defined(__i386__) || defined(__ia64__) static __inline__ void outb(unsigned short port, unsigned char val) @@ -1455,47 +1014,7 @@ inl(unsigned short port) return ret; } -#endif /* GCCUSESGAS */ - -#else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__m32r__) && !defined(__arc__) */ - -static __inline__ void -outb(unsigned short port, unsigned char val) -{ -} - -static __inline__ void -outw(unsigned short port, unsigned short val) -{ -} - -static __inline__ void -outl(unsigned short port, unsigned int val) -{ -} - -static __inline__ unsigned int -inb(unsigned short port) -{ - return 0; -} - -static __inline__ unsigned int -inw(unsigned short port) -{ - return 0; -} - -static __inline__ unsigned int -inl(unsigned short port) -{ - return 0; -} - -#endif /* FAKEIT */ -#endif /* __SUNPRO_C */ - -#endif /* ix86 */ +#endif /* arch madness */ #else /* !GNUC */ #if defined(__STDC__) && (__STDC__ == 1) @@ -1506,18 +1025,12 @@ inl(unsigned short port) #if !defined(__SUNPRO_C) #include #endif -#if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \ - defined(__USLC__) -#pragma asm partial_optimization outl -#pragma asm partial_optimization outw -#pragma asm partial_optimization outb -#pragma asm partial_optimization inl -#pragma asm partial_optimization inw -#pragma asm partial_optimization inb -#endif #endif /* __GNUC__ */ -#endif /* NO_INLINE */ +#if !defined(MMIO_IS_BE) && \ + (defined(SPARC_MMIO_IS_BE) || defined(PPC_MMIO_IS_BE)) +#define MMIO_IS_BE +#endif #ifdef __alpha__ /* entry points for Mmio memory access routines */ @@ -1538,9 +1051,6 @@ xf86ReadMmio32(void *Base, unsigned long Offset) 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); -extern _X_EXPORT void (*xf86WriteMmioNB8) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmioNB16) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmioNB32) (int, void *, unsigned long); extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); @@ -1560,43 +1070,29 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); write_mem_barrier(); \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ } while (0) -#define MMIO_ONB32(base, offset, val) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) #define MMIO_OUT8(base, offset, val) \ (*xf86WriteMmio8)((CARD8)(val), base, offset) #define MMIO_OUT16(base, offset, val) \ (*xf86WriteMmio16)((CARD16)(val), base, offset) -#define MMIO_ONB8(base, offset, val) \ - (*xf86WriteMmioNB8)((CARD8)(val), base, offset) -#define MMIO_ONB16(base, offset, val) \ - (*xf86WriteMmioNB16)((CARD16)(val), base, offset) -#define MMIO_MOVE32(base, offset, val) \ - MMIO_OUT32(base, offset, val) -#elif defined(__powerpc__) - /* +#elif defined(__powerpc__) || defined(__sparc__) + /* * we provide byteswapping and no byteswapping functions here - * with byteswapping as default, - * drivers that don't need byteswapping should define PPC_MMIO_IS_BE + * with byteswapping as default, + * drivers that don't need byteswapping should define MMIO_IS_BE */ #define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) #define MMIO_OUT8(base, offset, val) \ xf86WriteMmio8(base, offset, (CARD8)(val)) -#define MMIO_ONB8(base, offset, val) \ - xf86WriteMmioNB8(base, offset, (CARD8)(val)) -#if defined(PPC_MMIO_IS_BE) /* No byteswapping */ +#if defined(MMIO_IS_BE) /* No byteswapping */ #define MMIO_IN16(base, offset) xf86ReadMmio16Be(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32Be(base, offset) #define MMIO_OUT16(base, offset, val) \ xf86WriteMmio16Be(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Be(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmioNB16Be(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmioNB32Be(base, offset, (CARD32)(val)) #else /* byteswapping is the default */ #define MMIO_IN16(base, offset) xf86ReadMmio16Le(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32Le(base, offset) @@ -1604,56 +1100,8 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); xf86WriteMmio16Le(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Le(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmioNB16Le(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmioNB32Le(base, offset, (CARD32)(val)) #endif -#define MMIO_MOVE32(base, offset, val) \ - xf86WriteMmio32Be(base, offset, (CARD32)(val)) - -#elif defined(__sparc__) || defined(sparc) || defined(__sparc) - /* - * Like powerpc, we provide byteswapping and no byteswapping functions - * here with byteswapping as default, drivers that don't need byteswapping - * should define SPARC_MMIO_IS_BE (perhaps create a generic macro so that we - * do not need to use PPC_MMIO_IS_BE and the sparc one in all the same places - * of drivers?). - */ -#define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) -#define MMIO_OUT8(base, offset, val) \ - xf86WriteMmio8(base, offset, (CARD8)(val)) -#define MMIO_ONB8(base, offset, val) \ - xf86WriteMmio8NB(base, offset, (CARD8)(val)) - -#if defined(SPARC_MMIO_IS_BE) /* No byteswapping */ -#define MMIO_IN16(base, offset) xf86ReadMmio16Be(base, offset) -#define MMIO_IN32(base, offset) xf86ReadMmio32Be(base, offset) -#define MMIO_OUT16(base, offset, val) \ - xf86WriteMmio16Be(base, offset, (CARD16)(val)) -#define MMIO_OUT32(base, offset, val) \ - xf86WriteMmio32Be(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmio16BeNB(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmio32BeNB(base, offset, (CARD32)(val)) -#else /* byteswapping is the default */ -#define MMIO_IN16(base, offset) xf86ReadMmio16Le(base, offset) -#define MMIO_IN32(base, offset) xf86ReadMmio32Le(base, offset) -#define MMIO_OUT16(base, offset, val) \ - xf86WriteMmio16Le(base, offset, (CARD16)(val)) -#define MMIO_OUT32(base, offset, val) \ - xf86WriteMmio32Le(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmio16LeNB(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmio32LeNB(base, offset, (CARD32)(val)) -#endif - -#define MMIO_MOVE32(base, offset, val) \ - xf86WriteMmio32Be(base, offset, (CARD32)(val)) - #elif defined(__nds32__) /* * we provide byteswapping and no byteswapping functions here @@ -1664,8 +1112,6 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); #define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) #define MMIO_OUT8(base, offset, val) \ xf86WriteMmio8(base, offset, (CARD8)(val)) -#define MMIO_ONB8(base, offset, val) \ - xf86WriteMmioNB8(base, offset, (CARD8)(val)) #if defined(NDS32_MMIO_SWAP) /* byteswapping */ #define MMIO_IN16(base, offset) xf86ReadMmio16Swap(base, offset) @@ -1674,10 +1120,6 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); xf86WriteMmio16Swap(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32Swap(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmioNB16Swap(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmioNB32Swap(base, offset, (CARD32)(val)) #else /* no byteswapping is the default */ #define MMIO_IN16(base, offset) xf86ReadMmio16(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) @@ -1685,30 +1127,6 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); xf86WriteMmio16(base, offset, (CARD16)(val)) #define MMIO_OUT32(base, offset, val) \ xf86WriteMmio32(base, offset, (CARD32)(val)) -#define MMIO_ONB16(base, offset, val) \ - xf86WriteMmioNB16(base, offset, (CARD16)(val)) -#define MMIO_ONB32(base, offset, val) \ - xf86WriteMmioNB32(base, offset, (CARD32)(val)) -#endif - -#define MMIO_MOVE32(base, offset, val) \ - xf86WriteMmio32(base, offset, (CARD32)(val)) - -#ifdef N1213_HC /* for NDS32 N1213 hardcore */ -static __inline__ void -nds32_flush_icache(char *addr) -{ - __asm__ volatile ("isync %0;" - "msync;" - "isb;" - "cctl %0,L1I_VA_INVAL;" "isb;"::"r" (addr):"memory"); -} -#else -static __inline__ void -nds32_flush_icache(char *addr) -{ - __asm__ volatile ("isync %0;" "isb;"::"r" (addr):"memory"); -} #endif #else /* !__alpha__ && !__powerpc__ && !__sparc__ */ @@ -1725,11 +1143,6 @@ nds32_flush_icache(char *addr) *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val) #define MMIO_OUT32(base, offset, val) \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) -#define MMIO_ONB8(base, offset, val) MMIO_OUT8(base, offset, val) -#define MMIO_ONB16(base, offset, val) MMIO_OUT16(base, offset, val) -#define MMIO_ONB32(base, offset, val) MMIO_OUT32(base, offset, val) - -#define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val) #endif /* __alpha__ */ diff --git a/xserver/hw/xfree86/common/xf86.h b/xserver/hw/xfree86/common/xf86.h index cec31354e..49ff35b86 100644 --- a/xserver/hw/xfree86/common/xf86.h +++ b/xserver/hw/xfree86/common/xf86.h @@ -129,14 +129,6 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, EntityProc enter, EntityProc leave, void *private); -/* Obsolete! don't use */ -extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, - int entityIndex, - PciChipsets * p_chip, - void *dummy, EntityProc init, - EntityProc enter, - EntityProc leave, - void *private); #else #define xf86VGAarbiterInit() do {} while (0) #define xf86VGAarbiterFini() do {} while (0) diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c index ef74ba2d5..b0e036058 100644 --- a/xserver/hw/xfree86/common/xf86AutoConfig.c +++ b/xserver/hw/xfree86/common/xf86AutoConfig.c @@ -9,10 +9,10 @@ * 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 @@ -20,12 +20,12 @@ * 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). - * + * * Author: David Dawes . */ @@ -208,7 +208,6 @@ listPossibleVideoDrivers(char *matches[], int nmatches) if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { struct vis_identifier visid; const char *cp; - extern char xf86SolarisFbDev[PATH_MAX]; int iret; SYSCALL(iret = ioctl(xf86Info.consoleFd, VIS_GETIDENTIFIER, &visid)); diff --git a/xserver/hw/xfree86/common/xf86Bus.c b/xserver/hw/xfree86/common/xf86Bus.c index 9289744a3..ad255aeed 100644 --- a/xserver/hw/xfree86/common/xf86Bus.c +++ b/xserver/hw/xfree86/common/xf86Bus.c @@ -519,7 +519,7 @@ xf86GetDevFromEntity(int entityIndex, int instance) } /* - * xf86AccessEnter() -- gets called to save the text mode VGA IO + * xf86AccessEnter() -- gets called to save the text mode VGA IO * resources when reentering the server after a VT switch. */ void diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c index 89ba2c1b0..e6ac49a48 100644 --- a/xserver/hw/xfree86/common/xf86Config.c +++ b/xserver/hw/xfree86/common/xf86Config.c @@ -274,7 +274,7 @@ xf86ModulelistFromConfig(void ***optlist) if (xf86configptr->conf_modules) { /* Walk the disable list and let people know what we've parsed to - * not be loaded + * not be loaded */ modp = xf86configptr->conf_modules->mod_disable_lst; while (modp) { @@ -570,25 +570,6 @@ xf86DriverlistFromCompile(void) return driverlist; } -/* - * xf86ConfigError -- - * Print a READABLE ErrorMessage!!! All information that is - * available is printed. - */ -static void -_X_ATTRIBUTE_PRINTF(1, 2) -xf86ConfigError(const char *msg, ...) -{ - va_list ap; - - ErrorF("\nConfig Error:\n"); - va_start(ap, msg); - VErrorF(msg, ap); - va_end(ap); - ErrorF("\n"); - return; -} - static void configFiles(XF86ConfFilesPtr fileconf) { @@ -778,7 +759,7 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, }; -static Bool +static void configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) { XF86OptionPtr optp, tmp; @@ -892,12 +873,10 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) { if (!xf86NameCmp(s, "flush")) { xf86Msg(X_CONFIG, "Flushing logfile enabled\n"); - xf86Info.log = LogFlush; LogSetParameter(XLOG_FLUSH, TRUE); } else if (!xf86NameCmp(s, "sync")) { xf86Msg(X_CONFIG, "Syncing logfile enabled\n"); - xf86Info.log = LogSync; LogSetParameter(XLOG_FLUSH, TRUE); LogSetParameter(XLOG_SYNC, TRUE); } @@ -979,10 +958,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) XkbFreeRMLVOSet(&set, FALSE); xf86Info.useDefaultFontPath = TRUE; - xf86Info.useDefaultFontPathFrom = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { xf86Info.useDefaultFontPath = value; - xf86Info.useDefaultFontPathFrom = X_CONFIG; } /* Make sure that timers don't overflow CARD32's after multiplying */ @@ -993,9 +970,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if ((i >= 0) && (i < MAX_TIME_IN_MIN)) ScreenSaverTime = defaultScreenSaverTime = i * MILLI_PER_MIN; else if (i != -1) - xf86ConfigError - ("BlankTime value %d outside legal range of 0 - %d minutes", i, - MAX_TIME_IN_MIN); + ErrorF("BlankTime value %d outside legal range of 0 - %d minutes\n", + i, MAX_TIME_IN_MIN); #ifdef DPMSExtension i = -1; @@ -1003,25 +979,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSStandbyTime = i * MILLI_PER_MIN; else if (i != -1) - xf86ConfigError - ("StandbyTime value %d outside legal range of 0 - %d minutes", i, - MAX_TIME_IN_MIN); + ErrorF("StandbyTime value %d outside legal range of 0 - %d minutes\n", + i, MAX_TIME_IN_MIN); i = -1; xf86GetOptValInteger(FlagOptions, FLAG_DPMS_SUSPENDTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSSuspendTime = i * MILLI_PER_MIN; else if (i != -1) - xf86ConfigError - ("SuspendTime value %d outside legal range of 0 - %d minutes", i, - MAX_TIME_IN_MIN); + ErrorF("SuspendTime value %d outside legal range of 0 - %d minutes\n", + i, MAX_TIME_IN_MIN); i = -1; xf86GetOptValInteger(FlagOptions, FLAG_DPMS_OFFTIME, &i); if ((i >= 0) && (i < MAX_TIME_IN_MIN)) DPMSOffTime = i * MILLI_PER_MIN; else if (i != -1) - xf86ConfigError - ("OffTime value %d outside legal range of 0 - %d minutes", i, - MAX_TIME_IN_MIN); + ErrorF("OffTime value %d outside legal range of 0 - %d minutes\n", + i, MAX_TIME_IN_MIN); #endif i = -1; @@ -1036,8 +1009,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) case -1: break; default: - xf86ConfigError("Pixmap option's value (%d) must be 24 or 32\n", i); - return FALSE; + ErrorF("Pixmap option's value (%d) must be 24 or 32\n", i); + break; } if (xf86Pix24 != Pix24DontCare) { xf86Info.pixmap24 = xf86Pix24; @@ -1072,8 +1045,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.dri2From = X_CONFIG; } #endif - - return TRUE; } Bool @@ -1969,7 +1940,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) /* now add the modes found in the modes section to the list of modes for this monitor unless it has been added before - because we are reusing the same section + because we are reusing the same section for another screen */ if (xf86itemNotSublist((GenericListPtr) conf_monitor->mon_modeline_lst, (GenericListPtr) modes->mon_modeline_lst)) { @@ -2048,8 +2019,8 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) badgamma = monitorp->gamma.blue; } if (badgamma > GAMMA_ZERO) { - xf86ConfigError("Gamma value %.f is out of range (%.2f - %.1f)\n", - badgamma, GAMMA_MIN, GAMMA_MAX); + ErrorF("Gamma value %.f is out of range (%.2f - %.1f)\n", badgamma, + GAMMA_MIN, GAMMA_MAX); return FALSE; } @@ -2108,8 +2079,7 @@ configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display) if (conf_display->disp_visual) { displayp->defaultVisual = lookupVisual(conf_display->disp_visual); if (displayp->defaultVisual == -1) { - xf86ConfigError("Invalid visual name: \"%s\"", - conf_display->disp_visual); + ErrorF("Invalid visual name: \"%s\"\n", conf_display->disp_visual); return FALSE; } } @@ -2167,7 +2137,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) devicep->IOBase = conf_device->dev_io_base; devicep->clockchip = conf_device->dev_clockchip; devicep->busID = conf_device->dev_busid; - devicep->textClockFreq = conf_device->dev_textclockfreq; devicep->chipID = conf_device->dev_chipid; devicep->chipRev = conf_device->dev_chiprev; devicep->options = conf_device->dev_option_lst; @@ -2502,11 +2471,7 @@ xf86HandleConfigFile(Bool autoconfig) } #endif /* Now process everything else */ - if (!configServerFlags(xf86configptr->conf_flags, xf86ConfigLayout.options)) { - ErrorF("Problem when converting the config data structures\n"); - return CONFIG_PARSE_ERROR; - } - + configServerFlags(xf86configptr->conf_flags, xf86ConfigLayout.options); configFiles(xf86configptr->conf_files); configExtensions(xf86configptr->conf_extensions); #ifdef XF86DRI diff --git a/xserver/hw/xfree86/common/xf86Configure.c b/xserver/hw/xfree86/common/xf86Configure.c index e5412ac3a..f37f22445 100644 --- a/xserver/hw/xfree86/common/xf86Configure.c +++ b/xserver/hw/xfree86/common/xf86Configure.c @@ -267,7 +267,6 @@ configureDeviceSection(int screennum) for (i = 0; (i < MAXDACSPEEDS) && (i < CONF_MAXDACSPEEDS); i++) ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i]; ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam; - ptr->dev_textclockfreq = DevToConfig[screennum].GDev.textClockFreq; ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase; ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase; ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase; @@ -680,8 +679,8 @@ DoConfigure(void) if (primary) continue; /* not primary: assign it to next device of same driver */ - /* - * NOTE: we assume that devices in DevToConfig + /* + * NOTE: we assume that devices in DevToConfig * and xf86Screens[] have the same order except * for the primary device which always comes first. */ diff --git a/xserver/hw/xfree86/common/xf86Cursor.c b/xserver/hw/xfree86/common/xf86Cursor.c index 7d0776eaa..92c08af9e 100644 --- a/xserver/hw/xfree86/common/xf86Cursor.c +++ b/xserver/hw/xfree86/common/xf86Cursor.c @@ -37,8 +37,6 @@ #include "scrnintstr.h" #include "globals.h" -#include "compiler.h" - #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSproc.h" @@ -76,8 +74,6 @@ static miPointerScreenFuncRec xf86PointerScreenFuncs = { static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS]; -static Bool HardEdges; - /* * xf86InitViewport -- * Initialize paning & zooming parameters, so that a driver must only @@ -431,16 +427,6 @@ xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y) } } -#if 0 - /* This presents problems for overlapping screens when - HardEdges is used. Have to think about the logic more */ - if ((*x < 0) || (*x >= (*pScreen)->width) || - (*y < 0) || (*y >= (*pScreen)->height)) { - /* We may have crossed more than one screen */ - xf86CursorOffScreen(pScreen, x, y); - } -#endif - return TRUE; } @@ -584,9 +570,6 @@ xf86InitOrigins(void) xf86ScreenLayoutPtr pLayout; Bool OldStyleConfig = FALSE; - /* need to have this set up with a config file option */ - HardEdges = FALSE; - memset(xf86ScreenLayout, 0, MAXSCREENS * sizeof(xf86ScreenLayoutRec)); screensLeft = prevScreensLeft = (1 << xf86NumScreens) - 1; @@ -838,7 +821,7 @@ xf86InitOrigins(void) } } - if (!HardEdges && !OldStyleConfig) { + if (!OldStyleConfig) { for (i = 0; i < xf86NumScreens; i++) { pLayout = &xf86ScreenLayout[i]; pScreen = xf86Screens[i]->pScreen; diff --git a/xserver/hw/xfree86/common/xf86Events.c b/xserver/hw/xfree86/common/xf86Events.c index 35a673d15..2b84d8669 100644 --- a/xserver/hw/xfree86/common/xf86Events.c +++ b/xserver/hw/xfree86/common/xf86Events.c @@ -58,7 +58,6 @@ #include #include #include "misc.h" -#include "compiler.h" #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS @@ -584,10 +583,11 @@ xf86VTEnter(void) /* Turn screen saver off when switching back */ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - /* If we use systemd-logind it will enable input devices for us */ - if (!systemd_logind_controls_session()) - for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) + for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) { + /* Devices with server managed fds get enabled on logind resume */ + if (!(pInfo->flags & XI86_SERVER_FD)) xf86EnableInputDeviceForVTSwitch(pInfo); + } for (ih = InputHandlers; ih; ih = ih->next) { if (ih->is_input) diff --git a/xserver/hw/xfree86/common/xf86Globals.c b/xserver/hw/xfree86/common/xf86Globals.c index 984c39bca..93a35b80e 100644 --- a/xserver/hw/xfree86/common/xf86Globals.c +++ b/xserver/hw/xfree86/common/xf86Globals.c @@ -120,7 +120,6 @@ xf86InfoRec xf86Info = { .pixmap24 = Pix24DontCare, .pix24From = X_DEFAULT, .pmFlag = TRUE, - .log = LogNone, .disableRandR = FALSE, .randRFrom = X_DEFAULT, #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index bb5d8256c..a05e3f713 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -56,8 +56,6 @@ #include "dbus-core.h" #include "systemd-logind.h" -#include "compiler.h" - #include "loaderProcs.h" #ifdef XFreeXDGA #include "dgaproc.h" @@ -239,12 +237,6 @@ xf86PrintBanner(void) "\tto make sure that you have the latest version.\n"); } -static void -xf86PrintMarkers(void) -{ - LogPrintMarkers(); -} - Bool xf86PrivsElevated(void) { @@ -320,14 +312,6 @@ xf86CreateRootWindow(WindowPtr pWin) DebugF("xf86CreateRootWindow(%p)\n", pWin); - if (pScreen->CreateWindow != xf86CreateRootWindow) { - /* Can't find hook we are hung on */ - xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */ , - "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n", - (void *) xf86CreateRootWindow, - (void *) pScreen->CreateWindow); - } - /* Unhook this function ... */ pScreen->CreateWindow = create_window; dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); @@ -355,15 +339,8 @@ xf86CreateRootWindow(WindowPtr pWin) ret &= (err == Success); } - else { - xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " - "non-root window %p (parent %p)\n", - (void *) pWin, (void *) pWin->parent); - ret = FALSE; - } } - DebugF("xf86CreateRootWindow() returns %d\n", ret); return ret; } @@ -427,7 +404,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) xf86ServerName = argv[0]; xf86PrintBanner(); - xf86PrintMarkers(); + LogPrintMarkers(); if (xf86LogFile) { time_t t; const char *ct; diff --git a/xserver/hw/xfree86/common/xf86Mode.c b/xserver/hw/xfree86/common/xf86Mode.c index 44bc55953..9a5550faf 100644 --- a/xserver/hw/xfree86/common/xf86Mode.c +++ b/xserver/hw/xfree86/common/xf86Mode.c @@ -1878,8 +1878,8 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, const int ntypes = sizeof(types) / sizeof(int); int n; - /* - * We did not find the estimated virtual size. So now we want to + /* + * We did not find the estimated virtual size. So now we want to * find the largest mode available, but we want to search in the * modes in the order of "types" listed above. */ @@ -2033,8 +2033,8 @@ xf86PruneDriverModes(ScrnInfoPtr scrp) /* * A modePool mode's prev field is used to hold a pointer to the * member of the scrp->modes list for which a match was considered. - * Clear that pointer first, otherwise xf86DeleteMode might get - * confused + * Clear that pointer first, otherwise xf86DeleteMode might get + * confused */ scrp->modePool->prev = NULL; xf86DeleteMode(&scrp->modePool, scrp->modePool); diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h index b848f53f1..e68fe9cba 100644 --- a/xserver/hw/xfree86/common/xf86Module.h +++ b/xserver/hw/xfree86/common/xf86Module.h @@ -80,9 +80,9 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(18, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(8, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 diff --git a/xserver/hw/xfree86/common/xf86PciInfo.h b/xserver/hw/xfree86/common/xf86PciInfo.h index d6450e25c..0f5430868 100644 --- a/xserver/hw/xfree86/common/xf86PciInfo.h +++ b/xserver/hw/xfree86/common/xf86PciInfo.h @@ -40,7 +40,7 @@ * or for non-video devices unless they're needed by a driver or elsewhere. * A comprehensive set of PCI vendor, device and subsystem data is * auto-generated from the ../etc/pci.ids file using the pciids2c.pl script, - * and is used in scanpci utility. Don't modify the pci.ids file. If + * and is used in scanpci utility. Don't modify the pci.ids file. If * new/corrected entries are required, add them to ../etc/extrapci.ids. */ diff --git a/xserver/hw/xfree86/common/xf86Privstr.h b/xserver/hw/xfree86/common/xf86Privstr.h index 410ef17ac..cffa14d01 100644 --- a/xserver/hw/xfree86/common/xf86Privstr.h +++ b/xserver/hw/xfree86/common/xf86Privstr.h @@ -36,12 +36,6 @@ #include "xf86str.h" -typedef enum { - LogNone, - LogFlush, - LogSync -} Log; - typedef enum { XF86_GlxVisualsMinimal, XF86_GlxVisualsTypical, @@ -91,7 +85,6 @@ typedef struct { Pix24Flags pixmap24; MessageType pix24From; Bool pmFlag; - Log log; Bool disableRandR; MessageType randRFrom; Bool aiglx; @@ -100,7 +93,6 @@ typedef struct { MessageType glxVisualsFrom; Bool useDefaultFontPath; - MessageType useDefaultFontPathFrom; Bool ignoreABI; Bool forceInputDevices; /* force xorg.conf or built-in input devices */ diff --git a/xserver/hw/xfree86/common/xf86RandR.c b/xserver/hw/xfree86/common/xf86RandR.c index 2418731dc..08f656b30 100644 --- a/xserver/hw/xfree86/common/xf86RandR.c +++ b/xserver/hw/xfree86/common/xf86RandR.c @@ -37,7 +37,6 @@ #include "inputstr.h" typedef struct _xf86RandRInfo { - CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; int virtualX; int virtualY; @@ -335,34 +334,6 @@ xf86RandRSetConfig(ScreenPtr pScreen, return TRUE; } -/* - * Wait until the screen is initialized before whacking the - * sizes around; otherwise the screen pixmap will be allocated - * at the current mode size rather than the maximum size - */ -static Bool -xf86RandRCreateScreenResources(ScreenPtr pScreen) -{ - XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - -#if 0 - ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); - DisplayModePtr mode; -#endif - - pScreen->CreateScreenResources = randrp->CreateScreenResources; - if (!(*pScreen->CreateScreenResources) (pScreen)) - return FALSE; - -#if 0 - mode = scrp->currentMode; - if (mode) - xf86RandRSetMode(pScreen, mode, TRUE); -#endif - - return TRUE; -} - /* * Reset size back to original */ @@ -463,9 +434,6 @@ xf86RandRInit(ScreenPtr pScreen) randrp->mmWidth = pScreen->mmWidth; randrp->mmHeight = pScreen->mmHeight; - randrp->CreateScreenResources = pScreen->CreateScreenResources; - pScreen->CreateScreenResources = xf86RandRCreateScreenResources; - randrp->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86RandRCloseScreen; diff --git a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h index ec21bc2f2..b832c9a5f 100644 --- a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -49,10 +49,14 @@ #define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x -#define SCREEN_PROLOG(x) pScreen->x = ((VGAarbiterScreenPtr) \ - dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey))->x +#define SCREEN_PRIV() ((VGAarbiterScreenPtr) dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey)) -#define SCREEN_EPILOG(x,y) pScreen->x = y; +#define SCREEN_PROLOG(x) (pScreen->x = SCREEN_PRIV()->x) + +#define SCREEN_EPILOG(x,y) do { \ + SCREEN_PRIV()->x = pScreen->x; \ + pScreen->x = y; \ + } while (0) #define WRAP_PICT(x,y) if (ps) {pScreenPriv->x = ps->x;\ ps->x = y;} diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c index 4e8060b0f..1fb5b1635 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.c +++ b/xserver/hw/xfree86/common/xf86Xinput.c @@ -1,6 +1,6 @@ /* * Copyright 1995-1999 by Frederic Lepied, France. - * + * * 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 @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -315,7 +315,7 @@ ApplyTransformationMatrix(DeviceIntPtr dev) /*********************************************************************** * * xf86ProcessCommonOptions -- - * + * * Process global options. * *********************************************************************** @@ -1077,7 +1077,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) OsReleaseSignals(); } -/* +/* * convenient functions to post events */ @@ -1401,7 +1401,7 @@ xf86FirstLocalDevice(void) return xf86InputDevs; } -/* +/* * Cx - raw data from touch screen * to_max - scaled highest dimension * (remember, this is of rows - 1 because of 0 origin) @@ -1475,7 +1475,7 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) * Device will be moved to the off_devices list, but it will still be there * until you really clean up after it. * Notifies the client about an inactive device. - * + * * @param panic True if device is unrecoverable and needs to be removed. */ void @@ -1493,7 +1493,7 @@ xf86DisableDevice(DeviceIntPtr dev, Bool panic) /** * Reactivate a device. Call this function from the driver if you just found * out that the read error wasn't quite that bad after all. - * Device will be re-activated, and an event sent to the client. + * Device will be re-activated, and an event sent to the client. */ void xf86EnableDevice(DeviceIntPtr dev) diff --git a/xserver/hw/xfree86/common/xf86Xinput.h b/xserver/hw/xfree86/common/xf86Xinput.h index ef9a117cb..42d66d22e 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.h +++ b/xserver/hw/xfree86/common/xf86Xinput.h @@ -1,6 +1,6 @@ /* * Copyright 1995-1999 by Frederic Lepied, France. - * + * * 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 @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -51,6 +51,7 @@ #ifndef _xf86Xinput_h #define _xf86Xinput_h +#include "xf86.h" #include "xf86str.h" #include "inputstr.h" #include diff --git a/xserver/hw/xfree86/common/xf86cmap.c b/xserver/hw/xfree86/common/xf86cmap.c index 3f9c88035..ab51f9603 100644 --- a/xserver/hw/xfree86/common/xf86cmap.c +++ b/xserver/hw/xfree86/common/xf86cmap.c @@ -74,7 +74,6 @@ typedef struct _CMapLink { } CMapLink, *CMapLinkPtr; typedef struct { - ScrnInfoPtr pScrn; CloseScreenProcPtr CloseScreen; CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; @@ -123,7 +122,7 @@ static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr); #endif static int CMapChangeGamma(ScrnInfoPtr, Gamma); -static void ComputeGamma(CMapScreenPtr); +static void ComputeGamma(ScrnInfoPtr, CMapScreenPtr); static Bool CMapAllocateColormapPrivate(ColormapPtr); static void CMapRefreshColors(ColormapPtr, int, int *); static void CMapSetOverscan(ColormapPtr, int, int *); @@ -194,7 +193,6 @@ xf86HandleColormaps(ScreenPtr pScreen, pScreen->InstallColormap = CMapInstallColormap; pScreen->StoreColors = CMapStoreColors; - pScreenPriv->pScrn = pScrn; pScrn->LoadPalette = loadPalette; pScrn->SetOverscan = setOverscan; pScreenPriv->maxColors = maxColors; @@ -221,7 +219,7 @@ xf86HandleColormaps(ScreenPtr pScreen, #endif pScrn->ChangeGamma = CMapChangeGamma; - ComputeGamma(pScreenPriv); + ComputeGamma(pScrn, pScreenPriv); /* get the default map */ dixLookupResourceByType((void **) &pDefMap, pScreen->defColormap, @@ -445,7 +443,7 @@ CMapInstallColormap(ColormapPtr pmap) (*pScreen->InstallColormap) (pmap); pScreen->InstallColormap = CMapInstallColormap; - /* Important. We let the lower layers, namely DGA, + /* Important. We let the lower layers, namely DGA, overwrite the choice of Colormap to install */ if (GetInstalledmiColormap(pmap->pScreen)) pmap = GetInstalledmiColormap(pmap->pScreen); @@ -660,8 +658,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int *indices) } if (LOAD_PALETTE(pmap)) - (*pScrn->LoadPalette) (pScreenPriv->pScrn, defs, indices, - colors, pmap->pVisual); + (*pScrn->LoadPalette) (pScrn, defs, indices, colors, pmap->pVisual); if (pScrn->SetOverscan) CMapSetOverscan(pmap, defs, indices); @@ -822,7 +819,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) #ifdef DEBUGOVERSCAN ErrorF("SetOverscan() called from CmapSetOverscan\n"); #endif - pScrn->SetOverscan(pScreenPriv->pScrn, overscan); + pScrn->SetOverscan(pScrn, overscan); } } } @@ -851,7 +848,7 @@ CMapUnwrapScreen(ScreenPtr pScreen) } static void -ComputeGamma(CMapScreenPtr priv) +ComputeGamma(ScrnInfoPtr pScrn, CMapScreenPtr priv) { int elements = priv->gammaElements - 1; double RedGamma, GreenGamma, BlueGamma; @@ -859,28 +856,25 @@ ComputeGamma(CMapScreenPtr priv) #ifndef DONT_CHECK_GAMMA /* This check is to catch drivers that are not initialising pScrn->gamma */ - if (priv->pScrn->gamma.red < GAMMA_MIN || - priv->pScrn->gamma.red > GAMMA_MAX || - priv->pScrn->gamma.green < GAMMA_MIN || - priv->pScrn->gamma.green > GAMMA_MAX || - priv->pScrn->gamma.blue < GAMMA_MIN || - priv->pScrn->gamma.blue > GAMMA_MAX) { + if (pScrn->gamma.red < GAMMA_MIN || pScrn->gamma.red > GAMMA_MAX || + pScrn->gamma.green < GAMMA_MIN || pScrn->gamma.green > GAMMA_MAX || + pScrn->gamma.blue < GAMMA_MIN || pScrn->gamma.blue > GAMMA_MAX) { - xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0, + xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0, "The %s driver didn't call xf86SetGamma() to initialise\n" - "\tthe gamma values.\n", priv->pScrn->driverName); - xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0, + "\tthe gamma values.\n", pScrn->driverName); + xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0, "PLEASE FIX THE `%s' DRIVER!\n", - priv->pScrn->driverName); - priv->pScrn->gamma.red = 1.0; - priv->pScrn->gamma.green = 1.0; - priv->pScrn->gamma.blue = 1.0; + pScrn->driverName); + pScrn->gamma.red = 1.0; + pScrn->gamma.green = 1.0; + pScrn->gamma.blue = 1.0; } #endif - RedGamma = 1.0 / (double) priv->pScrn->gamma.red; - GreenGamma = 1.0 / (double) priv->pScrn->gamma.green; - BlueGamma = 1.0 / (double) priv->pScrn->gamma.blue; + RedGamma = 1.0 / (double) pScrn->gamma.red; + GreenGamma = 1.0 / (double) pScrn->gamma.green; + BlueGamma = 1.0 / (double) pScrn->gamma.blue; for (i = 0; i <= elements; i++) { if (RedGamma == 1.0) @@ -933,7 +927,7 @@ CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) pScrn->gamma.green = gamma.green; pScrn->gamma.blue = gamma.blue; - ComputeGamma(pScreenPriv); + ComputeGamma(pScrn, pScreenPriv); /* mark all colormaps on this screen */ pLink = pScreenPriv->maps; @@ -964,7 +958,7 @@ CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) } if (pLink) { - /* need to trick CMapRefreshColors() into thinking + /* need to trick CMapRefreshColors() into thinking this is the currently installed map */ SetInstalledmiColormap(pScreen, pLink->cmap); CMapReinstallMap(pLink->cmap); diff --git a/xserver/hw/xfree86/common/xf86fbman.c b/xserver/hw/xfree86/common/xf86fbman.c index db715bd2f..1b2cb5704 100644 --- a/xserver/hw/xfree86/common/xf86fbman.c +++ b/xserver/hw/xfree86/common/xf86fbman.c @@ -38,7 +38,7 @@ #include "regionstr.h" #include "xf86fbman.h" -/* +/* #define DEBUG */ @@ -259,7 +259,7 @@ xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen) return (*funcs->PurgeOffscreenAreas) (pScreen); } -/************************************************************\ +/************************************************************\ Below is a specific implementation of an offscreen manager. @@ -1381,7 +1381,7 @@ xf86InitFBManagerLinear(ScreenPtr pScreen, int offset, int size) return TRUE; } -/* This is an implementation specific function and should +/* This is an implementation specific function and should disappear after the next release. People should use the real linear functions instead */ diff --git a/xserver/hw/xfree86/common/xf86pciBus.c b/xserver/hw/xfree86/common/xf86pciBus.c index c06b04033..e86ecb9d4 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.c +++ b/xserver/hw/xfree86/common/xf86pciBus.c @@ -1061,33 +1061,6 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, return pScrn; } -/* - * OBSOLETE ! xf86ConfigActivePciEntity() is an obsolete function. - * It is likely to be removed. Don't use! - */ -Bool -xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, - PciChipsets * p_chip, void *dummy, EntityProc init, - EntityProc enter, EntityProc leave, void *private) -{ - EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); - - if (!pEnt) - return FALSE; - - if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) { - free(pEnt); - return FALSE; - } - xf86AddEntityToScreen(pScrn, entityIndex); - - free(pEnt); - if (!xf86SetEntityFuncs(entityIndex, init, enter, leave, private)) - return FALSE; - - return TRUE; -} - int xf86VideoPtrToDriverList(struct pci_device *dev, char *returnList[], int returnListMax) @@ -1500,15 +1473,3 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, if (*chipset < 0) *chipset = (pVideo->vendor_id << 16) | pVideo->device_id; } - -struct pci_io_handle * -xf86MapLegacyIO(struct pci_device *dev) -{ - return pci_legacy_open_io(dev, 0, 64 * 1024); -} - -void -xf86UnmapLegacyIO(struct pci_device *dev, struct pci_io_handle *handle) -{ - pci_device_close_io(dev, handle); -} diff --git a/xserver/hw/xfree86/common/xf86platformBus.c b/xserver/hw/xfree86/common/xf86platformBus.c index c5417885d..c1aaba41a 100644 --- a/xserver/hw/xfree86/common/xf86platformBus.c +++ b/xserver/hw/xfree86/common/xf86platformBus.c @@ -77,7 +77,7 @@ xf86_remove_platform_device(int dev_index) { int j; - config_odev_free_attribute_list(xf86_platform_devices[dev_index].attribs); + config_odev_free_attributes(xf86_platform_devices[dev_index].attribs); for (j = dev_index; j < xf86_num_platform_devices - 1; j++) memcpy(&xf86_platform_devices[j], &xf86_platform_devices[j + 1], sizeof(struct xf86_platform_device)); @@ -85,44 +85,6 @@ xf86_remove_platform_device(int dev_index) return 0; } -Bool -xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_name) -{ - struct xf86_platform_device *device = &xf86_platform_devices[index]; - - return config_odev_add_attribute(device->attribs, attrib_id, attrib_name); -} - -Bool -xf86_add_platform_device_int_attrib(int index, int attrib_id, int attrib_value) -{ - return config_odev_add_int_attribute(xf86_platform_devices[index].attribs, attrib_id, attrib_value); -} - -char * -xf86_get_platform_attrib(int index, int attrib_id) -{ - return config_odev_get_attribute(xf86_platform_devices[index].attribs, attrib_id); -} - -char * -xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id) -{ - return config_odev_get_attribute(device->attribs, attrib_id); -} - -int -xf86_get_platform_int_attrib(int index, int attrib_id, int def) -{ - return config_odev_get_int_attribute(xf86_platform_devices[index].attribs, attrib_id, def); -} - -int -xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib_id, int def) -{ - return config_odev_get_int_attribute(device->attribs, attrib_id, def); -} - Bool xf86_get_platform_device_unowned(int index) { @@ -136,8 +98,8 @@ xf86_find_platform_device_by_devnum(int major, int minor) int i, attr_major, attr_minor; for (i = 0; i < xf86_num_platform_devices; i++) { - attr_major = xf86_get_platform_int_attrib(i, ODEV_ATTRIB_MAJOR, 0); - attr_minor = xf86_get_platform_int_attrib(i, ODEV_ATTRIB_MINOR, 0); + attr_major = xf86_platform_odev_attributes(i)->major; + attr_minor = xf86_platform_odev_attributes(i)->minor; if (attr_major == major && attr_minor == minor) return &xf86_platform_devices[i]; } @@ -191,8 +153,10 @@ xf86_check_platform_slot(const struct xf86_platform_device *pd) for (i = 0; i < xf86NumEntities; i++) { const EntityPtr u = xf86Entities[i]; - if (pd->pdev && u->bus.type == BUS_PCI) - return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci); + if (pd->pdev && u->bus.type == BUS_PCI && + MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci)) { + return FALSE; + } if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) { return FALSE; } @@ -240,7 +204,7 @@ MatchToken(const char *value, struct xorg_list *patterns, static Bool OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) { - char *driver = xf86_get_platform_attrib(index, ODEV_ATTRIB_DRIVER); + char *driver = xf86_platform_odev_attributes(index)->driver; if (!MatchToken(driver, &oclass->match_driver, strcmp)) return FALSE; @@ -259,7 +223,7 @@ xf86OutputClassDriverList(int index, char *matches[], int nmatches) for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { if (OutputClassMatches(cl, index)) { - char *path = xf86_get_platform_attrib(index, ODEV_ATTRIB_PATH); + char *path = xf86_platform_odev_attributes(index)->path; xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", cl->identifier, path); @@ -324,7 +288,7 @@ xf86platformProbe(void) } for (i = 0; i < xf86_num_platform_devices; i++) { - char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID); + char *busid = xf86_platform_odev_attributes(i)->busid; if (pci && (strncmp(busid, "pci:", 4) == 0)) { platform_find_pci_info(&xf86_platform_devices[i], busid); @@ -386,7 +350,7 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp, GDevPtr gdev, int flags, intptr_t match_data) { Bool foundScreen = FALSE; - int entity, fd, major, minor; + int entity; if (gdev && gdev->screen == 0 && !xf86_check_platform_slot(dev)) return FALSE; @@ -412,11 +376,8 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp, if (entity != -1) { if ((dev->flags & XF86_PDEV_SERVER_FD) && (!drvp->driverFunc || !drvp->driverFunc(NULL, SUPPORTS_SERVER_FDS, NULL))) { - fd = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_FD, -1); - major = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_MAJOR, 0); - minor = xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_MINOR, 0); - systemd_logind_release_fd(major, minor, fd); - config_odev_add_int_attribute(dev->attribs, ODEV_ATTRIB_FD, -1); + systemd_logind_release_fd(dev->attribs->major, dev->attribs->minor, dev->attribs->fd); + dev->attribs->fd = -1; dev->flags &= ~XF86_PDEV_SERVER_FD; } @@ -467,6 +428,10 @@ xf86platformProbeDev(DriverPtr drvp) /* find the main device or any device specificed in xorg.conf */ for (i = 0; i < numDevs; i++) { + /* skip inactive devices */ + if (!devList[i]->active) + continue; + for (j = 0; j < xf86_num_platform_devices; j++) { if (devList[i]->busID && *devList[i]->busID) { if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID)) @@ -490,10 +455,14 @@ xf86platformProbeDev(DriverPtr drvp) continue; } - /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */ - if (xf86Info.autoAddGPU && numDevs) { + /* if autoaddgpu devices is enabled then go find any unclaimed platform + * devices and add them as GPU screens */ + if (xf86Info.autoAddGPU) { for (j = 0; j < xf86_num_platform_devices; j++) { - probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN); + if (probeSingleDevice(&xf86_platform_devices[j], drvp, + devList ? devList[0] : NULL, + PLATFORM_PROBE_GPU_SCREEN)) + foundScreen = TRUE; } } @@ -538,7 +507,7 @@ xf86platformAddDevice(int index) if (xf86GPUScreens[i]->PreInit && xf86GPUScreens[i]->PreInit(xf86GPUScreens[i], 0)) - xf86GPUScreens[i]->configured = TRUE; + xf86GPUScreens[i]->configured = TRUE; if (!xf86GPUScreens[i]->configured) { ErrorF("hotplugged device %d didn't configure\n", i); @@ -642,12 +611,10 @@ void xf86platformPrimary(void) xf86Msg(X_INFO, "no primary bus or device found\n"); if (xf86_num_platform_devices > 0) { - char *syspath = xf86_get_platform_attrib(0, ODEV_ATTRIB_SYSPATH); - primaryBus.id.plat = &xf86_platform_devices[0]; primaryBus.type = BUS_PLATFORM; - xf86Msg(X_NONE, "\tfalling back to %s\n", syspath); + xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath); } } } diff --git a/xserver/hw/xfree86/common/xf86platformBus.h b/xserver/hw/xfree86/common/xf86platformBus.h index dec195648..a7335b9da 100644 --- a/xserver/hw/xfree86/common/xf86platformBus.h +++ b/xserver/hw/xfree86/common/xf86platformBus.h @@ -45,31 +45,109 @@ int xf86platformProbeDev(DriverPtr drvp); extern int xf86_num_platform_devices; extern struct xf86_platform_device *xf86_platform_devices; -extern char * -xf86_get_platform_attrib(int index, int attrib_id); -extern int -xf86_get_platform_int_attrib(int index, int attrib_id, int def); extern int xf86_add_platform_device(struct OdevAttributes *attribs, Bool unowned); extern int xf86_remove_platform_device(int dev_index); extern Bool xf86_get_platform_device_unowned(int index); -/* Note starting with xserver 1.16 these 2 functions never fail */ -extern Bool -xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_str); -extern Bool -xf86_add_platform_device_int_attrib(int index, int attrib_id, int attrib_value); extern int xf86platformAddDevice(int index); extern void xf86platformRemoveDevice(int index); -extern _X_EXPORT char * -xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id); -extern _X_EXPORT int -xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib_id, int def); +static inline struct OdevAttributes * +xf86_platform_device_odev_attributes(struct xf86_platform_device *device) +{ + return device->attribs; +} + +static inline struct OdevAttributes * +xf86_platform_odev_attributes(int index) +{ + struct xf86_platform_device *device = &xf86_platform_devices[index]; + + return device->attribs; +} + +#ifndef _XORG_CONFIG_H_ +/* + * Define the legacy API only for external builds + */ + +/* path to kernel device node - Linux e.g. /dev/dri/card0 */ +#define ODEV_ATTRIB_PATH 1 +/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */ +#define ODEV_ATTRIB_SYSPATH 2 +/* DRI-style bus id */ +#define ODEV_ATTRIB_BUSID 3 +/* Server managed FD */ +#define ODEV_ATTRIB_FD 4 +/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */ +#define ODEV_ATTRIB_MAJOR 5 +/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ +#define ODEV_ATTRIB_MINOR 6 +/* kernel driver name */ +#define ODEV_ATTRIB_DRIVER 7 + +/* Protect against a mismatch attribute type by generating a compiler + * error using a negative array size when an incorrect attribute is + * passed + */ + +#define _ODEV_ATTRIB_IS_STRING(x) ((x) == ODEV_ATTRIB_PATH || \ + (x) == ODEV_ATTRIB_SYSPATH || \ + (x) == ODEV_ATTRIB_BUSID || \ + (x) == ODEV_ATTRIB_DRIVER) + +#define _ODEV_ATTRIB_STRING_CHECK(x) ((int (*)[_ODEV_ATTRIB_IS_STRING(x)-1]) 0) + +static inline char * +_xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]) +{ + switch (attrib) { + case ODEV_ATTRIB_PATH: + return xf86_platform_device_odev_attributes(device)->path; + case ODEV_ATTRIB_SYSPATH: + return xf86_platform_device_odev_attributes(device)->syspath; + case ODEV_ATTRIB_BUSID: + return xf86_platform_device_odev_attributes(device)->busid; + case ODEV_ATTRIB_DRIVER: + return xf86_platform_device_odev_attributes(device)->driver; + default: + assert(FALSE); + return NULL; + } +} + +#define xf86_get_platform_device_attrib(device, attrib) _xf86_get_platform_device_attrib(device,attrib,_ODEV_ATTRIB_STRING_CHECK(attrib)) + +#define _ODEV_ATTRIB_IS_INT(x) ((x) == ODEV_ATTRIB_FD || (x) == ODEV_ATTRIB_MAJOR || (x) == ODEV_ATTRIB_MINOR) +#define _ODEV_ATTRIB_INT_DEFAULT(x) ((x) == ODEV_ATTRIB_FD ? -1 : 0) +#define _ODEV_ATTRIB_DEFAULT_CHECK(x,def) (_ODEV_ATTRIB_INT_DEFAULT(x) == (def)) +#define _ODEV_ATTRIB_INT_CHECK(x,def) ((int (*)[_ODEV_ATTRIB_IS_INT(x)*_ODEV_ATTRIB_DEFAULT_CHECK(x,def)-1]) 0) + +static inline int +_xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]) +{ + switch (attrib) { + case ODEV_ATTRIB_FD: + return xf86_platform_device_odev_attributes(device)->fd; + case ODEV_ATTRIB_MAJOR: + return xf86_platform_device_odev_attributes(device)->major; + case ODEV_ATTRIB_MINOR: + return xf86_platform_device_odev_attributes(device)->minor; + default: + assert(FALSE); + return 0; + } +} + +#define xf86_get_platform_device_int_attrib(device, attrib, def) _xf86_get_platform_device_int_attrib(device,attrib,_ODEV_ATTRIB_INT_CHECK(attrib,def)) + +#endif + extern _X_EXPORT Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid); diff --git a/xserver/hw/xfree86/common/xf86str.h b/xserver/hw/xfree86/common/xf86str.h index a81e88614..643a65db1 100644 --- a/xserver/hw/xfree86/common/xf86str.h +++ b/xserver/hw/xfree86/common/xf86str.h @@ -403,7 +403,6 @@ typedef struct { Bool active; Bool inUse; int videoRam; - int textClockFreq; unsigned long BiosBase; /* Base address of video BIOS */ unsigned long MemBase; /* Frame buffer base address */ unsigned long IOBase; @@ -569,7 +568,7 @@ typedef struct _PciChipsets { * In drivers that don't have a specific vendor (e.g., vga) contains the * device ID for either the generic VGA or generic 8514 devices. This * turns out to be the same as the subclass and programming interface - * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or + * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or * 0x000101) and for 8514 is 0x030001). */ int PCIid; @@ -753,7 +752,6 @@ typedef struct _ScrnInfoRec { unsigned long memPhysBase; /* Physical address of FB */ unsigned long fbOffset; /* Offset of FB in the above */ int memClk; /* memory clock */ - int textClockFreq; /* clock of text mode */ Bool flipPixels; /* swap default black/white */ void *options; diff --git a/xserver/hw/xfree86/common/xf86vmode.c b/xserver/hw/xfree86/common/xf86vmode.c index 2b07833ad..0ce58e365 100644 --- a/xserver/hw/xfree86/common/xf86vmode.c +++ b/xserver/hw/xfree86/common/xf86vmode.c @@ -17,13 +17,13 @@ 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 Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES +IN NO EVENT SHALL Kaleb S. KEITHLEY 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 Kaleb S. KEITHLEY -shall not be used in advertising or otherwise to promote the sale, use +Except as contained in this notice, the name of Kaleb S. KEITHLEY +shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Kaleb S. KEITHLEY @@ -361,7 +361,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) } /* - * Older servers sometimes had server privates that the VidMode + * Older servers sometimes had server privates that the VidMode * extention made available. So to be compatiable pretend that * there are no server privates to pass to the client */ diff --git a/xserver/hw/xfree86/common/xf86xv.c b/xserver/hw/xfree86/common/xf86xv.c index b16cb5df3..b974cd212 100644 --- a/xserver/hw/xfree86/common/xf86xv.c +++ b/xserver/hw/xfree86/common/xf86xv.c @@ -54,47 +54,41 @@ #include "xf86xvpriv.h" -/* XvScreenRec fields */ - -static Bool xf86XVCloseScreen(ScreenPtr); -static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); - /* XvAdaptorRec fields */ -static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr *); -static int xf86XVFreePort(XvPortPtr); -static int xf86XVPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVGetVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVGetStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr); -static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); -static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); -static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8, +static int xf86XVStopVideo(XvPortPtr, DrawablePtr); +static int xf86XVSetPortAttribute(XvPortPtr, Atom, INT32); +static int xf86XVGetPortAttribute(XvPortPtr, Atom, INT32 *); +static int xf86XVQueryBestSize(XvPortPtr, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); -static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutImage(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); -static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, +static int xf86XVQueryImageAttributes(XvPortPtr, XvImagePtr, CARD16 *, CARD16 *, int *, int *); /* ScreenRec fields */ static Bool xf86XVDestroyWindow(WindowPtr pWin); -static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); +static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1); static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); +static Bool xf86XVCloseScreen(ScreenPtr); #define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) @@ -113,7 +107,10 @@ static DevPrivateKeyRec XF86XVWindowKeyRec; #define XF86XVWindowKey (&XF86XVWindowKeyRec) +/* dixmain.c XvScreenPtr screen private */ DevPrivateKey XF86XvScreenKey; +/** xf86xv.c XF86XVScreenPtr screen private */ +static DevPrivateKeyRec XF86XVScreenPrivateKey; static unsigned long PortResource = 0; @@ -121,7 +118,7 @@ static unsigned long PortResource = 0; ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey)) #define GET_XF86XV_SCREEN(pScreen) \ - ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr)) + ((XF86XVScreenPtr)(dixGetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey))) #define GET_XF86XV_WINDOW(pWin) \ ((XF86XVWindowPtr)dixLookupPrivate(&(pWin)->devPrivates, XF86XVWindowKey)) @@ -232,7 +229,6 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) { ScrnInfoPtr pScrn; XF86XVScreenPtr ScreenPriv; - XvScreenPtr pxvs; if (num <= 0 || noXvExtension) return FALSE; @@ -242,26 +238,15 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; + if (!dixRegisterPrivateKey(&XF86XVScreenPrivateKey, PRIVATE_SCREEN, 0)) + return FALSE; XF86XvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); - pxvs = GET_XV_SCREEN(pScreen); - - /* Anyone initializing the Xv layer must provide these two. - The Xv di layer calls them without even checking if they exist! */ - - pxvs->ddCloseScreen = xf86XVCloseScreen; - pxvs->ddQueryAdaptors = xf86XVQueryAdaptors; - - /* The Xv di layer provides us with a private hook so that we don't - have to allocate our own screen private. They also provide - a CloseScreen hook so that we don't have to wrap it. I'm not - sure that I appreciate that. */ - ScreenPriv = malloc(sizeof(XF86XVScreenRec)); - pxvs->devPriv.ptr = (void *) ScreenPriv; + dixSetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey, ScreenPriv); if (!ScreenPriv) return FALSE; @@ -272,6 +257,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; + ScreenPriv->CloseScreen = pScreen->CloseScreen; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; @@ -280,6 +266,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; pScreen->ClipNotify = xf86XVClipNotify; + pScreen->CloseScreen = xf86XVCloseScreen; pScrn->EnterVT = xf86XVEnterVT; pScrn->LeaveVT = xf86XVLeaveVT; if (pScrn->AdjustFrame) @@ -297,21 +284,6 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - free(pAdaptor->name); - pAdaptor->name = NULL; - - if (pAdaptor->pEncodings) { - XvEncodingPtr pEncode = pAdaptor->pEncodings; - - for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) - free(pEncode->name); - free(pAdaptor->pEncodings); - pAdaptor->pEncodings = NULL; - } - - free(pAdaptor->pFormats); - pAdaptor->pFormats = NULL; - if (pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; @@ -328,23 +300,9 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) free(pPriv); } } - free(pAdaptor->pPorts); - pAdaptor->pPorts = NULL; } - if (pAdaptor->pAttributes) { - XvAttributePtr pAttribute = pAdaptor->pAttributes; - - for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) - free(pAttribute->name); - free(pAdaptor->pAttributes); - pAdaptor->pAttributes = NULL; - } - - free(pAdaptor->pImages); - free(pAdaptor->devPriv.ptr); - pAdaptor->pImages = NULL; - pAdaptor->devPriv.ptr = NULL; + XvFreeAdaptor(pAdaptor); } static Bool @@ -359,15 +317,11 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) XvPortRecPrivatePtr portPriv; XvPortPtr pPort, pp; int numPort; - XF86AttributePtr attributePtr; - XvAttributePtr pAttribute, pat; XF86VideoFormatPtr formatPtr; XvFormatPtr pFormat, pf; int numFormat, totFormat; XF86VideoEncodingPtr encodingPtr; XvEncodingPtr pEncode, pe; - XF86ImagePtr imagePtr; - XvImagePtr pImage, pi; int numVisuals; VisualPtr pVisual; int i; @@ -413,8 +367,6 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) continue; pa->pScreen = pScreen; - pa->ddAllocatePort = xf86XVAllocatePort; - pa->ddFreePort = xf86XVFreePort; pa->ddPutVideo = xf86XVPutVideo; pa->ddPutStill = xf86XVPutStill; pa->ddGetVideo = xf86XVGetVideo; @@ -445,49 +397,24 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) } if (adaptorPtr->nImages && - (pImage = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { - - for (i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; - i < adaptorPtr->nImages; i++, pi++, imagePtr++) { - pi->id = imagePtr->id; - pi->type = imagePtr->type; - pi->byte_order = imagePtr->byte_order; - memcpy(pi->guid, imagePtr->guid, 16); - pi->bits_per_pixel = imagePtr->bits_per_pixel; - pi->format = imagePtr->format; - pi->num_planes = imagePtr->num_planes; - pi->depth = imagePtr->depth; - pi->red_mask = imagePtr->red_mask; - pi->green_mask = imagePtr->green_mask; - pi->blue_mask = imagePtr->blue_mask; - pi->y_sample_bits = imagePtr->y_sample_bits; - pi->u_sample_bits = imagePtr->u_sample_bits; - pi->v_sample_bits = imagePtr->v_sample_bits; - pi->horz_y_period = imagePtr->horz_y_period; - pi->horz_u_period = imagePtr->horz_u_period; - pi->horz_v_period = imagePtr->horz_v_period; - pi->vert_y_period = imagePtr->vert_y_period; - pi->vert_u_period = imagePtr->vert_u_period; - pi->vert_v_period = imagePtr->vert_v_period; - memcpy(pi->component_order, imagePtr->component_order, 32); - pi->scanline_order = imagePtr->scanline_order; - } + (pa->pImages = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + memcpy(pa->pImages, adaptorPtr->pImages, + adaptorPtr->nImages * sizeof(XvImageRec)); pa->nImages = adaptorPtr->nImages; - pa->pImages = pImage; } if (adaptorPtr->nAttributes && - (pAttribute = - calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { - for (pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = - 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) { - pat->flags = attributePtr->flags; - pat->min_value = attributePtr->min_value; - pat->max_value = attributePtr->max_value; - pat->name = strdup(attributePtr->name); + (pa->pAttributes = calloc(adaptorPtr->nAttributes, + sizeof(XvAttributeRec)))) { + memcpy(pa->pAttributes, adaptorPtr->pAttributes, + adaptorPtr->nAttributes * sizeof(XvAttributeRec)); + + for (i = 0; i < adaptorPtr->nAttributes; i++) { + pa->pAttributes[i].name = + strdup(adaptorPtr->pAttributes[i].name); } + pa->nAttributes = adaptorPtr->nAttributes; - pa->pAttributes = pAttribute; } totFormat = adaptorPtr->nFormats; @@ -672,7 +599,7 @@ static void xf86XVCopyClip(XvPortRecPrivatePtr portPriv, GCPtr pGC) { /* copy the new clip if it exists */ - if ((pGC->clientClipType == CT_REGION) && pGC->clientClip) { + if (pGC->clientClip) { if (!portPriv->clientClip) portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ @@ -741,10 +668,6 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -817,22 +740,6 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -911,22 +818,6 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->ReputImage) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -1157,7 +1048,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) } static void -xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) +xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1) { ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); @@ -1168,7 +1059,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; - (*pScreen->WindowExposures) (pWin, reg1, reg2); + (*pScreen->WindowExposures) (pWin, reg1); pScreen->WindowExposures = xf86XVWindowExposures; /* filter out XClearWindow/Area */ @@ -1226,10 +1117,6 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) pPriv->pCompositeClip = NULL; - if (pPriv->AdaptorRec->ClipNotify) - (*pPriv->AdaptorRec->ClipNotify) (pPriv->pScrn, pPriv->DevPriv.ptr, - pWin, dx, dy); - pPriv->clipChanged = TRUE; if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) { @@ -1264,6 +1151,7 @@ xf86XVCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; + pScreen->CloseScreen = ScreenPriv->CloseScreen; pScrn->EnterVT = ScreenPriv->EnterVT; pScrn->LeaveVT = ScreenPriv->LeaveVT; @@ -1276,19 +1164,8 @@ xf86XVCloseScreen(ScreenPtr pScreen) free(pxvs->pAdaptors); free(ScreenPriv); - return TRUE; -} -static int -xf86XVQueryAdaptors(ScreenPtr pScreen, - XvAdaptorPtr * p_pAdaptors, int *p_nAdaptors) -{ - XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); - - *p_nAdaptors = pxvs->nAdaptors; - *p_pAdaptors = pxvs->pAdaptors; - - return Success; + return pScreen->CloseScreen(pScreen); } /**** ScrnInfoRec fields ****/ @@ -1390,21 +1267,7 @@ xf86XVModeSet(ScrnInfoPtr pScrn) /**** XvAdaptorRec fields ****/ static int -xf86XVAllocatePort(unsigned long port, XvPortPtr pPort, XvPortPtr * ppPort) -{ - *ppPort = pPort; - return Success; -} - -static int -xf86XVFreePort(XvPortPtr pPort) -{ - return Success; -} - -static int -xf86XVPutVideo(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1454,8 +1317,7 @@ xf86XVPutVideo(ClientPtr client, } static int -xf86XVPutStill(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1509,21 +1371,6 @@ xf86XVPutStill(ClientPtr client, goto PUT_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_STILL_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1567,8 +1414,7 @@ xf86XVPutStill(ClientPtr client, } static int -xf86XVGetVideo(ClientPtr client, - DrawablePtr pDraw, +xf86XVGetVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1618,8 +1464,7 @@ xf86XVGetVideo(ClientPtr client, } static int -xf86XVGetStill(ClientPtr client, - DrawablePtr pDraw, +xf86XVGetStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1657,10 +1502,6 @@ xf86XVGetStill(ClientPtr client, goto GET_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1682,7 +1523,7 @@ xf86XVGetStill(ClientPtr client, } static int -xf86XVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) +xf86XVStopVideo(XvPortPtr pPort, DrawablePtr pDraw) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1706,8 +1547,7 @@ xf86XVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) } static int -xf86XVSetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 value) +xf86XVSetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1717,8 +1557,7 @@ xf86XVSetPortAttribute(ClientPtr client, } static int -xf86XVGetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 *p_value) +xf86XVGetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 *p_value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1728,8 +1567,7 @@ xf86XVGetPortAttribute(ClientPtr client, } static int -xf86XVQueryBestSize(ClientPtr client, - XvPortPtr pPort, +xf86XVQueryBestSize(XvPortPtr pPort, CARD8 motion, CARD16 vid_w, CARD16 vid_h, CARD16 drw_w, CARD16 drw_h, @@ -1746,8 +1584,7 @@ xf86XVQueryBestSize(ClientPtr client, } static int -xf86XVPutImage(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutImage(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, @@ -1809,21 +1646,6 @@ xf86XVPutImage(ClientPtr client, goto PUT_IMAGE_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_IMAGE_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutImage) (portPriv->pScrn, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, @@ -1867,8 +1689,7 @@ xf86XVPutImage(ClientPtr client, } static int -xf86XVQueryImageAttributes(ClientPtr client, - XvPortPtr pPort, +xf86XVQueryImageAttributes(XvPortPtr pPort, XvImagePtr format, CARD16 *width, CARD16 *height, int *pitches, int *offsets) @@ -1885,34 +1706,11 @@ void xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; - ChangeGCVal pval[2]; - BoxPtr pbox = RegionRects(fillboxes); - int i, nbox = RegionNumRects(fillboxes); - xRectangle *rects; - GCPtr gc; if (!xf86ScreenToScrn(pScreen)->vtSema) return; - gc = GetScratchGC(pDraw->depth, pScreen); - pval[0].val = key; - pval[1].val = IncludeInferiors; - (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); - ValidateGC(pDraw, gc); - - rects = malloc(nbox * sizeof(xRectangle)); - - for (i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1 - pDraw->x; - rects[i].y = pbox->y1 - pDraw->y; - rects[i].width = pbox->x2 - pbox->x1; - rects[i].height = pbox->y2 - pbox->y1; - } - - (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); - - free(rects); - FreeScratchGC(gc); + XvFillColorKey(pDraw, key, fillboxes); } void diff --git a/xserver/hw/xfree86/common/xf86xv.h b/xserver/hw/xfree86/common/xf86xv.h index 8986e2e57..6f8662c04 100644 --- a/xserver/hw/xfree86/common/xf86xv.h +++ b/xserver/hw/xfree86/common/xf86xv.h @@ -32,8 +32,6 @@ #include "xvdix.h" #include "xf86str.h" -#define VIDEO_NO_CLIPPING 0x00000001 -#define VIDEO_INVERT_CLIPLIST 0x00000002 #define VIDEO_OVERLAID_IMAGES 0x00000004 #define VIDEO_OVERLAID_STILLS 0x00000008 /* @@ -42,34 +40,7 @@ */ #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 -typedef struct { - int id; - int type; - int byte_order; - unsigned char guid[16]; - int bits_per_pixel; - int format; - int num_planes; - - /* for RGB formats only */ - int depth; - unsigned int red_mask; - unsigned int green_mask; - unsigned int blue_mask; - - /* for YUV formats only */ - unsigned int y_sample_bits; - unsigned int u_sample_bits; - unsigned int v_sample_bits; - unsigned int horz_y_period; - unsigned int horz_u_period; - unsigned int horz_v_period; - unsigned int vert_y_period; - unsigned int vert_u_period; - unsigned int vert_v_period; - char component_order[32]; - int scanline_order; -} XF86ImageRec, *XF86ImagePtr; +typedef XvImageRec XF86ImageRec, *XF86ImagePtr; typedef struct { ScrnInfoPtr pScrn; @@ -124,8 +95,6 @@ typedef int (*QueryImageAttributesFuncPtr) (ScrnInfoPtr pScrn, int image, unsigned short *width, unsigned short *height, int *pitches, int *offsets); -typedef void (*ClipNotifyFuncPtr) (ScrnInfoPtr pScrn, void *data, - WindowPtr window, int dx, int dy); typedef enum { XV_OFF, @@ -147,12 +116,7 @@ typedef struct { short class; } XF86VideoFormatRec, *XF86VideoFormatPtr; -typedef struct { - int flags; - int min_value; - int max_value; - const char *name; -} XF86AttributeRec, *XF86AttributePtr; +typedef XvAttributeRec XF86AttributeRec, *XF86AttributePtr; typedef struct { unsigned int type; @@ -179,7 +143,6 @@ typedef struct { PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; /* image/still */ QueryImageAttributesFuncPtr QueryImageAttributes; - ClipNotifyFuncPtr ClipNotify; } XF86VideoAdaptorRec, *XF86VideoAdaptorPtr; typedef struct { diff --git a/xserver/hw/xfree86/common/xf86xvmc.h b/xserver/hw/xfree86/common/xf86xvmc.h index aaa4e65f0..023aff526 100644 --- a/xserver/hw/xfree86/common/xf86xvmc.h +++ b/xserver/hw/xfree86/common/xf86xvmc.h @@ -51,7 +51,7 @@ typedef struct { } XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr; /* - xf86XvMCCreateContextProc + xf86XvMCCreateContextProc DIX will fill everything out in the context except the driver_priv. The port_priv holds the private data specified for the port when @@ -71,7 +71,7 @@ typedef void (*xf86XvMCDestroyContextProcPtr) (ScrnInfoPtr pScrn, XvMCContextPtr context); /* - xf86XvMCCreateSurfaceProc + xf86XvMCCreateSurfaceProc DIX will fill everything out in the surface except the driver_priv. The driver may store whatever it wants in driver_priv. The driver @@ -87,7 +87,7 @@ typedef void (*xf86XvMCDestroySurfaceProcPtr) (ScrnInfoPtr pScrn, XvMCSurfacePtr surface); /* - xf86XvMCCreateSubpictureProc + xf86XvMCCreateSubpictureProc DIX will fill everything out in the subpicture except the driver_priv, num_palette_entries, entry_bytes and component_order. The driver may @@ -122,8 +122,8 @@ typedef struct { xf86XvMCDestroySubpictureProcPtr DestroySubpicture; } XF86MCAdaptorRec, *XF86MCAdaptorPtr; -/* - xf86XvMCScreenInit +/* + xf86XvMCScreenInit Unlike Xv, the adaptor data is not copied from this structure. This structure's data is used so it must stick around for the diff --git a/xserver/hw/xfree86/common/xf86xvpriv.h b/xserver/hw/xfree86/common/xf86xvpriv.h index e95f959a8..8fb22e60e 100644 --- a/xserver/hw/xfree86/common/xf86xvpriv.h +++ b/xserver/hw/xfree86/common/xf86xvpriv.h @@ -45,6 +45,7 @@ typedef struct { Bool (*EnterVT) (ScrnInfoPtr); void (*LeaveVT) (ScrnInfoPtr); xf86ModeSetProc *ModeSet; + CloseScreenProcPtr CloseScreen; } XF86XVScreenRec, *XF86XVScreenPtr; typedef struct { @@ -60,7 +61,6 @@ typedef struct { PutImageFuncPtr PutImage; ReputImageFuncPtr ReputImage; QueryImageAttributesFuncPtr QueryImageAttributes; - ClipNotifyFuncPtr ClipNotify; } XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr; typedef struct { diff --git a/xserver/hw/xfree86/ddc/Makefile.in b/xserver/hw/xfree86/ddc/Makefile.in index cc6c3709a..cd361df1f 100644 --- a/xserver/hw/xfree86/ddc/Makefile.in +++ b/xserver/hw/xfree86/ddc/Makefile.in @@ -263,6 +263,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/ddc/ddc.c b/xserver/hw/xfree86/ddc/ddc.c index 04d1a09c5..29185ad8b 100644 --- a/xserver/hw/xfree86/ddc/ddc.c +++ b/xserver/hw/xfree86/ddc/ddc.c @@ -1,5 +1,5 @@ -/* xf86DDC.c - * +/* xf86DDC.c + * * Copyright 1998,1999 by Egbert Eich */ @@ -212,10 +212,10 @@ TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC) (ScrnInfoPtr)) return count; } -/* +/* * read EDID record , pass it to callback function to interpret. * callback function will store it for further use by calling - * function; it will also decide if we need to reread it + * function; it will also decide if we need to reread it */ static unsigned char * EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, @@ -328,7 +328,7 @@ DDC2Init(I2CBusPtr pBus) I2CDevPtr dev = NULL; /* - * Slow down the bus so that older monitors don't + * Slow down the bus so that older monitors don't * miss things. */ pBus->RiseFallTime = 20; @@ -468,61 +468,3 @@ xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus) { return xf86DoEEDID(pScrn, pBus, FALSE); } - -/* XXX write me */ -static void * -DDC2ReadDisplayID(void) -{ - return FALSE; -} - -/** - * Attempts to probe the monitor for DisplayID information, if NoDDC and - * NoDDC2 are unset. DisplayID blocks are interpreted and the results - * returned in an xf86MonPtr. - * - * This function does not affect the list of modes used by drivers -- it is up - * to the driver to decide policy on what to do with DisplayID information. - * - * @return pointer to a new xf86MonPtr containing the DisplayID information. - * @return NULL if no monitor attached or failure to interpret the DisplayID. - */ -xf86MonPtr -xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus) -{ - unsigned char *did = NULL; - xf86MonPtr tmp = NULL; - I2CDevPtr dev = NULL; - - /* Default DDC and DDC2 to enabled. */ - Bool noddc = FALSE, noddc2 = FALSE; - OptionInfoPtr options; - - options = malloc(sizeof(DDCOptions)); - if (!options) - return NULL; - memcpy(options, DDCOptions, sizeof(DDCOptions)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); - - xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); - xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2); - free(options); - - if (noddc || noddc2) - return NULL; - - if (!(dev = DDC2Init(pBus))) - return NULL; - - if ((did = DDC2ReadDisplayID())) { - tmp = calloc(1, sizeof(*tmp)); - if (!tmp) - return NULL; - - tmp->scrnIndex = pScrn->scrnIndex; - tmp->flags |= MONITOR_DISPLAYID; - tmp->rawData = did; - } - - return tmp; -} diff --git a/xserver/hw/xfree86/ddc/edid.h b/xserver/hw/xfree86/ddc/edid.h index 91565a2cf..4c2da51c1 100644 --- a/xserver/hw/xfree86/ddc/edid.h +++ b/xserver/hw/xfree86/ddc/edid.h @@ -1,9 +1,9 @@ /* - * edid.h: defines to parse an EDID block + * edid.h: defines to parse an EDID block * - * This file contains all information to interpret a standard EDIC block - * transmitted by a display device via DDC (Display Data Channel). So far - * there is no information to deal with optional EDID blocks. + * This file contains all information to interpret a standard EDIC block + * transmitted by a display device via DDC (Display Data Channel). So far + * there is no information to deal with optional EDID blocks. * DDC is a Trademark of VESA (Video Electronics Standard Association). * * Copyright 1998 by Egbert Eich diff --git a/xserver/hw/xfree86/ddc/print_edid.c b/xserver/hw/xfree86/ddc/print_edid.c index 4f983f934..e16b12476 100644 --- a/xserver/hw/xfree86/ddc/print_edid.c +++ b/xserver/hw/xfree86/ddc/print_edid.c @@ -21,7 +21,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * print_edid.c: print out all information retrieved from display device + * print_edid.c: print out all information retrieved from display device */ #ifdef HAVE_XORG_CONFIG_H diff --git a/xserver/hw/xfree86/ddc/xf86DDC.h b/xserver/hw/xfree86/ddc/xf86DDC.h index de8e71831..7d81ab911 100644 --- a/xserver/hw/xfree86/ddc/xf86DDC.h +++ b/xserver/hw/xfree86/ddc/xf86DDC.h @@ -1,9 +1,9 @@ /* xf86DDC.h * - * This file contains all information to interpret a standard EDIC block - * transmitted by a display device via DDC (Display Data Channel). So far - * there is no information to deal with optional EDID blocks. + * This file contains all information to interpret a standard EDIC block + * transmitted by a display device via DDC (Display Data Channel). So far + * there is no information to deal with optional EDID blocks. * DDC is a Trademark of VESA (Video Electronics Standard Association). * * Copyright 1998 by Egbert Eich @@ -48,11 +48,6 @@ extern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC); extern _X_EXPORT Bool xf86MonitorIsHDMI(xf86MonPtr mon); -extern _X_EXPORT xf86MonPtr xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus); - -extern _X_EXPORT void - xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC); - extern _X_EXPORT DisplayModePtr FindDMTMode(int hsize, int vsize, int refresh, Bool rb); diff --git a/xserver/hw/xfree86/dixmods/Makefile.in b/xserver/hw/xfree86/dixmods/Makefile.in index c19fb9a57..2c3d2dc42 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.in +++ b/xserver/hw/xfree86/dixmods/Makefile.in @@ -305,6 +305,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/dixmods/xkbKillSrv.c b/xserver/hw/xfree86/dixmods/xkbKillSrv.c index 6dd21dd51..79cf08198 100644 --- a/xserver/hw/xfree86/dixmods/xkbKillSrv.c +++ b/xserver/hw/xfree86/dixmods/xkbKillSrv.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/hw/xfree86/dixmods/xkbVT.c b/xserver/hw/xfree86/dixmods/xkbVT.c index 4ca4451d0..984096122 100644 --- a/xserver/hw/xfree86/dixmods/xkbVT.c +++ b/xserver/hw/xfree86/dixmods/xkbVT.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/hw/xfree86/doc/Makefile.in b/xserver/hw/xfree86/doc/Makefile.in index 257d825a9..20b69b5b5 100644 --- a/xserver/hw/xfree86/doc/Makefile.in +++ b/xserver/hw/xfree86/doc/Makefile.in @@ -221,6 +221,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -470,6 +471,7 @@ top_srcdir = @top_srcdir@ # DocBook/XML file with chapters, appendix and images it includes @ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@FILTER_XMLTO = $(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO) @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \ @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \ @@ -684,13 +686,13 @@ uninstall-am: mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< @ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters) -@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/hw/xfree86/doc/README.DRIcomp b/xserver/hw/xfree86/doc/README.DRIcomp index 2d3ebf148..73886504f 100644 --- a/xserver/hw/xfree86/doc/README.DRIcomp +++ b/xserver/hw/xfree86/doc/README.DRIcomp @@ -142,9 +142,6 @@ Here are the basic steps for kernel setup. o Enable all chipsets' support for AGP - o It's recommended that you turn on MTRRs under Processor type and - Features, but not required. - o Configure the rest of the kernel as required for your system (i.e. Eth- ernet, SCSI, etc) diff --git a/xserver/hw/xfree86/doc/Registry b/xserver/hw/xfree86/doc/Registry index 48e24a2f4..ad5b9bffb 100644 --- a/xserver/hw/xfree86/doc/Registry +++ b/xserver/hw/xfree86/doc/Registry @@ -231,7 +231,6 @@ DDC B C Enable/disable DDC DDC1 B C Enable/disable DDC1 DDC2 B C Enable/disable DDC2 DPMS O C Enable DPMS -MTRR B C Enable/disable setting MTRRs BaudRate I I Serial port baud rate ButtonNumber I I Button number (for touch screen?) diff --git a/xserver/hw/xfree86/doc/ddxDesign.xml b/xserver/hw/xfree86/doc/ddxDesign.xml index d1fd9af7b..6a9de9e7f 100644 --- a/xserver/hw/xfree86/doc/ddxDesign.xml +++ b/xserver/hw/xfree86/doc/ddxDesign.xml @@ -4542,31 +4542,6 @@ as follows: Currently, the following flags are defined: - - VIDEO_NO_CLIPPING - - This indicates that the video adaptor does not support - clipping. The driver will never receive Put requests - where less than the entire area determined by - drw_x, drw_y, - drw_w and drw_h is visible. - This flag does not apply to Get requests. Hardware - that is incapable of clipping Gets may punt or get - the extents of the clipping region passed to it. - - - - - - VIDEO_INVERT_CLIPLIST - - This indicates that the video driver requires the clip - list to contain the regions which are obscured rather - than the regions which are are visible. - - - - VIDEO_OVERLAID_STILLS @@ -4724,18 +4699,13 @@ as follows: - If the VIDEO_NO_CLIPPING - flag is set, the clipBoxes may be ignored by - the driver. ClipBoxes is an X-Y + ClipBoxes is an X-Y banded region identical to those used throughout the server. The clipBoxes represent the visible portions of the area determined by drw_x, drw_y, drw_w and drw_h in the Get/Put function. The boxes are in screen coordinates, are guaranteed not to overlap and an empty region will never be passed. - If the driver has specified VIDEO_INVERT_CLIPLIST, - clipBoxes will indicate the areas of the primitive - which are obscured rather than the areas visible. @@ -9094,8 +9064,7 @@ ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); /* - * Install colourmap functions. If using the vgahw module, - * vgaHandleColormaps would usually be called here. + * Install colourmap functions. */ ... diff --git a/xserver/hw/xfree86/dri/Makefile.in b/xserver/hw/xfree86/dri/Makefile.in index 8d1147b31..402367e76 100644 --- a/xserver/hw/xfree86/dri/Makefile.in +++ b/xserver/hw/xfree86/dri/Makefile.in @@ -262,6 +262,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/dri/dri.c b/xserver/hw/xfree86/dri/dri.c index 5fc658e1b..95d8e7dea 100644 --- a/xserver/hw/xfree86/dri/dri.c +++ b/xserver/hw/xfree86/dri/dri.c @@ -577,14 +577,6 @@ DRIFinishScreenInit(ScreenPtr pScreen) DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; /* Wrap DRI support */ - if (pDRIInfo->wrap.ValidateTree) { - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree; - } - if (pDRIInfo->wrap.PostValidateTree) { - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree; - } if (pDRIInfo->wrap.WindowExposures) { pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; @@ -634,14 +626,6 @@ DRICloseScreen(ScreenPtr pScreen) if (pDRIPriv->wrapped) { /* Unwrap DRI Functions */ - if (pDRIInfo->wrap.ValidateTree) { - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - pDRIPriv->wrap.ValidateTree = NULL; - } - if (pDRIInfo->wrap.PostValidateTree) { - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - pDRIPriv->wrap.PostValidateTree = NULL; - } if (pDRIInfo->wrap.WindowExposures) { pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; pDRIPriv->wrap.WindowExposures = NULL; @@ -1576,8 +1560,6 @@ DRICreateInfoRec(void) inforec->wrap.BlockHandler = DRIDoBlockHandler; inforec->wrap.WindowExposures = DRIWindowExposures; inforec->wrap.CopyWindow = DRICopyWindow; - inforec->wrap.ValidateTree = DRIValidateTree; - inforec->wrap.PostValidateTree = DRIPostValidateTree; inforec->wrap.ClipNotify = DRIClipNotify; inforec->wrap.AdjustFrame = DRIAdjustFrame; @@ -1821,7 +1803,7 @@ DRIGetContextStore(DRIContextPrivPtr context) } void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) +DRIWindowExposures(WindowPtr pWin, RegionPtr prgn) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -1839,7 +1821,7 @@ DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; /* call lower layers */ - (*pScreen->WindowExposures) (pWin, prgn, bsreg); + (*pScreen->WindowExposures) (pWin, prgn); /* rewrap */ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; @@ -2039,61 +2021,6 @@ DRILockTree(ScreenPtr pScreen) } } -int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - int returnValue = 1; /* always return 1, not checked by dix/window.c */ - - if (!pDRIPriv) - return returnValue; - - /* call lower wrapped functions */ - if (pDRIPriv->wrap.ValidateTree) { - /* unwrap */ - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - - /* call lower layers */ - returnValue = (*pScreen->ValidateTree) (pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - } - - return returnValue; -} - -void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen; - DRIScreenPrivPtr pDRIPriv; - - if (pParent) { - pScreen = pParent->drawable.pScreen; - } - else { - pScreen = pChild->drawable.pScreen; - } - if (!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) - return; - - if (pDRIPriv->wrap.PostValidateTree) { - /* unwrap */ - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - - /* call lower layers */ - (*pScreen->PostValidateTree) (pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - } -} - void DRIClipNotify(WindowPtr pWin, int dx, int dy) { @@ -2340,11 +2267,11 @@ DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y) _DRIAdjustFrame(pScrn, pDRIPriv, x, y); } -/* +/* * DRIMoveBuffersHelper swaps the regions rects in place leaving you * a region with the rects in the order that you need to blit them, * but it is possibly (likely) an invalid region afterwards. If you - * need to use the region again for anything you have to call + * need to use the region again for anything you have to call * REGION_VALIDATE on it, or better yet, save a copy first. */ diff --git a/xserver/hw/xfree86/dri/dri.h b/xserver/hw/xfree86/dri/dri.h index fa43a2cc2..2802da56a 100644 --- a/xserver/hw/xfree86/dri/dri.h +++ b/xserver/hw/xfree86/dri/dri.h @@ -85,8 +85,6 @@ typedef struct { ScreenBlockHandlerProcPtr BlockHandler; WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; ClipNotifyProcPtr ClipNotify; AdjustFramePtr AdjustFrame; } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; @@ -282,20 +280,13 @@ extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context); -extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, - RegionPtr prgn, RegionPtr bsreg); +extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn); extern _X_EXPORT Bool DRIDestroyWindow(WindowPtr pWin); extern _X_EXPORT void DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -extern _X_EXPORT int DRIValidateTree(WindowPtr pParent, - WindowPtr pChild, VTKind kind); - -extern _X_EXPORT void DRIPostValidateTree(WindowPtr pParent, - WindowPtr pChild, VTKind kind); - extern _X_EXPORT void DRIClipNotify(WindowPtr pWin, int dx, int dy); extern _X_EXPORT CARD32 DRIGetDrawableIndex(WindowPtr pWin); diff --git a/xserver/hw/xfree86/dri/sarea.h b/xserver/hw/xfree86/dri/sarea.h index 7a55b49d6..1bef2421e 100644 --- a/xserver/hw/xfree86/dri/sarea.h +++ b/xserver/hw/xfree86/dri/sarea.h @@ -1,7 +1,7 @@ /** - * \file sarea.h + * \file sarea.h * SAREA definitions. - * + * * \author Kevin E. Martin * \author Jens Owen * \author Rickard E. (Rik) Faith @@ -11,7 +11,7 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, 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 @@ -19,11 +19,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. diff --git a/xserver/hw/xfree86/dri2/Makefile.am b/xserver/hw/xfree86/dri2/Makefile.am index 502a2ee29..78e507bd3 100644 --- a/xserver/hw/xfree86/dri2/Makefile.am +++ b/xserver/hw/xfree86/dri2/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS=pci_ids + noinst_LTLIBRARIES = libdri2.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ diff --git a/xserver/hw/xfree86/dri2/Makefile.in b/xserver/hw/xfree86/dri2/Makefile.in index 8be3ac22f..5b335b9f7 100644 --- a/xserver/hw/xfree86/dri2/Makefile.in +++ b/xserver/hw/xfree86/dri2/Makefile.in @@ -117,6 +117,13 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdri2_la_SOURCES) DIST_SOURCES = $(libdri2_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -151,9 +158,40 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(sdkdir)" HEADERS = $(sdk_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ @@ -262,6 +300,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -499,6 +538,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUBDIRS = pci_ids noinst_LTLIBRARIES = libdri2.la AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ @@ -513,7 +553,7 @@ libdri2_la_SOURCES = \ dri2int.h sdk_HEADERS = dri2.h -all: all-am +all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -618,6 +658,53 @@ uninstall-sdkHEADERS: files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sdkdir)'; $(am__uninstall_files_from_dir) +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -628,10 +715,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -650,7 +750,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -667,7 +767,7 @@ GTAGS: && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: $(HEADERS) $(SOURCES) $(LISP) +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ @@ -714,22 +814,48 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done check-am: all-am -check: check-am +check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: +installdirs: installdirs-recursive +installdirs-am: 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 -uninstall: uninstall-am +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -751,92 +877,96 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-am +clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive html-am: -info: info-am +info: info-recursive info-am: install-data-am: install-sdkHEADERS -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: -install-html: install-html-am +install-html: install-html-recursive install-html-am: -install-info: install-info-am +install-info: install-info-recursive install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive install-pdf-am: -install-ps: install-ps-am +install-ps: install-ps-recursive install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: uninstall-am: uninstall-sdkHEADERS -.MAKE: install-am install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ - distclean distclean-compile distclean-generic \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES cscopelist cscopelist-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-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 + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive 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/dri2/dri2.c b/xserver/hw/xfree86/dri2/dri2.c index f64ba7ca9..0c038b3d1 100644 --- a/xserver/hw/xfree86/dri2/dri2.c +++ b/xserver/hw/xfree86/dri2/dri2.c @@ -1413,6 +1413,59 @@ get_prime_id(void) return -1; } +#include "pci_ids/pci_id_driver_map.h" + +static char * +dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + struct pci_device *pdev = NULL; + int i, j; + + if (pEnt) + pdev = xf86GetPciInfoForEntity(pEnt->index); + + /* For non-PCI devices, just assume that the 3D driver is named + * the same as the kernel driver. This is currently true for vc4 + * and msm (freedreno). + */ + if (!pdev) { + drmVersionPtr version = drmGetVersion(info->fd); + char *kernel_driver; + + if (!version) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[DRI2] Couldn't drmGetVersion() on non-PCI device, " + "no driver name found.\n"); + return NULL; + } + + kernel_driver = strndup(version->name, version->name_len); + drmFreeVersion(version); + return kernel_driver; + } + + for (i = 0; driver_map[i].driver; i++) { + if (pdev->vendor_id != driver_map[i].vendor_id) + continue; + + if (driver_map[i].num_chips_ids == -1) + return strdup(driver_map[i].driver); + + for (j = 0; j < driver_map[i].num_chips_ids; j++) { + if (driver_map[i].chip_ids[j] == pdev->device_id) + return strdup(driver_map[i].driver); + } + } + + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[DRI2] No driver mapping found for PCI device " + "0x%04x / 0x%04x\n", + pdev->vendor_id, pdev->device_id); + return NULL; +} + Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) { @@ -1523,11 +1576,18 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) if (info->version == 3 || info->numDrivers == 0) { /* Driver too old: use the old-style driverName field */ - ds->numDrivers = 1; - ds->driverNames = malloc(sizeof(*ds->driverNames)); + ds->numDrivers = info->driverName ? 1 : 2; + ds->driverNames = malloc(ds->numDrivers * sizeof(*ds->driverNames)); if (!ds->driverNames) goto err_out; - ds->driverNames[0] = info->driverName; + + if (info->driverName) { + ds->driverNames[0] = info->driverName; + } else { + ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); + if (!ds->driverNames[0]) + return FALSE; + } } else { ds->numDrivers = info->numDrivers; diff --git a/xserver/hw/xfree86/dri2/pci_ids/Makefile.am b/xserver/hw/xfree86/dri2/pci_ids/Makefile.am new file mode 100644 index 000000000..c5111082b --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.am @@ -0,0 +1,11 @@ +EXTRA_DIST = \ + pci_id_driver_map.h \ + i810_pci_ids.h \ + i915_pci_ids.h \ + i965_pci_ids.h \ + r200_pci_ids.h \ + r300_pci_ids.h \ + r600_pci_ids.h \ + radeon_pci_ids.h \ + radeonsi_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 new file mode 100644 index 000000000..8f2016d67 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/Makefile.in @@ -0,0 +1,645 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = hw/xfree86/dri2/pci_ids +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +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@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + pci_id_driver_map.h \ + i810_pci_ids.h \ + i915_pci_ids.h \ + i965_pci_ids.h \ + r200_pci_ids.h \ + r300_pci_ids.h \ + r600_pci_ids.h \ + radeon_pci_ids.h \ + radeonsi_pci_ids.h \ + vmwgfx_pci_ids.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/dri2/pci_ids/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/dri2/pci_ids/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xfree86/dri2/pci_ids/i810_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i810_pci_ids.h new file mode 100644 index 000000000..7f681925d --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/i810_pci_ids.h @@ -0,0 +1,4 @@ +CHIPSET(0x7121, I810, i8xx) +CHIPSET(0x7123, I810_DC100, i8xx) +CHIPSET(0x7125, I810_E, i8xx) +CHIPSET(0x1132, I815, i8xx) diff --git a/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h new file mode 100644 index 000000000..7d51975c3 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/i915_pci_ids.h @@ -0,0 +1,15 @@ +CHIPSET(0x3577, I830_M, "Intel(R) 830M") +CHIPSET(0x2562, 845_G, "Intel(R) 845G") +CHIPSET(0x3582, I855_GM, "Intel(R) 852GM/855GM") +CHIPSET(0x2572, I865_G, "Intel(R) 865G") +CHIPSET(0x2582, I915_G, "Intel(R) 915G") +CHIPSET(0x258A, E7221_G, "Intel(R) E7221G (i915)") +CHIPSET(0x2592, I915_GM, "Intel(R) 915GM") +CHIPSET(0x2772, I945_G, "Intel(R) 945G") +CHIPSET(0x27A2, I945_GM, "Intel(R) 945GM") +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") diff --git a/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h new file mode 100644 index 000000000..2e04301fb --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/i965_pci_ids.h @@ -0,0 +1,115 @@ +CHIPSET(0x29A2, i965, "Intel(R) 965G") +CHIPSET(0x2992, i965, "Intel(R) 965Q") +CHIPSET(0x2982, i965, "Intel(R) 965G") +CHIPSET(0x2972, i965, "Intel(R) 946GZ") +CHIPSET(0x2A02, i965, "Intel(R) 965GM") +CHIPSET(0x2A12, i965, "Intel(R) 965GME/GLE") +CHIPSET(0x2A42, g4x, "Mobile Intel® GM45 Express Chipset") +CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") +CHIPSET(0x2E12, g4x, "Intel(R) Q45/Q43") +CHIPSET(0x2E22, g4x, "Intel(R) G45/G43") +CHIPSET(0x2E32, g4x, "Intel(R) G41") +CHIPSET(0x2E42, g4x, "Intel(R) B43") +CHIPSET(0x2E92, g4x, "Intel(R) B43") +CHIPSET(0x0042, ilk, "Intel(R) Ironlake Desktop") +CHIPSET(0x0046, ilk, "Intel(R) Ironlake Mobile") +CHIPSET(0x0102, snb_gt1, "Intel(R) Sandybridge Desktop") +CHIPSET(0x0112, snb_gt2, "Intel(R) Sandybridge Desktop") +CHIPSET(0x0122, snb_gt2, "Intel(R) Sandybridge Desktop") +CHIPSET(0x0106, snb_gt1, "Intel(R) Sandybridge Mobile") +CHIPSET(0x0116, snb_gt2, "Intel(R) Sandybridge Mobile") +CHIPSET(0x0126, snb_gt2, "Intel(R) Sandybridge Mobile") +CHIPSET(0x010A, snb_gt1, "Intel(R) Sandybridge Server") +CHIPSET(0x0152, ivb_gt1, "Intel(R) Ivybridge Desktop") +CHIPSET(0x0162, ivb_gt2, "Intel(R) Ivybridge Desktop") +CHIPSET(0x0156, ivb_gt1, "Intel(R) Ivybridge Mobile") +CHIPSET(0x0166, ivb_gt2, "Intel(R) Ivybridge Mobile") +CHIPSET(0x015a, ivb_gt1, "Intel(R) Ivybridge Server") +CHIPSET(0x016a, ivb_gt2, "Intel(R) Ivybridge Server") +CHIPSET(0x0402, hsw_gt1, "Intel(R) Haswell Desktop") +CHIPSET(0x0412, hsw_gt2, "Intel(R) Haswell Desktop") +CHIPSET(0x0422, hsw_gt3, "Intel(R) Haswell Desktop") +CHIPSET(0x0406, hsw_gt1, "Intel(R) Haswell Mobile") +CHIPSET(0x0416, hsw_gt2, "Intel(R) Haswell Mobile") +CHIPSET(0x0426, hsw_gt3, "Intel(R) Haswell Mobile") +CHIPSET(0x040A, hsw_gt1, "Intel(R) Haswell Server") +CHIPSET(0x041A, hsw_gt2, "Intel(R) Haswell Server") +CHIPSET(0x042A, hsw_gt3, "Intel(R) Haswell Server") +CHIPSET(0x040B, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x041B, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x042B, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x040E, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x041E, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x042E, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0C02, hsw_gt1, "Intel(R) Haswell Desktop") +CHIPSET(0x0C12, hsw_gt2, "Intel(R) Haswell Desktop") +CHIPSET(0x0C22, hsw_gt3, "Intel(R) Haswell Desktop") +CHIPSET(0x0C06, hsw_gt1, "Intel(R) Haswell Mobile") +CHIPSET(0x0C16, hsw_gt2, "Intel(R) Haswell Mobile") +CHIPSET(0x0C26, hsw_gt3, "Intel(R) Haswell Mobile") +CHIPSET(0x0C0A, hsw_gt1, "Intel(R) Haswell Server") +CHIPSET(0x0C1A, hsw_gt2, "Intel(R) Haswell Server") +CHIPSET(0x0C2A, hsw_gt3, "Intel(R) Haswell Server") +CHIPSET(0x0C0B, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0C1B, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0C2B, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0C0E, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0C1E, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0C2E, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0A02, hsw_gt1, "Intel(R) Haswell Desktop") +CHIPSET(0x0A12, hsw_gt2, "Intel(R) Haswell Desktop") +CHIPSET(0x0A22, hsw_gt3, "Intel(R) Haswell Desktop") +CHIPSET(0x0A06, hsw_gt1, "Intel(R) Haswell Mobile") +CHIPSET(0x0A16, hsw_gt2, "Intel(R) Haswell Mobile") +CHIPSET(0x0A26, hsw_gt3, "Intel(R) Haswell Mobile") +CHIPSET(0x0A0A, hsw_gt1, "Intel(R) Haswell Server") +CHIPSET(0x0A1A, hsw_gt2, "Intel(R) Haswell Server") +CHIPSET(0x0A2A, hsw_gt3, "Intel(R) Haswell Server") +CHIPSET(0x0A0B, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0A1B, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0A2B, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0A0E, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0A1E, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0A2E, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0D02, hsw_gt1, "Intel(R) Haswell Desktop") +CHIPSET(0x0D12, hsw_gt2, "Intel(R) Haswell Desktop") +CHIPSET(0x0D22, hsw_gt3, "Intel(R) Haswell Desktop") +CHIPSET(0x0D06, hsw_gt1, "Intel(R) Haswell Mobile") +CHIPSET(0x0D16, hsw_gt2, "Intel(R) Haswell Mobile") +CHIPSET(0x0D26, hsw_gt3, "Intel(R) Haswell Mobile") +CHIPSET(0x0D0A, hsw_gt1, "Intel(R) Haswell Server") +CHIPSET(0x0D1A, hsw_gt2, "Intel(R) Haswell Server") +CHIPSET(0x0D2A, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0D0B, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0D1B, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0D2B, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0D0E, hsw_gt1, "Intel(R) Haswell") +CHIPSET(0x0D1E, hsw_gt2, "Intel(R) Haswell") +CHIPSET(0x0D2E, hsw_gt3, "Intel(R) Haswell") +CHIPSET(0x0F31, byt, "Intel(R) Bay Trail") +CHIPSET(0x0F32, byt, "Intel(R) Bay Trail") +CHIPSET(0x0F33, byt, "Intel(R) Bay Trail") +CHIPSET(0x0157, byt, "Intel(R) Bay Trail") +CHIPSET(0x0155, byt, "Intel(R) Bay Trail") +CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell GT1") +CHIPSET(0x1612, bdw_gt2, "Intel(R) HD Graphics 5600 (Broadwell GT2)") +CHIPSET(0x1616, bdw_gt2, "Intel(R) HD Graphics 5500 (Broadwell GT2)") +CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell GT2") +CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell GT2") +CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell GT2") +CHIPSET(0x161E, bdw_gt2, "Intel(R) HD Graphics 5300 (Broadwell GT2)") +CHIPSET(0x1622, bdw_gt3, "Intel(R) Iris Pro 6200 (Broadwell GT3e)") +CHIPSET(0x1626, bdw_gt3, "Intel(R) HD Graphics 6000 (Broadwell GT3)") +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") 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 new file mode 100644 index 000000000..8a97c6f31 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h @@ -0,0 +1,80 @@ +#ifndef _PCI_ID_DRIVER_MAP_H_ +#define _PCI_ID_DRIVER_MAP_H_ + +#include + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#endif + +static const int i915_chip_ids[] = { +#define CHIPSET(chip, desc, name) chip, +#include "pci_ids/i915_pci_ids.h" +#undef CHIPSET +}; + +static const int i965_chip_ids[] = { +#define CHIPSET(chip, family, name) chip, +#include "pci_ids/i965_pci_ids.h" +#undef CHIPSET +}; + +#ifndef DRIVER_MAP_GALLIUM_ONLY +static const int r100_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/radeon_pci_ids.h" +#undef CHIPSET +}; + +static const int r200_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/r200_pci_ids.h" +#undef CHIPSET +}; +#endif + +static const int r300_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/r300_pci_ids.h" +#undef CHIPSET +}; + +static const int r600_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/r600_pci_ids.h" +#undef CHIPSET +}; + +static const int radeonsi_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/radeonsi_pci_ids.h" +#undef CHIPSET +}; + +static const int vmwgfx_chip_ids[] = { +#define CHIPSET(chip, name, family) chip, +#include "pci_ids/vmwgfx_pci_ids.h" +#undef CHIPSET +}; + +static const struct { + int vendor_id; + const char *driver; + const int *chip_ids; + int num_chips_ids; +} driver_map[] = { + { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, + { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, +#ifndef DRIVER_MAP_GALLIUM_ONLY + { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, + { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) }, +#endif + { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, + { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, + { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, + { 0x10de, "nouveau", NULL, -1 }, + { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, + { 0x0000, NULL, NULL, 0 }, +}; + +#endif /* _PCI_ID_DRIVER_MAP_H_ */ diff --git a/xserver/hw/xfree86/dri2/pci_ids/r200_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/r200_pci_ids.h new file mode 100644 index 000000000..f857ca704 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/r200_pci_ids.h @@ -0,0 +1,24 @@ +CHIPSET(0x5148, R200_QH, R200) +CHIPSET(0x514C, R200_QL, R200) +CHIPSET(0x514D, R200_QM, R200) +CHIPSET(0x4242, R200_BB, R200) + +CHIPSET(0x4966, RV250_If, RV250) +CHIPSET(0x4967, RV250_Ig, RV250) +CHIPSET(0x4C64, RV250_Ld, RV250) +CHIPSET(0x4C66, RV250_Lf, RV250) +CHIPSET(0x4C67, RV250_Lg, RV250) + +CHIPSET(0x4C6E, RV280_4C6E, RV280) +CHIPSET(0x5960, RV280_5960, RV280) +CHIPSET(0x5961, RV280_5961, RV280) +CHIPSET(0x5962, RV280_5962, RV280) +CHIPSET(0x5964, RV280_5964, RV280) +CHIPSET(0x5965, RV280_5965, RV280) +CHIPSET(0x5C61, RV280_5C61, RV280) +CHIPSET(0x5C63, RV280_5C63, RV280) + +CHIPSET(0x5834, RS300_5834, RS300) +CHIPSET(0x5835, RS300_5835, RS300) +CHIPSET(0x7834, RS350_7834, RS300) +CHIPSET(0x7835, RS350_7835, RS300) diff --git a/xserver/hw/xfree86/dri2/pci_ids/r300_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/r300_pci_ids.h new file mode 100644 index 000000000..791026ae7 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/r300_pci_ids.h @@ -0,0 +1,227 @@ +CHIPSET(0x4144, R300_AD, R300) +CHIPSET(0x4145, R300_AE, R300) +CHIPSET(0x4146, R300_AF, R300) +CHIPSET(0x4147, R300_AG, R300) +CHIPSET(0x4E44, R300_ND, R300) +CHIPSET(0x4E45, R300_NE, R300) +CHIPSET(0x4E46, R300_NF, R300) +CHIPSET(0x4E47, R300_NG, R300) + +CHIPSET(0x4E48, R350_NH, R350) +CHIPSET(0x4E49, R350_NI, R350) +CHIPSET(0x4E4B, R350_NK, R350) +CHIPSET(0x4148, R350_AH, R350) +CHIPSET(0x4149, R350_AI, R350) +CHIPSET(0x414A, R350_AJ, R350) +CHIPSET(0x414B, R350_AK, R350) +CHIPSET(0x4E4A, R360_NJ, R350) + +CHIPSET(0x4150, RV350_AP, RV350) +CHIPSET(0x4151, RV350_AQ, RV350) +CHIPSET(0x4152, RV350_AR, RV350) +CHIPSET(0x4153, RV350_AS, RV350) +CHIPSET(0x4154, RV350_AT, RV350) +CHIPSET(0x4155, RV350_AU, RV350) +CHIPSET(0x4156, RV350_AV, RV350) +CHIPSET(0x4E50, RV350_NP, RV350) +CHIPSET(0x4E51, RV350_NQ, RV350) +CHIPSET(0x4E52, RV350_NR, RV350) +CHIPSET(0x4E53, RV350_NS, RV350) +CHIPSET(0x4E54, RV350_NT, RV350) +CHIPSET(0x4E56, RV350_NV, RV350) + +CHIPSET(0x5460, RV370_5460, RV370) +CHIPSET(0x5462, RV370_5462, RV370) +CHIPSET(0x5464, RV370_5464, RV370) +CHIPSET(0x5B60, RV370_5B60, RV370) +CHIPSET(0x5B62, RV370_5B62, RV370) +CHIPSET(0x5B63, RV370_5B63, RV370) +CHIPSET(0x5B64, RV370_5B64, RV370) +CHIPSET(0x5B65, RV370_5B65, RV370) + +CHIPSET(0x3150, RV380_3150, RV380) +CHIPSET(0x3151, RV380_3151, RV380) +CHIPSET(0x3152, RV380_3152, RV380) +CHIPSET(0x3154, RV380_3154, RV380) +CHIPSET(0x3155, RV380_3155, RV380) +CHIPSET(0x3E50, RV380_3E50, RV380) +CHIPSET(0x3E54, RV380_3E54, RV380) + +CHIPSET(0x4A48, R420_JH, R420) +CHIPSET(0x4A49, R420_JI, R420) +CHIPSET(0x4A4A, R420_JJ, R420) +CHIPSET(0x4A4B, R420_JK, R420) +CHIPSET(0x4A4C, R420_JL, R420) +CHIPSET(0x4A4D, R420_JM, R420) +CHIPSET(0x4A4E, R420_JN, R420) +CHIPSET(0x4A4F, R420_JO, R420) +CHIPSET(0x4A50, R420_JP, R420) +CHIPSET(0x4A54, R420_JT, R420) + +CHIPSET(0x5548, R423_UH, R423) +CHIPSET(0x5549, R423_UI, R423) +CHIPSET(0x554A, R423_UJ, R423) +CHIPSET(0x554B, R423_UK, R423) +CHIPSET(0x5550, R423_5550, R423) +CHIPSET(0x5551, R423_UQ, R423) +CHIPSET(0x5552, R423_UR, R423) +CHIPSET(0x5554, R423_UT, R423) +CHIPSET(0x5D57, R423_5D57, R423) + +CHIPSET(0x554C, R430_554C, R430) +CHIPSET(0x554D, R430_554D, R430) +CHIPSET(0x554E, R430_554E, R430) +CHIPSET(0x554F, R430_554F, R430) +CHIPSET(0x5D48, R430_5D48, R430) +CHIPSET(0x5D49, R430_5D49, R430) +CHIPSET(0x5D4A, R430_5D4A, R430) + +CHIPSET(0x5D4C, R480_5D4C, R480) +CHIPSET(0x5D4D, R480_5D4D, R480) +CHIPSET(0x5D4E, R480_5D4E, R480) +CHIPSET(0x5D4F, R480_5D4F, R480) +CHIPSET(0x5D50, R480_5D50, R480) +CHIPSET(0x5D52, R480_5D52, R480) + +CHIPSET(0x4B48, R481_4B48, R481) +CHIPSET(0x4B49, R481_4B49, R481) +CHIPSET(0x4B4A, R481_4B4A, R481) +CHIPSET(0x4B4B, R481_4B4B, R481) +CHIPSET(0x4B4C, R481_4B4C, R481) + +CHIPSET(0x564A, RV410_564A, RV410) +CHIPSET(0x564B, RV410_564B, RV410) +CHIPSET(0x564F, RV410_564F, RV410) +CHIPSET(0x5652, RV410_5652, RV410) +CHIPSET(0x5653, RV410_5653, RV410) +CHIPSET(0x5657, RV410_5657, RV410) +CHIPSET(0x5E48, RV410_5E48, RV410) +CHIPSET(0x5E4A, RV410_5E4A, RV410) +CHIPSET(0x5E4B, RV410_5E4B, RV410) +CHIPSET(0x5E4C, RV410_5E4C, RV410) +CHIPSET(0x5E4D, RV410_5E4D, RV410) +CHIPSET(0x5E4F, RV410_5E4F, RV410) + +CHIPSET(0x5A41, RS400_5A41, RS400) +CHIPSET(0x5A42, RS400_5A42, RS400) + +CHIPSET(0x5A61, RC410_5A61, RC410) +CHIPSET(0x5A62, RC410_5A62, RC410) + +CHIPSET(0x5954, RS480_5954, RS480) +CHIPSET(0x5955, RS480_5955, RS480) +CHIPSET(0x5974, RS482_5974, RS480) +CHIPSET(0x5975, RS482_5975, RS480) + +CHIPSET(0x7100, R520_7100, R520) +CHIPSET(0x7101, R520_7101, R520) +CHIPSET(0x7102, R520_7102, R520) +CHIPSET(0x7103, R520_7103, R520) +CHIPSET(0x7104, R520_7104, R520) +CHIPSET(0x7105, R520_7105, R520) +CHIPSET(0x7106, R520_7106, R520) +CHIPSET(0x7108, R520_7108, R520) +CHIPSET(0x7109, R520_7109, R520) +CHIPSET(0x710A, R520_710A, R520) +CHIPSET(0x710B, R520_710B, R520) +CHIPSET(0x710C, R520_710C, R520) +CHIPSET(0x710E, R520_710E, R520) +CHIPSET(0x710F, R520_710F, R520) + +CHIPSET(0x7140, RV515_7140, RV515) +CHIPSET(0x7141, RV515_7141, RV515) +CHIPSET(0x7142, RV515_7142, RV515) +CHIPSET(0x7143, RV515_7143, RV515) +CHIPSET(0x7144, RV515_7144, RV515) +CHIPSET(0x7145, RV515_7145, RV515) +CHIPSET(0x7146, RV515_7146, RV515) +CHIPSET(0x7147, RV515_7147, RV515) +CHIPSET(0x7149, RV515_7149, RV515) +CHIPSET(0x714A, RV515_714A, RV515) +CHIPSET(0x714B, RV515_714B, RV515) +CHIPSET(0x714C, RV515_714C, RV515) +CHIPSET(0x714D, RV515_714D, RV515) +CHIPSET(0x714E, RV515_714E, RV515) +CHIPSET(0x714F, RV515_714F, RV515) +CHIPSET(0x7151, RV515_7151, RV515) +CHIPSET(0x7152, RV515_7152, RV515) +CHIPSET(0x7153, RV515_7153, RV515) +CHIPSET(0x715E, RV515_715E, RV515) +CHIPSET(0x715F, RV515_715F, RV515) +CHIPSET(0x7180, RV515_7180, RV515) +CHIPSET(0x7181, RV515_7181, RV515) +CHIPSET(0x7183, RV515_7183, RV515) +CHIPSET(0x7186, RV515_7186, RV515) +CHIPSET(0x7187, RV515_7187, RV515) +CHIPSET(0x7188, RV515_7188, RV515) +CHIPSET(0x718A, RV515_718A, RV515) +CHIPSET(0x718B, RV515_718B, RV515) +CHIPSET(0x718C, RV515_718C, RV515) +CHIPSET(0x718D, RV515_718D, RV515) +CHIPSET(0x718F, RV515_718F, RV515) +CHIPSET(0x7193, RV515_7193, RV515) +CHIPSET(0x7196, RV515_7196, RV515) +CHIPSET(0x719B, RV515_719B, RV515) +CHIPSET(0x719F, RV515_719F, RV515) +CHIPSET(0x7200, RV515_7200, RV515) +CHIPSET(0x7210, RV515_7210, RV515) +CHIPSET(0x7211, RV515_7211, RV515) + +CHIPSET(0x71C0, RV530_71C0, RV530) +CHIPSET(0x71C1, RV530_71C1, RV530) +CHIPSET(0x71C2, RV530_71C2, RV530) +CHIPSET(0x71C3, RV530_71C3, RV530) +CHIPSET(0x71C4, RV530_71C4, RV530) +CHIPSET(0x71C5, RV530_71C5, RV530) +CHIPSET(0x71C6, RV530_71C6, RV530) +CHIPSET(0x71C7, RV530_71C7, RV530) +CHIPSET(0x71CD, RV530_71CD, RV530) +CHIPSET(0x71CE, RV530_71CE, RV530) +CHIPSET(0x71D2, RV530_71D2, RV530) +CHIPSET(0x71D4, RV530_71D4, RV530) +CHIPSET(0x71D5, RV530_71D5, RV530) +CHIPSET(0x71D6, RV530_71D6, RV530) +CHIPSET(0x71DA, RV530_71DA, RV530) +CHIPSET(0x71DE, RV530_71DE, RV530) + +CHIPSET(0x7281, RV560_7281, RV560) +CHIPSET(0x7283, RV560_7283, RV560) +CHIPSET(0x7287, RV560_7287, RV560) +CHIPSET(0x7290, RV560_7290, RV560) +CHIPSET(0x7291, RV560_7291, RV560) +CHIPSET(0x7293, RV560_7293, RV560) +CHIPSET(0x7297, RV560_7297, RV560) + +CHIPSET(0x7280, RV570_7280, RV570) +CHIPSET(0x7288, RV570_7288, RV570) +CHIPSET(0x7289, RV570_7289, RV570) +CHIPSET(0x728B, RV570_728B, RV570) +CHIPSET(0x728C, RV570_728C, RV570) + +CHIPSET(0x7240, R580_7240, R580) +CHIPSET(0x7243, R580_7243, R580) +CHIPSET(0x7244, R580_7244, R580) +CHIPSET(0x7245, R580_7245, R580) +CHIPSET(0x7246, R580_7246, R580) +CHIPSET(0x7247, R580_7247, R580) +CHIPSET(0x7248, R580_7248, R580) +CHIPSET(0x7249, R580_7249, R580) +CHIPSET(0x724A, R580_724A, R580) +CHIPSET(0x724B, R580_724B, R580) +CHIPSET(0x724C, R580_724C, R580) +CHIPSET(0x724D, R580_724D, R580) +CHIPSET(0x724E, R580_724E, R580) +CHIPSET(0x724F, R580_724F, R580) +CHIPSET(0x7284, R580_7284, R580) + +CHIPSET(0x793F, RS600_793F, RS600) +CHIPSET(0x7941, RS600_7941, RS600) +CHIPSET(0x7942, RS600_7942, RS600) + +CHIPSET(0x791E, RS690_791E, RS690) +CHIPSET(0x791F, RS690_791F, RS690) + +CHIPSET(0x796C, RS740_796C, RS740) +CHIPSET(0x796D, RS740_796D, RS740) +CHIPSET(0x796E, RS740_796E, RS740) +CHIPSET(0x796F, RS740_796F, RS740) diff --git a/xserver/hw/xfree86/dri2/pci_ids/r600_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/r600_pci_ids.h new file mode 100644 index 000000000..533c9f3fc --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/r600_pci_ids.h @@ -0,0 +1,327 @@ +CHIPSET(0x9400, R600_9400, R600) +CHIPSET(0x9401, R600_9401, R600) +CHIPSET(0x9402, R600_9402, R600) +CHIPSET(0x9403, R600_9403, R600) +CHIPSET(0x9405, R600_9405, R600) +CHIPSET(0x940A, R600_940A, R600) +CHIPSET(0x940B, R600_940B, R600) +CHIPSET(0x940F, R600_940F, R600) + +CHIPSET(0x94C0, RV610_94C0, RV610) +CHIPSET(0x94C1, RV610_94C1, RV610) +CHIPSET(0x94C3, RV610_94C3, RV610) +CHIPSET(0x94C4, RV610_94C4, RV610) +CHIPSET(0x94C5, RV610_94C5, RV610) +CHIPSET(0x94C6, RV610_94C6, RV610) +CHIPSET(0x94C7, RV610_94C7, RV610) +CHIPSET(0x94C8, RV610_94C8, RV610) +CHIPSET(0x94C9, RV610_94C9, RV610) +CHIPSET(0x94CB, RV610_94CB, RV610) +CHIPSET(0x94CC, RV610_94CC, RV610) +CHIPSET(0x94CD, RV610_94CD, RV610) + +CHIPSET(0x9580, RV630_9580, RV630) +CHIPSET(0x9581, RV630_9581, RV630) +CHIPSET(0x9583, RV630_9583, RV630) +CHIPSET(0x9586, RV630_9586, RV630) +CHIPSET(0x9587, RV630_9587, RV630) +CHIPSET(0x9588, RV630_9588, RV630) +CHIPSET(0x9589, RV630_9589, RV630) +CHIPSET(0x958A, RV630_958A, RV630) +CHIPSET(0x958B, RV630_958B, RV630) +CHIPSET(0x958C, RV630_958C, RV630) +CHIPSET(0x958D, RV630_958D, RV630) +CHIPSET(0x958E, RV630_958E, RV630) +CHIPSET(0x958F, RV630_958F, RV630) + +CHIPSET(0x9500, RV670_9500, RV670) +CHIPSET(0x9501, RV670_9501, RV670) +CHIPSET(0x9504, RV670_9504, RV670) +CHIPSET(0x9505, RV670_9505, RV670) +CHIPSET(0x9506, RV670_9506, RV670) +CHIPSET(0x9507, RV670_9507, RV670) +CHIPSET(0x9508, RV670_9508, RV670) +CHIPSET(0x9509, RV670_9509, RV670) +CHIPSET(0x950F, RV670_950F, RV670) +CHIPSET(0x9511, RV670_9511, RV670) +CHIPSET(0x9515, RV670_9515, RV670) +CHIPSET(0x9517, RV670_9517, RV670) +CHIPSET(0x9519, RV670_9519, RV670) + +CHIPSET(0x95C0, RV620_95C0, RV620) +CHIPSET(0x95C2, RV620_95C2, RV620) +CHIPSET(0x95C4, RV620_95C4, RV620) +CHIPSET(0x95C5, RV620_95C5, RV620) +CHIPSET(0x95C6, RV620_95C6, RV620) +CHIPSET(0x95C7, RV620_95C7, RV620) +CHIPSET(0x95C9, RV620_95C9, RV620) +CHIPSET(0x95CC, RV620_95CC, RV620) +CHIPSET(0x95CD, RV620_95CD, RV620) +CHIPSET(0x95CE, RV620_95CE, RV620) +CHIPSET(0x95CF, RV620_95CF, RV620) + +CHIPSET(0x9590, RV635_9590, RV635) +CHIPSET(0x9591, RV635_9591, RV635) +CHIPSET(0x9593, RV635_9593, RV635) +CHIPSET(0x9595, RV635_9595, RV635) +CHIPSET(0x9596, RV635_9596, RV635) +CHIPSET(0x9597, RV635_9597, RV635) +CHIPSET(0x9598, RV635_9598, RV635) +CHIPSET(0x9599, RV635_9599, RV635) +CHIPSET(0x959B, RV635_959B, RV635) + +CHIPSET(0x9610, RS780_9610, RS780) +CHIPSET(0x9611, RS780_9611, RS780) +CHIPSET(0x9612, RS780_9612, RS780) +CHIPSET(0x9613, RS780_9613, RS780) +CHIPSET(0x9614, RS780_9614, RS780) +CHIPSET(0x9615, RS780_9615, RS780) +CHIPSET(0x9616, RS780_9616, RS780) + +CHIPSET(0x9710, RS880_9710, RS880) +CHIPSET(0x9711, RS880_9711, RS880) +CHIPSET(0x9712, RS880_9712, RS880) +CHIPSET(0x9713, RS880_9713, RS880) +CHIPSET(0x9714, RS880_9714, RS880) +CHIPSET(0x9715, RS880_9715, RS880) + +CHIPSET(0x9440, RV770_9440, RV770) +CHIPSET(0x9441, RV770_9441, RV770) +CHIPSET(0x9442, RV770_9442, RV770) +CHIPSET(0x9443, RV770_9443, RV770) +CHIPSET(0x9444, RV770_9444, RV770) +CHIPSET(0x9446, RV770_9446, RV770) +CHIPSET(0x944A, RV770_944A, RV770) +CHIPSET(0x944B, RV770_944B, RV770) +CHIPSET(0x944C, RV770_944C, RV770) +CHIPSET(0x944E, RV770_944E, RV770) +CHIPSET(0x9450, RV770_9450, RV770) +CHIPSET(0x9452, RV770_9452, RV770) +CHIPSET(0x9456, RV770_9456, RV770) +CHIPSET(0x945A, RV770_945A, RV770) +CHIPSET(0x945B, RV770_945B, RV770) +CHIPSET(0x945E, RV770_945E, RV770) +CHIPSET(0x9460, RV790_9460, RV770) +CHIPSET(0x9462, RV790_9462, RV770) +CHIPSET(0x946A, RV770_946A, RV770) +CHIPSET(0x946B, RV770_946B, RV770) +CHIPSET(0x947A, RV770_947A, RV770) +CHIPSET(0x947B, RV770_947B, RV770) + +CHIPSET(0x9480, RV730_9480, RV730) +CHIPSET(0x9487, RV730_9487, RV730) +CHIPSET(0x9488, RV730_9488, RV730) +CHIPSET(0x9489, RV730_9489, RV730) +CHIPSET(0x948A, RV730_948A, RV730) +CHIPSET(0x948F, RV730_948F, RV730) +CHIPSET(0x9490, RV730_9490, RV730) +CHIPSET(0x9491, RV730_9491, RV730) +CHIPSET(0x9495, RV730_9495, RV730) +CHIPSET(0x9498, RV730_9498, RV730) +CHIPSET(0x949C, RV730_949C, RV730) +CHIPSET(0x949E, RV730_949E, RV730) +CHIPSET(0x949F, RV730_949F, RV730) + +CHIPSET(0x9540, RV710_9540, RV710) +CHIPSET(0x9541, RV710_9541, RV710) +CHIPSET(0x9542, RV710_9542, RV710) +CHIPSET(0x954E, RV710_954E, RV710) +CHIPSET(0x954F, RV710_954F, RV710) +CHIPSET(0x9552, RV710_9552, RV710) +CHIPSET(0x9553, RV710_9553, RV710) +CHIPSET(0x9555, RV710_9555, RV710) +CHIPSET(0x9557, RV710_9557, RV710) +CHIPSET(0x955F, RV710_955F, RV710) + +CHIPSET(0x94A0, RV740_94A0, RV740) +CHIPSET(0x94A1, RV740_94A1, RV740) +CHIPSET(0x94A3, RV740_94A3, RV740) +CHIPSET(0x94B1, RV740_94B1, RV740) +CHIPSET(0x94B3, RV740_94B3, RV740) +CHIPSET(0x94B4, RV740_94B4, RV740) +CHIPSET(0x94B5, RV740_94B5, RV740) +CHIPSET(0x94B9, RV740_94B9, RV740) + +CHIPSET(0x68E0, CEDAR_68E0, CEDAR) +CHIPSET(0x68E1, CEDAR_68E1, CEDAR) +CHIPSET(0x68E4, CEDAR_68E4, CEDAR) +CHIPSET(0x68E5, CEDAR_68E5, CEDAR) +CHIPSET(0x68E8, CEDAR_68E8, CEDAR) +CHIPSET(0x68E9, CEDAR_68E9, CEDAR) +CHIPSET(0x68F1, CEDAR_68F1, CEDAR) +CHIPSET(0x68F2, CEDAR_68F2, CEDAR) +CHIPSET(0x68F8, CEDAR_68F8, CEDAR) +CHIPSET(0x68F9, CEDAR_68F9, CEDAR) +CHIPSET(0x68FA, CEDAR_68FA, CEDAR) +CHIPSET(0x68FE, CEDAR_68FE, CEDAR) + +CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD) +CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD) +CHIPSET(0x68C7, REDWOOD_68C7, REDWOOD) +CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD) +CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD) +CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD) +CHIPSET(0x68D9, REDWOOD_68D9, REDWOOD) +CHIPSET(0x68DA, REDWOOD_68DA, REDWOOD) +CHIPSET(0x68DE, REDWOOD_68DE, REDWOOD) + +CHIPSET(0x68A0, JUNIPER_68A0, JUNIPER) +CHIPSET(0x68A1, JUNIPER_68A1, JUNIPER) +CHIPSET(0x68A8, JUNIPER_68A8, JUNIPER) +CHIPSET(0x68A9, JUNIPER_68A9, JUNIPER) +CHIPSET(0x68B0, JUNIPER_68B0, JUNIPER) +CHIPSET(0x68B8, JUNIPER_68B8, JUNIPER) +CHIPSET(0x68B9, JUNIPER_68B9, JUNIPER) +CHIPSET(0x68BA, JUNIPER_68BA, JUNIPER) +CHIPSET(0x68BE, JUNIPER_68BE, JUNIPER) +CHIPSET(0x68BF, JUNIPER_68BF, JUNIPER) + +CHIPSET(0x6880, CYPRESS_6880, CYPRESS) +CHIPSET(0x6888, CYPRESS_6888, CYPRESS) +CHIPSET(0x6889, CYPRESS_6889, CYPRESS) +CHIPSET(0x688A, CYPRESS_688A, CYPRESS) +CHIPSET(0x688C, CYPRESS_688C, CYPRESS) +CHIPSET(0x688D, CYPRESS_688D, CYPRESS) +CHIPSET(0x6898, CYPRESS_6898, CYPRESS) +CHIPSET(0x6899, CYPRESS_6899, CYPRESS) +CHIPSET(0x689B, CYPRESS_689B, CYPRESS) +CHIPSET(0x689E, CYPRESS_689E, CYPRESS) + +CHIPSET(0x689C, HEMLOCK_689C, HEMLOCK) +CHIPSET(0x689D, HEMLOCK_689D, HEMLOCK) + +CHIPSET(0x9802, PALM_9802, PALM) +CHIPSET(0x9803, PALM_9803, PALM) +CHIPSET(0x9804, PALM_9804, PALM) +CHIPSET(0x9805, PALM_9805, PALM) +CHIPSET(0x9806, PALM_9806, PALM) +CHIPSET(0x9807, PALM_9807, PALM) +CHIPSET(0x9808, PALM_9808, PALM) +CHIPSET(0x9809, PALM_9809, PALM) +CHIPSET(0x980A, PALM_980A, PALM) + +CHIPSET(0x9640, SUMO_9640, SUMO) +CHIPSET(0x9641, SUMO_9641, SUMO) +CHIPSET(0x9642, SUMO2_9642, SUMO2) +CHIPSET(0x9643, SUMO2_9643, SUMO2) +CHIPSET(0x9644, SUMO2_9644, SUMO2) +CHIPSET(0x9645, SUMO2_9645, SUMO2) +CHIPSET(0x9647, SUMO_9647, SUMO) +CHIPSET(0x9648, SUMO_9648, SUMO) +CHIPSET(0x9649, SUMO2_9649, SUMO2) +CHIPSET(0x964a, SUMO_964A, SUMO) +CHIPSET(0x964b, SUMO_964B, SUMO) +CHIPSET(0x964c, SUMO_964C, SUMO) +CHIPSET(0x964e, SUMO_964E, SUMO) +CHIPSET(0x964f, SUMO_964F, SUMO) + +CHIPSET(0x6700, CAYMAN_6700, CAYMAN) +CHIPSET(0x6701, CAYMAN_6701, CAYMAN) +CHIPSET(0x6702, CAYMAN_6702, CAYMAN) +CHIPSET(0x6703, CAYMAN_6703, CAYMAN) +CHIPSET(0x6704, CAYMAN_6704, CAYMAN) +CHIPSET(0x6705, CAYMAN_6705, CAYMAN) +CHIPSET(0x6706, CAYMAN_6706, CAYMAN) +CHIPSET(0x6707, CAYMAN_6707, CAYMAN) +CHIPSET(0x6708, CAYMAN_6708, CAYMAN) +CHIPSET(0x6709, CAYMAN_6709, CAYMAN) +CHIPSET(0x6718, CAYMAN_6718, CAYMAN) +CHIPSET(0x6719, CAYMAN_6719, CAYMAN) +CHIPSET(0x671C, CAYMAN_671C, CAYMAN) +CHIPSET(0x671D, CAYMAN_671D, CAYMAN) +CHIPSET(0x671F, CAYMAN_671F, CAYMAN) + +CHIPSET(0x6720, BARTS_6720, BARTS) +CHIPSET(0x6721, BARTS_6721, BARTS) +CHIPSET(0x6722, BARTS_6722, BARTS) +CHIPSET(0x6723, BARTS_6723, BARTS) +CHIPSET(0x6724, BARTS_6724, BARTS) +CHIPSET(0x6725, BARTS_6725, BARTS) +CHIPSET(0x6726, BARTS_6726, BARTS) +CHIPSET(0x6727, BARTS_6727, BARTS) +CHIPSET(0x6728, BARTS_6728, BARTS) +CHIPSET(0x6729, BARTS_6729, BARTS) +CHIPSET(0x6738, BARTS_6738, BARTS) +CHIPSET(0x6739, BARTS_6739, BARTS) +CHIPSET(0x673E, BARTS_673E, BARTS) + +CHIPSET(0x6740, TURKS_6740, TURKS) +CHIPSET(0x6741, TURKS_6741, TURKS) +CHIPSET(0x6742, TURKS_6742, TURKS) +CHIPSET(0x6743, TURKS_6743, TURKS) +CHIPSET(0x6744, TURKS_6744, TURKS) +CHIPSET(0x6745, TURKS_6745, TURKS) +CHIPSET(0x6746, TURKS_6746, TURKS) +CHIPSET(0x6747, TURKS_6747, TURKS) +CHIPSET(0x6748, TURKS_6748, TURKS) +CHIPSET(0x6749, TURKS_6749, TURKS) +CHIPSET(0x674A, TURKS_674A, TURKS) +CHIPSET(0x6750, TURKS_6750, TURKS) +CHIPSET(0x6751, TURKS_6751, TURKS) +CHIPSET(0x6758, TURKS_6758, TURKS) +CHIPSET(0x6759, TURKS_6759, TURKS) +CHIPSET(0x675B, TURKS_675B, TURKS) +CHIPSET(0x675D, TURKS_675D, TURKS) +CHIPSET(0x675F, TURKS_675F, TURKS) +CHIPSET(0x6840, TURKS_6840, TURKS) +CHIPSET(0x6841, TURKS_6841, TURKS) +CHIPSET(0x6842, TURKS_6842, TURKS) +CHIPSET(0x6843, TURKS_6843, TURKS) +CHIPSET(0x6849, TURKS_6849, TURKS) +CHIPSET(0x6850, TURKS_6850, TURKS) +CHIPSET(0x6858, TURKS_6858, TURKS) +CHIPSET(0x6859, TURKS_6859, TURKS) + +CHIPSET(0x6760, CAICOS_6760, CAICOS) +CHIPSET(0x6761, CAICOS_6761, CAICOS) +CHIPSET(0x6762, CAICOS_6762, CAICOS) +CHIPSET(0x6763, CAICOS_6763, CAICOS) +CHIPSET(0x6764, CAICOS_6764, CAICOS) +CHIPSET(0x6765, CAICOS_6765, CAICOS) +CHIPSET(0x6766, CAICOS_6766, CAICOS) +CHIPSET(0x6767, CAICOS_6767, CAICOS) +CHIPSET(0x6768, CAICOS_6768, CAICOS) +CHIPSET(0x6770, CAICOS_6770, CAICOS) +CHIPSET(0x6771, CAICOS_6771, CAICOS) +CHIPSET(0x6772, CAICOS_6772, CAICOS) +CHIPSET(0x6778, CAICOS_6778, CAICOS) +CHIPSET(0x6779, CAICOS_6779, CAICOS) +CHIPSET(0x677B, CAICOS_677B, CAICOS) + +CHIPSET(0x9900, ARUBA_9900, ARUBA) +CHIPSET(0x9901, ARUBA_9901, ARUBA) +CHIPSET(0x9903, ARUBA_9903, ARUBA) +CHIPSET(0x9904, ARUBA_9904, ARUBA) +CHIPSET(0x9905, ARUBA_9905, ARUBA) +CHIPSET(0x9906, ARUBA_9906, ARUBA) +CHIPSET(0x9907, ARUBA_9907, ARUBA) +CHIPSET(0x9908, ARUBA_9908, ARUBA) +CHIPSET(0x9909, ARUBA_9909, ARUBA) +CHIPSET(0x990A, ARUBA_990A, ARUBA) +CHIPSET(0x990B, ARUBA_990B, ARUBA) +CHIPSET(0x990C, ARUBA_990C, ARUBA) +CHIPSET(0x990D, ARUBA_990D, ARUBA) +CHIPSET(0x990E, ARUBA_990E, ARUBA) +CHIPSET(0x990F, ARUBA_990F, ARUBA) +CHIPSET(0x9910, ARUBA_9910, ARUBA) +CHIPSET(0x9913, ARUBA_9913, ARUBA) +CHIPSET(0x9917, ARUBA_9917, ARUBA) +CHIPSET(0x9918, ARUBA_9918, ARUBA) +CHIPSET(0x9919, ARUBA_9919, ARUBA) +CHIPSET(0x9990, ARUBA_9990, ARUBA) +CHIPSET(0x9991, ARUBA_9991, ARUBA) +CHIPSET(0x9992, ARUBA_9992, ARUBA) +CHIPSET(0x9993, ARUBA_9993, ARUBA) +CHIPSET(0x9994, ARUBA_9994, ARUBA) +CHIPSET(0x9995, ARUBA_9995, ARUBA) +CHIPSET(0x9996, ARUBA_9996, ARUBA) +CHIPSET(0x9997, ARUBA_9997, ARUBA) +CHIPSET(0x9998, ARUBA_9998, ARUBA) +CHIPSET(0x9999, ARUBA_9999, ARUBA) +CHIPSET(0x999A, ARUBA_999A, ARUBA) +CHIPSET(0x999B, ARUBA_999B, ARUBA) +CHIPSET(0x999C, ARUBA_999C, ARUBA) +CHIPSET(0x999D, ARUBA_999D, ARUBA) +CHIPSET(0x99A0, ARUBA_99A0, ARUBA) +CHIPSET(0x99A2, ARUBA_99A2, ARUBA) +CHIPSET(0x99A4, ARUBA_99A4, ARUBA) diff --git a/xserver/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h new file mode 100644 index 000000000..a9efc767d --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h @@ -0,0 +1,23 @@ +CHIPSET(0x4C57, RADEON_LW, RV200) +CHIPSET(0x4C58, RADEON_LX, RV200) +CHIPSET(0x4C59, RADEON_LY, RV100) +CHIPSET(0x4C5A, RADEON_LZ, RV100) +CHIPSET(0x5144, RADEON_QD, R100) +CHIPSET(0x5145, RADEON_QE, R100) +CHIPSET(0x5146, RADEON_QF, R100) +CHIPSET(0x5147, RADEON_QG, R100) +CHIPSET(0x5159, RADEON_QY, RV100) +CHIPSET(0x515A, RADEON_QZ, RV100) + +CHIPSET(0x5157, RV200_QW, RV200) +CHIPSET(0x5158, RV200_QX, RV200) + +CHIPSET(0x515E, RN50_515E, UNKNOWN) +CHIPSET(0x5969, RN50_5969, UNKNOWN) + +CHIPSET(0x4136, RS100_4136, RS100) +CHIPSET(0x4336, RS100_4336, RS100) +CHIPSET(0x4137, RS200_4137, RS200) +CHIPSET(0x4337, RS200_4337, RS200) +CHIPSET(0x4237, RS250_4237, RS200) +CHIPSET(0x4437, RS250_4437, RS200) diff --git a/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h new file mode 100644 index 000000000..571e8633f --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h @@ -0,0 +1,157 @@ +CHIPSET(0x6780, TAHITI_6780, TAHITI) +CHIPSET(0x6784, TAHITI_6784, TAHITI) +CHIPSET(0x6788, TAHITI_6788, TAHITI) +CHIPSET(0x678A, TAHITI_678A, TAHITI) +CHIPSET(0x6790, TAHITI_6790, TAHITI) +CHIPSET(0x6791, TAHITI_6791, TAHITI) +CHIPSET(0x6792, TAHITI_6792, TAHITI) +CHIPSET(0x6798, TAHITI_6798, TAHITI) +CHIPSET(0x6799, TAHITI_6799, TAHITI) +CHIPSET(0x679A, TAHITI_679A, TAHITI) +CHIPSET(0x679B, TAHITI_679B, TAHITI) +CHIPSET(0x679E, TAHITI_679E, TAHITI) +CHIPSET(0x679F, TAHITI_679F, TAHITI) + +CHIPSET(0x6800, PITCAIRN_6800, PITCAIRN) +CHIPSET(0x6801, PITCAIRN_6801, PITCAIRN) +CHIPSET(0x6802, PITCAIRN_6802, PITCAIRN) +CHIPSET(0x6806, PITCAIRN_6806, PITCAIRN) +CHIPSET(0x6808, PITCAIRN_6808, PITCAIRN) +CHIPSET(0x6809, PITCAIRN_6809, PITCAIRN) +CHIPSET(0x6810, PITCAIRN_6810, PITCAIRN) +CHIPSET(0x6811, PITCAIRN_6811, PITCAIRN) +CHIPSET(0x6816, PITCAIRN_6816, PITCAIRN) +CHIPSET(0x6817, PITCAIRN_6817, PITCAIRN) +CHIPSET(0x6818, PITCAIRN_6818, PITCAIRN) +CHIPSET(0x6819, PITCAIRN_6819, PITCAIRN) +CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN) + +CHIPSET(0x6820, VERDE_6820, VERDE) +CHIPSET(0x6821, VERDE_6821, VERDE) +CHIPSET(0x6822, VERDE_6822, VERDE) +CHIPSET(0x6823, VERDE_6823, VERDE) +CHIPSET(0x6824, VERDE_6824, VERDE) +CHIPSET(0x6825, VERDE_6825, VERDE) +CHIPSET(0x6826, VERDE_6826, VERDE) +CHIPSET(0x6827, VERDE_6827, VERDE) +CHIPSET(0x6828, VERDE_6828, VERDE) +CHIPSET(0x6829, VERDE_6829, VERDE) +CHIPSET(0x682A, VERDE_682A, VERDE) +CHIPSET(0x682B, VERDE_682B, VERDE) +CHIPSET(0x682C, VERDE_682C, VERDE) +CHIPSET(0x682D, VERDE_682D, VERDE) +CHIPSET(0x682F, VERDE_682F, VERDE) +CHIPSET(0x6830, VERDE_6830, VERDE) +CHIPSET(0x6831, VERDE_6831, VERDE) +CHIPSET(0x6835, VERDE_6835, VERDE) +CHIPSET(0x6837, VERDE_6837, VERDE) +CHIPSET(0x6838, VERDE_6838, VERDE) +CHIPSET(0x6839, VERDE_6839, VERDE) +CHIPSET(0x683B, VERDE_683B, VERDE) +CHIPSET(0x683D, VERDE_683D, VERDE) +CHIPSET(0x683F, VERDE_683F, VERDE) + +CHIPSET(0x6600, OLAND_6600, OLAND) +CHIPSET(0x6601, OLAND_6601, OLAND) +CHIPSET(0x6602, OLAND_6602, OLAND) +CHIPSET(0x6603, OLAND_6603, OLAND) +CHIPSET(0x6604, OLAND_6604, OLAND) +CHIPSET(0x6605, OLAND_6605, OLAND) +CHIPSET(0x6606, OLAND_6606, OLAND) +CHIPSET(0x6607, OLAND_6607, OLAND) +CHIPSET(0x6608, OLAND_6608, OLAND) +CHIPSET(0x6610, OLAND_6610, OLAND) +CHIPSET(0x6611, OLAND_6611, OLAND) +CHIPSET(0x6613, OLAND_6613, OLAND) +CHIPSET(0x6620, OLAND_6620, OLAND) +CHIPSET(0x6621, OLAND_6621, OLAND) +CHIPSET(0x6623, OLAND_6623, OLAND) +CHIPSET(0x6631, OLAND_6631, OLAND) + +CHIPSET(0x6660, HAINAN_6660, HAINAN) +CHIPSET(0x6663, HAINAN_6663, HAINAN) +CHIPSET(0x6664, HAINAN_6664, HAINAN) +CHIPSET(0x6665, HAINAN_6665, HAINAN) +CHIPSET(0x6667, HAINAN_6667, HAINAN) +CHIPSET(0x666F, HAINAN_666F, HAINAN) + +CHIPSET(0x6640, BONAIRE_6640, BONAIRE) +CHIPSET(0x6641, BONAIRE_6641, BONAIRE) +CHIPSET(0x6646, BONAIRE_6646, BONAIRE) +CHIPSET(0x6647, BONAIRE_6647, BONAIRE) +CHIPSET(0x6649, BONAIRE_6649, BONAIRE) +CHIPSET(0x6650, BONAIRE_6650, BONAIRE) +CHIPSET(0x6651, BONAIRE_6651, BONAIRE) +CHIPSET(0x6658, BONAIRE_6658, BONAIRE) +CHIPSET(0x665C, BONAIRE_665C, BONAIRE) +CHIPSET(0x665D, BONAIRE_665D, BONAIRE) + +CHIPSET(0x9830, KABINI_9830, KABINI) +CHIPSET(0x9831, KABINI_9831, KABINI) +CHIPSET(0x9832, KABINI_9832, KABINI) +CHIPSET(0x9833, KABINI_9833, KABINI) +CHIPSET(0x9834, KABINI_9834, KABINI) +CHIPSET(0x9835, KABINI_9835, KABINI) +CHIPSET(0x9836, KABINI_9836, KABINI) +CHIPSET(0x9837, KABINI_9837, KABINI) +CHIPSET(0x9838, KABINI_9838, KABINI) +CHIPSET(0x9839, KABINI_9839, KABINI) +CHIPSET(0x983A, KABINI_983A, KABINI) +CHIPSET(0x983B, KABINI_983B, KABINI) +CHIPSET(0x983C, KABINI_983C, KABINI) +CHIPSET(0x983D, KABINI_983D, KABINI) +CHIPSET(0x983E, KABINI_983E, KABINI) +CHIPSET(0x983F, KABINI_983F, KABINI) + +CHIPSET(0x9850, MULLINS_9850, MULLINS) +CHIPSET(0x9851, MULLINS_9851, MULLINS) +CHIPSET(0x9852, MULLINS_9852, MULLINS) +CHIPSET(0x9853, MULLINS_9853, MULLINS) +CHIPSET(0x9854, MULLINS_9854, MULLINS) +CHIPSET(0x9855, MULLINS_9855, MULLINS) +CHIPSET(0x9856, MULLINS_9856, MULLINS) +CHIPSET(0x9857, MULLINS_9857, MULLINS) +CHIPSET(0x9858, MULLINS_9858, MULLINS) +CHIPSET(0x9859, MULLINS_9859, MULLINS) +CHIPSET(0x985A, MULLINS_985A, MULLINS) +CHIPSET(0x985B, MULLINS_985B, MULLINS) +CHIPSET(0x985C, MULLINS_985C, MULLINS) +CHIPSET(0x985D, MULLINS_985D, MULLINS) +CHIPSET(0x985E, MULLINS_985E, MULLINS) +CHIPSET(0x985F, MULLINS_985F, MULLINS) + +CHIPSET(0x1304, KAVERI_1304, KAVERI) +CHIPSET(0x1305, KAVERI_1305, KAVERI) +CHIPSET(0x1306, KAVERI_1306, KAVERI) +CHIPSET(0x1307, KAVERI_1307, KAVERI) +CHIPSET(0x1309, KAVERI_1309, KAVERI) +CHIPSET(0x130A, KAVERI_130A, KAVERI) +CHIPSET(0x130B, KAVERI_130B, KAVERI) +CHIPSET(0x130C, KAVERI_130C, KAVERI) +CHIPSET(0x130D, KAVERI_130D, KAVERI) +CHIPSET(0x130E, KAVERI_130E, KAVERI) +CHIPSET(0x130F, KAVERI_130F, KAVERI) +CHIPSET(0x1310, KAVERI_1310, KAVERI) +CHIPSET(0x1311, KAVERI_1311, KAVERI) +CHIPSET(0x1312, KAVERI_1312, KAVERI) +CHIPSET(0x1313, KAVERI_1313, KAVERI) +CHIPSET(0x1315, KAVERI_1315, KAVERI) +CHIPSET(0x1316, KAVERI_1316, KAVERI) +CHIPSET(0x1317, KAVERI_1317, KAVERI) +CHIPSET(0x1318, KAVERI_1318, KAVERI) +CHIPSET(0x131B, KAVERI_131B, KAVERI) +CHIPSET(0x131C, KAVERI_131C, KAVERI) +CHIPSET(0x131D, KAVERI_131D, KAVERI) + +CHIPSET(0x67A0, HAWAII_67A0, HAWAII) +CHIPSET(0x67A1, HAWAII_67A1, HAWAII) +CHIPSET(0x67A2, HAWAII_67A2, HAWAII) +CHIPSET(0x67A8, HAWAII_67A8, HAWAII) +CHIPSET(0x67A9, HAWAII_67A9, HAWAII) +CHIPSET(0x67AA, HAWAII_67AA, HAWAII) +CHIPSET(0x67B0, HAWAII_67B0, HAWAII) +CHIPSET(0x67B1, HAWAII_67B1, HAWAII) +CHIPSET(0x67B8, HAWAII_67B8, HAWAII) +CHIPSET(0x67B9, HAWAII_67B9, HAWAII) +CHIPSET(0x67BA, HAWAII_67BA, HAWAII) +CHIPSET(0x67BE, HAWAII_67BE, HAWAII) diff --git a/xserver/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h b/xserver/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h new file mode 100644 index 000000000..124d75b72 --- /dev/null +++ b/xserver/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h @@ -0,0 +1 @@ +CHIPSET(0x0405, SVGAII, SVGAII) diff --git a/xserver/hw/xfree86/drivers/Makefile.am b/xserver/hw/xfree86/drivers/Makefile.am new file mode 100644 index 000000000..04d787f52 --- /dev/null +++ b/xserver/hw/xfree86/drivers/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = + +if XORG_DRIVER_MODESETTING +SUBDIRS += modesetting +endif diff --git a/xserver/hw/xfree86/drivers/Makefile.in b/xserver/hw/xfree86/drivers/Makefile.in new file mode 100644 index 000000000..da20f87e9 --- /dev/null +++ b/xserver/hw/xfree86/drivers/Makefile.in @@ -0,0 +1,824 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@XORG_DRIVER_MODESETTING_TRUE@am__append_1 = modesetting +subdir = hw/xfree86/drivers +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = modesetting +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +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@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = $(am__append_1) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/drivers/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/drivers/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + cscopelist cscopelist-recursive ctags ctags-recursive \ + distclean distclean-generic distclean-libtool distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.am b/xserver/hw/xfree86/drivers/modesetting/Makefile.am new file mode 100644 index 000000000..82c4f2f32 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.am @@ -0,0 +1,69 @@ +# Copyright 2005 Adam Jackson. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# ADAM JACKSON 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. + +# this is obnoxious: +# -module lets us name the module exactly how we want +# -avoid-version prevents gratuitous .0.0.0 version numbers on the end +# _ladir passes a dummy rpath to libtool so the thing will actually link +# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. + +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS) + +AM_CPPFLAGS = \ + $(XORG_INCS) \ + -I$(top_srcdir)/glamor \ + -I$(srcdir)/../../ddc \ + -I$(srcdir)/../../dri2 \ + -I$(srcdir)/../../i2c \ + -I$(srcdir)/../../modes \ + -I$(srcdir)/../../parser \ + -I$(srcdir)/../../ramdac \ + $(NULL) + +modesetting_drv_la_LTLIBRARIES = modesetting_drv.la +modesetting_drv_la_LDFLAGS = -module -avoid-version +modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS) +modesetting_drv_ladir = @moduledir@/drivers + +modesetting_drv_la_SOURCES = \ + dri2.c \ + driver.c \ + driver.h \ + drmmode_display.c \ + drmmode_display.h \ + dumb_bo.c \ + dumb_bo.h \ + present.c \ + vblank.c \ + $(NULL) + +drivermandir = $(DRIVER_MAN_DIR) +driverman_PRE = modesetting.man +driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) + +EXTRA_DIST = modesetting.man + +CLEANFILES = $(driverman_DATA) + +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure +SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man + +.man.$(DRIVER_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff --git a/xserver/hw/xfree86/drivers/modesetting/Makefile.in b/xserver/hw/xfree86/drivers/modesetting/Makefile.in new file mode 100644 index 000000000..ee6dc889c --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/Makefile.in @@ -0,0 +1,935 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright 2005 Adam Jackson. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# ADAM JACKSON 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. + +# this is obnoxious: +# -module lets us name the module exactly how we want +# -avoid-version prevents gratuitous .0.0.0 version numbers on the end +# _ladir passes a dummy rpath to libtool so the thing will actually link +# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = hw/xfree86/drivers/modesetting +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 +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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)$(modesetting_drv_ladir)" \ + "$(DESTDIR)$(drivermandir)" +LTLIBRARIES = $(modesetting_drv_la_LTLIBRARIES) +am__DEPENDENCIES_1 = +modesetting_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_modesetting_drv_la_OBJECTS = dri2.lo driver.lo drmmode_display.lo \ + dumb_bo.lo present.lo vblank.lo +modesetting_drv_la_OBJECTS = $(am_modesetting_drv_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +modesetting_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(modesetting_drv_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(modesetting_drv_la_SOURCES) +DIST_SOURCES = $(modesetting_drv_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(driverman_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +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@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS) +AM_CPPFLAGS = \ + $(XORG_INCS) \ + -I$(top_srcdir)/glamor \ + -I$(srcdir)/../../ddc \ + -I$(srcdir)/../../dri2 \ + -I$(srcdir)/../../i2c \ + -I$(srcdir)/../../modes \ + -I$(srcdir)/../../parser \ + -I$(srcdir)/../../ramdac \ + $(NULL) + +modesetting_drv_la_LTLIBRARIES = modesetting_drv.la +modesetting_drv_la_LDFLAGS = -module -avoid-version +modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS) +modesetting_drv_ladir = @moduledir@/drivers +modesetting_drv_la_SOURCES = \ + dri2.c \ + driver.c \ + driver.h \ + drmmode_display.c \ + drmmode_display.h \ + dumb_bo.c \ + dumb_bo.h \ + present.c \ + vblank.c \ + $(NULL) + +drivermandir = $(DRIVER_MAN_DIR) +driverman_PRE = modesetting.man +driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) +EXTRA_DIST = modesetting.man +CLEANFILES = $(driverman_DATA) + +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure +SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man +all: all-am + +.SUFFIXES: +.SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/drivers/modesetting/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/drivers/modesetting/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-modesetting_drv_laLTLIBRARIES: $(modesetting_drv_la_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(modesetting_drv_la_LTLIBRARIES)'; test -n "$(modesetting_drv_ladir)" || 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)$(modesetting_drv_ladir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(modesetting_drv_ladir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(modesetting_drv_ladir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(modesetting_drv_ladir)"; \ + } + +uninstall-modesetting_drv_laLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(modesetting_drv_la_LTLIBRARIES)'; test -n "$(modesetting_drv_ladir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(modesetting_drv_ladir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(modesetting_drv_ladir)/$$f"; \ + done + +clean-modesetting_drv_laLTLIBRARIES: + -test -z "$(modesetting_drv_la_LTLIBRARIES)" || rm -f $(modesetting_drv_la_LTLIBRARIES) + @list='$(modesetting_drv_la_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}; \ + } +modesetting_drv.la: $(modesetting_drv_la_OBJECTS) $(modesetting_drv_la_DEPENDENCIES) $(EXTRA_modesetting_drv_la_DEPENDENCIES) + $(AM_V_CCLD)$(modesetting_drv_la_LINK) -rpath $(modesetting_drv_ladir) $(modesetting_drv_la_OBJECTS) $(modesetting_drv_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmmode_display.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumb_bo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vblank.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-drivermanDATA: $(driverman_DATA) + @$(NORMAL_INSTALL) + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ + done + +uninstall-drivermanDATA: + @$(NORMAL_UNINSTALL) + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(modesetting_drv_ladir)" "$(DESTDIR)$(drivermandir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool \ + clean-modesetting_drv_laLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-drivermanDATA \ + install-modesetting_drv_laLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-drivermanDATA \ + uninstall-modesetting_drv_laLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-modesetting_drv_laLTLIBRARIES 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-drivermanDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-modesetting_drv_laLTLIBRARIES install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-drivermanDATA \ + uninstall-modesetting_drv_laLTLIBRARIES + + +.man.$(DRIVER_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xfree86/drivers/modesetting/dri2.c b/xserver/hw/xfree86/drivers/modesetting/dri2.c new file mode 100644 index 000000000..63cb0659d --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/dri2.c @@ -0,0 +1,861 @@ +/* + * Copyright © 2013 Intel Corporation + * Copyright © 2014 Broadcom + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * @file dri2.c + * + * Implements generic support for DRI2 on KMS, using glamor pixmaps + * for color buffer management (no support for other aux buffers), and + * the DRM vblank ioctls. + * + * This doesn't implement pageflipping yet. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include "list.h" +#include "xf86.h" +#include "driver.h" +#include "dri2.h" + +#ifdef GLAMOR + +enum ms_dri2_frame_event_type { + MS_DRI2_QUEUE_SWAP, + MS_DRI2_WAIT_MSC, +}; + +typedef struct ms_dri2_frame_event { + ScreenPtr screen; + + DrawablePtr drawable; + ClientPtr client; + enum ms_dri2_frame_event_type type; + int frame; + xf86CrtcPtr crtc; + + struct xorg_list drawable_resource, client_resource; + + /* for swaps & flips only */ + DRI2SwapEventPtr event_complete; + void *event_data; + DRI2BufferPtr front; + DRI2BufferPtr back; +} ms_dri2_frame_event_rec, *ms_dri2_frame_event_ptr; + +typedef struct { + int refcnt; + PixmapPtr pixmap; +} ms_dri2_buffer_private_rec, *ms_dri2_buffer_private_ptr; + +static DevPrivateKeyRec ms_dri2_client_key; +static RESTYPE frame_event_client_type, frame_event_drawable_type; +static int ms_dri2_server_generation; + +struct ms_dri2_resource { + XID id; + RESTYPE type; + struct xorg_list list; +}; + +static struct ms_dri2_resource * +ms_get_resource(XID id, RESTYPE type) +{ + struct ms_dri2_resource *resource; + void *ptr; + + ptr = NULL; + dixLookupResourceByType(&ptr, id, type, NULL, DixWriteAccess); + if (ptr) + return ptr; + + resource = malloc(sizeof(*resource)); + if (resource == NULL) + return NULL; + + if (!AddResource(id, type, resource)) { + free(resource); + return NULL; + } + + resource->id = id; + resource->type = type; + xorg_list_init(&resource->list); + return resource; +} + +static inline PixmapPtr +get_drawable_pixmap(DrawablePtr drawable) +{ + ScreenPtr screen = drawable->pScreen; + + if (drawable->type == DRAWABLE_PIXMAP) + return (PixmapPtr) drawable; + else + return screen->GetWindowPixmap((WindowPtr) drawable); +} + +static PixmapPtr +get_front_buffer(DrawablePtr drawable) +{ + PixmapPtr pixmap; + + pixmap = get_drawable_pixmap(drawable); + pixmap->refcnt++; + + return pixmap; +} + +static DRI2Buffer2Ptr +ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment, + unsigned int format) +{ + ScreenPtr screen = drawable->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + DRI2Buffer2Ptr buffer; + PixmapPtr pixmap; + uint32_t size; + uint16_t pitch; + ms_dri2_buffer_private_ptr private; + + buffer = calloc(1, sizeof *buffer); + if (buffer == NULL) + return NULL; + + private = calloc(1, sizeof(*private)); + if (private == NULL) { + free(buffer); + return NULL; + } + + pixmap = NULL; + if (attachment == DRI2BufferFrontLeft) + pixmap = get_front_buffer(drawable); + + if (pixmap == NULL) { + int pixmap_width = drawable->width; + int pixmap_height = drawable->height; + int pixmap_cpp = (format != 0) ? format : drawable->depth; + + /* Assume that non-color-buffers require special + * device-specific handling. Mesa currently makes no requests + * for non-color aux buffers. + */ + switch (attachment) { + case DRI2BufferAccum: + case DRI2BufferBackLeft: + case DRI2BufferBackRight: + case DRI2BufferFakeFrontLeft: + case DRI2BufferFakeFrontRight: + case DRI2BufferFrontLeft: + case DRI2BufferFrontRight: + break; + + case DRI2BufferStencil: + case DRI2BufferDepth: + case DRI2BufferDepthStencil: + case DRI2BufferHiz: + default: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Request for DRI2 buffer attachment %d unsupported\n", + attachment); + free(private); + free(buffer); + return NULL; + } + + pixmap = screen->CreatePixmap(screen, + pixmap_width, + pixmap_height, + pixmap_cpp, + 0); + if (pixmap == NULL) { + if (pixmap) + screen->DestroyPixmap(pixmap); + free(private); + free(buffer); + return NULL; + } + } + + buffer->attachment = attachment; + buffer->cpp = pixmap->drawable.bitsPerPixel / 8; + buffer->format = format; + /* The buffer's flags field is unused by the client drivers in + * Mesa currently. + */ + buffer->flags = 0; + + buffer->name = glamor_name_from_pixmap(pixmap, &pitch, &size); + buffer->pitch = pitch; + if (buffer->name == -1) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to get DRI2 name for pixmap\n"); + screen->DestroyPixmap(pixmap); + free(private); + free(buffer); + return NULL; + } + + buffer->driverPrivate = private; + private->refcnt = 1; + private->pixmap = pixmap; + + return buffer; +} + +static void +ms_dri2_reference_buffer(DRI2Buffer2Ptr buffer) +{ + if (buffer) { + ms_dri2_buffer_private_ptr private = buffer->driverPrivate; + private->refcnt++; + } +} + +static void ms_dri2_destroy_buffer(DrawablePtr drawable, DRI2Buffer2Ptr buffer) +{ + if (!buffer) + return; + + if (buffer->driverPrivate) { + ms_dri2_buffer_private_ptr private = buffer->driverPrivate; + if (--private->refcnt == 0) { + ScreenPtr screen = private->pixmap->drawable.pScreen; + screen->DestroyPixmap(private->pixmap); + free(private); + free(buffer); + } + } else { + free(buffer); + } +} + +static void +ms_dri2_copy_region(DrawablePtr drawable, RegionPtr pRegion, + DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer) +{ + ms_dri2_buffer_private_ptr src_priv = sourceBuffer->driverPrivate; + ms_dri2_buffer_private_ptr dst_priv = destBuffer->driverPrivate; + PixmapPtr src_pixmap = src_priv->pixmap; + PixmapPtr dst_pixmap = dst_priv->pixmap; + ScreenPtr screen = drawable->pScreen; + DrawablePtr src = (sourceBuffer->attachment == DRI2BufferFrontLeft) + ? drawable : &src_pixmap->drawable; + DrawablePtr dst = (destBuffer->attachment == DRI2BufferFrontLeft) + ? drawable : &dst_pixmap->drawable; + RegionPtr pCopyClip; + GCPtr gc; + + gc = GetScratchGC(dst->depth, screen); + if (!gc) + return; + + pCopyClip = REGION_CREATE(screen, NULL, 0); + REGION_COPY(screen, pCopyClip, pRegion); + (*gc->funcs->ChangeClip) (gc, CT_REGION, pCopyClip, 0); + ValidateGC(dst, gc); + + /* It's important that this copy gets submitted before the direct + * rendering client submits rendering for the next frame, but we + * don't actually need to submit right now. The client will wait + * for the DRI2CopyRegion reply or the swap buffer event before + * rendering, and we'll hit the flush callback chain before those + * messages are sent. We submit our batch buffers from the flush + * callback chain so we know that will happen before the client + * tries to render again. + */ + gc->ops->CopyArea(src, dst, gc, + 0, 0, + drawable->width, drawable->height, + 0, 0); + + FreeScratchGC(gc); +} + +static uint64_t +gettime_us(void) +{ + struct timespec tv; + + if (clock_gettime(CLOCK_MONOTONIC, &tv)) + return 0; + + return (uint64_t)tv.tv_sec * 1000000 + tv.tv_nsec / 1000; +} + +/** + * Get current frame count and frame count timestamp, based on drawable's + * crtc. + */ +static int +ms_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc) +{ + int ret; + xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); + + /* Drawable not displayed, make up a *monotonic* value */ + if (crtc == NULL) { + *ust = gettime_us(); + *msc = 0; + return TRUE; + } + + ret = ms_get_crtc_ust_msc(crtc, ust, msc); + + if (ret) + return FALSE; + + return TRUE; +} + +static XID +get_client_id(ClientPtr client) +{ + XID *ptr = dixGetPrivateAddr(&client->devPrivates, &ms_dri2_client_key); + if (*ptr == 0) + *ptr = FakeClientID(client->index); + return *ptr; +} + +/* + * Hook this frame event into the server resource + * database so we can clean it up if the drawable or + * client exits while the swap is pending + */ +static Bool +ms_dri2_add_frame_event(ms_dri2_frame_event_ptr info) +{ + struct ms_dri2_resource *resource; + + resource = ms_get_resource(get_client_id(info->client), + frame_event_client_type); + if (resource == NULL) + return FALSE; + + xorg_list_add(&info->client_resource, &resource->list); + + resource = ms_get_resource(info->drawable->id, frame_event_drawable_type); + if (resource == NULL) { + xorg_list_del(&info->client_resource); + return FALSE; + } + + xorg_list_add(&info->drawable_resource, &resource->list); + + return TRUE; +} + +static void +ms_dri2_del_frame_event(ms_dri2_frame_event_rec *info) +{ + xorg_list_del(&info->client_resource); + xorg_list_del(&info->drawable_resource); + + if (info->front) + ms_dri2_destroy_buffer(NULL, info->front); + if (info->back) + ms_dri2_destroy_buffer(NULL, info->back); + + free(info); +} + +static void +ms_dri2_blit_swap(DrawablePtr drawable, + DRI2BufferPtr dst, + DRI2BufferPtr src) +{ + BoxRec box; + RegionRec region; + + box.x1 = 0; + box.y1 = 0; + box.x2 = drawable->width; + box.y2 = drawable->height; + REGION_INIT(pScreen, ®ion, &box, 0); + + ms_dri2_copy_region(drawable, ®ion, dst, src); +} + +static void +ms_dri2_frame_event_handler(uint64_t msc, + uint64_t usec, + void *data) +{ + ms_dri2_frame_event_ptr frame_info = data; + DrawablePtr drawable = frame_info->drawable; + ScreenPtr screen = frame_info->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + uint32_t tv_sec = usec / 1000000; + uint32_t tv_usec = usec % 1000000; + + if (!drawable) { + ms_dri2_del_frame_event(frame_info); + return; + } + + switch (frame_info->type) { + case MS_DRI2_QUEUE_SWAP: + ms_dri2_blit_swap(drawable, frame_info->front, frame_info->back); + DRI2SwapComplete(frame_info->client, drawable, msc, tv_sec, tv_usec, + DRI2_BLIT_COMPLETE, + frame_info->client ? frame_info->event_complete : NULL, + frame_info->event_data); + break; + + case MS_DRI2_WAIT_MSC: + if (frame_info->client) + DRI2WaitMSCComplete(frame_info->client, drawable, + msc, tv_sec, tv_usec); + break; + + default: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s: unknown vblank event (type %d) received\n", __func__, + frame_info->type); + break; + } + + ms_dri2_del_frame_event(frame_info); +} + +static void +ms_dri2_frame_event_abort(void *data) +{ + ms_dri2_frame_event_ptr frame_info = data; + + ms_dri2_del_frame_event(frame_info); +} + +/** + * Request a DRM event when the requested conditions will be satisfied. + * + * We need to handle the event and ask the server to wake up the client when + * we receive it. + */ +static int +ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, + CARD64 divisor, CARD64 remainder) +{ + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + ms_dri2_frame_event_ptr wait_info; + drmVBlank vbl; + int ret; + xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); + drmmode_crtc_private_ptr drmmode_crtc; + CARD64 current_msc, current_ust, request_msc; + uint32_t seq; + + /* Drawable not visible, return immediately */ + if (!crtc) + goto out_complete; + drmmode_crtc = crtc->driver_private; + + wait_info = calloc(1, sizeof(*wait_info)); + if (!wait_info) + goto out_complete; + + wait_info->screen = screen; + wait_info->drawable = draw; + wait_info->client = client; + wait_info->type = MS_DRI2_WAIT_MSC; + + if (!ms_dri2_add_frame_event(wait_info)) { + free(wait_info); + wait_info = NULL; + goto out_complete; + } + + /* Get current count */ + ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); + + /* + * If divisor is zero, or current_msc is smaller than target_msc, + * we just need to make sure target_msc passes before waking up the + * client. + */ + if (divisor == 0 || current_msc < target_msc) { + /* If target_msc already reached or passed, set it to + * current_msc to ensure we return a reasonable value back + * to the caller. This keeps the client from continually + * sending us MSC targets from the past by forcibly updating + * their count on this call. + */ + seq = ms_drm_queue_alloc(crtc, wait_info, + ms_dri2_frame_event_handler, + ms_dri2_frame_event_abort); + if (!seq) + goto out_free; + + if (current_msc >= target_msc) + target_msc = current_msc; + vbl.request.type = (DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_EVENT | + drmmode_crtc->vblank_pipe); + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, target_msc); + vbl.request.signal = (unsigned long)seq; + + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } + goto out_free; + } + + wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + DRI2BlockClient(client, draw); + return TRUE; + } + + /* + * If we get here, target_msc has already passed or we don't have one, + * so we queue an event that will satisfy the divisor/remainder equation. + */ + vbl.request.type = + DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; + + request_msc = current_msc - (current_msc % divisor) + + remainder; + /* + * If calculated remainder is larger than requested remainder, + * it means we've passed the last point where + * seq % divisor == remainder, so we need to wait for the next time + * that will happen. + */ + if ((current_msc % divisor) >= remainder) + request_msc += divisor; + + seq = ms_drm_queue_alloc(crtc, wait_info, + ms_dri2_frame_event_handler, + ms_dri2_frame_event_abort); + if (!seq) + goto out_free; + + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); + vbl.request.signal = (unsigned long)seq; + + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } + goto out_free; + } + + wait_info->frame = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + DRI2BlockClient(client, draw); + + return TRUE; + + out_free: + ms_dri2_del_frame_event(wait_info); + out_complete: + DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); + return TRUE; +} + +/** + * ScheduleSwap is responsible for requesting a DRM vblank event for + * the appropriate frame, or executing the swap immediately if it + * doesn't need to wait. + * + * When the swap is complete, the driver should call into the server so it + * can send any swap complete events that have been requested. + */ +static int +ms_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, + DRI2BufferPtr front, DRI2BufferPtr back, + CARD64 *target_msc, CARD64 divisor, + CARD64 remainder, DRI2SwapEventPtr func, void *data) +{ + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmVBlank vbl; + int ret; + xf86CrtcPtr crtc = ms_dri2_crtc_covering_drawable(draw); + drmmode_crtc_private_ptr drmmode_crtc; + ms_dri2_frame_event_ptr frame_info = NULL; + uint64_t current_msc, current_ust; + uint64_t request_msc; + uint32_t seq; + + /* Drawable not displayed... just complete the swap */ + if (!crtc) + goto blit_fallback; + drmmode_crtc = crtc->driver_private; + + frame_info = calloc(1, sizeof(*frame_info)); + if (!frame_info) + goto blit_fallback; + + frame_info->screen = screen; + frame_info->drawable = draw; + frame_info->client = client; + frame_info->event_complete = func; + frame_info->event_data = data; + frame_info->front = front; + frame_info->back = back; + frame_info->crtc = crtc; + frame_info->type = MS_DRI2_QUEUE_SWAP; + + if (!ms_dri2_add_frame_event(frame_info)) { + free(frame_info); + frame_info = NULL; + goto blit_fallback; + } + + ms_dri2_reference_buffer(front); + ms_dri2_reference_buffer(back); + + ret = ms_get_crtc_ust_msc(crtc, ¤t_ust, ¤t_msc); + + /* + * If divisor is zero, or current_msc is smaller than target_msc + * we just need to make sure target_msc passes before initiating + * the swap. + */ + if (divisor == 0 || current_msc < *target_msc) { + /* We need to use DRM_VBLANK_NEXTONMISS to avoid unreliable + * timestamping later on. + */ + vbl.request.type = (DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_NEXTONMISS | + DRM_VBLANK_EVENT | + drmmode_crtc->vblank_pipe); + + /* If target_msc already reached or passed, set it to + * current_msc to ensure we return a reasonable value back + * to the caller. This makes swap_interval logic more robust. + */ + if (current_msc >= *target_msc) + *target_msc = current_msc; + + seq = ms_drm_queue_alloc(crtc, frame_info, + ms_dri2_frame_event_handler, + ms_dri2_frame_event_abort); + if (!seq) + goto blit_fallback; + + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, *target_msc); + vbl.request.signal = (unsigned long)seq; + + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "divisor 0 get vblank counter failed: %s\n", + strerror(errno)); + goto blit_fallback; + } + + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + frame_info->frame = *target_msc; + + return TRUE; + } + + /* + * If we get here, target_msc has already passed or we don't have one, + * and we need to queue an event that will satisfy the divisor/remainder + * equation. + */ + vbl.request.type = (DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_NEXTONMISS | + DRM_VBLANK_EVENT | + drmmode_crtc->vblank_pipe); + + request_msc = current_msc - (current_msc % divisor) + + remainder; + + /* + * If the calculated deadline vbl.request.sequence is smaller than + * or equal to current_msc, it means we've passed the last point + * when effective onset frame seq could satisfy + * seq % divisor == remainder, so we need to wait for the next time + * this will happen. + + * This comparison takes the DRM_VBLANK_NEXTONMISS delay into account. + */ + if (request_msc <= current_msc) + request_msc += divisor; + + + seq = ms_drm_queue_alloc(crtc, frame_info, + ms_dri2_frame_event_handler, + ms_dri2_frame_event_abort); + if (!seq) + goto blit_fallback; + + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc); + vbl.request.signal = (unsigned long)seq; + + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "final get vblank counter failed: %s\n", + strerror(errno)); + goto blit_fallback; + } + + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); + frame_info->frame = *target_msc; + + return TRUE; + + blit_fallback: + ms_dri2_blit_swap(draw, front, back); + DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); + if (frame_info) + ms_dri2_del_frame_event(frame_info); + *target_msc = 0; /* offscreen, so zero out target vblank count */ + return TRUE; +} + +static int +ms_dri2_frame_event_client_gone(void *data, XID id) +{ + struct ms_dri2_resource *resource = data; + + while (!xorg_list_is_empty(&resource->list)) { + ms_dri2_frame_event_ptr info = + xorg_list_first_entry(&resource->list, + ms_dri2_frame_event_rec, + client_resource); + + xorg_list_del(&info->client_resource); + info->client = NULL; + } + free(resource); + + return Success; +} + +static int +ms_dri2_frame_event_drawable_gone(void *data, XID id) +{ + struct ms_dri2_resource *resource = data; + + while (!xorg_list_is_empty(&resource->list)) { + ms_dri2_frame_event_ptr info = + xorg_list_first_entry(&resource->list, + ms_dri2_frame_event_rec, + drawable_resource); + + xorg_list_del(&info->drawable_resource); + info->drawable = NULL; + } + free(resource); + + return Success; +} + +static Bool +ms_dri2_register_frame_event_resource_types(void) +{ + frame_event_client_type = + CreateNewResourceType(ms_dri2_frame_event_client_gone, + "Frame Event Client"); + if (!frame_event_client_type) + return FALSE; + + frame_event_drawable_type = + CreateNewResourceType(ms_dri2_frame_event_drawable_gone, + "Frame Event Drawable"); + if (!frame_event_drawable_type) + return FALSE; + + return TRUE; +} + +Bool +ms_dri2_screen_init(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + DRI2InfoRec info; + + if (!glamor_supports_pixmap_import_export(screen)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "DRI2: glamor lacks support for pixmap import/export\n"); + } + + if (!xf86LoaderCheckSymbol("DRI2Version")) + return FALSE; + + if (!dixRegisterPrivateKey(&ms_dri2_client_key, + PRIVATE_CLIENT, sizeof(XID))) + return FALSE; + + if (serverGeneration != ms_dri2_server_generation) { + ms_dri2_server_generation = serverGeneration; + if (!ms_dri2_register_frame_event_resource_types()) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Cannot register DRI2 frame event resources\n"); + return FALSE; + } + } + + memset(&info, '\0', sizeof(info)); + info.fd = ms->fd; + info.driverName = NULL; /* Compat field, unused. */ + info.deviceName = drmGetDeviceNameFromFd(ms->fd); + + info.version = 4; + info.CreateBuffer = ms_dri2_create_buffer; + info.DestroyBuffer = ms_dri2_destroy_buffer; + info.CopyRegion = ms_dri2_copy_region; + info.ScheduleSwap = ms_dri2_schedule_swap; + info.GetMSC = ms_dri2_get_msc; + info.ScheduleWaitMSC = ms_dri2_schedule_wait_msc; + + /* These two will be filled in by dri2.c */ + info.numDrivers = 0; + info.driverNames = NULL; + + return DRI2ScreenInit(screen, &info); +} + +void +ms_dri2_close_screen(ScreenPtr screen) +{ + DRI2CloseScreen(screen); +} + +#endif /* GLAMOR */ diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.c b/xserver/hw/xfree86/drivers/modesetting/driver.c new file mode 100644 index 000000000..5cb160aae --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/driver.c @@ -0,0 +1,1251 @@ +/* + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2011 Dave Airlie + * 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, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + * Original Author: Alan Hourihane + * Rewrite: Dave Airlie + * + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include +#include "xf86.h" +#include "xf86_OSproc.h" +#include "compiler.h" +#include "xf86Pci.h" +#include "mipointer.h" +#include "micmap.h" +#include +#include "fb.h" +#include "edid.h" +#include "xf86i2c.h" +#include "xf86Crtc.h" +#include "miscstruct.h" +#include "dixstruct.h" +#include "shadow.h" +#include "xf86xv.h" +#include +#include +#ifdef XSERVER_PLATFORM_BUS +#include "xf86platformBus.h" +#endif +#if XSERVER_LIBPCIACCESS +#include +#endif + +#include "driver.h" + +#ifdef X_PRIVSEP +extern int priv_open_device(const char *); +#else +#define priv_open_device(n) open(n,O_RDWR,0) +#endif + +static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); +static Bool CloseScreen(ScreenPtr pScreen); +static Bool EnterVT(ScrnInfoPtr pScrn); +static void Identify(int flags); +static const OptionInfoRec *AvailableOptions(int chipid, int busid); +static ModeStatus ValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, + Bool verbose, int flags); +static void FreeScreen(ScrnInfoPtr pScrn); +static void LeaveVT(ScrnInfoPtr pScrn); +static Bool SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +static Bool ScreenInit(ScreenPtr pScreen, int argc, char **argv); +static Bool PreInit(ScrnInfoPtr pScrn, int flags); + +static Bool Probe(DriverPtr drv, int flags); +static Bool ms_pci_probe(DriverPtr driver, + int entity_num, struct pci_device *device, + intptr_t match_data); +static Bool ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data); + +#ifdef XSERVER_LIBPCIACCESS +static const struct pci_id_match ms_device_match[] = { + { + PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, + 0x00030000, 0x00ff0000, 0}, + + {0, 0, 0}, +}; +#endif + +#ifdef XSERVER_PLATFORM_BUS +static Bool ms_platform_probe(DriverPtr driver, + int entity_num, int flags, + struct xf86_platform_device *device, + intptr_t match_data); +#endif + +_X_EXPORT DriverRec modesetting = { + 1, + "modesetting", + Identify, + Probe, + AvailableOptions, + NULL, + 0, + ms_driver_func, + ms_device_match, + ms_pci_probe, +#ifdef XSERVER_PLATFORM_BUS + ms_platform_probe, +#endif +}; + +static SymTabRec Chipsets[] = { + {0, "kms"}, + {-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}, + {-1, NULL, OPTV_NONE, {0}, FALSE} +}; + +int modesettingEntityIndex = -1; + +static MODULESETUPPROTO(Setup); + +static XF86ModuleVersionInfo VersRec = { + "modesetting", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + XORG_VERSION_MAJOR, + XORG_VERSION_MINOR, + XORG_VERSION_PATCH, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0, 0, 0, 0} +}; + +_X_EXPORT XF86ModuleData modesettingModuleData = { &VersRec, Setup, NULL }; + +static void * +Setup(void *module, void *opts, int *errmaj, int *errmin) +{ + static Bool setupDone = 0; + + /* This module should be loaded only once, but check to be sure. + */ + if (!setupDone) { + setupDone = 1; + xf86AddDriver(&modesetting, module, HaveDriverFuncs); + + /* + * The return value must be non-NULL on success even though there + * is no TearDownProc. + */ + return (void *) 1; + } + else { + if (errmaj) + *errmaj = LDR_ONCEONLY; + return NULL; + } +} + +static void +Identify(int flags) +{ + xf86PrintChipsets("modesetting", "Driver for Modesetting Kernel Drivers", + Chipsets); +} + +static int +open_hw(const char *dev) +{ + int fd; + + if (dev) + fd = priv_open_device(dev); + else { + dev = getenv("KMSDEVICE"); + if ((NULL == dev) || ((fd = priv_open_device(dev)) == -1)) { + dev = "/dev/drm0"; + fd = priv_open_device(dev); + } + } + if (fd == -1) + xf86DrvMsg(-1, X_ERROR, "open %s: %s\n", dev, strerror(errno)); + + return fd; +} + +static int +check_outputs(int fd) +{ + drmModeResPtr res = drmModeGetResources(fd); + int ret; + + if (!res) + return FALSE; + ret = res->count_connectors > 0; + drmModeFreeResources(res); + return ret; +} + +static Bool +probe_hw(const char *dev, struct xf86_platform_device *platform_dev) +{ + int fd; + +#if XF86_PDEV_SERVER_FD + if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) { + fd = xf86_platform_device_odev_attributes(platform_dev)->fd; + if (fd == -1) + return FALSE; + return check_outputs(fd); + } +#endif + + fd = open_hw(dev); + if (fd != -1) { + int ret = check_outputs(fd); + + close(fd); + return ret; + } + return FALSE; +} + +static char * +ms_DRICreatePCIBusID(const struct pci_device *dev) +{ + char *busID; + + if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", + dev->domain, dev->bus, dev->dev, dev->func) == -1) + return NULL; + + return busID; +} + +static Bool +probe_hw_pci(const char *dev, struct pci_device *pdev) +{ + int ret = FALSE, fd = open_hw(dev); + char *id, *devid; + drmSetVersion sv; + + if (fd == -1) + return FALSE; + + sv.drm_di_major = 1; + sv.drm_di_minor = 4; + sv.drm_dd_major = -1; + sv.drm_dd_minor = -1; + if (drmSetInterfaceVersion(fd, &sv)) { + close(fd); + return FALSE; + } + + id = drmGetBusid(fd); + devid = ms_DRICreatePCIBusID(pdev); + + if (id && devid && !strcmp(id, devid)) + ret = check_outputs(fd); + + close(fd); + free(id); + free(devid); + return ret; +} + +static const OptionInfoRec * +AvailableOptions(int chipid, int busid) +{ + return Options; +} + +static Bool +ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data) +{ + xorgHWFlags *flag; + + switch (op) { + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32 *) data; + (*flag) = 0; + return TRUE; + case SUPPORTS_SERVER_FDS: + return TRUE; + default: + return FALSE; + } +} + +static void +ms_setup_scrn_hooks(ScrnInfoPtr scrn) +{ + scrn->driverVersion = 1; + scrn->driverName = "modesetting"; + scrn->name = "modeset"; + + scrn->Probe = NULL; + scrn->PreInit = PreInit; + scrn->ScreenInit = ScreenInit; + scrn->SwitchMode = SwitchMode; + scrn->AdjustFrame = AdjustFrame; + scrn->EnterVT = EnterVT; + scrn->LeaveVT = LeaveVT; + scrn->FreeScreen = FreeScreen; + scrn->ValidMode = ValidMode; +} + +#if XSERVER_LIBPCIACCESS +static Bool +ms_pci_probe(DriverPtr driver, + int entity_num, struct pci_device *dev, intptr_t match_data) +{ + ScrnInfoPtr scrn = NULL; + + scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL, + NULL, NULL, NULL, NULL, NULL); + if (scrn) { + const char *devpath; + GDevPtr devSection = xf86GetDevFromEntity(scrn->entityList[0], + scrn->entityInstanceList[0]); + + devpath = xf86FindOptionValue(devSection->options, "kmsdev"); + if (probe_hw_pci(devpath, dev)) { + ms_setup_scrn_hooks(scrn); + + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, + "claimed PCI slot %d@%d:%d:%d\n", + dev->bus, dev->domain, dev->dev, dev->func); + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "using %s\n", devpath ? devpath : "default device"); + } + else + scrn = NULL; + } + return scrn != NULL; +} +#endif + +#ifdef XSERVER_PLATFORM_BUS +static Bool +ms_platform_probe(DriverPtr driver, + int entity_num, int flags, struct xf86_platform_device *dev, + intptr_t match_data) +{ + ScrnInfoPtr scrn = NULL; + const char *path = xf86_platform_device_odev_attributes(dev)->path; + int scr_flags = 0; + + if (flags & PLATFORM_PROBE_GPU_SCREEN) + scr_flags = XF86_ALLOCATE_GPU_SCREEN; + + if (probe_hw(path, dev)) { + scrn = xf86AllocateScreen(driver, scr_flags); + xf86AddEntityToScreen(scrn, entity_num); + + ms_setup_scrn_hooks(scrn); + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "using drv %s\n", path ? path : "default device"); + } + + return scrn != NULL; +} +#endif + +static Bool +Probe(DriverPtr drv, int flags) +{ + int i, numDevSections; + GDevPtr *devSections; + Bool foundScreen = FALSE; + const char *dev; + ScrnInfoPtr scrn = NULL; + + /* For now, just bail out for PROBE_DETECT. */ + if (flags & PROBE_DETECT) + return FALSE; + + /* + * Find the config file Device sections that match this + * driver, and return if there are none. + */ + if ((numDevSections = xf86MatchDevice("modesetting", &devSections)) <= 0) { + return FALSE; + } + + for (i = 0; i < numDevSections; i++) { + + 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); + } + + if (scrn) { + foundScreen = TRUE; + ms_setup_scrn_hooks(scrn); + scrn->Probe = Probe; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "using %s\n", dev ? dev : "default device"); + } + } + + free(devSections); + + return foundScreen; +} + +static Bool +GetRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate) + return TRUE; + + pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1); + + return TRUE; +} + +static int +dispatch_dirty_region(ScrnInfoPtr scrn, + PixmapPtr pixmap, DamagePtr damage, int fb_id) +{ + modesettingPtr ms = modesettingPTR(scrn); + RegionPtr dirty = DamageRegion(damage); + unsigned num_cliprects = REGION_NUM_RECTS(dirty); + int ret = 0; + + if (num_cliprects) { + drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); + BoxPtr rect = REGION_RECTS(dirty); + int i; + + if (!clip) + return -ENOMEM; + + /* XXX no need for copy? */ + for (i = 0; i < num_cliprects; i++, rect++) { + clip[i].x1 = rect->x1; + clip[i].y1 = rect->y1; + clip[i].x2 = rect->x2; + clip[i].y2 = rect->y2; + } + + /* TODO query connector property to see if this is needed */ + ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects); + free(clip); + DamageEmpty(damage); + } + return ret; +} + +static void +dispatch_dirty(ScreenPtr pScreen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(scrn); + PixmapPtr pixmap = pScreen->GetScreenPixmap(pScreen); + int fb_id = ms->drmmode.fb_id; + int ret; + + ret = dispatch_dirty_region(scrn, pixmap, ms->damage, fb_id); + if (ret == -EINVAL || ret == -ENOSYS) { + ms->dirty_enabled = FALSE; + DamageUnregister(ms->damage); + DamageDestroy(ms->damage); + ms->damage = NULL; + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Disabling kernel dirty updates, not required.\n"); + return; + } +} + +static void +dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) +{ + modesettingPtr ms = modesettingPTR(scrn); + PixmapPtr pixmap = crtc->randr_crtc->scanout_pixmap; + msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, pixmap); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + DamagePtr damage = drmmode_crtc->slave_damage; + int fb_id = ppriv->fb_id; + int ret; + + ret = dispatch_dirty_region(scrn, pixmap, damage, fb_id); + if (ret) { + + } +} + +static void +dispatch_slave_dirty(ScreenPtr pScreen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (!crtc->randr_crtc) + continue; + if (!crtc->randr_crtc->scanout_pixmap) + continue; + + dispatch_dirty_crtc(scrn, crtc); + } +} + +static void +msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +{ + modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); + + pScreen->BlockHandler = ms->BlockHandler; + pScreen->BlockHandler(pScreen, pTimeout, pReadmask); + ms->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = msBlockHandler; + if (pScreen->isGPU) + dispatch_slave_dirty(pScreen); + else if (ms->dirty_enabled) + dispatch_dirty(pScreen); +} + +static void +FreeRec(ScrnInfoPtr pScrn) +{ + modesettingPtr ms; + + if (!pScrn) + return; + + ms = modesettingPTR(pScrn); + if (!ms) + return; + pScrn->driverPrivate = NULL; + + if (ms->fd > 0) { + int ret; + + 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))) +#endif + ret = close(ms->fd); + (void) ret; + } + free(ms->Options); + free(ms); + +} + +static void +try_enable_glamor(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + const char *accel_method_str = xf86GetOptValString(ms->Options, + OPTION_ACCEL_METHOD); + Bool do_glamor = (!accel_method_str || + strcmp(accel_method_str, "glamor") == 0); + + ms->drmmode.glamor = FALSE; + +#ifdef GLAMOR + if (!do_glamor) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "glamor disabled\n"); + return; + } + + if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) { + if (glamor_egl_init(pScrn, ms->fd)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n"); + ms->drmmode.glamor = TRUE; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "glamor initialization failed\n"); + } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to load glamor module.\n"); + } +#else + if (do_glamor) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "No glamor support in the X Server\n"); + } +#endif +} + +#ifndef DRM_CAP_CURSOR_WIDTH +#define DRM_CAP_CURSOR_WIDTH 0x8 +#endif + +#ifndef DRM_CAP_CURSOR_HEIGHT +#define DRM_CAP_CURSOR_HEIGHT 0x9 +#endif + +static Bool +PreInit(ScrnInfoPtr pScrn, int flags) +{ + modesettingPtr ms; + rgb defaultWeight = { 0, 0, 0 }; + EntityInfoPtr pEnt; + EntPtr msEnt = NULL; + 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; + + pScrn->displayWidth = 640; /* default it */ + + /* 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]); + } + } + + 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 + if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD) + ms->fd = + xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> + fd; + else +#endif + { + char *path = + xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> + path; + ms->fd = open_hw(path); + } + } + else +#endif + if (pEnt->location.type == BUS_PCI) { + ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); + if (ms->PciInfo) { + BusID = malloc(64); + sprintf(BusID, "PCI:%d:%d:%d", +#if XSERVER_LIBPCIACCESS + ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), + ms->PciInfo->dev, ms->PciInfo->func +#else + ((pciConfigPtr) ms->PciInfo->thisCard)->busnum, + ((pciConfigPtr) ms->PciInfo->thisCard)->devnum, + ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum +#endif + ); + } + ms->fd = drmOpen(NULL, BusID); + } + else { + devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev"); + ms->fd = open_hw(devicename); + } + if (ms->fd < 0) + return FALSE; + + ms->drmmode.fd = ms->fd; + + pScrn->capabilities = 0; +#ifdef DRM_CAP_PRIME + ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); + if (ret == 0) { + if (value & DRM_PRIME_CAP_IMPORT) + pScrn->capabilities |= RR_Capability_SinkOutput; + } +#endif + drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); + if (defaultdepth == 24 && defaultbpp == 24) + bppflags = SupportConvert32to24 | Support24bppFb; + else + bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; + + if (!xf86SetDepthBpp + (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) + return FALSE; + + switch (pScrn->depth) { + case 15: + case 16: + case 24: + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by the driver\n", + pScrn->depth); + return FALSE; + } + xf86PrintDepthBpp(pScrn); + + /* Process the options */ + xf86CollectOptions(pScrn, NULL); + if (!(ms->Options = malloc(sizeof(Options)))) + return FALSE; + memcpy(ms->Options, Options, sizeof(Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options); + + if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) + return FALSE; + if (!xf86SetDefaultVisual(pScrn, -1)) + return FALSE; + + if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) { + ms->drmmode.sw_cursor = TRUE; + } + + ms->cursor_width = 64; + ms->cursor_height = 64; + ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); + if (!ret) { + ms->cursor_width = value; + } + ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_HEIGHT, &value); + if (!ret) { + ms->cursor_height = value; + } + + try_enable_glamor(pScrn); + + if (ms->drmmode.glamor) { + xf86LoadSubModule(pScrn, "dri2"); + } else { + Bool prefer_shadow = TRUE; + + ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); + if (!ret) { + prefer_shadow = !!value; + } + + ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, + OPTION_SHADOW_FB, + prefer_shadow); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "ShadowFB: preferred %s, enabled %s\n", + prefer_shadow ? "YES" : "NO", + ms->drmmode.shadow_enable ? "YES" : "NO"); + } + + if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n"); + goto fail; + } + + /* + * If the driver can do gamma correction, it should call xf86SetGamma() here. + */ + { + Gamma zeros = { 0.0, 0.0, 0.0 }; + + if (!xf86SetGamma(pScrn, zeros)) { + return FALSE; + } + } + + if (pScrn->modes == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); + return FALSE; + } + + pScrn->currentMode = pScrn->modes; + + /* Set display resolution */ + xf86SetDpi(pScrn, 0, 0); + + /* Load the required sub modules */ + if (!xf86LoadSubModule(pScrn, "fb")) { + return FALSE; + } + + if (ms->drmmode.shadow_enable) { + if (!xf86LoadSubModule(pScrn, "shadow")) { + return FALSE; + } + } + + return TRUE; + fail: + return FALSE; +} + +static void * +msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, + CARD32 *size, void *closure) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(pScrn); + int stride; + + stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; + *size = stride; + + return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); +} + +static void +msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) +{ + shadowUpdatePacked(pScreen, pBuf); +} + +static Bool +CreateScreenResources(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + PixmapPtr rootPixmap; + Bool ret; + void *pixels = NULL; + int err; + + pScreen->CreateScreenResources = ms->createScreenResources; + ret = pScreen->CreateScreenResources(pScreen); + pScreen->CreateScreenResources = CreateScreenResources; + + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + return FALSE; + + if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode)) + return FALSE; + + drmmode_uevent_init(pScrn, &ms->drmmode); + + if (!ms->drmmode.sw_cursor) + drmmode_map_cursor_bos(pScrn, &ms->drmmode); + + if (!ms->drmmode.gbm) { + pixels = drmmode_map_front_bo(&ms->drmmode); + if (!pixels) + return FALSE; + } + + rootPixmap = pScreen->GetScreenPixmap(pScreen); + + if (ms->drmmode.shadow_enable) + pixels = ms->drmmode.shadow_fb; + + if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) + FatalError("Couldn't adjust screen pixmap\n"); + + if (ms->drmmode.shadow_enable) { + if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, + msShadowWindow, 0, 0)) + return FALSE; + } + + err = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, NULL, 0); + + if (err != -EINVAL && err != -ENOSYS) { + ms->damage = DamageCreate(NULL, NULL, DamageReportNone, TRUE, + pScreen, rootPixmap); + + if (ms->damage) { + DamageRegister(&rootPixmap->drawable, ms->damage); + ms->dirty_enabled = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Damage tracking initialized\n"); + } + else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to create screen damage record\n"); + return FALSE; + } + } + return ret; +} + +static Bool +msShadowInit(ScreenPtr pScreen) +{ + if (!shadowSetup(pScreen)) { + return FALSE; + } + return TRUE; +} + +static Bool +msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) +{ + 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 (ret == FALSE) + return ret; + + return TRUE; +} + +static Bool +SetMaster(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + int ret; + +#ifdef XF86_PDEV_SERVER_FD + if (ms->pEnt->location.type == BUS_PLATFORM && + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) + return TRUE; +#endif + + ret = drmSetMaster(ms->fd); + if (ret) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n", + strerror(errno)); + + return ret == 0; +} + +static Bool +ScreenInit(ScreenPtr pScreen, int argc, char **argv) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + VisualPtr visual; + + pScrn->pScreen = pScreen; + + if (!SetMaster(pScrn)) + return FALSE; + +#ifdef GLAMOR_HAS_GBM + if (ms->drmmode.glamor) + ms->drmmode.gbm = glamor_egl_get_gbm_device(pScreen); +#endif + + /* HW dependent - FIXME */ + pScrn->displayWidth = pScrn->virtualX; + if (!drmmode_create_initial_bos(pScrn, &ms->drmmode)) + return FALSE; + + if (ms->drmmode.shadow_enable) { + ms->drmmode.shadow_fb = + calloc(1, + pScrn->displayWidth * pScrn->virtualY * + ((pScrn->bitsPerPixel + 7) >> 3)); + if (!ms->drmmode.shadow_fb) + ms->drmmode.shadow_enable = FALSE; + } + + miClearVisualTypes(); + + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + + if (!miSetPixmapDepths()) + return FALSE; + + if (!dixRegisterScreenSpecificPrivateKey + (pScreen, &ms->drmmode.pixmapPrivateKeyRec, PRIVATE_PIXMAP, + sizeof(msPixmapPrivRec))) { + return FALSE; + } + + pScrn->memPhysBase = 0; + pScrn->fbOffset = 0; + + if (!fbScreenInit(pScreen, NULL, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel)) + return FALSE; + + if (pScrn->bitsPerPixel > 8) { + /* Fixup RGB ordering */ + visual = pScreen->visuals + pScreen->numVisuals; + while (--visual >= pScreen->visuals) { + if ((visual->class | DynamicClass) == DirectColor) { + visual->offsetRed = pScrn->offset.red; + visual->offsetGreen = pScrn->offset.green; + visual->offsetBlue = pScrn->offset.blue; + visual->redMask = pScrn->mask.red; + visual->greenMask = pScrn->mask.green; + visual->blueMask = pScrn->mask.blue; + } + } + } + + fbPictureInit(pScreen, NULL, 0); + +#ifdef GLAMOR + if (ms->drmmode.glamor) { + if (!glamor_init(pScreen, + GLAMOR_USE_EGL_SCREEN | + GLAMOR_USE_SCREEN | + GLAMOR_USE_PICTURE_SCREEN)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize glamor at ScreenInit() time.\n"); + return FALSE; + } + } +#endif + + if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n"); + return FALSE; + } + + ms->createScreenResources = pScreen->CreateScreenResources; + pScreen->CreateScreenResources = CreateScreenResources; + + xf86SetBlackWhitePixels(pScreen); + + xf86SetBackingStore(pScreen); + xf86SetSilkenMouse(pScreen); + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + /* Need to extend HWcursor support to handle mask interleave */ + if (!ms->drmmode.sw_cursor) + xf86_cursors_init(pScreen, ms->cursor_width, ms->cursor_height, + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | + HARDWARE_CURSOR_UPDATE_UNHIDDEN | + HARDWARE_CURSOR_ARGB); + + /* Must force it before EnterVT, so we are in control of VT and + * later memory should be bound when allocating, e.g rotate_mem */ + pScrn->vtSema = TRUE; + + pScreen->SaveScreen = xf86SaveScreen; + ms->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = CloseScreen; + + ms->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = msBlockHandler; + + pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; + + if (!xf86CrtcScreenInit(pScreen)) + return FALSE; + + if (!miCreateDefColormap(pScreen)) + return FALSE; + + xf86DPMSInit(pScreen, xf86DPMSSet, 0); + +#ifdef GLAMOR + if (ms->drmmode.glamor) { + XF86VideoAdaptorPtr glamor_adaptor; + + glamor_adaptor = glamor_xv_init(pScreen, 16); + if (glamor_adaptor != NULL) + xf86XVScreenInit(pScreen, &glamor_adaptor, 1); + else + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize XV support.\n"); + } +#endif + + if (serverGeneration == 1) + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + + if (!ms_vblank_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize vblank support.\n"); + return FALSE; + } + +#ifdef GLAMOR + if (ms->drmmode.glamor) { + if (!ms_dri2_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize the DRI2 extension.\n"); + } + + if (!ms_present_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize the Present extension.\n"); + } + } +#endif + + return EnterVT(pScrn); +} + +static void +AdjustFrame(ScrnInfoPtr pScrn, int x, int y) +{ + modesettingPtr ms = modesettingPTR(pScrn); + + drmmode_adjust_frame(pScrn, &ms->drmmode, x, y); +} + +static void +FreeScreen(ScrnInfoPtr pScrn) +{ + FreeRec(pScrn); +} + +static void +LeaveVT(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + + xf86_hide_cursors(pScrn); + + pScrn->vtSema = FALSE; + +#ifdef XF86_PDEV_SERVER_FD + if (ms->pEnt->location.type == BUS_PLATFORM && + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) + return; +#endif + + drmDropMaster(ms->fd); +} + +/* + * This gets called when gaining control of the VT, and from ScreenInit(). + */ +static Bool +EnterVT(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + + pScrn->vtSema = TRUE; + + SetMaster(pScrn); + + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) + return FALSE; + + return TRUE; +} + +static Bool +SwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + return xf86SetSingleMode(pScrn, mode, RR_Rotate_0); +} + +static Bool +CloseScreen(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + modesettingPtr ms = modesettingPTR(pScrn); + +#ifdef GLAMOR + if (ms->drmmode.glamor) { + ms_dri2_close_screen(pScreen); + } +#endif + + ms_vblank_close_screen(pScreen); + + if (ms->damage) { + DamageUnregister(ms->damage); + DamageDestroy(ms->damage); + ms->damage = NULL; + } + + if (ms->drmmode.shadow_enable) { + shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); + free(ms->drmmode.shadow_fb); + ms->drmmode.shadow_fb = NULL; + } + drmmode_uevent_fini(pScrn, &ms->drmmode); + + drmmode_free_bos(pScrn, &ms->drmmode); + + if (pScrn->vtSema) { + LeaveVT(pScrn); + } + + pScreen->CreateScreenResources = ms->createScreenResources; + pScreen->BlockHandler = ms->BlockHandler; + + pScrn->vtSema = FALSE; + pScreen->CloseScreen = ms->CloseScreen; + return (*pScreen->CloseScreen) (pScreen); +} + +static ModeStatus +ValidMode(ScrnInfoPtr arg, DisplayModePtr mode, Bool verbose, int flags) +{ + return MODE_OK; +} diff --git a/xserver/hw/xfree86/drivers/modesetting/driver.h b/xserver/hw/xfree86/drivers/modesetting/driver.h new file mode 100644 index 000000000..3decc3eea --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/driver.h @@ -0,0 +1,137 @@ +/* + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * 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, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + * Author: Alan Hourihane + * + */ + +#include +#include +#include +#include +#include + +#ifdef GLAMOR +#define GLAMOR_FOR_XORG 1 +#include "glamor.h" +#ifdef GLAMOR_HAS_GBM +#include +#endif +#endif + +#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; + +typedef void (*ms_drm_handler_proc)(uint64_t frame, + uint64_t usec, + void *data); + +typedef void (*ms_drm_abort_proc)(void *data); + +/** + * A tracked handler for an event that will hopefully be generated by + * the kernel, and what to do when it is encountered. + */ +struct ms_drm_queue { + struct xorg_list list; + xf86CrtcPtr crtc; + uint32_t seq; + void *data; + ScrnInfoPtr scrn; + ms_drm_handler_proc handler; + ms_drm_abort_proc abort; +}; + +typedef struct _modesettingRec { + int fd; + + EntPtr entityPrivate; + + int Chipset; + EntityInfoPtr pEnt; +#if XSERVER_LIBPCIACCESS + struct pci_device *PciInfo; +#else + pciVideoPtr PciInfo; + PCITAG PciTag; +#endif + + Bool noAccel; + CloseScreenProcPtr CloseScreen; + + /* Broken-out options. */ + OptionInfoPtr Options; + + unsigned int SaveGeneration; + + CreateScreenResourcesProcPtr createScreenResources; + ScreenBlockHandlerProcPtr BlockHandler; + void *driver; + + drmmode_rec drmmode; + + drmEventContext event_context; + + DamagePtr damage; + Bool dirty_enabled; + + uint32_t cursor_width, cursor_height; +} modesettingRec, *modesettingPtr; + +#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) + +uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc, + void *data, + ms_drm_handler_proc handler, + ms_drm_abort_proc abort); + +void ms_drm_abort(ScrnInfoPtr scrn, + Bool (*match)(void *data, void *match_data), + void *match_data); + +xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); +xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, + xf86CrtcPtr desired, BoxPtr crtc_box_ret); + +int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); + +uint32_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect); +uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence); + + +Bool ms_dri2_screen_init(ScreenPtr screen); +void ms_dri2_close_screen(ScreenPtr screen); + +Bool ms_vblank_screen_init(ScreenPtr screen); +void ms_vblank_close_screen(ScreenPtr screen); + +Bool ms_present_screen_init(ScreenPtr screen); diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c new file mode 100644 index 000000000..a8de5f9e7 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -0,0 +1,1822 @@ +/* + * Copyright © 2007 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Dave Airlie + * + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include +#include +#include +#include "dumb_bo.h" +#include "xf86str.h" +#include "X11/Xatom.h" +#include "micmap.h" +#include "xf86cmap.h" +#include "xf86DDC.h" + +#include +#include "xf86Crtc.h" +#include "drmmode_display.h" + +#include + +#include + +#include "driver.h" + +static int +drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo) +{ + int ret; + +#ifdef GLAMOR_HAS_GBM + if (bo->gbm) { + gbm_bo_destroy(bo->gbm); + bo->gbm = NULL; + } +#endif + + if (bo->dumb) { + ret = dumb_bo_destroy(drmmode->fd, bo->dumb); + if (ret == 0) + bo->dumb = NULL; + } + + return 0; +} + +static uint32_t +drmmode_bo_get_pitch(drmmode_bo *bo) +{ +#ifdef GLAMOR_HAS_GBM + if (bo->gbm) + return gbm_bo_get_stride(bo->gbm); +#endif + + return bo->dumb->pitch; +} + +static Bool +drmmode_bo_has_bo(drmmode_bo *bo) +{ +#ifdef GLAMOR_HAS_GBM + if (bo->gbm) + return TRUE; +#endif + + return bo->dumb != NULL; +} + +uint32_t +drmmode_bo_get_handle(drmmode_bo *bo) +{ +#ifdef GLAMOR_HAS_GBM + if (bo->gbm) + return gbm_bo_get_handle(bo->gbm).u32; +#endif + + return bo->dumb->handle; +} + +static void * +drmmode_bo_map(drmmode_ptr drmmode, drmmode_bo *bo) +{ + int ret; + +#ifdef GLAMOR_HAS_GBM + if (bo->gbm) + return NULL; +#endif + + if (bo->dumb->ptr) + return bo->dumb->ptr; + + ret = dumb_bo_map(drmmode->fd, bo->dumb); + if (ret) + return NULL; + + return bo->dumb->ptr; +} + +static Bool +drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo, + unsigned width, unsigned height, unsigned bpp) +{ +#ifdef GLAMOR_HAS_GBM + if (drmmode->glamor) { + bo->gbm = gbm_bo_create(drmmode->gbm, width, height, + GBM_FORMAT_ARGB8888, + GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); + return bo->gbm != NULL; + } +#endif + + bo->dumb = dumb_bo_create(drmmode->fd, width, height, bpp); + return bo->dumb != NULL; +} + +Bool +drmmode_SetSlaveBO(PixmapPtr ppix, + drmmode_ptr drmmode, int fd_handle, int pitch, int size) +{ + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + + ppriv->backing_bo = + dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); + if (!ppriv->backing_bo) + return FALSE; + + close(fd_handle); + return TRUE; +} + +static void +drmmode_ConvertFromKMode(ScrnInfoPtr scrn, + drmModeModeInfo * kmode, DisplayModePtr mode) +{ + memset(mode, 0, sizeof(DisplayModeRec)); + mode->status = MODE_OK; + + mode->Clock = kmode->clock; + + mode->HDisplay = kmode->hdisplay; + mode->HSyncStart = kmode->hsync_start; + mode->HSyncEnd = kmode->hsync_end; + mode->HTotal = kmode->htotal; + mode->HSkew = kmode->hskew; + + mode->VDisplay = kmode->vdisplay; + mode->VSyncStart = kmode->vsync_start; + mode->VSyncEnd = kmode->vsync_end; + mode->VTotal = kmode->vtotal; + mode->VScan = kmode->vscan; + + mode->Flags = kmode->flags; //& FLAG_BITS; + mode->name = strdup(kmode->name); + + if (kmode->type & DRM_MODE_TYPE_DRIVER) + mode->type = M_T_DRIVER; + if (kmode->type & DRM_MODE_TYPE_PREFERRED) + mode->type |= M_T_PREFERRED; + xf86SetModeCrtc(mode, scrn->adjustFlags); +} + +static void +drmmode_ConvertToKMode(ScrnInfoPtr scrn, + drmModeModeInfo * kmode, DisplayModePtr mode) +{ + memset(kmode, 0, sizeof(*kmode)); + + kmode->clock = mode->Clock; + kmode->hdisplay = mode->HDisplay; + kmode->hsync_start = mode->HSyncStart; + kmode->hsync_end = mode->HSyncEnd; + kmode->htotal = mode->HTotal; + kmode->hskew = mode->HSkew; + + kmode->vdisplay = mode->VDisplay; + kmode->vsync_start = mode->VSyncStart; + kmode->vsync_end = mode->VSyncEnd; + kmode->vtotal = mode->VTotal; + kmode->vscan = mode->VScan; + + kmode->flags = mode->Flags; //& FLAG_BITS; + if (mode->name) + strncpy(kmode->name, mode->name, DRM_DISPLAY_MODE_LEN); + kmode->name[DRM_DISPLAY_MODE_LEN - 1] = 0; + +} + +static void +drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_crtc->dpms_mode = mode; +} + +#if 0 +static PixmapPtr +create_pixmap_for_fbcon(drmmode_ptr drmmode, ScrnInfoPtr pScrn, int crtc_id) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + drmmode_crtc_private_ptr drmmode_crtc; + ScreenPtr pScreen = pScrn->pScreen; + PixmapPtr pixmap; + struct radeon_bo *bo; + drmModeFBPtr fbcon; + struct drm_gem_flink flink; + + drmmode_crtc = xf86_config->crtc[crtc_id]->driver_private; + + fbcon = drmModeGetFB(drmmode->fd, drmmode_crtc->mode_crtc->buffer_id); + if (fbcon == NULL) + return NULL; + + flink.handle = fbcon->handle; + if (ioctl(drmmode->fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't flink fbcon handle\n"); + return NULL; + } + + bo = radeon_bo_open(drmmode->bufmgr, flink.name, 0, 0, 0, 0); + if (bo == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Couldn't allocate bo for fbcon handle\n"); + return NULL; + } + + pixmap = drmmode_create_bo_pixmap(pScreen, fbcon->width, fbcon->height, + fbcon->depth, fbcon->bpp, + fbcon->pitch, bo); + if (!pixmap) + return NULL; + + radeon_bo_unref(bo); + drmModeFreeFB(fbcon); + return pixmap; +} + +#endif + +static Bool +drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, + Rotation rotation, int x, int y) +{ + ScrnInfoPtr pScrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + int saved_x, saved_y; + Rotation saved_rotation; + DisplayModeRec saved_mode; + uint32_t *output_ids; + int output_count = 0; + Bool ret = TRUE; + int i; + uint32_t fb_id; + drmModeModeInfo kmode; + int height; + + height = pScrn->virtualY; + + if (drmmode->fb_id == 0) { + ret = drmModeAddFB(drmmode->fd, + pScrn->virtualX, height, + pScrn->depth, pScrn->bitsPerPixel, + drmmode_bo_get_pitch(&drmmode->front_bo), + drmmode_bo_get_handle(&drmmode->front_bo), + &drmmode->fb_id); + if (ret < 0) { + ErrorF("failed to add fb %d\n", ret); + return FALSE; + } + } + + saved_mode = crtc->mode; + saved_x = crtc->x; + saved_y = crtc->y; + saved_rotation = crtc->rotation; + + if (mode) { + crtc->mode = *mode; + crtc->x = x; + crtc->y = y; + crtc->rotation = rotation; + crtc->transformPresent = FALSE; + } + + output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); + if (!output_ids) { + ret = FALSE; + goto done; + } + + if (mode) { + 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; + output_ids[output_count] = + drmmode_output->mode_output->connector_id; + output_count++; + } + + if (!xf86CrtcRotate(crtc)) { + goto done; + } + crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, + crtc->gamma_blue, crtc->gamma_size); + + drmmode_ConvertToKMode(crtc->scrn, &kmode, 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; + } + 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) + xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, + "failed to set mode: %s", strerror(-ret)); + else + ret = TRUE; + + if (crtc->scrn->pScreen) + xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen); + + 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]; + + if (output->crtc != crtc) + continue; + + output->funcs->dpms(output, DPMSModeOn); + } + } + +#if 0 + if (pScrn->pScreen && + !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) + xf86_reload_cursors(pScrn->pScreen); +#endif + done: + if (!ret) { + crtc->x = saved_x; + crtc->y = saved_y; + crtc->rotation = saved_rotation; + crtc->mode = saved_mode; + } +#if defined(XF86_CRTC_VERSION) && XF86_CRTC_VERSION >= 3 + else + crtc->active = TRUE; +#endif + + return ret; +} + +static void +drmmode_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) +{ + +} + +static void +drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); +} + +static void +drmmode_set_cursor(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + uint32_t handle = drmmode_crtc->cursor_bo->handle; + modesettingPtr ms = modesettingPTR(crtc->scrn); + static Bool use_set_cursor2 = TRUE; + int ret; + + if (use_set_cursor2) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + CursorPtr cursor = xf86_config->cursor; + + ret = + drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + handle, ms->cursor_width, ms->cursor_height, + cursor->bits->xhot, cursor->bits->yhot); + if (!ret) + return; + if (ret == -EINVAL) + use_set_cursor2 = FALSE; + } + + ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, + ms->cursor_width, ms->cursor_height); + + if (ret) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + + cursor_info->MaxWidth = cursor_info->MaxHeight = 0; + drmmode_crtc->drmmode->sw_cursor = TRUE; + /* fallback to swcursor */ + } +} + +static void +drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + int i; + uint32_t *ptr; + + /* cursor should be mapped already */ + ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr); + + for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) + ptr[i] = image[i]; // cpu_to_le32(image[i]); + + if (drmmode_crtc->cursor_up) + drmmode_set_cursor(crtc); +} + +static void +drmmode_hide_cursor(xf86CrtcPtr crtc) +{ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + drmmode_crtc->cursor_up = FALSE; + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, + ms->cursor_width, ms->cursor_height); +} + +static void +drmmode_show_cursor(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_crtc->cursor_up = TRUE; + drmmode_set_cursor(crtc); +} + +static void +drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green, + uint16_t * blue, int size) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + drmModeCrtcSetGamma(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + size, red, green, blue); +} + +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; + msPixmapPrivPtr ppriv; + void *ptr; + + if (!ppix) { + if (crtc->randr_crtc->scanout_pixmap) { + ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); + drmModeRmFB(drmmode->fd, ppriv->fb_id); + } + if (drmmode_crtc->slave_damage) { + DamageUnregister(drmmode_crtc->slave_damage); + drmmode_crtc->slave_damage = NULL; + } + return TRUE; + } + + ppriv = msGetPixmapPriv(drmmode, ppix); + if (!drmmode_crtc->slave_damage) { + drmmode_crtc->slave_damage = DamageCreate(NULL, NULL, + DamageReportNone, + TRUE, + crtc->randr_crtc->pScreen, + NULL); + } + ptr = drmmode_map_slave_bo(drmmode, ppriv); + ppix->devPrivate.ptr = ptr; + DamageRegister(&ppix->drawable, drmmode_crtc->slave_damage); + + if (ppriv->fb_id == 0) { + drmModeAddFB(drmmode->fd, ppix->drawable.width, + ppix->drawable.height, + ppix->drawable.depth, + ppix->drawable.bitsPerPixel, + ppix->devKind, ppriv->backing_bo->handle, &ppriv->fb_id); + } + return TRUE; +} + +static void * +drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + int ret; + + if (!drmmode_create_bo(drmmode, &drmmode_crtc->rotate_bo, + width, height, crtc->scrn->bitsPerPixel)) { + xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, + "Couldn't allocate shadow memory for rotated CRTC\n"); + return NULL; + } + + ret = drmModeAddFB(drmmode->fd, width, height, crtc->scrn->depth, + crtc->scrn->bitsPerPixel, + drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo), + drmmode_bo_get_handle(&drmmode_crtc->rotate_bo), + &drmmode_crtc->rotate_fb_id); + + if (ret) { + ErrorF("failed to add rotate fb\n"); + drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo); + return NULL; + } + +#ifdef GLAMOR_HAS_GBM + if (drmmode->gbm) + return drmmode_crtc->rotate_bo.gbm; +#endif + return drmmode_crtc->rotate_bo.dumb; +} + +static PixmapPtr +drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height, + int depth, int bitsPerPixel, int devKind, + void *pPixData) +{ + PixmapPtr pixmap; + + /* width and height of 0 means don't allocate any pixmap data */ + pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); + + if (pixmap) { + if ((*pScreen->ModifyPixmapHeader)(pixmap, width, height, depth, + bitsPerPixel, devKind, pPixData)) + return pixmap; + (*pScreen->DestroyPixmap)(pixmap); + } + return NullPixmap; +} + +static Bool +drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo); + +static PixmapPtr +drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) +{ + ScrnInfoPtr scrn = crtc->scrn; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + uint32_t rotate_pitch; + PixmapPtr rotate_pixmap; + void *pPixData = NULL; + + if (!data) { + data = drmmode_shadow_allocate(crtc, width, height); + if (!data) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Couldn't allocate shadow pixmap for rotated CRTC\n"); + return NULL; + } + } + + if (!drmmode_bo_has_bo(&drmmode_crtc->rotate_bo)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Couldn't allocate shadow pixmap for rotated CRTC\n"); + return NULL; + } + + pPixData = drmmode_bo_map(drmmode, &drmmode_crtc->rotate_bo); + rotate_pitch = drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo), + + rotate_pixmap = drmmode_create_pixmap_header(scrn->pScreen, + width, height, + scrn->depth, + scrn->bitsPerPixel, + rotate_pitch, + pPixData); + + if (rotate_pixmap == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Couldn't allocate shadow pixmap for rotated CRTC\n"); + return NULL; + } + + drmmode_set_pixmap_bo(drmmode, rotate_pixmap, &drmmode_crtc->rotate_bo); + + return rotate_pixmap; +} + +static void +drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + + if (rotate_pixmap) { + drmmode_set_pixmap_bo(drmmode, rotate_pixmap, NULL); + rotate_pixmap->drawable.pScreen->DestroyPixmap(rotate_pixmap); + } + + if (data) { + drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id); + drmmode_crtc->rotate_fb_id = 0; + + drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo); + memset(&drmmode_crtc->rotate_bo, 0, sizeof drmmode_crtc->rotate_bo); + } +} + +static const xf86CrtcFuncsRec drmmode_crtc_funcs = { + .dpms = drmmode_crtc_dpms, + .set_mode_major = drmmode_set_mode_major, + .set_cursor_colors = drmmode_set_cursor_colors, + .set_cursor_position = drmmode_set_cursor_position, + .show_cursor = drmmode_show_cursor, + .hide_cursor = drmmode_hide_cursor, + .load_cursor_argb = drmmode_load_cursor_argb, + + .gamma_set = drmmode_crtc_gamma_set, + .destroy = NULL, /* XXX */ + .set_scanout_pixmap = drmmode_set_scanout_pixmap, + .shadow_allocate = drmmode_shadow_allocate, + .shadow_create = drmmode_shadow_create, + .shadow_destroy = drmmode_shadow_destroy, +}; + +static uint32_t +drmmode_crtc_vblank_pipe(int crtc_id) +{ + if (crtc_id > 1) + return crtc_id << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (crtc_id > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +static void +drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) +{ + xf86CrtcPtr crtc; + drmmode_crtc_private_ptr drmmode_crtc; + + crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); + if (crtc == NULL) + return; + + drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1); + drmmode_crtc->mode_crtc = + drmModeGetCrtc(drmmode->fd, drmmode->mode_res->crtcs[num]); + drmmode_crtc->drmmode = drmmode; + drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num); + crtc->driver_private = drmmode_crtc; +} + +static xf86OutputStatus +drmmode_output_detect(xf86OutputPtr output) +{ + /* go to the hw and retrieve a new output struct */ + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmmode_ptr drmmode = drmmode_output->drmmode; + xf86OutputStatus status; + + drmModeFreeConnector(drmmode_output->mode_output); + + drmmode_output->mode_output = + drmModeGetConnector(drmmode->fd, drmmode_output->output_id); + if (!drmmode_output->mode_output) + return XF86OutputStatusDisconnected; + + switch (drmmode_output->mode_output->connection) { + case DRM_MODE_CONNECTED: + status = XF86OutputStatusConnected; + break; + case DRM_MODE_DISCONNECTED: + status = XF86OutputStatusDisconnected; + break; + default: + case DRM_MODE_UNKNOWNCONNECTION: + status = XF86OutputStatusUnknown; + break; + } + return status; +} + +static Bool +drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes) +{ + return MODE_OK; +} + +static Bool +has_panel_fitter(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; + + /* Presume that if the output supports scaling, then we have a + * panel fitter capable of adjust any mode to suit. + */ + for (i = 0; i < koutput->count_props; i++) { + drmModePropertyPtr props; + Bool found = FALSE; + + props = drmModeGetProperty(drmmode->fd, koutput->props[i]); + if (props) { + found = strcmp(props->name, "scaling mode") == 0; + drmModeFreeProperty(props); + } + + if (found) + return TRUE; + } + + return FALSE; +} + +static DisplayModePtr +drmmode_output_add_gtf_modes(xf86OutputPtr output, DisplayModePtr Modes) +{ + xf86MonPtr mon = output->MonInfo; + DisplayModePtr i, m, preferred = NULL; + int max_x = 0, max_y = 0; + float max_vrefresh = 0.0; + + if (mon && GTF_SUPPORTED(mon->features.msc)) + return Modes; + + if (!has_panel_fitter(output)) + return Modes; + + for (m = Modes; m; m = m->next) { + if (m->type & M_T_PREFERRED) + preferred = m; + max_x = max(max_x, m->HDisplay); + max_y = max(max_y, m->VDisplay); + max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m)); + } + + max_vrefresh = max(max_vrefresh, 60.0); + max_vrefresh *= (1 + SYNC_TOLERANCE); + + m = xf86GetDefaultModes(); + xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0); + + for (i = m; i; i = i->next) { + if (xf86ModeVRefresh(i) > max_vrefresh) + i->status = MODE_VSYNC; + if (preferred && + i->HDisplay >= preferred->HDisplay && + i->VDisplay >= preferred->VDisplay && + xf86ModeVRefresh(i) >= xf86ModeVRefresh(preferred)) + i->status = MODE_VSYNC; + } + + xf86PruneInvalidModes(output->scrn, &m, FALSE); + + return xf86ModesAdd(Modes, m); +} + +static DisplayModePtr +drmmode_output_get_modes(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; + DisplayModePtr Modes = NULL, Mode; + drmModePropertyPtr props; + xf86MonPtr mon = NULL; + + if (!koutput) + return NULL; + + /* look for an EDID property */ + 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, "EDID")) { + if (drmmode_output->edid_blob) + drmModeFreePropertyBlob(drmmode_output->edid_blob); + drmmode_output->edid_blob = + drmModeGetPropertyBlob(drmmode->fd, + koutput->prop_values[i]); + } + drmModeFreeProperty(props); + } + } + + if (drmmode_output->edid_blob) { + mon = xf86InterpretEDID(output->scrn->scrnIndex, + drmmode_output->edid_blob->data); + if (mon && drmmode_output->edid_blob->length > 128) + mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA; + } + xf86OutputSetEDID(output, mon); + + /* modes should already be available */ + for (i = 0; i < koutput->count_modes; i++) { + Mode = xnfalloc(sizeof(DisplayModeRec)); + + drmmode_ConvertFromKMode(output->scrn, &koutput->modes[i], Mode); + Modes = xf86ModesAdd(Modes, Mode); + + } + + return drmmode_output_add_gtf_modes(output, Modes); +} + +static void +drmmode_output_destroy(xf86OutputPtr output) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + int i; + + if (drmmode_output->edid_blob) + drmModeFreePropertyBlob(drmmode_output->edid_blob); + for (i = 0; i < drmmode_output->num_props; i++) { + drmModeFreeProperty(drmmode_output->props[i].mode_prop); + 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]); + } + free(drmmode_output->mode_encoders); + drmModeFreeConnector(drmmode_output->mode_output); + free(drmmode_output); + output->driver_private = NULL; +} + +static void +drmmode_output_dpms(xf86OutputPtr output, int mode) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmModeConnectorPtr koutput = drmmode_output->mode_output; + drmmode_ptr drmmode = drmmode_output->drmmode; + + if (!koutput) + return; + + drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, + drmmode_output->dpms_enum_id, mode); + return; +} + +static Bool +drmmode_property_ignore(drmModePropertyPtr prop) +{ + if (!prop) + return TRUE; + /* ignore blob prop */ + if (prop->flags & DRM_MODE_PROP_BLOB) + return TRUE; + /* ignore standard property */ + if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS")) + return TRUE; + + return FALSE; +} + +static void +drmmode_output_create_resources(xf86OutputPtr output) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmModeConnectorPtr mode_output = drmmode_output->mode_output; + drmmode_ptr drmmode = drmmode_output->drmmode; + drmModePropertyPtr drmmode_prop; + int i, j, err; + + drmmode_output->props = + calloc(mode_output->count_props, sizeof(drmmode_prop_rec)); + if (!drmmode_output->props) + return; + + drmmode_output->num_props = 0; + for (i = 0, j = 0; i < mode_output->count_props; i++) { + drmmode_prop = drmModeGetProperty(drmmode->fd, mode_output->props[i]); + if (drmmode_property_ignore(drmmode_prop)) { + drmModeFreeProperty(drmmode_prop); + continue; + } + drmmode_output->props[j].mode_prop = drmmode_prop; + drmmode_output->props[j].value = mode_output->prop_values[i]; + drmmode_output->num_props++; + j++; + } + + for (i = 0; i < drmmode_output->num_props; i++) { + drmmode_prop_ptr p = &drmmode_output->props[i]; + + drmmode_prop = p->mode_prop; + + if (drmmode_prop->flags & DRM_MODE_PROP_RANGE) { + INT32 prop_range[2]; + INT32 value = p->value; + + p->num_atoms = 1; + p->atoms = calloc(p->num_atoms, sizeof(Atom)); + if (!p->atoms) + continue; + p->atoms[0] = + MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); + prop_range[0] = drmmode_prop->values[0]; + prop_range[1] = drmmode_prop->values[1]; + err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], + FALSE, TRUE, + drmmode_prop-> + flags & DRM_MODE_PROP_IMMUTABLE ? + TRUE : FALSE, 2, prop_range); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRConfigureOutputProperty error, %d\n", err); + } + err = RRChangeOutputProperty(output->randr_output, p->atoms[0], + XA_INTEGER, 32, PropModeReplace, 1, + &value, FALSE, TRUE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", err); + } + } + else if (drmmode_prop->flags & DRM_MODE_PROP_ENUM) { + p->num_atoms = drmmode_prop->count_enums + 1; + p->atoms = calloc(p->num_atoms, sizeof(Atom)); + if (!p->atoms) + continue; + p->atoms[0] = + MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); + for (j = 1; j <= drmmode_prop->count_enums; j++) { + struct drm_mode_property_enum *e = &drmmode_prop->enums[j - 1]; + + p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE); + } + err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], + FALSE, FALSE, + drmmode_prop-> + flags & DRM_MODE_PROP_IMMUTABLE ? + TRUE : FALSE, p->num_atoms - 1, + (INT32 *) &p->atoms[1]); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRConfigureOutputProperty error, %d\n", err); + } + for (j = 0; j < drmmode_prop->count_enums; j++) + if (drmmode_prop->enums[j].value == p->value) + break; + /* there's always a matching value */ + err = RRChangeOutputProperty(output->randr_output, p->atoms[0], + XA_ATOM, 32, PropModeReplace, 1, + &p->atoms[j + 1], FALSE, TRUE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", err); + } + } + } +} + +static Bool +drmmode_output_set_property(xf86OutputPtr output, Atom property, + RRPropertyValuePtr value) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmmode_ptr drmmode = drmmode_output->drmmode; + int i; + + for (i = 0; i < drmmode_output->num_props; i++) { + drmmode_prop_ptr p = &drmmode_output->props[i]; + + if (p->atoms[0] != property) + continue; + + if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { + uint32_t val; + + if (value->type != XA_INTEGER || value->format != 32 || + value->size != 1) + return FALSE; + val = *(uint32_t *) value->data; + + drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, + p->mode_prop->prop_id, (uint64_t) val); + return TRUE; + } + else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { + Atom atom; + const char *name; + int j; + + if (value->type != XA_ATOM || value->format != 32 || + value->size != 1) + return FALSE; + memcpy(&atom, value->data, 4); + name = NameForAtom(atom); + + /* search for matching name string, then set its value down */ + for (j = 0; j < p->mode_prop->count_enums; j++) { + if (!strcmp(p->mode_prop->enums[j].name, name)) { + drmModeConnectorSetProperty(drmmode->fd, + drmmode_output->output_id, + p->mode_prop->prop_id, + p->mode_prop->enums[j].value); + return TRUE; + } + } + } + } + + return TRUE; +} + +static Bool +drmmode_output_get_property(xf86OutputPtr output, Atom property) +{ + return TRUE; +} + +static const xf86OutputFuncsRec drmmode_output_funcs = { + .dpms = drmmode_output_dpms, + .create_resources = drmmode_output_create_resources, + .set_property = drmmode_output_set_property, + .get_property = drmmode_output_get_property, + .detect = drmmode_output_detect, + .mode_valid = drmmode_output_mode_valid, + + .get_modes = drmmode_output_get_modes, + .destroy = drmmode_output_destroy +}; + +static int subpixel_conv_table[7] = { + 0, + SubPixelUnknown, + SubPixelHorizontalRGB, + SubPixelHorizontalBGR, + SubPixelVerticalRGB, + SubPixelVerticalBGR, + SubPixelNone +}; + +static const char *const output_names[] = { + "None", + "VGA", + "DVI", + "DVI", + "DVI", + "Composite", + "S-video", + "LVDS", + "CTV", + "DIN", + "DisplayPort", + "HDMI", + "HDMI", + "TV", + "eDP", + "Virtual", + "DSI", +}; + +static void +drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) +{ + xf86OutputPtr output; + drmModeConnectorPtr koutput; + drmModeEncoderPtr *kencoders = NULL; + drmmode_output_private_ptr drmmode_output; + drmModePropertyPtr props; + char name[32]; + int i; + + koutput = + drmModeGetConnector(drmmode->fd, drmmode->mode_res->connectors[num]); + if (!koutput) + return; + + kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders); + if (!kencoders) { + goto out_free_encoders; + } + + for (i = 0; i < koutput->count_encoders; i++) { + kencoders[i] = drmModeGetEncoder(drmmode->fd, koutput->encoders[i]); + if (!kencoders[i]) { + goto out_free_encoders; + } + } + + /* 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); + + output = xf86OutputCreate(pScrn, &drmmode_output_funcs, name); + if (!output) { + goto out_free_encoders; + } + + drmmode_output = calloc(sizeof(drmmode_output_private_rec), 1); + if (!drmmode_output) { + xf86OutputDestroy(output); + goto out_free_encoders; + } + + drmmode_output->output_id = drmmode->mode_res->connectors[num]; + drmmode_output->mode_output = koutput; + drmmode_output->mode_encoders = kencoders; + drmmode_output->drmmode = drmmode; + output->mm_width = koutput->mmWidth; + output->mm_height = koutput->mmHeight; + + output->subpixel_order = subpixel_conv_table[koutput->subpixel]; + output->interlaceAllowed = TRUE; + output->doubleScanAllowed = TRUE; + output->driver_private = drmmode_output; + + output->possible_crtcs = 0x7f; + for (i = 0; i < koutput->count_encoders; i++) { + output->possible_crtcs &= kencoders[i]->possible_crtcs; + } + /* work out the possible clones later */ + output->possible_clones = 0; + + for (i = 0; i < koutput->count_props; i++) { + props = drmModeGetProperty(drmmode->fd, koutput->props[i]); + if (props && (props->flags & DRM_MODE_PROP_ENUM)) { + if (!strcmp(props->name, "DPMS")) { + drmmode_output->dpms_enum_id = koutput->props[i]; + drmModeFreeProperty(props); + break; + } + drmModeFreeProperty(props); + } + } + + return; + out_free_encoders: + if (kencoders) { + for (i = 0; i < koutput->count_encoders; i++) + drmModeFreeEncoder(kencoders[i]); + free(kencoders); + } + drmModeFreeConnector(koutput); + +} + +static uint32_t +find_clones(ScrnInfoPtr scrn, xf86OutputPtr output) +{ + drmmode_output_private_ptr drmmode_output = + output->driver_private, clone_drmout; + int i; + xf86OutputPtr clone_output; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int index_mask = 0; + + if (drmmode_output->enc_clone_mask == 0) + return index_mask; + + for (i = 0; i < xf86_config->num_output; i++) { + clone_output = xf86_config->output[i]; + clone_drmout = clone_output->driver_private; + if (output == clone_output) + continue; + + if (clone_drmout->enc_mask == 0) + continue; + if (drmmode_output->enc_clone_mask == clone_drmout->enc_mask) + index_mask |= (1 << i); + } + return index_mask; +} + +static void +drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) +{ + int i, j; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + 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; + drmmode_output->enc_clone_mask = 0xff; + /* and all the possible encoder clones for this output together */ + 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] == + drmmode_output->mode_encoders[j]->encoder_id) + drmmode_output->enc_mask |= (1 << k); + } + + drmmode_output->enc_clone_mask &= + drmmode_output->mode_encoders[j]->possible_clones; + } + } + + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + + output->possible_clones = find_clones(scrn, output); + } +} + +static Bool +drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo) +{ +#ifdef GLAMOR + ScrnInfoPtr scrn = drmmode->scrn; + + if (!drmmode->glamor) + return TRUE; + + if (bo == NULL) { + glamor_egl_destroy_textured_pixmap(pixmap); + return TRUE; + } + +#ifdef GLAMOR_HAS_GBM + if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed"); + return FALSE; + } +#else + if (!glamor_egl_create_textured_pixmap(pixmap, + drmmode_bo_get_handle(&drmmode->front_bo), + scrn->displayWidth * + scrn->bitsPerPixel / 8)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "glamor_egl_create_textured_pixmap() failed\n"); + return FALSE; + } +#endif +#endif + + return TRUE; +} + +Bool +drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode) +{ + ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn); + PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen); + + if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo)) + return FALSE; + +#ifdef GLAMOR + if (drmmode->glamor) + glamor_set_screen_pixmap(screen_pixmap, NULL); +#endif + + return TRUE; +} + +static Bool +drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + drmmode_crtc_private_ptr + drmmode_crtc = xf86_config->crtc[0]->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + drmmode_bo old_front; + Bool ret; + ScreenPtr screen = xf86ScrnToScreen(scrn); + uint32_t old_fb_id; + int i, pitch, old_width, old_height, old_pitch; + int cpp = (scrn->bitsPerPixel + 7) / 8; + PixmapPtr ppix = screen->GetScreenPixmap(screen); + void *new_pixels = NULL; + + if (scrn->virtualX == width && scrn->virtualY == height) + return TRUE; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Allocate new frame buffer %dx%d stride\n", width, height); + + if (drmmode->triple_buffer_pixmap) { + screen->DestroyPixmap(drmmode->triple_buffer_pixmap); + drmmode->triple_buffer_pixmap = NULL; + } + + old_width = scrn->virtualX; + old_height = scrn->virtualY; + old_pitch = drmmode_bo_get_pitch(&drmmode->front_bo); + old_fb_id = drmmode->fb_id; + old_front = drmmode->front_bo; + + if (!drmmode_create_bo(drmmode, &drmmode->front_bo, + width, height, scrn->bitsPerPixel)) + goto fail; + + pitch = drmmode_bo_get_pitch(&drmmode->front_bo); + + scrn->virtualX = width; + scrn->virtualY = height; + scrn->displayWidth = pitch / cpp; + + ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, + scrn->bitsPerPixel, pitch, + drmmode_bo_get_handle(&drmmode->front_bo), + &drmmode->fb_id); + if (ret) + goto fail; + + if (!drmmode->gbm) { + new_pixels = drmmode_map_front_bo(drmmode); + if (!new_pixels) + goto fail; + } + + if (drmmode->shadow_enable) { + uint32_t size = scrn->displayWidth * scrn->virtualY * + ((scrn->bitsPerPixel + 7) >> 3); + new_pixels = calloc(1, size); + if (new_pixels == NULL) + goto fail; + free(drmmode->shadow_fb); + drmmode->shadow_fb = new_pixels; + } + + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels); + + if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) + goto fail; + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + + if (!crtc->enabled) + continue; + + drmmode_set_mode_major(crtc, &crtc->mode, + crtc->rotation, crtc->x, crtc->y); + } + + if (old_fb_id) { + drmModeRmFB(drmmode->fd, old_fb_id); + drmmode_bo_destroy(drmmode, &old_front); + } + + return TRUE; + + fail: + drmmode_bo_destroy(drmmode, &drmmode->front_bo); + drmmode->front_bo = old_front; + scrn->virtualX = old_width; + scrn->virtualY = old_height; + scrn->displayWidth = old_pitch / cpp; + drmmode->fb_id = old_fb_id; + + return FALSE; +} + +static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = { + drmmode_xf86crtc_resize +}; + +Bool +drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) +{ + int i; + int ret; + uint64_t value = 0; + + /* check for dumb capability */ + ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_BUFFER, &value); + if (ret > 0 || value != 1) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "KMS doesn't support dumb interface\n"); + return FALSE; + } + + xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs); + + drmmode->scrn = pScrn; + drmmode->cpp = cpp; + drmmode->mode_res = drmModeGetResources(drmmode->fd); + if (!drmmode->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++) + if (!xf86IsEntityShared(pScrn->entityList[0]) || + pScrn->confScreen->device->screen == i) + drmmode_crtc_init(pScrn, drmmode, i); + + for (i = 0; i < drmmode->mode_res->count_connectors; i++) + drmmode_output_init(pScrn, drmmode, i); + + /* workout clones */ + drmmode_clones_init(pScrn, drmmode); + +#if XF86_CRTC_VERSION >= 5 + xf86ProviderSetup(pScrn, NULL, "modesetting"); +#endif + + xf86InitialConfiguration(pScrn, TRUE); + + return TRUE; +} + +void +drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86OutputPtr output = config->output[config->compat_output]; + xf86CrtcPtr crtc = output->crtc; + + if (crtc && crtc->enabled) { + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, x, y); + } +} + +Bool +drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int c; + + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + xf86OutputPtr output = NULL; + int o; + + /* Skip disabled CRTCs */ + if (!crtc->enabled) { + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); + continue; + } + + if (config->output[config->compat_output]->crtc == crtc) + output = config->output[config->compat_output]; + else { + for (o = 0; o < config->num_output; o++) + if (config->output[o]->crtc == crtc) { + output = config->output[o]; + break; + } + } + /* paranoia */ + if (!output) + continue; + + /* Mark that we'll need to re-set the mode for sure */ + memset(&crtc->mode, 0, sizeof(crtc->mode)); + if (!crtc->desiredMode.CrtcHDisplay) { + DisplayModePtr mode = + xf86OutputFindClosestMode(output, pScrn->currentMode); + + if (!mode) + return FALSE; + crtc->desiredMode = *mode; + crtc->desiredRotation = RR_Rotate_0; + crtc->desiredX = 0; + crtc->desiredY = 0; + } + + if (!crtc->funcs-> + set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) + return FALSE; + } + return TRUE; +} + +static void +drmmode_load_palette(ScrnInfoPtr pScrn, int numColors, + int *indices, LOCO * colors, VisualPtr pVisual) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + uint16_t lut_r[256], lut_g[256], lut_b[256]; + int index, j, i; + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + for (i = 0; i < 256; i++) { + lut_r[i] = drmmode_crtc->lut_r[i] << 6; + lut_g[i] = drmmode_crtc->lut_g[i] << 6; + lut_b[i] = drmmode_crtc->lut_b[i] << 6; + } + + switch (pScrn->depth) { + case 15: + for (i = 0; i < numColors; i++) { + index = indices[i]; + for (j = 0; j < 8; j++) { + lut_r[index * 8 + j] = colors[index].red << 6; + lut_g[index * 8 + j] = colors[index].green << 6; + lut_b[index * 8 + j] = colors[index].blue << 6; + } + } + break; + case 16: + for (i = 0; i < numColors; i++) { + index = indices[i]; + + if (i <= 31) { + for (j = 0; j < 8; j++) { + lut_r[index * 8 + j] = colors[index].red << 6; + lut_b[index * 8 + j] = colors[index].blue << 6; + } + } + + for (j = 0; j < 4; j++) { + lut_g[index * 4 + j] = colors[index].green << 6; + } + } + break; + default: + for (i = 0; i < numColors; i++) { + index = indices[i]; + lut_r[index] = colors[index].red << 6; + lut_g[index] = colors[index].green << 6; + lut_b[index] = colors[index].blue << 6; + } + break; + } + + /* Make the change through RandR */ + if (crtc->randr_crtc) + RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b); + else + crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256); + } +} + +Bool +drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) +{ + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, "Initializing kms color map\n"); + if (!miCreateDefColormap(pScreen)) + return FALSE; + /* all radeons support 10 bit CLUTs */ + if (!xf86HandleColormaps(pScreen, 256, 10, + drmmode_load_palette, NULL, CMAP_PALETTED_TRUECOLOR +#if 0 /* This option messes up text mode! (eich@suse.de) */ + | CMAP_LOAD_EVEN_IF_OFFSCREEN +#endif + | CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + return TRUE; +} + +#ifdef CONFIG_UDEV_KMS +static void +drmmode_handle_uevents(int fd, void *closure) +{ + drmmode_ptr drmmode = closure; + ScrnInfoPtr scrn = drmmode->scrn; + struct udev_device *dev; + + dev = udev_monitor_receive_device(drmmode->uevent_monitor); + if (!dev) + return; + + RRGetInfo(xf86ScrnToScreen(scrn), TRUE); + udev_device_unref(dev); +} +#endif + +void +drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) +{ +#ifdef CONFIG_UDEV_KMS + struct udev *u; + struct udev_monitor *mon; + + u = udev_new(); + if (!u) + return; + mon = udev_monitor_new_from_netlink(u, "udev"); + if (!mon) { + udev_unref(u); + return; + } + + if (udev_monitor_filter_add_match_subsystem_devtype(mon, + "drm", + "drm_minor") < 0 || + udev_monitor_enable_receiving(mon) < 0) { + udev_monitor_unref(mon); + udev_unref(u); + return; + } + + drmmode->uevent_handler = + xf86AddGeneralHandler(udev_monitor_get_fd(mon), + drmmode_handle_uevents, drmmode); + + drmmode->uevent_monitor = mon; +#endif +} + +void +drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode) +{ +#ifdef CONFIG_UDEV_KMS + if (drmmode->uevent_handler) { + struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor); + + xf86RemoveGeneralHandler(drmmode->uevent_handler); + + udev_monitor_unref(drmmode->uevent_monitor); + udev_unref(u); + } +#endif +} + +/* create front and cursor BOs */ +Bool +drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ + modesettingPtr ms = modesettingPTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int width; + int height; + int bpp = pScrn->bitsPerPixel; + int i; + int cpp = (bpp + 7) / 8; + + width = pScrn->virtualX; + height = pScrn->virtualY; + + if (!drmmode_create_bo(drmmode, &drmmode->front_bo, width, height, bpp)) + return FALSE; + pScrn->displayWidth = drmmode_bo_get_pitch(&drmmode->front_bo) / cpp; + + width = ms->cursor_width; + height = ms->cursor_height; + bpp = 32; + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->cursor_bo = + dumb_bo_create(drmmode->fd, width, height, bpp); + } + return TRUE; +} + +void * +drmmode_map_front_bo(drmmode_ptr drmmode) +{ + return drmmode_bo_map(drmmode, &drmmode->front_bo); +} + +void * +drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv) +{ + int ret; + + if (ppriv->backing_bo->ptr) + return ppriv->backing_bo->ptr; + + ret = dumb_bo_map(drmmode->fd, ppriv->backing_bo); + if (ret) + return NULL; + + return ppriv->backing_bo->ptr; +} + +Bool +drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int i, ret; + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + ret = dumb_bo_map(drmmode->fd, drmmode_crtc->cursor_bo); + if (ret) + return FALSE; + } + return TRUE; +} + +void +drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + + if (drmmode->fb_id) { + drmModeRmFB(drmmode->fd, drmmode->fb_id); + drmmode->fb_id = 0; + } + + drmmode_bo_destroy(drmmode, &drmmode->front_bo); + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + dumb_bo_destroy(drmmode->fd, drmmode_crtc->cursor_bo); + } +} + +/* ugly workaround to see if we can create 32bpp */ +void +drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth, + int *bpp) +{ + drmModeResPtr mode_res; + uint64_t value; + struct dumb_bo *bo; + uint32_t fb_id; + int ret; + + /* 16 is fine */ + ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &value); + if (!ret && (value == 16 || value == 8)) { + *depth = value; + *bpp = value; + return; + } + + *depth = 24; + mode_res = drmModeGetResources(drmmode->fd); + if (!mode_res) + return; + + if (mode_res->min_width == 0) + mode_res->min_width = 1; + if (mode_res->min_height == 0) + mode_res->min_height = 1; + /*create a bo */ + bo = dumb_bo_create(drmmode->fd, mode_res->min_width, mode_res->min_height, + 32); + if (!bo) { + *bpp = 24; + goto out; + } + + ret = drmModeAddFB(drmmode->fd, mode_res->min_width, mode_res->min_height, + 24, 32, bo->pitch, bo->handle, &fb_id); + + if (ret) { + *bpp = 24; + dumb_bo_destroy(drmmode->fd, bo); + goto out; + } + + drmModeRmFB(drmmode->fd, fb_id); + *bpp = 32; + + dumb_bo_destroy(drmmode->fd, bo); + out: + drmModeFreeResources(mode_res); + return; +} diff --git a/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h new file mode 100644 index 000000000..3a8959ac3 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -0,0 +1,174 @@ +/* + * Copyright © 2007 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Dave Airlie + * + */ +#ifndef DRMMODE_DISPLAY_H +#define DRMMODE_DISPLAY_H + +#include "xf86drmMode.h" +#ifdef CONFIG_UDEV_KMS +#include "libudev.h" +#endif + +#include "dumb_bo.h" + +struct gbm_device; + +typedef struct { + struct dumb_bo *dumb; +#ifdef GLAMOR_HAS_GBM + struct gbm_bo *gbm; +#endif +} drmmode_bo; + +typedef struct { + int fd; + unsigned fb_id; + unsigned old_fb_id; + drmModeResPtr mode_res; + drmModeFBPtr mode_fb; + int cpp; + ScrnInfoPtr scrn; + + struct gbm_device *gbm; + +#ifdef CONFIG_UDEV_KMS + struct udev_monitor *uevent_monitor; + InputHandlerProc uevent_handler; +#endif + drmEventContext event_context; + drmmode_bo front_bo; + Bool sw_cursor; + + Bool glamor; + Bool shadow_enable; + void *shadow_fb; + + /** + * A screen-sized pixmap when we're doing triple-buffered DRI2 + * pageflipping. + * + * One is shared between all drawables that flip to the front + * buffer, and it only gets reallocated when root pixmap size + * changes. + */ + PixmapPtr triple_buffer_pixmap; + + /** The GEM name for triple_buffer_pixmap */ + uint32_t triple_buffer_name; + + DevPrivateKeyRec pixmapPrivateKeyRec; +} drmmode_rec, *drmmode_ptr; + +typedef struct { + drmmode_ptr drmmode; + drmModeCrtcPtr mode_crtc; + uint32_t vblank_pipe; + int dpms_mode; + struct dumb_bo *cursor_bo; + Bool cursor_up; + uint16_t lut_r[256], lut_g[256], lut_b[256]; + DamagePtr slave_damage; + + drmmode_bo rotate_bo; + unsigned rotate_fb_id; + + /** + * @{ MSC (vblank count) handling for the PRESENT extension. + * + * The kernel's vblank counters are 32 bits and apparently full of + * lies, and we need to give a reliable 64-bit msc for GL, so we + * have to track and convert to a userland-tracked 64-bit msc. + */ + int32_t vblank_offset; + uint32_t msc_prev; + uint64_t msc_high; + /** @} */ +} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; + +typedef struct { + drmModePropertyPtr mode_prop; + uint64_t value; + int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ + Atom *atoms; +} drmmode_prop_rec, *drmmode_prop_ptr; + +typedef struct { + drmmode_ptr drmmode; + int output_id; + drmModeConnectorPtr mode_output; + drmModeEncoderPtr *mode_encoders; + drmModePropertyBlobPtr edid_blob; + int dpms_enum_id; + int num_props; + drmmode_prop_ptr props; + int enc_mask; + int enc_clone_mask; +} drmmode_output_private_rec, *drmmode_output_private_ptr; + +typedef struct _msPixmapPriv { + uint32_t fb_id; + struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ +} msPixmapPrivRec, *msPixmapPrivPtr; + +extern DevPrivateKeyRec msPixmapPrivateKeyRec; + +#define msPixmapPrivateKey (&msPixmapPrivateKeyRec) + +#define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) + +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); +Bool drmmode_SetSlaveBO(PixmapPtr ppix, + drmmode_ptr drmmode, + int fd_handle, int pitch, int size); + +extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); +void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); +extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); + +extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode); +extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode); + +Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +void *drmmode_map_front_bo(drmmode_ptr drmmode); +Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, + int *depth, int *bpp); + + +#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH +#define DRM_CAP_DUMB_PREFERRED_DEPTH 3 +#endif +#ifndef DRM_CAP_DUMB_PREFER_SHADOW +#define DRM_CAP_DUMB_PREFER_SHADOW 4 +#endif + +#define MS_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + +#endif diff --git a/xserver/hw/xfree86/drivers/modesetting/dumb_bo.c b/xserver/hw/xfree86/drivers/modesetting/dumb_bo.c new file mode 100644 index 000000000..cf13f0a9c --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/dumb_bo.c @@ -0,0 +1,138 @@ +/* + * Copyright © 2007 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Dave Airlie + * + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include "dumb_bo.h" + +#include +#include +#include +#include +#include +#include +#include + +struct dumb_bo * +dumb_bo_create(int fd, + const unsigned width, const unsigned height, const unsigned bpp) +{ + struct drm_mode_create_dumb arg; + struct dumb_bo *bo; + int ret; + + bo = calloc(1, sizeof(*bo)); + if (!bo) + return NULL; + + memset(&arg, 0, sizeof(arg)); + arg.width = width; + arg.height = height; + arg.bpp = bpp; + + ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg); + if (ret) + goto err_free; + + bo->handle = arg.handle; + bo->size = arg.size; + bo->pitch = arg.pitch; + + return bo; + err_free: + free(bo); + return NULL; +} + +int +dumb_bo_map(int fd, struct dumb_bo *bo) +{ + struct drm_mode_map_dumb arg; + int ret; + void *map; + + if (bo->ptr) { + return 0; + } + + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; + + ret = drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); + if (ret) + return ret; + + map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, arg.offset); + if (map == MAP_FAILED) + return -errno; + + bo->ptr = map; + return 0; +} + +int +dumb_bo_destroy(int fd, struct dumb_bo *bo) +{ + struct drm_mode_destroy_dumb arg; + int ret; + + if (bo->ptr) { + munmap(bo->ptr, bo->size); + bo->ptr = NULL; + } + + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; + ret = drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg); + if (ret) + return -errno; + + free(bo); + return 0; +} + +struct dumb_bo * +dumb_get_bo_from_fd(int fd, int handle, int pitch, int size) +{ + struct dumb_bo *bo; + int ret; + + bo = calloc(1, sizeof(*bo)); + if (!bo) + return NULL; + + ret = drmPrimeFDToHandle(fd, handle, &bo->handle); + if (ret) { + free(bo); + return NULL; + } + bo->pitch = pitch; + bo->size = size; + return bo; +} diff --git a/xserver/hw/xfree86/drivers/modesetting/dumb_bo.h b/xserver/hw/xfree86/drivers/modesetting/dumb_bo.h new file mode 100644 index 000000000..9235e61e2 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/dumb_bo.h @@ -0,0 +1,45 @@ +/* + * Copyright © 2007 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Dave Airlie + * + */ +#ifndef DUMB_BO_H +#define DUMB_BO_H + +#include + +struct dumb_bo { + uint32_t handle; + uint32_t size; + void *ptr; + uint32_t pitch; +}; + +struct dumb_bo *dumb_bo_create(int fd, const unsigned width, + const unsigned height, const unsigned bpp); +int dumb_bo_map(int fd, struct dumb_bo *bo); +int dumb_bo_destroy(int fd, struct dumb_bo *bo); +struct dumb_bo *dumb_get_bo_from_fd(int fd, int handle, int pitch, int size); + +#endif diff --git a/xserver/hw/xfree86/drivers/modesetting/modesetting.man b/xserver/hw/xfree86/drivers/modesetting/modesetting.man new file mode 100644 index 000000000..9cb27d728 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/modesetting.man @@ -0,0 +1,57 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH MODESETTING __drivermansuffix__ __vendorversion__ +.SH NAME +modesetting \- video driver for framebuffer device +.SH SYNOPSIS +.nf +.B "Section \*qDevice\*q" +.BI " Identifier \*q" devname \*q +.B " Driver \*qmodesetting\*q" +.BI " BusID \*qpci:" bus : dev : func \*q +\ \ ... +.B EndSection +.fi +.SH DESCRIPTION +.B modesetting +is an __xservername__ driver for KMS devices. This is a non-accelerated +driver, the following framebuffer depths are supported: 8, 15, 16, 24. +All visual types are supported for depth 8, and TrueColor visual is +supported for the other depths. RandR 1.2 is supported. +.SH SUPPORTED HARDWARE +The +.B modesetting +driver supports all hardware where a KMS driver is available. +modesetting uses the Linux DRM KMS ioctls and dumb object create/map. +.SH CONFIGURATION DETAILS +Please refer to __xconfigfile__(__filemansuffix__) for general configuration +details. This section only covers configuration details specific to +this driver. +.PP +For this driver it is not required to specify modes in the screen +section of the config file. The +.B modesetting +driver can pick up the currently used video mode from the kernel +driver and will use it if there are no video modes configured. +.PP +For PCI boards you might have to add a BusID line to the Device +section. See above for a sample line. +.PP +The following driver +.B Options +are supported: +.TP +.BI "Option \*qkmsdev\*q \*q" string \*q +The framebuffer device to use. Default: /dev/dri/card0. +.TP +.BI "Option \*qShadowFB\*q \*q" boolean \*q +Enable or disable use of the shadow framebuffer layer. Default: on. +.TP +.BI "Option \*qAccelMethod\*q \*q" string \*q +One of \*qglamor\*q or \*qnone\*q. Default: glamor +.TP +.SH "SEE ALSO" +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), +X(__miscmansuffix__) +.SH AUTHORS +Authors include: Dave Airlie diff --git a/xserver/hw/xfree86/drivers/modesetting/present.c b/xserver/hw/xfree86/drivers/modesetting/present.c new file mode 100644 index 000000000..359e11316 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/present.c @@ -0,0 +1,228 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "driver.h" + +#if 0 +#define DebugPresent(x) ErrorF x +#else +#define DebugPresent(x) +#endif + +struct ms_present_vblank_event { + uint64_t event_id; +}; + +static RRCrtcPtr +ms_present_get_crtc(WindowPtr window) +{ + xf86CrtcPtr xf86_crtc = ms_dri2_crtc_covering_drawable(&window->drawable); + return xf86_crtc ? xf86_crtc->randr_crtc : NULL; +} + +static int +ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) +{ + xf86CrtcPtr xf86_crtc = crtc->devPrivate; + + return ms_get_crtc_ust_msc(xf86_crtc, ust, msc); +} + +/* + * Flush the DRM event queue when full; makes space for new events. + */ +static Bool +ms_flush_drm_events(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + struct pollfd p = { .fd = ms->fd, .events = POLLIN }; + int r; + + do { + r = poll(&p, 1, 0); + } while (r == -1 && (errno == EINTR || errno == EAGAIN)); + + if (r <= 0) + return TRUE; + + return drmHandleEvent(ms->fd, &ms->event_context) >= 0; +} + +/* + * Called when the queued vblank event has occurred + */ +static void +ms_present_vblank_handler(uint64_t msc, uint64_t usec, void *data) +{ + struct ms_present_vblank_event *event = data; + + DebugPresent(("\t\tmh %lld msc %llu\n", + (long long) event->event_id, (long long) msc)); + + present_event_notify(event->event_id, usec, msc); + free(event); +} + +/* + * Called when the queued vblank is aborted + */ +static void +ms_present_vblank_abort(void *data) +{ + struct ms_present_vblank_event *event = data; + + DebugPresent(("\t\tma %lld\n", (long long) event->event_id)); + + free(event); +} + +/* + * Queue an event to report back to the Present extension when the specified + * MSC has past + */ +static int +ms_present_queue_vblank(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + xf86CrtcPtr xf86_crtc = crtc->devPrivate; + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; + struct ms_present_vblank_event *event; + drmVBlank vbl; + int ret; + uint32_t seq; + + event = calloc(sizeof(struct ms_present_vblank_event), 1); + if (!event) + return BadAlloc; + event->event_id = event_id; + seq = ms_drm_queue_alloc(xf86_crtc, event, + ms_present_vblank_handler, + ms_present_vblank_abort); + if (!seq) { + free(event); + return BadAlloc; + } + + vbl.request.type = + DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | drmmode_crtc->vblank_pipe; + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(xf86_crtc, msc); + vbl.request.signal = seq; + for (;;) { + ret = drmWaitVBlank(ms->fd, &vbl); + if (!ret) + break; + if (errno != EBUSY || !ms_flush_drm_events(screen)) + return BadAlloc; + } + DebugPresent(("\t\tmq %lld seq %u msc %llu (hw msc %u)\n", + (long long) event_id, seq, (long long) msc, + vbl.request.sequence)); + return Success; +} + +static Bool +ms_present_event_match(void *data, void *match_data) +{ + struct ms_present_vblank_event *event = data; + uint64_t *match = match_data; + + return *match == event->event_id; +} + +/* + * Remove a pending vblank event from the DRM queue so that it is not reported + * to the extension + */ +static void +ms_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + + ms_drm_abort(scrn, ms_present_event_match, &event_id); +} + +/* + * Flush our batch buffer when requested by the Present extension. + */ +static void +ms_present_flush(WindowPtr window) +{ +#ifdef GLAMOR + ScreenPtr screen = window->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (ms->drmmode.glamor) + glamor_block_handler(screen); +#endif +} + +static present_screen_info_rec ms_present_screen_info = { + .version = PRESENT_SCREEN_INFO_VERSION, + + .get_crtc = ms_present_get_crtc, + .get_ust_msc = ms_present_get_ust_msc, + .queue_vblank = ms_present_queue_vblank, + .abort_vblank = ms_present_abort_vblank, + .flush = ms_present_flush, + + .capabilities = PresentCapabilityNone, + .check_flip = 0, + .flip = 0, + .unflip = 0, +}; + +Bool +ms_present_screen_init(ScreenPtr screen) +{ + 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 new file mode 100644 index 000000000..a342662a7 --- /dev/null +++ b/xserver/hw/xfree86/drivers/modesetting/vblank.c @@ -0,0 +1,402 @@ +/* + * Copyright © 2013 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. + */ + +/** @file vblank.c + * + * Support for tracking the DRM's vblank events. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include +#include +#include +#include "driver.h" +#include "drmmode_display.h" + +/** + * Tracking for outstanding events queued to the kernel. + * + * Each list entry is a struct ms_drm_queue, which has a uint32_t + * value generated from drm_seq that identifies the event and a + * reference back to the crtc/screen associated with the event. It's + * done this way rather than in the screen because we want to be able + * to drain the list of event handlers that should be called at server + * regen time, even though we don't close the drm fd and have no way + * to actually drain the kernel events. + */ +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; + dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; + if (dest->x1 >= dest->x2) { + dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; + return; + } + + dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; + dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; + if (dest->y1 >= dest->y2) + dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; +} + +static void ms_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) +{ + if (crtc->enabled) { + crtc_box->x1 = crtc->x; + crtc_box->x2 = + crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); + crtc_box->y1 = crtc->y; + crtc_box->y2 = + crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); + } else + crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; +} + +static int ms_box_area(BoxPtr box) +{ + return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1); +} + +static Bool +ms_crtc_on(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + return crtc->enabled && drmmode_crtc->dpms_mode == DPMSModeOn; +} + +/* + * Return the crtc covering 'box'. If two crtcs cover a portion of + * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc + * with greater coverage + */ + +xf86CrtcPtr +ms_covering_crtc(ScrnInfoPtr scrn, + BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr crtc, best_crtc; + int coverage, best_coverage; + int c; + BoxRec crtc_box, cover_box; + + best_crtc = NULL; + best_coverage = 0; + crtc_box_ret->x1 = 0; + crtc_box_ret->x2 = 0; + crtc_box_ret->y1 = 0; + crtc_box_ret->y2 = 0; + for (c = 0; c < xf86_config->num_crtc; c++) { + crtc = xf86_config->crtc[c]; + + /* If the CRTC is off, treat it as not covering */ + if (!ms_crtc_on(crtc)) + continue; + + ms_crtc_box(crtc, &crtc_box); + ms_box_intersect(&cover_box, &crtc_box, box); + coverage = ms_box_area(&cover_box); + if (coverage && crtc == desired) { + *crtc_box_ret = crtc_box; + return crtc; + } + if (coverage > best_coverage) { + *crtc_box_ret = crtc_box; + best_crtc = crtc; + best_coverage = coverage; + } + } + return best_crtc; +} + +xf86CrtcPtr +ms_dri2_crtc_covering_drawable(DrawablePtr pDraw) +{ + ScreenPtr pScreen = pDraw->pScreen; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + BoxRec box, crtcbox; + + box.x1 = pDraw->x; + box.y1 = pDraw->y; + box.x2 = box.x1 + pDraw->width; + box.y2 = box.y1 + pDraw->height; + + return ms_covering_crtc(pScrn, &box, NULL, &crtcbox); +} + +static Bool +ms_get_kernel_ust_msc(xf86CrtcPtr crtc, + uint32_t *msc, uint64_t *ust) +{ + ScreenPtr screen = crtc->randr_crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmVBlank vbl; + int ret; + + /* Get current count */ + vbl.request.type = DRM_VBLANK_RELATIVE | drmmode_crtc->vblank_pipe; + vbl.request.sequence = 0; + vbl.request.signal = 0; + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + *msc = 0; + *ust = 0; + return FALSE; + } else { + *msc = vbl.reply.sequence; + *ust = (CARD64) vbl.reply.tval_sec * 1000000 + vbl.reply.tval_usec; + return TRUE; + } +} + +/** + * Convert a 32-bit kernel MSC sequence number to a 64-bit local sequence + * number, adding in the vblank_offset and high 32 bits, and dealing + * with 64-bit wrapping + */ +uint64_t +ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence) +{ + drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; + sequence += drmmode_crtc->vblank_offset; + + if ((int32_t) (sequence - drmmode_crtc->msc_prev) < -0x40000000) + drmmode_crtc->msc_high += 0x100000000L; + drmmode_crtc->msc_prev = sequence; + return drmmode_crtc->msc_high + sequence; +} + +int +ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc) +{ + uint32_t kernel_msc; + + if (!ms_get_kernel_ust_msc(crtc, &kernel_msc, ust)) + return BadMatch; + *msc = ms_kernel_msc_to_crtc_msc(crtc, kernel_msc); + + return Success; +} + +#define MAX_VBLANK_OFFSET 1000 + +/** + * Convert a 64-bit adjusted MSC value into a 32-bit kernel sequence number, + * removing the high 32 bits and subtracting out the vblank_offset term. + * + * This also updates the vblank_offset when it notices that the value should + * change. + */ +uint32_t +ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect) +{ + drmmode_crtc_private_rec *drmmode_crtc = crtc->driver_private; + uint64_t msc; + uint64_t ust; + int64_t diff; + + if (ms_get_crtc_ust_msc(crtc, &ust, &msc) == Success) { + diff = expect - msc; + + /* We're way off here, assume that the kernel has lost its mind + * and smack the vblank back to something sensible + */ + if (diff < -MAX_VBLANK_OFFSET || MAX_VBLANK_OFFSET < diff) { + drmmode_crtc->vblank_offset += (int32_t) diff; + if (drmmode_crtc->vblank_offset > -MAX_VBLANK_OFFSET && + drmmode_crtc->vblank_offset < MAX_VBLANK_OFFSET) + drmmode_crtc->vblank_offset = 0; + } + } + return (uint32_t) (expect - drmmode_crtc->vblank_offset); +} + +/** + * Check for pending DRM events and process them. + */ +static void +ms_drm_wakeup_handler(void *data, int err, void *mask) +{ + ScreenPtr screen = data; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + fd_set *read_mask = mask; + + if (data == NULL || err < 0) + return; + + if (FD_ISSET(ms->fd, read_mask)) + drmHandleEvent(ms->fd, &ms->event_context); +} + +/* + * Enqueue a potential drm response; when the associated response + * appears, we've got data to pass to the handler from here + */ +uint32_t +ms_drm_queue_alloc(xf86CrtcPtr crtc, + void *data, + ms_drm_handler_proc handler, + ms_drm_abort_proc abort) +{ + ScreenPtr screen = crtc->randr_crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + struct ms_drm_queue *q; + + q = calloc(1, sizeof(struct ms_drm_queue)); + + if (!q) + return 0; + if (!ms_drm_seq) + ++ms_drm_seq; + q->seq = ms_drm_seq++; + q->scrn = scrn; + q->crtc = crtc; + q->data = data; + q->handler = handler; + q->abort = abort; + + xorg_list_add(&q->list, &ms_drm_queue); + + return q->seq; +} + +/** + * Abort one queued DRM entry, removing it + * from the list, calling the abort function and + * freeing the memory + */ +static void +ms_drm_abort_one(struct ms_drm_queue *q) +{ + xorg_list_del(&q->list); + q->abort(q->data); + free(q); +} + +/** + * Abort all queued entries on a specific scrn, used + * when resetting the X server + */ +static void +ms_drm_abort_scrn(ScrnInfoPtr scrn) +{ + struct ms_drm_queue *q, *tmp; + + xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { + if (q->scrn == scrn) + ms_drm_abort_one(q); + } +} + +/* + * Externally usable abort function that uses a callback to match a single + * queued entry to abort + */ +void +ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), + void *match_data) +{ + struct ms_drm_queue *q; + + xorg_list_for_each_entry(q, &ms_drm_queue, list) { + if (match(q->data, match_data)) { + ms_drm_abort_one(q); + break; + } + } +} + +/* + * General DRM kernel handler. Looks for the matching sequence number in the + * drm event queue and calls the handler for it. + */ +static void +ms_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, + void *user_ptr) +{ + struct ms_drm_queue *q, *tmp; + uint32_t user_data = (uint32_t) (intptr_t) user_ptr; + + xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { + if (q->seq == user_data) { + uint64_t msc; + + msc = ms_kernel_msc_to_crtc_msc(q->crtc, frame); + xorg_list_del(&q->list); + q->handler(msc, (uint64_t) sec * 1000000 + usec, q->data); + free(q); + break; + } + } +} + +Bool +ms_vblank_screen_init(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + xorg_list_init(&ms_drm_queue); + + ms->event_context.version = DRM_EVENT_CONTEXT_VERSION; + ms->event_context.vblank_handler = ms_drm_handler; + ms->event_context.page_flip_handler = ms_drm_handler; + + /* We need to re-register the DRM fd for the synchronisation + * 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); + + return TRUE; +} + +void +ms_vblank_close_screen(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + ms_drm_abort_scrn(scrn); + + RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, + ms_drm_wakeup_handler, screen); + RemoveGeneralSocket(ms->fd); +} diff --git a/xserver/hw/xfree86/exa/Makefile.in b/xserver/hw/xfree86/exa/Makefile.in index ecf602edb..dbf95d4b3 100644 --- a/xserver/hw/xfree86/exa/Makefile.in +++ b/xserver/hw/xfree86/exa/Makefile.in @@ -302,6 +302,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/exa/man/Makefile.in b/xserver/hw/xfree86/exa/man/Makefile.in index 98e2150e7..f968b0087 100644 --- a/xserver/hw/xfree86/exa/man/Makefile.in +++ b/xserver/hw/xfree86/exa/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.in b/xserver/hw/xfree86/fbdevhw/Makefile.in index 37b6b020b..ac9818698 100644 --- a/xserver/hw/xfree86/fbdevhw/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/Makefile.in @@ -305,6 +305,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhw.c b/xserver/hw/xfree86/fbdevhw/fbdevhw.c index 0450822ee..8cd207961 100644 --- a/xserver/hw/xfree86/fbdevhw/fbdevhw.c +++ b/xserver/hw/xfree86/fbdevhw/fbdevhw.c @@ -251,7 +251,7 @@ fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode) /* open correct framebuffer device */ /** - * Try to find the framebuffer device for a given PCI device + * Try to find the framebuffer device for a given PCI device */ static int fbdev_open_pci(struct pci_device *pPci, char **namep) diff --git a/xserver/hw/xfree86/fbdevhw/man/Makefile.in b/xserver/hw/xfree86/fbdevhw/man/Makefile.in index de2f00d52..174ffd4ed 100644 --- a/xserver/hw/xfree86/fbdevhw/man/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/glamor_egl/Makefile.am b/xserver/hw/xfree86/glamor_egl/Makefile.am index 85e1c0c06..e697c8296 100644 --- a/xserver/hw/xfree86/glamor_egl/Makefile.am +++ b/xserver/hw/xfree86/glamor_egl/Makefile.am @@ -24,7 +24,7 @@ module_LTLIBRARIES = libglamoregl.la libglamoregl_la_SOURCES = \ $(top_srcdir)/glamor/glamor_egl.c \ $(top_srcdir)/glamor/glamor_eglmodule.c \ - $(top_srcdir)/glamor/glamor_xv.c \ + glamor_xf86_xv.c \ $() libglamoregl_la_LDFLAGS = \ @@ -38,6 +38,7 @@ libglamoregl_la_LIBADD = \ AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/dri3 \ + -I$(top_srcdir)/glamor \ $() AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(GLAMOR_CFLAGS) $(GBM_CFLAGS) diff --git a/xserver/hw/xfree86/glamor_egl/Makefile.in b/xserver/hw/xfree86/glamor_egl/Makefile.in index 2cb23328f..46fa1d1ec 100644 --- a/xserver/hw/xfree86/glamor_egl/Makefile.in +++ b/xserver/hw/xfree86/glamor_egl/Makefile.in @@ -124,7 +124,7 @@ am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libglamoregl_la_DEPENDENCIES = $(top_builddir)/glamor/libglamor.la am_libglamoregl_la_OBJECTS = glamor_egl.lo glamor_eglmodule.lo \ - glamor_xv.lo + glamor_xf86_xv.lo libglamoregl_la_OBJECTS = $(am_libglamoregl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -286,6 +286,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -527,7 +528,7 @@ module_LTLIBRARIES = libglamoregl.la libglamoregl_la_SOURCES = \ $(top_srcdir)/glamor/glamor_egl.c \ $(top_srcdir)/glamor/glamor_eglmodule.c \ - $(top_srcdir)/glamor/glamor_xv.c \ + glamor_xf86_xv.c \ $() libglamoregl_la_LDFLAGS = \ @@ -541,6 +542,7 @@ libglamoregl_la_LIBADD = \ AM_CPPFLAGS = $(XORG_INCS) \ -I$(top_srcdir)/dri3 \ + -I$(top_srcdir)/glamor \ $() AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(GLAMOR_CFLAGS) $(GBM_CFLAGS) @@ -623,7 +625,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_egl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_eglmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_xv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glamor_xf86_xv.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -660,13 +662,6 @@ glamor_eglmodule.lo: $(top_srcdir)/glamor/glamor_eglmodule.c @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) $(AM_CFLAGS) $(CFLAGS) -c -o glamor_eglmodule.lo `test -f '$(top_srcdir)/glamor/glamor_eglmodule.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_eglmodule.c -glamor_xv.lo: $(top_srcdir)/glamor/glamor_xv.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) $(AM_CFLAGS) $(CFLAGS) -MT glamor_xv.lo -MD -MP -MF $(DEPDIR)/glamor_xv.Tpo -c -o glamor_xv.lo `test -f '$(top_srcdir)/glamor/glamor_xv.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_xv.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/glamor_xv.Tpo $(DEPDIR)/glamor_xv.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/glamor/glamor_xv.c' object='glamor_xv.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) $(AM_CFLAGS) $(CFLAGS) -c -o glamor_xv.lo `test -f '$(top_srcdir)/glamor/glamor_xv.c' || echo '$(srcdir)/'`$(top_srcdir)/glamor/glamor_xv.c - mostlyclean-libtool: -rm -f *.lo diff --git a/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c b/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c new file mode 100644 index 000000000..8535fa0c9 --- /dev/null +++ b/xserver/hw/xfree86/glamor_egl/glamor_xf86_xv.c @@ -0,0 +1,185 @@ +/* + * Copyright © 2013 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: + * Dave Airlie + * + * some code is derived from the xf86-video-ati radeon driver, mainly + * the calculations. + */ + +/** @file glamor_xf86_xv.c + * + * This implements the XF86 XV interface, and calls into glamor core + * for its support of the suspiciously similar XF86 and Kdrive + * device-dependent XV interfaces. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#define GLAMOR_FOR_XORG +#include "glamor_priv.h" + +#include +#include "fourcc.h" + +#define NUM_FORMATS 3 + +static XF86VideoFormatRec Formats[NUM_FORMATS] = { + {15, TrueColor}, {16, TrueColor}, {24, TrueColor} +}; + +static void +glamor_xf86_xv_stop_video(ScrnInfoPtr pScrn, void *data, Bool cleanup) +{ + if (!cleanup) + return; + + glamor_xv_stop_video(data); +} + +static int +glamor_xf86_xv_set_port_attribute(ScrnInfoPtr pScrn, + Atom attribute, INT32 value, void *data) +{ + return glamor_xv_set_port_attribute(data, attribute, value); +} + +static int +glamor_xf86_xv_get_port_attribute(ScrnInfoPtr pScrn, + Atom attribute, INT32 *value, void *data) +{ + return glamor_xv_get_port_attribute(data, attribute, value); +} + +static void +glamor_xf86_xv_query_best_size(ScrnInfoPtr pScrn, + Bool motion, + short vid_w, short vid_h, + short drw_w, short drw_h, + unsigned int *p_w, unsigned int *p_h, void *data) +{ + *p_w = drw_w; + *p_h = drw_h; +} + +static int +glamor_xf86_xv_query_image_attributes(ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets) +{ + return glamor_xv_query_image_attributes(id, w, h, pitches, offsets); +} + +static int +glamor_xf86_xv_put_image(ScrnInfoPtr pScrn, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + int id, + unsigned char *buf, + short width, + short height, + Bool sync, + RegionPtr clipBoxes, void *data, DrawablePtr pDrawable) +{ + return glamor_xv_put_image(data, pDrawable, + src_x, src_y, + drw_x, drw_y, + src_w, src_h, + drw_w, drw_h, + id, buf, width, height, sync, clipBoxes); +} + +static XF86VideoEncodingRec DummyEncodingGLAMOR[1] = { + { + 0, + "XV_IMAGE", + 8192, 8192, + {1, 1} + } +}; + +XF86VideoAdaptorPtr +glamor_xv_init(ScreenPtr screen, int num_texture_ports) +{ + glamor_port_private *port_priv; + XF86VideoAdaptorPtr adapt; + int i; + + glamor_xv_core_init(screen); + + adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports * + (sizeof(glamor_port_private) + sizeof(DevUnion))); + if (adapt == NULL) + return NULL; + + adapt->type = XvWindowMask | XvInputMask | XvImageMask; + adapt->flags = 0; + adapt->name = "GLAMOR Textured Video"; + adapt->nEncodings = 1; + adapt->pEncodings = DummyEncodingGLAMOR; + + adapt->nFormats = NUM_FORMATS; + adapt->pFormats = Formats; + adapt->nPorts = num_texture_ports; + adapt->pPortPrivates = (DevUnion *) (&adapt[1]); + + adapt->pAttributes = glamor_xv_attributes; + adapt->nAttributes = glamor_xv_num_attributes; + + port_priv = + (glamor_port_private *) (&adapt->pPortPrivates[num_texture_ports]); + adapt->pImages = glamor_xv_images; + adapt->nImages = glamor_xv_num_images; + adapt->PutVideo = NULL; + adapt->PutStill = NULL; + adapt->GetVideo = NULL; + adapt->GetStill = NULL; + adapt->StopVideo = glamor_xf86_xv_stop_video; + adapt->SetPortAttribute = glamor_xf86_xv_set_port_attribute; + adapt->GetPortAttribute = glamor_xf86_xv_get_port_attribute; + adapt->QueryBestSize = glamor_xf86_xv_query_best_size; + adapt->PutImage = glamor_xf86_xv_put_image; + adapt->ReputImage = NULL; + adapt->QueryImageAttributes = glamor_xf86_xv_query_image_attributes; + + for (i = 0; i < num_texture_ports; i++) { + glamor_port_private *pPriv = &port_priv[i]; + + pPriv->brightness = 0; + pPriv->contrast = 0; + pPriv->saturation = 0; + pPriv->hue = 0; + pPriv->gamma = 1000; + pPriv->transform_index = 0; + + REGION_NULL(pScreen, &pPriv->clip); + + adapt->pPortPrivates[i].ptr = (void *) (pPriv); + } + return adapt; +} diff --git a/xserver/hw/xfree86/i2c/Makefile.am b/xserver/hw/xfree86/i2c/Makefile.am index c31159196..8bf795ded 100644 --- a/xserver/hw/xfree86/i2c/Makefile.am +++ b/xserver/hw/xfree86/i2c/Makefile.am @@ -1,43 +1,9 @@ noinst_LTLIBRARIES = libi2c.la -multimediadir = $(moduledir)/multimedia -multimedia_LTLIBRARIES = \ - bt829_drv.la \ - fi1236_drv.la \ - msp3430_drv.la \ - tda8425_drv.la \ - tda9850_drv.la \ - tda9885_drv.la \ - uda1380_drv.la - libi2c_la_SOURCES = xf86i2c.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h uda1380.h i2c_def.h - -# -# i2c drivers -# -bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c - -fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c - -msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c - -tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c - -tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c - -tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c - -uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c +sdk_HEADERS = xf86i2c.h i2c_def.h diff --git a/xserver/hw/xfree86/i2c/Makefile.in b/xserver/hw/xfree86/i2c/Makefile.in index f97c9a348..90a901f0d 100644 --- a/xserver/hw/xfree86/i2c/Makefile.in +++ b/xserver/hw/xfree86/i2c/Makefile.in @@ -73,89 +73,14 @@ 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)$(multimediadir)" "$(DESTDIR)$(sdkdir)" -LTLIBRARIES = $(multimedia_LTLIBRARIES) $(noinst_LTLIBRARIES) -bt829_drv_la_LIBADD = -am_bt829_drv_la_OBJECTS = bt829.lo bt829_module.lo -bt829_drv_la_OBJECTS = $(am_bt829_drv_la_OBJECTS) +LTLIBRARIES = $(noinst_LTLIBRARIES) +libi2c_la_LIBADD = +am_libi2c_la_OBJECTS = xf86i2c.lo +libi2c_la_OBJECTS = $(am_libi2c_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 = -bt829_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(bt829_drv_la_LDFLAGS) $(LDFLAGS) -o $@ -fi1236_drv_la_LIBADD = -am_fi1236_drv_la_OBJECTS = fi1236.lo fi1236_module.lo tda9885.lo -fi1236_drv_la_OBJECTS = $(am_fi1236_drv_la_OBJECTS) -fi1236_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(fi1236_drv_la_LDFLAGS) $(LDFLAGS) -o $@ -libi2c_la_LIBADD = -am_libi2c_la_OBJECTS = xf86i2c.lo -libi2c_la_OBJECTS = $(am_libi2c_la_OBJECTS) -msp3430_drv_la_LIBADD = -am_msp3430_drv_la_OBJECTS = msp3430.lo msp3430_module.lo -msp3430_drv_la_OBJECTS = $(am_msp3430_drv_la_OBJECTS) -msp3430_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(msp3430_drv_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -tda8425_drv_la_LIBADD = -am_tda8425_drv_la_OBJECTS = tda8425.lo tda8425_module.lo -tda8425_drv_la_OBJECTS = $(am_tda8425_drv_la_OBJECTS) -tda8425_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(tda8425_drv_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -tda9850_drv_la_LIBADD = -am_tda9850_drv_la_OBJECTS = tda9850.lo tda9850_module.lo -tda9850_drv_la_OBJECTS = $(am_tda9850_drv_la_OBJECTS) -tda9850_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(tda9850_drv_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -tda9885_drv_la_LIBADD = -am_tda9885_drv_la_OBJECTS = tda9885.lo tda9885_module.lo -tda9885_drv_la_OBJECTS = $(am_tda9885_drv_la_OBJECTS) -tda9885_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(tda9885_drv_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -uda1380_drv_la_LIBADD = -am_uda1380_drv_la_OBJECTS = uda1380.lo uda1380_module.lo -uda1380_drv_la_OBJECTS = $(am_uda1380_drv_la_OBJECTS) -uda1380_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(uda1380_drv_la_LDFLAGS) $(LDFLAGS) -o \ - $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -190,19 +115,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 = $(bt829_drv_la_SOURCES) $(fi1236_drv_la_SOURCES) \ - $(libi2c_la_SOURCES) $(msp3430_drv_la_SOURCES) \ - $(tda8425_drv_la_SOURCES) $(tda9850_drv_la_SOURCES) \ - $(tda9885_drv_la_SOURCES) $(uda1380_drv_la_SOURCES) -DIST_SOURCES = $(bt829_drv_la_SOURCES) $(fi1236_drv_la_SOURCES) \ - $(libi2c_la_SOURCES) $(msp3430_drv_la_SOURCES) \ - $(tda8425_drv_la_SOURCES) $(tda9850_drv_la_SOURCES) \ - $(tda9885_drv_la_SOURCES) $(uda1380_drv_la_SOURCES) +SOURCES = $(libi2c_la_SOURCES) +DIST_SOURCES = $(libi2c_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 @@ -315,6 +262,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -553,38 +501,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libi2c.la -multimediadir = $(moduledir)/multimedia -multimedia_LTLIBRARIES = \ - bt829_drv.la \ - fi1236_drv.la \ - msp3430_drv.la \ - tda8425_drv.la \ - tda9850_drv.la \ - tda9885_drv.la \ - uda1380_drv.la - libi2c_la_SOURCES = xf86i2c.c AM_CPPFLAGS = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h uda1380.h i2c_def.h - -# -# i2c drivers -# -bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c -fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c -msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c -tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c -tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c -tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c -uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c +sdk_HEADERS = xf86i2c.h i2c_def.h all: all-am .SUFFIXES: @@ -619,40 +539,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-multimediaLTLIBRARIES: $(multimedia_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(multimedia_LTLIBRARIES)'; test -n "$(multimediadir)" || 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)$(multimediadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(multimediadir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(multimediadir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(multimediadir)"; \ - } - -uninstall-multimediaLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(multimedia_LTLIBRARIES)'; test -n "$(multimediadir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(multimediadir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(multimediadir)/$$f"; \ - done - -clean-multimediaLTLIBRARIES: - -test -z "$(multimedia_LTLIBRARIES)" || rm -f $(multimedia_LTLIBRARIES) - @list='$(multimedia_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) @@ -664,22 +550,8 @@ clean-noinstLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } -bt829_drv.la: $(bt829_drv_la_OBJECTS) $(bt829_drv_la_DEPENDENCIES) $(EXTRA_bt829_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(bt829_drv_la_LINK) -rpath $(multimediadir) $(bt829_drv_la_OBJECTS) $(bt829_drv_la_LIBADD) $(LIBS) -fi1236_drv.la: $(fi1236_drv_la_OBJECTS) $(fi1236_drv_la_DEPENDENCIES) $(EXTRA_fi1236_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(fi1236_drv_la_LINK) -rpath $(multimediadir) $(fi1236_drv_la_OBJECTS) $(fi1236_drv_la_LIBADD) $(LIBS) libi2c.la: $(libi2c_la_OBJECTS) $(libi2c_la_DEPENDENCIES) $(EXTRA_libi2c_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libi2c_la_OBJECTS) $(libi2c_la_LIBADD) $(LIBS) -msp3430_drv.la: $(msp3430_drv_la_OBJECTS) $(msp3430_drv_la_DEPENDENCIES) $(EXTRA_msp3430_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(msp3430_drv_la_LINK) -rpath $(multimediadir) $(msp3430_drv_la_OBJECTS) $(msp3430_drv_la_LIBADD) $(LIBS) -tda8425_drv.la: $(tda8425_drv_la_OBJECTS) $(tda8425_drv_la_DEPENDENCIES) $(EXTRA_tda8425_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(tda8425_drv_la_LINK) -rpath $(multimediadir) $(tda8425_drv_la_OBJECTS) $(tda8425_drv_la_LIBADD) $(LIBS) -tda9850_drv.la: $(tda9850_drv_la_OBJECTS) $(tda9850_drv_la_DEPENDENCIES) $(EXTRA_tda9850_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(tda9850_drv_la_LINK) -rpath $(multimediadir) $(tda9850_drv_la_OBJECTS) $(tda9850_drv_la_LIBADD) $(LIBS) -tda9885_drv.la: $(tda9885_drv_la_OBJECTS) $(tda9885_drv_la_DEPENDENCIES) $(EXTRA_tda9885_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(tda9885_drv_la_LINK) -rpath $(multimediadir) $(tda9885_drv_la_OBJECTS) $(tda9885_drv_la_LIBADD) $(LIBS) -uda1380_drv.la: $(uda1380_drv_la_OBJECTS) $(uda1380_drv_la_DEPENDENCIES) $(EXTRA_uda1380_drv_la_DEPENDENCIES) - $(AM_V_CCLD)$(uda1380_drv_la_LINK) -rpath $(multimediadir) $(uda1380_drv_la_OBJECTS) $(uda1380_drv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -687,20 +559,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt829.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt829_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fi1236.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fi1236_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msp3430.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msp3430_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda8425.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda8425_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda9850.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda9850_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda9885.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tda9885_module.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uda1380.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uda1380_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86i2c.Plo@am__quote@ .c.o: @@ -851,7 +709,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(multimediadir)" "$(DESTDIR)$(sdkdir)"; do \ + for dir in "$(DESTDIR)$(sdkdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -886,8 +744,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-multimediaLTLIBRARIES \ - clean-noinstLTLIBRARIES mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -907,7 +765,7 @@ info: info-am info-am: -install-data-am: install-multimediaLTLIBRARIES install-sdkHEADERS +install-data-am: install-sdkHEADERS install-dvi: install-dvi-am @@ -953,25 +811,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-multimediaLTLIBRARIES uninstall-sdkHEADERS +uninstall-am: uninstall-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-multimediaLTLIBRARIES \ - clean-noinstLTLIBRARIES cscopelist ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-multimediaLTLIBRARIES install-pdf install-pdf-am \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-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-multimediaLTLIBRARIES \ - uninstall-sdkHEADERS + 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/i2c/bt829.c b/xserver/hw/xfree86/i2c/bt829.c deleted file mode 100644 index 991c26eab..000000000 --- a/xserver/hw/xfree86/i2c/bt829.c +++ /dev/null @@ -1,822 +0,0 @@ -/* TODO: clean up/fix CC code */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "xf86.h" -#include "xf86i2c.h" -#include "bt829.h" -#include "i2c_def.h" - -/* Changing the following settings (especially VCROP) may */ -/* require modifying code that calls this driver. */ -#define HCROP 0 /* amount to crop from the left and right edges */ -#define VCROP 0 /* amount to crop from the top and bottom edges */ - -#define BTVERSION (bt->id>>4) - -#define H(X) ( ((X)>>8) & 0xFF ) -#define L(X) ( (X) & 0xFF ) - -#define LIMIT(X,A,B) (((X)<(A)) ? (A) : ((X)>(B)) ? (B) : (X) ) - -/* Bt829 family chip ID's */ -#define BT815 0x02 -#define BT817 0x06 -#define BT819 0x07 -#define BT827 0x0C -#define BT829 0x0E - -/* Bt829 registers */ -#define STATUS 0x00 /* Device Status */ -#define IFORM 0x01 /* Input Format */ -#define TDEC 0x02 /* Temporal Decimation */ -#define CROP 0x03 /* MSB Cropping */ -#define VDELAY_LO 0x04 /* Vertical Delay */ -#define VACTIVE_LO 0x05 /* Vertical Active */ -#define HDELAY_LO 0x06 /* Horizontal Delay */ -#define HACTIVE_LO 0x07 /* Horizontal Active */ -#define HSCALE_HI 0x08 /* Horizontal Scaling */ -#define HSCALE_LO 0x09 /* Horizontal Scaling */ -#define BRIGHT 0x0A /* Brightness Control */ -#define CONTROL 0x0B /* Miscellaneous Control */ -#define CONTRAST_LO 0x0C /* Luma Gain (Contrast) */ -#define SAT_U_LO 0x0D /* Chroma (U) Gain (Saturation) */ -#define SAT_V_LO 0x0E /* Chroma (V) Gain (Saturation) */ -#define HUE 0x0F /* Hue Control */ -#define SCLOOP 0x10 /* SC Loop Control */ -#define WC_UP 0x11 /* White Crush Up Count */ -#define OFORM 0x12 /* Output Format */ -#define VSCALE_HI 0x13 /* Vertical Scaling */ -#define VSCALE_LO 0x14 /* Vertical Scaling */ -#define TEST 0x15 /* Test Control */ -#define VPOLE 0x16 /* Video Timing Polarity */ -#define IDCODE 0x17 /* ID Code */ -#define ADELAY 0x18 /* AGC Delay */ -#define BDELAY 0x19 /* Burst Gate Delay */ -#define ADC 0x1A /* ADC Interface */ -#define VTC 0x1B /* Video Timing Control */ -#define CC_STATUS 0x1C /* Extended Data Services/Closed Capt Status */ -#define CC_DATA 0x1D /* Extended Data Services/Closed Capt Data */ -#define WC_DN 0x1E /* White Crush Down Count */ -#define SRESET 0x1F /* Software Reset */ -#define P_IO 0x3F /* Programmable I/O */ - -static CARD8 -btread(BT829Ptr bt, CARD8 reg) -{ - CARD8 v; - - I2C_WriteRead(&(bt->d), ®, 1, &v, 1); - - return v; -} - -static void -btwrite(BT829Ptr bt, CARD8 reg, CARD8 val) -{ - CARD8 data[2]; - - data[0] = reg; - data[1] = val; - I2C_WriteRead(&(bt->d), data, 2, NULL, 0); -} - -/* - * Register access - */ -static void -btwrite_status(BT829Ptr bt) -{ /* STATUS */ - btwrite(bt, STATUS, 0x00); /* clear */ -} - -static void -btwrite_iform(BT829Ptr bt) -{ /* IFORM */ - int xtsel; - - switch (bt->format) { - case BT829_NTSC: - case BT829_NTSC_JAPAN: - case BT829_PAL_M: - case BT829_PAL_N_COMB: /* gatos says xtsel = 2 */ - xtsel = 1; - break; - case BT829_PAL: - case BT829_PAL_N: - case BT829_SECAM: - xtsel = 2; - break; - default: /* shouldn't get here */ - xtsel = 3; /* hardware default */ - break; - } - - btwrite(bt, IFORM, (bt->mux << 5) | (xtsel << 3) | bt->format); -} - -static void -btwrite_tdec(BT829Ptr bt) -{ /* TDEC */ - /* use default */ -} - -static void -btwrite_crop(BT829Ptr bt) -{ /* CROP */ - btwrite(bt, CROP, (H(bt->vdelay) << 6) | (H(bt->vactive) << 4) | - (H(bt->hdelay) << 2) | H(bt->width)); -} - -static void -btwrite_vdelay_lo(BT829Ptr bt) -{ /* VDELAY_LO */ - btwrite(bt, VDELAY_LO, L(bt->vdelay)); -} - -static void -btwrite_vactive_lo(BT829Ptr bt) -{ /* VACTIVE_LO */ - btwrite(bt, VACTIVE_LO, L(bt->vactive)); -} - -static void -btwrite_hdelay_lo(BT829Ptr bt) -{ /* HDELAY_LO */ - btwrite(bt, HDELAY_LO, L(bt->hdelay)); -} - -static void -btwrite_hactive_lo(BT829Ptr bt) -{ /* HACTIVE_LO */ - btwrite(bt, HACTIVE_LO, L(bt->width)); -} - -static void -btwrite_hscale_hi(BT829Ptr bt) -{ /* HSCALE_HI */ - btwrite(bt, HSCALE_HI, H(bt->hscale)); -} - -static void -btwrite_hscale_lo(BT829Ptr bt) -{ /* HSCALE_LO */ - btwrite(bt, HSCALE_LO, L(bt->hscale)); -} - -static void -btwrite_bright(BT829Ptr bt) -{ /* BRIGHT */ - btwrite(bt, BRIGHT, bt->brightness); -} - -static void -btwrite_control(BT829Ptr bt) -{ /* CONTROL */ - int ldec; - - /* The data sheet says ldec should always be 0 for SECAM */ - /* but the picture quality is better with ldec = 1 */ - ldec = (bt->width > 360); /* gatos says 384 */ - - btwrite(bt, CONTROL, ((bt->mux == bt->svideo_mux) ? 0xC0 : 0x00) | /* LNOTCH and COMP */ - (ldec << 5) | (H(bt->contrast) << 2) | (H(bt->sat_u) << 1) | H(bt-> - sat_v)); -} - -static void -btwrite_contrast_lo(BT829Ptr bt) -{ /* CONTRAST_LO */ - btwrite(bt, CONTRAST_LO, L(bt->contrast)); -} - -static void -btwrite_sat_u_lo(BT829Ptr bt) -{ /* SAT_U_LO */ - btwrite(bt, SAT_U_LO, L(bt->sat_u)); -} - -static void -btwrite_sat_v_lo(BT829Ptr bt) -{ /* SAT_V_LO */ - btwrite(bt, SAT_V_LO, L(bt->sat_v)); -} - -static void -btwrite_hue(BT829Ptr bt) -{ /* HUE */ - btwrite(bt, HUE, bt->hue); -} - -static void -btwrite_scloop(BT829Ptr bt) -{ /* SCLOOP */ - if (BTVERSION >= BT827) { - btwrite(bt, SCLOOP, (bt->format == BT829_SECAM) ? 0x10 : 0x00 /* QCIF or AUTO */ - ); - } -} - -static void -btwrite_wc_up(BT829Ptr bt) -{ /* WC_UP */ - if (BTVERSION >= BT827) { - /* use default */ - } -} - -static void -btwrite_oform(BT829Ptr bt) -{ /* OFORM */ - btwrite(bt, OFORM, (bt->code << 3) | (bt->len << 2) | 0x02 /* RANGE = 0, CORE = 0, VBI_FRAME = 0, OES = 2 (default) */ - ); -} - -static void -btwrite_vscale_hi(BT829Ptr bt) -{ /* VSCALE_HI */ - btwrite(bt, VSCALE_HI, H(bt->vscale) | 0x60 /* YCOMB = 0, COMB = 1, INT = 1 (default) */ - ); -} - -static void -btwrite_vscale_lo(BT829Ptr bt) -{ /* VSCALE_LO */ - btwrite(bt, VSCALE_LO, L(bt->vscale)); -} - -/* TEST should not be written to */ - -static void -btwrite_vpole(BT829Ptr bt) -{ /* VPOLE */ - btwrite(bt, VPOLE, (bt->out_en << 7)); -} - -/* IDCODE is read only */ - -static void -btwrite_adelay(BT829Ptr bt) -{ /* ADELAY */ - switch (bt->format) { - case BT829_NTSC: - case BT829_NTSC_JAPAN: - case BT829_PAL_M: - btwrite(bt, ADELAY, 104); - break; - case BT829_PAL: - case BT829_PAL_N: - case BT829_SECAM: - case BT829_PAL_N_COMB: - btwrite(bt, ADELAY, 127); - break; - default: /* shouldn't get here */ - btwrite(bt, ADELAY, 104); /* hardware default */ - break; - } -} - -static void -btwrite_bdelay(BT829Ptr bt) -{ /* BDELAY */ - switch (bt->format) { - case BT829_NTSC: - case BT829_NTSC_JAPAN: - case BT829_PAL_M: - btwrite(bt, BDELAY, 93); - break; - case BT829_PAL: - case BT829_PAL_N: - case BT829_PAL_N_COMB: - btwrite(bt, BDELAY, 114); - break; - case BT829_SECAM: - btwrite(bt, BDELAY, 160); - break; - default: /* shouldn't get here */ - btwrite(bt, BDELAY, 93); /* hardware default */ - break; - } -} - -static void -btwrite_adc(BT829Ptr bt) -{ /* ADC */ - btwrite(bt, ADC, bt->mux == bt->svideo_mux ? 0x80 : 0x82); /* CSLEEP = 0 or 1 */ -} - -static void -btwrite_vtc(BT829Ptr bt) -{ /* VTC */ - int vfilt = 0; /* hardware default */ - - if (BTVERSION > BT827) { /* gatos says >= BT827 */ - switch (bt->format) { - case BT829_NTSC: - case BT829_NTSC_JAPAN: - case BT829_PAL_M: - case BT829_PAL_N_COMB: /* gatos groups with BT829_PAL */ - if (bt->width <= 360) - vfilt = 1; /* gatos says <= 240 */ - if (bt->width <= 180) - vfilt = 2; /* gatos says <= 120 */ - if (bt->width <= 90) - vfilt = 3; /* gatos says <= 60 */ - break; - case BT829_PAL: - case BT829_PAL_N: - case BT829_SECAM: - if (bt->width <= 384) - vfilt = 1; - if (bt->width <= 192) - vfilt = 2; - if (bt->width <= 96) - vfilt = 3; - break; - default: /* shouldn't get here */ - break; /* use hardware default */ - } - btwrite(bt, VTC, (bt->vbien << 4) | (bt->vbifmt << 3) | vfilt); - } -} - -static void -btwrite_cc_status(BT829Ptr bt) -{ /* CC_STATUS *//* FIXME: ATI specific */ - if (BTVERSION >= BT827) { - if (bt->ccmode == 0) - btwrite(bt, CC_STATUS, 0x00); - /* 0x40 is activate to set the CCVALID line. Not required yet */ - else - btwrite(bt, CC_STATUS, (bt->ccmode << 4) | 0x40); - } -} - -/* CC_DATA is read only */ - -static void -btwrite_wc_dn(BT829Ptr bt) -{ /* WC_DN */ - if (BTVERSION >= BT827) { - /* use default */ - } -} - -static void -bt_reset(BT829Ptr bt) -{ /* SRESET */ - btwrite(bt, SRESET, 0x0); /* Reset all registers */ -} - -static void -btwrite_p_io(BT829Ptr bt) -{ /* P_IO */ - if (BTVERSION >= BT827) { - btwrite(bt, P_IO, bt->p_io); - } -} - -/* - * Deal with dependencies - */ -static void -propagate_changes(BT829Ptr bt) -{ - CARD16 hdelay, unscaled_hdelay, vdelay, hscale, vscale; - int htotal, vactive; - - switch (bt->format) { - case BT829_NTSC: - case BT829_NTSC_JAPAN: - case BT829_PAL_M: - vdelay = 22; - htotal = 754; - vactive = 480; - unscaled_hdelay = 135; - break; - case BT829_PAL: - case BT829_PAL_N: - vdelay = (bt->tunertype == 5) ? 34 : 22; - htotal = 922; - vactive = 576; - unscaled_hdelay = 186; - break; - case BT829_SECAM: - vdelay = 34; - htotal = 922; - vactive = 576; - unscaled_hdelay = 186; - break; - case BT829_PAL_N_COMB: - vdelay = (bt->tunertype == 5) ? 34 : 22; /* windows says 22 */ - htotal = 754; /* gatos and windows say 922 */ - vactive = 576; - unscaled_hdelay = 135; /* gatos and windows say 186 */ - break; - default: /* shouldn't get here */ - vdelay = 22; /* hardware default */ - htotal = 754; - vactive = 480; /* hardware default */ - unscaled_hdelay = 135; - break; - } - - bt->htotal = htotal; /* Used for error checking in bt829_SetCaptSize */ - - hscale = 4096 * htotal / (bt->width + 2 * HCROP) - 4096; - hdelay = - (HCROP + (bt->width + 2 * HCROP) * unscaled_hdelay / htotal) & 0x3FE; - - vactive = vactive - 2 * VCROP; - vdelay = vdelay + VCROP; - vscale = (0x10000 - (512 * vactive / bt->height - 512)) & 0x1FFF; - - if ((hdelay != bt->hdelay) || (vdelay != bt->vdelay) || - (vactive != bt->vactive) || (hscale != bt->hscale) || - (vscale != bt->vscale)) { - bt->hdelay = hdelay; - bt->vdelay = vdelay; - bt->vactive = vactive; - bt->hscale = hscale; - bt->vscale = vscale; - btwrite_crop(bt); - btwrite_vdelay_lo(bt); - btwrite_vactive_lo(bt); - btwrite_hdelay_lo(bt); - btwrite_hscale_hi(bt); - btwrite_hscale_lo(bt); - btwrite_control(bt); - btwrite_vscale_hi(bt); - btwrite_vscale_lo(bt); - } -} - -static void -write_all(BT829Ptr bt) -{ - bt_reset(bt); - propagate_changes(bt); /* ensure consistency */ - btwrite_iform(bt); - btwrite_tdec(bt); - btwrite_crop(bt); - btwrite_vdelay_lo(bt); - btwrite_vactive_lo(bt); - btwrite_hdelay_lo(bt); - btwrite_hactive_lo(bt); - btwrite_hscale_hi(bt); - btwrite_hscale_lo(bt); - btwrite_bright(bt); - btwrite_control(bt); - btwrite_contrast_lo(bt); - btwrite_sat_u_lo(bt); - btwrite_sat_v_lo(bt); - btwrite_hue(bt); - btwrite_scloop(bt); - btwrite_wc_up(bt); - btwrite_oform(bt); - btwrite_vscale_hi(bt); - btwrite_vscale_lo(bt); - btwrite_vpole(bt); - btwrite_adelay(bt); - btwrite_bdelay(bt); - btwrite_adc(bt); - btwrite_vtc(bt); - /* btwrite_cc_status(bt); *//* FIXME: CC code needs cleaning */ - btwrite_wc_dn(bt); - btwrite_p_io(bt); -} - -/* - * Public functions - */ -BT829Ptr -bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr) -{ - BT829Ptr bt; - I2CByte a; - char *devname; - - bt = calloc(1, sizeof(BT829Rec)); - if (bt == NULL) - return NULL; - bt->d.DevName = strdup("BT829 video decoder"); - bt->d.SlaveAddr = addr; - bt->d.pI2CBus = b; - bt->d.NextDev = NULL; - bt->d.StartTimeout = b->StartTimeout; - bt->d.BitTimeout = b->BitTimeout; - bt->d.AcknTimeout = b->AcknTimeout; - bt->d.ByteTimeout = b->ByteTimeout; - - if (!I2C_WriteRead(&(bt->d), NULL, 0, &a, 1)) { - free(bt); - return NULL; - } - - bt->id = btread(bt, IDCODE); - - free((void *) bt->d.DevName); - bt->d.DevName = devname = calloc(200, sizeof(char)); - switch (BTVERSION) { - case BT815: - sprintf(devname, "bt815a video decoder, revision %d", - bt->id & 0xf); - break; - case BT817: - sprintf(devname, "bt817a video decoder, revision %d", - bt->id & 0xf); - break; - case BT819: - sprintf(devname, "bt819a video decoder, revision %d", - bt->id & 0xf); - break; - case BT827: - sprintf(devname, "bt827a/b video decoder, revision %d", - bt->id & 0xf); - break; - case BT829: - sprintf(devname, "bt829a/b video decoder, revision %d", - bt->id & 0xf); - break; - default: - sprintf(devname, - "bt8xx/unknown video decoder version %d, revision %d", - bt->id >> 4, bt->id & 0xf); - break; - } - - /* set default parameters */ - if (!I2CDevInit(&(bt->d))) { - free(bt); - return NULL; - } - - bt->tunertype = 1; - - bt->brightness = 0; /* hardware default */ - bt->ccmode = 0; - bt->code = 0; /* hardware default */ - bt->contrast = 216; /* hardware default */ - bt->format = BT829_NTSC; - bt->height = 480; /* hardware default for vactive */ - bt->hue = 0; /* hardware default */ - bt->len = 1; /* hardware default */ - bt->mux = BT829_MUX0; /* hardware default */ - bt->out_en = 0; /* hardware default */ - bt->p_io = 0; /* hardware default */ - bt->sat_u = 254; /* hardware default */ - bt->sat_v = 180; /* hardware default */ - bt->vbien = 0; /* hardware default */ - bt->vbifmt = 0; /* hardware default */ - bt->width = 640; /* hardware default for hactive */ - - bt->hdelay = 120; /* hardware default */ - bt->hscale = 684; /* hardware default */ - bt->vactive = 480; /* hardware default */ - bt->vdelay = 22; /* hardware default */ - bt->vscale = 0; /* hardware default */ - - bt->htotal = 754; /* NTSC */ - bt->svideo_mux = 0; /* no s-video */ - - return bt; -} - -int -bt829_ATIInit(BT829Ptr bt) -{ - bt->code = 1; - bt->len = 0; - bt->vbien = 1; - bt->vbifmt = 1; - bt->svideo_mux = BT829_MUX1; - - write_all(bt); - - return 0; -} - -int -bt829_SetFormat(BT829Ptr bt, CARD8 format) -{ - if ((format < 1) || (format > 7)) - return -1; - if ((BTVERSION <= BT819) && (format != BT829_NTSC) && (format != BT829_PAL)) - return -1; - if (format == bt->format) - return 0; - bt->format = format; - propagate_changes(bt); - btwrite_iform(bt); - btwrite_scloop(bt); - btwrite_adelay(bt); - btwrite_bdelay(bt); - btwrite_vtc(bt); - return 0; -} - -int -bt829_SetMux(BT829Ptr bt, CARD8 mux) -{ - if ((mux < 1) || (mux > 3)) - return -1; - if (mux == bt->mux) - return 0; - bt->mux = mux; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_iform(bt); - btwrite_control(bt); - btwrite_adc(bt); - return 0; -} - -void -bt829_SetBrightness(BT829Ptr bt, int brightness) -{ - brightness = LIMIT(brightness, -1000, 999); /* ensure -128 <= brightness <= 127 below */ - brightness = (128 * brightness) / 1000; - if (brightness == bt->brightness) - return; - bt->brightness = brightness; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_bright(bt); -} - -void -bt829_SetContrast(BT829Ptr bt, int contrast) -{ - contrast = LIMIT(contrast, -1000, 1000); - contrast = (216 * (contrast + 1000)) / 1000; - if (contrast == bt->contrast) - return; - bt->contrast = contrast; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_control(bt); - btwrite_contrast_lo(bt); -} - -void -bt829_SetSaturation(BT829Ptr bt, int saturation) -{ - CARD16 sat_u, sat_v; - - saturation = LIMIT(saturation, -1000, 1000); - sat_u = (254 * (saturation + 1000)) / 1000; - sat_v = (180 * (saturation + 1000)) / 1000; - if ((sat_u == bt->sat_u) && (sat_v == bt->sat_v)) - return; - bt->sat_u = sat_u; - bt->sat_v = sat_v; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_control(bt); - btwrite_sat_u_lo(bt); - btwrite_sat_v_lo(bt); -} - -void -bt829_SetTint(BT829Ptr bt, int hue) -{ - hue = LIMIT(hue, -1000, 999); /* ensure -128 <= hue <= 127 below */ - hue = (128 * hue) / 1000; - if (hue == bt->hue) - return; - bt->hue = hue; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_hue(bt); -} - -int -bt829_SetCaptSize(BT829Ptr bt, int width, int height) -{ - if ((width > bt->htotal - 2 * HCROP) || - (16 * width < bt->htotal - 32 * HCROP)) - return -1; - if ((height > bt->vactive) || (16 * height < bt->vactive)) - return -1; - if ((width == bt->width) && (height == bt->height)) - return 0; - bt->width = width; - bt->height = height; - propagate_changes(bt); - btwrite_crop(bt); - btwrite_hactive_lo(bt); - btwrite_control(bt); - btwrite_vtc(bt); - return 0; -} - -int -bt829_SetCC(BT829Ptr bt) -{ /* FIXME: should take ccmode as a parameter */ - if (BTVERSION < BT827) - return -1; /* can't do it */ - /* propagate_changes(bt); *//* no dependencies */ - btwrite_cc_status(bt); - /* we write to STATUS to reset the CCVALID flag */ - if (bt->ccmode != 0) - btwrite_status(bt); - return 0; -} - -void -bt829_SetOUT_EN(BT829Ptr bt, BOOL out_en) -{ - out_en = (out_en != 0); - if (out_en == bt->out_en) - return; - bt->out_en = out_en; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_vpole(bt); -} - -void -bt829_SetP_IO(BT829Ptr bt, CARD8 p_io) -{ - if (p_io == bt->p_io) - return; - bt->p_io = p_io; - /* propagate_changes(bt); *//* no dependencies */ - btwrite_p_io(bt); -} - -#define BTREAD(R) btread(bt,(R)) - -#if 0 - -void -bt829_getCCdata(BT829Ptr bt, struct CCdata *data) -{ - CARD8 status; - - data->num_valid = 0; - /* wait for buffer to be half full (means 8/16 bytes) - * either 4 (one of CC/EDS) or 2 (both CC/EDS) frames */ - if (!(BTREAD(STATUS) & 0x04)) - return; /* could comment this line */ - for (; data->num_valid < CC_FIFO_SIZE; data->num_valid++) { - status = BTREAD(CC_STATUS); - if (!(status & 0x04)) - break; - data->data[data->num_valid] = BTREAD(CC_DATA) & 0x7f; - /* stripped high bit (parity) */ - data->status[data->num_valid] = (CCS_EDS * ((status & 0x02) >> 1)) | - (CCS_HIGH * (status & 0x01)) | - (CCS_OVER * ((status & 0x08) >> 3)) | - (CCS_PAR * ((status & 0x80) >> 7)); - } - btwrite(bt, STATUS, 0x00); /* Reset CCVALID status bit */ - return; -} - -#endif - -/* ------------------------------------------------------------------------ */ -/* Debug and report routines */ - -#define DUMPREG(REG) \ - xf86DrvMsg(bt->d.pI2CBus->scrnIndex,X_INFO," %-12s (0x%02X) = 0x%02X\n", \ - #REG,REG,BTREAD(REG)) - -/*static void bt829_dumpregs(BT829Ptr bt) -{ - DUMPREG(STATUS); - DUMPREG(IFORM); - DUMPREG(TDEC); - DUMPREG(CROP); - DUMPREG(VDELAY_LO); - DUMPREG(VACTIVE_LO); - DUMPREG(HDELAY_LO); - DUMPREG(HACTIVE_LO); - DUMPREG(HSCALE_HI); - DUMPREG(HSCALE_LO); - DUMPREG(BRIGHT); - DUMPREG(CONTROL); - DUMPREG(CONTRAST_LO); - DUMPREG(SAT_U_LO); - DUMPREG(SAT_V_LO); - DUMPREG(HUE); - if (BTVERSION >= BT827) { - DUMPREG(SCLOOP); - DUMPREG(WC_UP) ; } - DUMPREG(OFORM); - DUMPREG(VSCALE_HI); - DUMPREG(VSCALE_LO); - DUMPREG(TEST); - DUMPREG(VPOLE); - DUMPREG(IDCODE); - DUMPREG(ADELAY); - DUMPREG(BDELAY); - DUMPREG(ADC); - if (BTVERSION >= BT827) { - DUMPREG(VTC); - DUMPREG(CC_STATUS); - DUMPREG(CC_DATA); - DUMPREG(WC_DN); - DUMPREG(P_IO) ; } -}*/ diff --git a/xserver/hw/xfree86/i2c/bt829.h b/xserver/hw/xfree86/i2c/bt829.h deleted file mode 100644 index 2709bee50..000000000 --- a/xserver/hw/xfree86/i2c/bt829.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef __BT829_H__ -#define __BT829_H__ - -#include "xf86i2c.h" - -typedef struct { - int tunertype; /* Must be set before init */ - /* Private variables */ - I2CDevRec d; - - CARD8 brightness; - CARD8 ccmode; - CARD8 code; - CARD16 contrast; - CARD8 format; - int height; - CARD8 hue; - CARD8 len; - CARD8 mux; - CARD8 out_en; - CARD8 p_io; - CARD16 sat_u; - CARD16 sat_v; - CARD8 vbien; - CARD8 vbifmt; - int width; - - CARD16 hdelay; - CARD16 hscale; - CARD16 vactive; - CARD16 vdelay; - CARD16 vscale; - - CARD16 htotal; - CARD8 id; - CARD8 svideo_mux; -} BT829Rec, *BT829Ptr; - -#define xf86_bt829_Detect bt829_Detect -extern _X_EXPORT BT829Ptr bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr); - -/* ATI card specific initialization */ -#define BT829_ATI_ADDR_1 0x8A -#define BT829_ATI_ADDR_2 0x88 - -#define xf86_bt829_ATIInit bt829_ATIInit -extern _X_EXPORT int bt829_ATIInit(BT829Ptr bt); - -#define BT829_NTSC 1 /* NTSC-M */ -#define BT829_NTSC_JAPAN 2 /* NTSC-Japan */ -#define BT829_PAL 3 /* PAL-B,D,G,H,I */ -#define BT829_PAL_M 4 /* PAL-M */ -#define BT829_PAL_N 5 /* PAL-N */ -#define BT829_SECAM 6 /* SECAM */ -#define BT829_PAL_N_COMB 7 /* PAL-N combination */ - -#define xf86_bt829_SetFormat bt829_SetFormat -extern _X_EXPORT int bt829_SetFormat(BT829Ptr bt, CARD8 format); - -#define BT829_MUX2 1 /* ATI -> composite video */ -#define BT829_MUX0 2 /* ATI -> tv tuner */ -#define BT829_MUX1 3 /* ATI -> s-video */ - -#define xf86_bt829_SetMux bt829_SetMux -extern _X_EXPORT int bt829_SetMux(BT829Ptr bt, CARD8 mux); - -#define xf86_bt829_SetCaptSize bt829_SetCaptSize -extern _X_EXPORT int bt829_SetCaptSize(BT829Ptr bt, int width, int height); - -#define xf86_bt829_SetBrightness bt829_SetBrightness -extern _X_EXPORT void bt829_SetBrightness(BT829Ptr bt, int brightness); - -#define xf86_bt829_SetContrast bt829_SetContrast -extern _X_EXPORT void bt829_SetContrast(BT829Ptr bt, int contrast); - -#define xf86_bt829_SetSaturation bt829_SetSaturation -extern _X_EXPORT void bt829_SetSaturation(BT829Ptr bt, int saturation); - -#define xf86_bt829_SetTint bt829_SetTint -extern _X_EXPORT void bt829_SetTint(BT829Ptr bt, int hue); /* Hue */ - -#define xf86_bt829_SetOUT_EN bt829_SetOUT_EN -extern _X_EXPORT void bt829_SetOUT_EN(BT829Ptr bt, BOOL out_en); /* VPOLE register */ - -#define xf86_bt829_SetP_IO bt829_SetP_IO -extern _X_EXPORT void bt829_SetP_IO(BT829Ptr bt, CARD8 p_io); /* P_IO register */ - -extern _X_EXPORT int bt829_SetCC(BT829Ptr bt); - -#define BT829SymbolsList \ - "bt829_Detect", \ - "bt829_ATIInit", \ - "bt829_SetFormat", \ - "bt829_SetMux", \ - "bt829_SetBrightness", \ - "bt829_SetContrast", \ - "bt829_SetSaturation", \ - "bt829_SetTint", \ - "bt829_SetCaptSize", \ - "bt829_SetOUT_EN", \ - "bt829_SetP_IO" - -#endif diff --git a/xserver/hw/xfree86/i2c/bt829_module.c b/xserver/hw/xfree86/i2c/bt829_module.c deleted file mode 100644 index c8a6ac6d1..000000000 --- a/xserver/hw/xfree86/i2c/bt829_module.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo bt829VersRec = { - "bt829", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData bt829ModuleData = { &bt829VersRec, NULL, NULL }; diff --git a/xserver/hw/xfree86/i2c/fi1236.c b/xserver/hw/xfree86/i2c/fi1236.c deleted file mode 100644 index ebd14547d..000000000 --- a/xserver/hw/xfree86/i2c/fi1236.c +++ /dev/null @@ -1,686 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "xf86.h" -#include "xf86i2c.h" -#include "fi1236.h" -#include "tda9885.h" -#include "i2c_def.h" - -#define NUM_TUNERS 8 - -const FI1236_parameters tuner_parms[NUM_TUNERS] = { - /* 0 - FI1236 */ - {733, 884, 12820, 2516, 7220, 0xA2, 0x94, 0x34, 0x8e}, - /* !!!based on documentation - it should be: - {733, 16*55.25, 16*801.25, 16*160, 16*454, 0xA0, 0x90, 0x30, 0x8e}, */ - - /* 1 - FI1216 */ - {623, 16 * 48.75, 16 * 855.25, 16 * 170, 16 * 450, 0xA0, 0x90, 0x30, 0x8e}, - /* 2 - TEMIC FN5AL */ - {623, 16 * 45.75, 16 * 855.25, 16 * 169, 16 * 454, 0xA0, 0x90, 0x30, 0x8e}, - /* 3 - MT2032.. */ - {733, 768, 13760, 0, 0, 0, 0, 0, 0}, - /* 4 - FI1246 */ - {623, 16 * 45.75, 16 * 855.25, 16 * 170, 16 * 450, 0xA0, 0x90, 0x30, 0x8e}, - /* 5 - FI1256 */ - {623, 16 * 49.75, 16 * 863.25, 16 * 170, 16 * 450, 0xA0, 0x90, 0x30, 0x8e}, - /* 6 - FI1236W */ - /*{ 733, 884, 12820, 2516, 7220, 0x1, 0x2, 0x4, 0x8e }, */ - {732, 16 * 55.25, 16 * 801.25, 16 * 160, 16 * 442, 0x1, 0x2, 0x4, 0x8e}, - /* 7 - FM1216ME */ - {623, 16 * 48.25, 16 * 863.25, 16 * 158.00, 16 * 442.00, 0x1, 0x2, 0x4, 0x8e} -}; - -FI1236Ptr -Detect_FI1236(I2CBusPtr b, I2CSlaveAddr addr) -{ - FI1236Ptr f; - I2CByte a; - - f = calloc(1, sizeof(FI1236Rec)); - if (f == NULL) - return NULL; - f->d.DevName = strdup("FI12xx Tuner"); - f->d.SlaveAddr = addr; - f->d.pI2CBus = b; - f->d.NextDev = NULL; - f->d.StartTimeout = b->StartTimeout; - f->d.BitTimeout = b->BitTimeout; - f->d.AcknTimeout = b->AcknTimeout; - f->d.ByteTimeout = b->ByteTimeout; - f->type = TUNER_TYPE_FI1236; - f->afc_timer_installed = FALSE; - f->last_afc_hint = TUNER_OFF; - f->video_if = 45.7812; - - if (!I2C_WriteRead(&(f->d), NULL, 0, &a, 1)) { - free(f); - return NULL; - } - FI1236_set_tuner_type(f, TUNER_TYPE_FI1236); - if (!I2CDevInit(&(f->d))) { - free(f); - return NULL; - } - return f; -} - -static void -MT2032_dump_parameters(FI1236Ptr f, MT2032_parameters * m) -{ - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: input f_rf=%g f_if1=%g f_if2=%g f_ref=%g f_ifbw=%g f_step=%g\n", - m->f_rf, m->f_if1, m->f_if2, m->f_ref, m->f_ifbw, m->f_step); - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: computed f_lo1=%g f_lo2=%g LO1I=%d LO2I=%d SEL=%d STEP=%d NUM=%d\n", - m->f_lo1, m->f_lo2, m->LO1I, m->LO2I, m->SEL, m->STEP, m->NUM); -} - -static void -MT2032_getid(FI1236Ptr f) -{ - CARD8 out[4]; - CARD8 in; - - in = 0x11; - I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 4); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: Company code 0x%02x%02x, part code 0x%02x, revision code 0x%02x\n", - out[0], out[1], out[2], out[3]); - -} - -/* might be buggy */ -#if 0 -static void -MT2032_shutdown(FI1236Ptr f) -{ - CARD8 data[10]; - - data[0] = 0x00; /* start with register 0x00 */ - data[1] = 0x1A; - data[2] = 0x44; - data[3] = 0x20; - - I2C_WriteRead(&(f->d), (I2CByte *) data, 4, NULL, 0); - - data[0] = 0x05; /* now start with register 0x05 */ - data[1] = 0xD7; - data[2] = 0x14; - data[3] = 0x05; - I2C_WriteRead(&(f->d), (I2CByte *) data, 4, NULL, 0); - - data[0] = 0x0B; /* now start with register 0x05 */ - data[1] = 0x8F; - data[2] = 0x07; - data[3] = 0x43; - I2C_WriteRead(&(f->d), (I2CByte *) data, 4, NULL, 0); - - usleep(15000); -} -#endif - -static void MT2032_dump_status(FI1236Ptr f); - -static void -MT2032_init(FI1236Ptr f) -{ - CARD8 data[10]; - CARD8 value; - CARD8 xogc = 0x00; - - MT2032_getid(f); - - data[0] = 0x02; /* start with register 0x02 */ - data[1] = 0xFF; - data[2] = 0x0F; - data[3] = 0x1F; - - I2C_WriteRead(&(f->d), (I2CByte *) data, 4, NULL, 0); - - data[0] = 0x06; /* now start with register 0x06 */ - data[1] = 0xE4; - data[2] = 0x8F; - data[3] = 0xC3; - data[4] = 0x4E; - data[5] = 0xEC; - I2C_WriteRead(&(f->d), (I2CByte *) data, 6, NULL, 0); - - data[0] = 0x0d; /* now start with register 0x0d */ - data[1] = 0x32; - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - - while (1) { - usleep(15000); /* wait 15 milliseconds */ - - data[0] = 0x0e; /* register number 7, status */ - value = 0xFF; - if (!I2C_WriteRead(&(f->d), (I2CByte *) data, 1, &value, 1)) - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: failed to read XOK\n"); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: XOK=%d\n", value & 0x01); - if (value & 1) - break; - - data[0] = 0x07; - if (!I2C_WriteRead(&(f->d), (I2CByte *) data, 1, &value, 1)) - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: failed to read XOGC\n"); - - xogc = value & 0x7; - if (xogc == 4) - break; /* XOGC has reached 4.. stop */ - xogc--; - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: try XOGC=%d\n", xogc); - usleep(15000); - data[0] = 0x07; /* register number 7, control byte 2 */ - data[1] = 0x08 | xogc; - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - } - f->xogc = xogc; - /* wait before continuing */ - usleep(15000); /* wait 50 milliseconds */ - MT2032_dump_status(f); -} - -static int -MT2032_no_spur_in_band(MT2032_parameters * m) -{ - int n_max, n1, n2; - double f_test; - - n_max = 5; - n1 = 1; - while (1) { - n2 = -n1; - f_test = n1 * (m->f_lo1 - m->f_lo2); - while (1) { - n2--; - f_test = f_test - m->f_lo2; - xf86DrvMsg(0, X_INFO, - "testing f_test=%g n1=%d n2=%d f_lo1=%g f_lo2=%g f_if2=%g\n", - f_test, n1, n2, m->f_lo1, m->f_lo2, m->f_if2); - xf86DrvMsg(0, X_INFO, "d_f=%g f_ifbw=%g\n", - fabs(fabs(f_test) - m->f_if2), m->f_ifbw); - if ((fabs(fabs(f_test) - m->f_if2) * 2.0) <= m->f_ifbw) - return 0; - if (n2 <= -n_max) - break; - /* this line in the manual is bogus. I say it is faster - and more correct to go over all harmonics.. */ -#if 0 - if (f_test < (m->f_lo2 - m->f_if2 - m->f_ifbw)) - break; -#endif - } - n1++; - if (n1 >= n_max) - return 1; - } - -} - -static void -MT2032_calculate_register_settings(MT2032_parameters * m, double f_rf, - double f_if1, double f_if2, double f_ref, - double f_ifbw, double f_step) -{ - int n; - - m->f_rf = f_rf; - m->f_if1 = f_if1; - m->f_if2 = f_if2; - m->f_ref = f_ref; - m->f_ifbw = f_ifbw; - m->f_step = f_step; - - m->f_lo1 = f_rf + f_if1; - m->LO1I = lrint(m->f_lo1 / f_ref); - m->f_lo1 = f_ref * m->LO1I; - - m->f_lo2 = m->f_lo1 - f_rf - f_if2; - - /* check for spurs */ - n = 1; - while (n < 3) { - if (MT2032_no_spur_in_band(m)) - break; - - if (m->f_lo1 < (f_rf + f_if1)) - m->LO1I += n; - else - m->LO1I -= n; - - m->f_lo1 = m->LO1I * f_ref; - m->f_lo2 = m->f_lo1 - f_rf - f_if2; - n++; - } - /* xf86DrvMsg(0, X_INFO, "MT2032: n=%d\n", n); */ - /* select VCO */ - - /* m->f_lo1>1100.0 */ - if (m->f_lo1 < 1370.0) - m->SEL = 4; - else if (m->f_lo1 < 1530.0) - m->SEL = 3; - else if (m->f_lo1 < 1720.0) - m->SEL = 2; - else if (m->f_lo1 < 1890.0) - m->SEL = 1; - else /* m->f_lo1 < 1958.0 */ - m->SEL = 0; - - /* calculate the rest of the registers */ - m->LO2I = floor(m->f_lo2 / f_ref); - m->STEP = floor(3780.0 * f_step / f_ref); - m->NUM = floor(3780.0 * (m->f_lo2 / f_ref - m->LO2I)); - m->NUM = m->STEP * lrint((1.0 * m->NUM) / (1.0 * m->STEP)); -} - -static int -MT2032_wait_for_lock(FI1236Ptr f) -{ - int n; - CARD8 data[10]; - CARD8 value; - - n = 12; - while (1) { - data[0] = 0x0e; /* register number 7, status */ - I2C_WriteRead(&(f->d), (I2CByte *) data, 1, &value, 1); - /* xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: LO1LK=%d LO2LK=%d\n", - (value & 0x04)>>2, (value & 0x02)>>1); */ - if ((value & 6) == 6) - break; - usleep(1500); - n--; - if (n < 0) - break; - } - if (n < 0) { - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: failed to set frequency\n"); - return 0; - } - return 1; -} - -static void -MT2032_implement_settings(FI1236Ptr f, MT2032_parameters * m) -{ - CARD8 data[10]; - CARD8 value; - - data[0] = 0x00; /* start with register 0x00 */ - data[1] = (m->LO1I >> 3) - 1; - data[2] = (m->SEL << 4) | (m->LO1I & 0x7); - data[3] = 0x86; - I2C_WriteRead(&(f->d), (I2CByte *) data, 4, NULL, 0); - - data[0] = 0x05; /* start with register 0x05 */ - data[1] = ((m->LO2I & 0x7) << 5) | ((m->LO2I >> 3) - 1); - if (m->f_rf < 400.0) - data[2] = 0xe4; - else - data[2] = 0xf4; - I2C_WriteRead(&(f->d), (I2CByte *) data, 3, NULL, 0); - - data[0] = 0x07; /* register number 7, control byte 2 */ - I2C_WriteRead(&(f->d), (I2CByte *) data, 1, &value, 1); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: using XOGC=%d\n", (value & 0x07)); - data[1] = 8 | (value & 0x7); - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - - data[0] = 0x0b; /* start with register 0x0b */ - data[1] = m->NUM & 0xff; - data[2] = (1 << 7) | ((m->NUM >> 8) & 0x0f); - I2C_WriteRead(&(f->d), (I2CByte *) data, 3, NULL, 0); - - MT2032_wait_for_lock(f); -} - -static void -MT2032_optimize_VCO(FI1236Ptr f, MT2032_parameters * m) -{ - CARD8 data[10]; - CARD8 value; - CARD8 TAD1; - - data[0] = 0x0f; /* register number 7, status */ - I2C_WriteRead(&(f->d), (I2CByte *) data, 1, &value, 1); - TAD1 = value & 0x07; - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: TAD1=%d SEL=%d\n", TAD1, m->SEL); - if (TAD1 < 2) - return; - if (TAD1 == 2) { - if (m->SEL == 0) - return; - m->SEL--; - } - else { - if (m->SEL >= 4) - return; - m->SEL++; - } - data[0] = 0x01; /* start with register 1 */ - data[1] = (m->SEL << 4) | (m->LO1I & 0x7); - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - -} - -static int -FI1236_get_afc_hint(FI1236Ptr f) -{ - CARD8 out; - CARD8 AFC; - - if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W)) { - TDA9885Ptr t = (TDA9885Ptr) f->afc_source; - - if (t == NULL) - return TUNER_OFF; - - tda9885_getstatus(t); - tda9885_dumpstatus(t); - AFC = t->afc_status & 0x0f; - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: FI1236_get_afc_hint: %i\n", AFC); - if (AFC == 0) - return TUNER_TUNED; - else if (AFC <= 0x07) - return TUNER_JUST_BELOW; - else if (AFC < 0x0f) - return TUNER_JUST_ABOVE; - else if (AFC == 0x0f) - return TUNER_TUNED; - } - else { - I2C_WriteRead(&(f->d), NULL, 0, &out, 1); - AFC = out & 0x7; - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: FI1236_get_afc_hint: %i\n", AFC); - if (AFC == 2) - return TUNER_TUNED; - if (AFC == 3) - return TUNER_JUST_BELOW; - if (AFC == 1) - return TUNER_JUST_ABOVE; - return TUNER_OFF; - } - return TUNER_OFF; -} - -static int -MT2032_get_afc_hint(FI1236Ptr f) -{ - CARD8 in; - CARD8 out[2]; - CARD8 AFC; - - in = 0x0e; - I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 2); - AFC = (out[0] >> 4) & 0x7; -#if 0 - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC=%d TAD1=%d TAD2=%d\n", - AFC, out[1] & 0x7, (out[1] >> 4) & 0x07); -#endif - if (AFC == 2) - return TUNER_TUNED; - if (AFC == 3) - return TUNER_JUST_BELOW; - if (AFC == 1) - return TUNER_JUST_ABOVE; - return TUNER_OFF; -} - -/* this function is for external use only */ -int -TUNER_get_afc_hint(FI1236Ptr f) -{ - if (f->afc_timer_installed) - return TUNER_STILL_TUNING; - return f->last_afc_hint; -} - -static void -MT2032_dump_status(FI1236Ptr f) -{ - CARD8 in; - CARD8 out[2]; - CARD8 AFC; - CARD8 LDONrb; - CARD8 LO1LK, LO2LK, XOK; - CARD8 TAD2, TAD1; - - in = 0x0e; - I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 2); - XOK = out[0] & 1; - LO1LK = (out[0] >> 2) & 1; - LO2LK = (out[0] >> 1) & 1; - LDONrb = (out[0] >> 3) & 1; - - AFC = (out[0] >> 4) & 0x7; - - TAD1 = (out[1] & 0x7); - TAD2 = (out[1] >> 4) & 0x7; - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: status: XOK=%d LO1LK=%d LO2LK=%d LDONrb=%d AFC=%d TAD1=%d TAD2=%d\n", - XOK, LO1LK, LO2LK, LDONrb, AFC, TAD1, TAD2); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: status: OSCILLATOR:%s PLL1:%s PLL2:%s\n", - XOK ? "ok" : "off", - LO1LK ? "locked" : "off", LO2LK ? "locked" : "off"); - -} - -static void -MT2032_tune(FI1236Ptr f, double freq, double step) -{ - MT2032_parameters m; - CARD8 data[10]; - int i; - - /* NTSC IF is 44mhz.. but 733/16=45.8125 and all TDAXXXX docs mention - 45.75, 39, 58.75 and 30. */ -#if 0 - MT2032_calculate_register_settings(&m, freq, 1090.0, 45.125, 5.25, 6.0, - step); - MT2032_calculate_register_settings(&m, freq, 1090.0, 45.74, 5.25, 6.0, - step); -#endif - MT2032_calculate_register_settings(&m, freq, 1090.0, f->video_if, 5.25, 3.0, - step); - MT2032_dump_parameters(f, &m); - MT2032_implement_settings(f, &m); - /* MT2032_dump_parameters(f, &m); */ - for (i = 0; i < 3; i++) { - MT2032_optimize_VCO(f, &m); - if (MT2032_wait_for_lock(f)) { - data[0] = 0x02; /* LO Gain control register 0x02 */ - data[1] = 0x20; - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - return; - } - data[0] = 0x07; - data[1] = 0x88 | f->xogc; - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - usleep(15000); - data[1] = 0x08 | f->xogc; - I2C_WriteRead(&(f->d), (I2CByte *) data, 2, NULL, 0); - } - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "MT2032: failed to set frequency\n"); -} - -void -FI1236_set_tuner_type(FI1236Ptr f, int type) -{ - f->type = type; - if (type >= NUM_TUNERS) - type = NUM_TUNERS - 1; - if (type < 0) - type = 0; - memcpy(&(f->parm), &(tuner_parms[type]), sizeof(FI1236_parameters)); - f->original_frequency = f->parm.min_freq; - f->afc_delta = 0; - if (type == TUNER_TYPE_MT2032) { - MT2032_init(f); - return; - } -} - -static CARD32 -AFC_TimerCallback(OsTimerPtr timer, CARD32 time, void *data) -{ - FI1236Ptr f = (FI1236Ptr) data; - - if (FI1236_AFC(f)) - return 150; - else { - f->afc_timer_installed = FALSE; - f->afc_count = 0; - return 0; - } -} - -void -FI1236_tune(FI1236Ptr f, CARD32 frequency) -{ - CARD16 divider; - CARD8 data; - - if (frequency < f->parm.min_freq) - frequency = f->parm.min_freq; - if (frequency > f->parm.max_freq) - frequency = f->parm.max_freq; - - divider = (f->parm.fcar + (CARD16) frequency) & 0x7fff; - f->tuner_data.div1 = (CARD8) ((divider >> 8) & 0x7f); - f->tuner_data.div2 = (CARD8) (divider & 0xff); - f->tuner_data.control = f->parm.control; - - if (frequency < f->parm.threshold1) - f->tuner_data.band = f->parm.band_low; - else if (frequency < f->parm.threshold2) - f->tuner_data.band = f->parm.band_mid; - else - f->tuner_data.band = f->parm.band_high; - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "Setting tuner band to %d\n", f->tuner_data.band); - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "Setting tuner frequency to %d\n", (int) frequency); - - if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W)) { - f->tuner_data.aux = 0x20; - I2C_WriteRead(&(f->d), (I2CByte *) &(f->tuner_data), 5, NULL, 0); - I2C_WriteRead(&(f->d), NULL, 0, &data, 1); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Tuner status %x\n", data); - } - else - I2C_WriteRead(&(f->d), (I2CByte *) &(f->tuner_data), 4, NULL, 0); -} - -void -TUNER_set_frequency(FI1236Ptr f, CARD32 frequency) -{ - if (frequency < f->parm.min_freq) - frequency = f->parm.min_freq; - if (frequency > f->parm.max_freq) - frequency = f->parm.max_freq; - - f->afc_delta = 0; - f->original_frequency = frequency; - - if (f->type == TUNER_TYPE_MT2032) - MT2032_tune(f, (1.0 * frequency) / 16.0, 0.0625); - else - FI1236_tune(f, frequency); - - if (!f->afc_timer_installed) { - f->afc_timer_installed = TRUE; -/* RegisterBlockAndWakeupHandlers(FI1236_BlockHandler, AFCWakeup, f); */ - TimerSet(NULL, 0, 300, AFC_TimerCallback, f); - } - -} - -int -FI1236_AFC(FI1236Ptr f) -{ -#if 0 - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: f=%p f->count=%d f->original_frequency=%d f->afc_delta=%d\n", - f, f->afc_count, f->original_frequency, f->afc_delta); -#endif - f->afc_count++; - if (f->type == TUNER_TYPE_MT2032) { - f->last_afc_hint = MT2032_get_afc_hint(f); - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: afc_hint=%d\n", f->last_afc_hint); - if (f->last_afc_hint == TUNER_TUNED) - return 0; - if (f->afc_count > 3) - f->last_afc_hint = TUNER_OFF; - if (f->last_afc_hint == TUNER_OFF) - f->afc_delta = 0; - else - f->afc_delta += f->last_afc_hint; - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: Setting tuner frequency to %g\n", - (0.5 * (2 * f->original_frequency + f->afc_delta)) / 16.0); - MT2032_tune(f, - (1.0 * f->original_frequency + 0.5 * f->afc_delta) / 16.0, - 0.03125); - if (f->last_afc_hint == TUNER_OFF) - return 0; - return 1; /* call me again */ - } - else { - f->last_afc_hint = FI1236_get_afc_hint(f); - if (f->last_afc_hint == TUNER_TUNED) { - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: TUNER_TUNNED\n"); - return 0; - } - if (f->afc_count > 3) - f->last_afc_hint = TUNER_OFF; - - if (f->last_afc_hint == TUNER_OFF) - f->afc_delta = 0; - else - f->afc_delta += f->last_afc_hint; - - xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, - "AFC: Setting tuner frequency to %g\n", - (0.5 * (2 * f->original_frequency + f->afc_delta)) / 16.0); - FI1236_tune(f, f->original_frequency + f->afc_delta); - if (f->last_afc_hint == TUNER_OFF) - return 0; - return 1; /* call me again */ - } - return 0; /* done */ -} - -void -fi1236_dump_status(FI1236Ptr f) -{ - if (f->type == TUNER_TYPE_MT2032) - MT2032_dump_status(f); -} diff --git a/xserver/hw/xfree86/i2c/fi1236.h b/xserver/hw/xfree86/i2c/fi1236.h deleted file mode 100644 index 053089277..000000000 --- a/xserver/hw/xfree86/i2c/fi1236.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef __FI1236_H__ -#define __FI1236_H__ - -#include "xf86i2c.h" - -/* why someone has defined NUM someplace else is beyoung me.. */ -#undef NUM - -typedef struct { - CARD32 fcar; /* 16 * fcar_Mhz */ - CARD32 min_freq; /* 16 * min_freq_Mhz */ - CARD32 max_freq; /* 16 * max_freq_Mhz */ - - CARD32 threshold1; /* 16 * Value_Mhz */ - CARD32 threshold2; /* 16 * Value_Mhz */ - - CARD8 band_low; - CARD8 band_mid; - CARD8 band_high; - CARD8 control; -} FI1236_parameters; - -typedef struct { - /* what we want */ - /* all frequencies are in Mhz */ - double f_rf; /* frequency to tune to */ - double f_if1; /* first intermediate frequency */ - double f_if2; /* second intermediate frequency */ - double f_ref; /* reference frequency */ - double f_ifbw; /* bandwidth */ - double f_step; /* step */ - - /* what we compute */ - double f_lo1; - double f_lo2; - int LO1I; - int LO2I; - int SEL; - int STEP; - int NUM; -} MT2032_parameters; - -typedef struct { - I2CDevRec d; - int type; - - void *afc_source; /* The AFC source may be another chip like TDA988x */ - - int afc_delta; - CARD32 original_frequency; - Bool afc_timer_installed; - int afc_count; - int last_afc_hint; - - double video_if; - FI1236_parameters parm; - int xogc; /* for MT2032 */ - - struct { - CARD8 div1; - CARD8 div2; - CARD8 control; - CARD8 band; - CARD8 aux; /* this is for MK3 tuners */ - } tuner_data; -} FI1236Rec, *FI1236Ptr; - -#define TUNER_TYPE_FI1236 0 -#define TUNER_TYPE_FI1216 1 -#define TUNER_TYPE_TEMIC_FN5AL 2 -#define TUNER_TYPE_MT2032 3 -#define TUNER_TYPE_FI1246 4 -#define TUNER_TYPE_FI1256 5 -#define TUNER_TYPE_FI1236W 6 -#define TUNER_TYPE_FM1216ME 7 - -#define FI1236_ADDR(a) ((a)->d.SlaveAddr) - -#define FI1236_ADDR_1 0xC6 -#define FI1236_ADDR_2 0xC0 - -#define TUNER_TUNED 0 -#define TUNER_JUST_BELOW 1 -#define TUNER_JUST_ABOVE -1 -#define TUNER_OFF 4 -#define TUNER_STILL_TUNING 5 - -void FI1236_tune(FI1236Ptr f, CARD32 frequency); - -#define FI1236SymbolsList \ - "Detect_FI1236", \ - "FI1236_set_tuner_type", \ - "TUNER_set_frequency" - -#define xf86_Detect_FI1236 Detect_FI1236 -extern _X_EXPORT FI1236Ptr Detect_FI1236(I2CBusPtr b, I2CSlaveAddr addr); - -#define xf86_FI1236_set_tuner_type FI1236_set_tuner_type -extern _X_EXPORT void FI1236_set_tuner_type(FI1236Ptr f, int type); - -#define xf86_TUNER_set_frequency TUNER_set_frequency -extern _X_EXPORT void TUNER_set_frequency(FI1236Ptr f, CARD32 frequency); - -#define xf86_FI1236_AFC FI1236_AFC -extern _X_EXPORT int FI1236_AFC(FI1236Ptr f); - -#define xf86_TUNER_get_afc_hint TUNER_get_afc_hint -extern _X_EXPORT int TUNER_get_afc_hint(FI1236Ptr f); - -#define xf86_fi1236_dump_status fi1236_dump_status -extern _X_EXPORT void fi1236_dump_status(FI1236Ptr f); - -#endif diff --git a/xserver/hw/xfree86/i2c/fi1236_module.c b/xserver/hw/xfree86/i2c/fi1236_module.c deleted file mode 100644 index 2f453d964..000000000 --- a/xserver/hw/xfree86/i2c/fi1236_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo fi1236VersRec = { - "fi1236", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData fi1236ModuleData = { - &fi1236VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/msp3430.c b/xserver/hw/xfree86/i2c/msp3430.c deleted file mode 100644 index a501489ee..000000000 --- a/xserver/hw/xfree86/i2c/msp3430.c +++ /dev/null @@ -1,779 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include - -#include "xf86.h" -#include "xf86i2c.h" -#include "msp3430.h" -#include "i2c_def.h" - -#define CONTROL 0x00 -#define WR_DEM 0x10 -#define RD_DEM 0x11 -#define WR_DSP 0x12 -#define RD_DSP 0x13 - -void InitMSP34xxG(MSP3430Ptr m); -void InitMSP34x5D(MSP3430Ptr m); -void CheckModeMSP34x5D(MSP3430Ptr m); -static const char *MSP_getProductName(CARD16 product_id); -void mpause(int milliseconds); - -#define __MSPDEBUG__ 0 - -#if __MSPDEBUG__ > 3 - -void MSPBeep(MSP3430Ptr m, CARD8 freq); - -#define __MSPBEEP MSPBeep(m,0x14); - -#else - -#define __MSPBEEP -#endif - -static void -SetMSP3430Control(MSP3430Ptr m, CARD8 RegAddress, CARD8 RegValueHigh, - CARD8 RegValueLow) -{ - I2CByte data[3]; - - data[0] = RegAddress; - data[1] = RegValueHigh; - data[2] = RegValueLow; - - I2C_WriteRead(&(m->d), data, 3, NULL, 0); -} - -static void -SetMSP3430Data(MSP3430Ptr m, CARD8 RegAddress, CARD8 RegSubAddressHigh, - CARD8 RegSubAddressLow, CARD8 RegValueHigh, CARD8 RegValueLow) -{ - I2CByte data[5]; - -#ifdef MSP_DEBUG - if (!m->registers_present[RegSubAddressLow]) { - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_ERROR, - "Attempt to access non-existent register in MSP34xxX: 0x%02x 0x%02x 0x%02x <- 0x%02x 0x%02x\n", - RegAddress, RegSubAddressHigh, RegSubAddressLow, - RegValueHigh, RegValueLow); - } -#endif - - data[0] = RegAddress; - data[1] = RegSubAddressHigh; - data[2] = RegSubAddressLow; - data[3] = RegValueHigh; - data[4] = RegValueLow; - - I2C_WriteRead(&(m->d), data, 5, NULL, 0); -} - -static void -GetMSP3430Data(MSP3430Ptr m, CARD8 RegAddress, CARD8 RegSubAddressHigh, - CARD8 RegSubAddressLow, CARD8 *RegValueHigh, CARD8 *RegValueLow) -{ - I2CByte send[3]; - I2CByte receive[2]; - - send[0] = RegAddress; - send[1] = RegSubAddressHigh; - send[2] = RegSubAddressLow; - - I2C_WriteRead(&(m->d), send, 3, receive, 2); - - *RegValueHigh = receive[0]; - *RegValueLow = receive[1]; -} - -#if __MSPDEBUG__ > 2 -static void -MSP3430DumpStatus(MSP3430Ptr m) -{ - CARD8 status_hi, status_lo; - CARD8 subaddr, data[2]; - - GetMSP3430Data(m, RD_DEM, 0x02, 0x00, &status_hi, &status_lo); - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "MSP34xx: SAP(8)=%d mono/NICAM(7)=%d stereo=%d %s O_1=%d O_0=%d 2nd car=%d 1st car=%d\n", - status_hi & 1, (status_lo >> 7) & 1, (status_lo >> 6) & 1, - (status_lo >> 5) ? ((status_hi >> 1) & 1 ? "bad NICAM reception" - : "NICAM") : ((status_hi >> 1) & 1 ? "bogus" - : "ANALOG FM/AM"), - (status_lo >> 4) & 1, (status_lo >> 3) & 1, - !((status_lo >> 2) & 1), !((status_lo >> 1) & 1)); - - GetMSP3430Data(m, RD_DEM, 0x00, 0x7E, &status_hi, &status_lo); - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "MSP34xx: standard result=0x%02x%02x\n", status_hi, status_lo); - subaddr = 0x0; - I2C_WriteRead(&(m->d), &subaddr, 1, data, 2); - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, "MSP34xx: control=0x%02x%02x\n", - data[1], data[0]); -} -#endif - -/* wrapper */ -void -InitMSP3430(MSP3430Ptr m) -{ -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "InitMSP3430(m->connector=%d, m->standard=%d, m->chip_family=%d)\n", - m->connector, m->standard, m->chip_family); -#endif - switch (m->chip_family) { - case MSPFAMILY_34x0G: - InitMSP34xxG(m); - break; - case MSPFAMILY_34x5G: - InitMSP34xxG(m); - break; - case MSPFAMILY_34x5D: - InitMSP34x5D(m); - break; - } -} - -/*----------------------------------------------------------------- -| common functions for all MSP34xx chips -|----------------------------------------------------------------*/ - -MSP3430Ptr -DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) -{ - MSP3430Ptr m; - I2CByte a; - CARD8 hardware_version, major_revision, product_code, rom_version; - Bool supported; - - m = calloc(1, sizeof(MSP3430Rec)); - if (m == NULL) - return NULL; - m->d.DevName = strdup("MSP34xx"); - m->d.SlaveAddr = addr; - m->d.pI2CBus = b; - m->d.NextDev = NULL; - m->d.StartTimeout = b->StartTimeout; - m->d.BitTimeout = b->BitTimeout; - m->d.AcknTimeout = b->AcknTimeout; - m->d.ByteTimeout = b->ByteTimeout; - - if (!I2C_WriteRead(&(m->d), NULL, 0, &a, 1)) { - free((void *) m->d.DevName); - free(m); - return NULL; - } - - m->standard = MSP3430_NTSC; - m->connector = MSP3430_CONNECTOR_1; - m->mode = MSPMODE_STEREO_A; /*stereo or chanel A if avail. */ - m->c_format = MSPFORMAT_UNKNOWN; - m->c_standard = MSPSTANDARD_UNKNOWN; - m->c_matrix = m->c_fmmatrix = m->c_source = 0; - m->volume = 0; - m->recheck = FALSE; - - GetMSP3430Data(m, RD_DSP, 0x00, 0x1E, &hardware_version, &major_revision); - GetMSP3430Data(m, RD_DSP, 0x00, 0x1F, &product_code, &rom_version); - m->hardware_version = hardware_version; - m->major_revision = major_revision; - m->product_code = product_code; - m->rom_version = rom_version; - - m->chip_id = ((major_revision << 8) | product_code); - - supported = FALSE; - switch (major_revision) { - case 4: /* 34xxD */ - switch (product_code) { - case 0x05: /* 3405D */ - case 0x0A: /* 3410D */ - case 0x0F: /* 3415D */ - m->chip_family = MSPFAMILY_34x5D; - m->recheck = TRUE; - supported = TRUE; - break; - default: - m->chip_family = MSPFAMILY_34x0D; - } - break; - case 7: /* 34xxG */ - switch (product_code) { - case 0x00: - case 0x0A: - case 0x1E: - case 0x28: - case 0x32: - m->chip_family = MSPFAMILY_34x0G; - supported = TRUE; - break; - case 0x0f: - case 0x19: - case 0x2d: - case 0x37: - case 0x41: - m->chip_family = MSPFAMILY_34x5G; - supported = TRUE; -#ifdef MSP_DEBUG - memset(m->registers_present, 0, 256); -#define A(num) m->registers_present[(num)]=1; -#define B(num1, num2) memset(&(m->registers_present[num1]), 1, num2-num1); - A(0x20) - A(0x30) - A(0x40) - A(0x00) - B(0x01, 0x08) - B(0x0B, 0x0E) - A(0x10) - B(0x12, 0x14) - A(0x16) - A(0x29) -#undef B -#undef A -#endif - break; - default: - m->chip_family = MSPFAMILY_UNKNOWN; - } - break; - default: - m->chip_family = MSPFAMILY_UNKNOWN; - } - - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Found %s%s, rom version 0x%02x, chip_id=0x%04x\n", - MSP_getProductName(m->chip_id), - supported ? "" : " (unsupported)", rom_version, m->chip_id); - - if (!supported) { - free((void *) m->d.DevName); - free(m); - return NULL; - } - if (!I2CDevInit(&(m->d))) { - free((void *) m->d.DevName); - free(m); - return NULL; - } - - return m; -} - -void -ResetMSP3430(MSP3430Ptr m) -{ - /* Reset the MSP3430 */ - SetMSP3430Control(m, 0x00, 0x80, 0x00); - /* Set it back to normal operation */ - SetMSP3430Control(m, 0x00, 0x00, 0x00); - - m->c_format = MSPFORMAT_UNKNOWN; - m->c_standard = MSPSTANDARD_UNKNOWN; - m->c_matrix = m->c_fmmatrix = m->c_source = 0; - m->volume = 0; -} - -void -MSP3430SetVolume(MSP3430Ptr m, CARD8 value) -{ - CARD8 result; - -#if 0 - CARD8 old_volume; - - GetMSP3430Data(m, RD_DSP, 0x00, 0x00, &old_volume, &result); - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, "MSP3430 result 0x%02x\n", - result); -#endif - /* save an extra Get call */ - result = 0; - - SetMSP3430Data(m, WR_DSP, 0x00, 0x00, value, result); - - SetMSP3430Data(m, WR_DSP, 0x00, 0x07, value, 0); - m->volume = value; - -#if __MSPDEBUG__ > 2 - MSP3430DumpStatus(m); - __MSPBEEP GetMSP3430Data(m, RD_DSP, 0x00, 0x00, &old_volume, &result); - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, "MSP3430 volume 0x%02x\n", - value); -#endif -} - -void -MSP3430SetSAP(MSP3430Ptr m, int mode) -{ - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Put actual code to change SAP here\n"); - - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, mode & 0xff, 0x20); -} - -#if 0 -void -MSP3430SetSource(MSP3430Ptr m, CARD8 value) -{ - /* Write to DSP, register 0x0008, (loudspeaker channel source/matrix) */ - /* This sets the source to the TV tuner, for stereo operation */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, value, 0x20); -} -#endif - -static const char * -MSP_getProductName(CARD16 product_id) -{ - switch (product_id) { - case 0x0400: - return "MSP3400D"; - case 0x040a: - return "MSP3410D"; - case 0x0405: - return "MSP3405D"; - case 0x040f: - return "MSP3415D"; - case 0x0700: - return "MSP3400G"; - case 0x070a: - return "MSP3410G"; - case 0x071e: - return "MSP3430G"; - case 0x0728: - return "MSP3440G"; - case 0x0732: - return "MSP3450G"; - case 0x070f: - return "MSP3415G"; - case 0x0719: - return "MSP3425G"; - case 0x072d: - return "MSP3445G"; - case 0x0737: - return "MSP3455G"; - case 0x0741: - return "MSP3465G"; - } - return "MSP - unknown type"; -} - -#if __MSPDEBUG__ > 2 -/*puts beep in MSP output - freq = 0x01 - 16Hz ... 0x40 - 1kHz ... 0xff - 4kHz -*/ -void -MSPBeep(MSP3430Ptr m, CARD8 freq) -{ - SetMSP3430Data(m, WR_DSP, 0x00, freq, 0x7f, 0x40); - mpause(100); - SetMSP3430Data(m, WR_DSP, 0x00, 0x14, 0x00, 0x00); -} -#endif - -void -mpause(int milliseconds) -{ - int i, m; - - m = milliseconds / 20; - for (i = 0; i < m; i++) - usleep(20000); -} - -/*----------------------------------------------------------------- -| specific functions for all MSP34xxG chips -|----------------------------------------------------------------*/ - -void -InitMSP34xxG(MSP3430Ptr m) -{ - -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "InitMSP34xxG(m->connector=%d, m->standard=%d, m->chip_family=%d)\n", - m->connector, m->standard, m->chip_family); -#endif - /* Reset MSP3430 */ - SetMSP3430Control(m, 0x00, 0x80, 0x00); - /* Set it back to normal operation */ - SetMSP3430Control(m, 0x00, 0x00, 0x00); - - /*set MODUS register */ - /* bits: 0 - automatic sound detection */ - /* 1 - enable STATUS change */ - /* 12 - detect 6.5 Mhz carrier as D/K1, D/K2 or D/K NICAM (does not seem to work ) */ - /* 13 - detect 4.5 Mhz carrier as BTSC */ - if ((m->standard & 0xff) == MSP3430_PAL) { - SetMSP3430Data(m, WR_DEM, 0x00, 0x30, 0x30, 0x03 | 0x08); /* make O_ pins tristate */ - /* PAL standard */ - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, 0x00, 0x01); /* possibly wrong */ - } - else { - SetMSP3430Data(m, WR_DEM, 0x00, 0x30, 0x20, 0x03 | 0x08); - /* standard selection is M-BTSC-Stereo */ - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, 0x00, 0x20); - } - - switch (m->connector) { - case MSP3430_CONNECTOR_1: - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, 0x03, 0x20); - break; - case MSP3430_CONNECTOR_2: - /* this has not been checked yet.. could be bogus */ - /* SCART Input Prescale: 0 dB gain */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0d, 0x19, 0x00); - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, 0x02, 0x20); - break; - case MSP3430_CONNECTOR_3: - default: - /* SCART Input Prescale: 0 dB gain */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0d, 0x19, 0x00); - - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, 0x02, 0x20); - break; - } - - switch (m->standard) { - case MSP3430_PAL: - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x24, 0x03); - SetMSP3430Data(m, WR_DSP, 0x00, 0x10, 0x00, 0x5a); - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, 0x00, 0x03); - /* Set volume to FAST_MUTE. */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x00, 0xFF, 0x00); - break; - case MSP3430_PAL_DK1: - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x24, 0x03); - SetMSP3430Data(m, WR_DSP, 0x00, 0x10, 0x00, 0x5a); - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, 0x00, 0x04); - /* Set volume to FAST_MUTE. */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x00, 0xFF, 0x00); - break; - case MSP3430_SECAM: /* is this right ? */ - case MSP3430_NTSC: - /* Write to DSP, register 0x000E, (prescale FM/FM matrix) */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x24, 0x03); - - /* Set volume to FAST_MUTE. */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x00, 0xFF, 0x00); - break; - } - -} - -/*----------------------------------------------------------------- -| specific functions for all MSP34x5D chips -|----------------------------------------------------------------*/ - -void -InitMSP34x5D(MSP3430Ptr m) -{ - int count; - CARD8 high, low; - CARD16 result, standard; - CARD16 peak; - - if (m->c_format == MSPFORMAT_UNKNOWN) - ResetMSP3430(m); - else { - /*mute volume */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x00, 0x00, 0x00); - } - - switch (m->connector) { - case MSP3430_CONNECTOR_2: - case MSP3430_CONNECTOR_3: - if (m->c_format != MSPFORMAT_SCART) { - /* SCART Input Prescale: 0 dB gain */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0d, 0x19, 0x00); - /* this has not been checked yet.. could be bogus */ - m->c_format = MSPFORMAT_SCART; /*stereo */ - } - break; - case MSP3430_CONNECTOR_1: - default: - - switch (m->standard & 0x00ff) { - case MSP3430_PAL: - switch (m->standard) { - case MSP3430_PAL_DK1: - standard = MSPSTANDARD_FM_DK1; - break; -/* case MSP3430_PAL_DK2: - standard=MSPSTANDARD_FM_DK2; - break; - case MSP3430_PAL_BG: - may be FM stereo (Germany) or FM NICAM (Scandinavia,spain) - standard=MSPSTANDARD_AUTO; - break; -*/ - default: - standard = MSPSTANDARD_AUTO; - } - break; - case MSP3430_SECAM: - standard = MSPSTANDARD_AUTO; - case MSP3430_NTSC: - /* Only MSP34x5 supported format - Korean NTSC-M */ - standard = MSPSTANDARD_FM_M; - default: - standard = MSPSTANDARD_AUTO; - } - - /*no NICAM support in MSP3410D - force to autodetect */ - if ((m->chip_id == 0x405) && (standard >= MSPSTANDARD_NICAM_BG)) - standard = MSPSTANDARD_AUTO; - - if (m->c_standard != standard) { - - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, standard >> 8, - standard & 0xFF); - if (standard == MSPSTANDARD_AUTO) { - count = 50; /* time shouldn't exceed 1s, just in case */ - do { - usleep(20000); - GetMSP3430Data(m, RD_DEM, 0x00, 0x7e, &high, &low); - result = (high << 8) | low; - --count; - } while (result > 0x07ff && count > 0); - - if ((result > MSPSTANDARD_AUTO)) - standard = result; - else - standard = MSPSTANDARD_UNKNOWN; -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Detected audio standard: %d\n", result); -#endif - /* result = MSPSTANDARD_NICAM_L can be one of: - SECAM_L - MSPSTANDARD_NICAM_L - D/K1 - MSPSTANDARD_FM_DK1 - D/K2 - MSPSTANDARD_FM_DK2 - D/K-NICAM - MSPSTANDARD_NICAM_DK */ - if (standard == MSPSTANDARD_NICAM_L) { - if ((m->standard & 0x00ff) == MSP3430_PAL) { - /* force PAL D/K */ - standard = MSPSTANDARD_FM_DK1; - SetMSP3430Data(m, WR_DEM, 0x00, 0x20, standard >> 8, - standard & 0xFF); -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Detected 6.5MHz carrier - forced to D/K1 !!!\n"); -#endif - } - } - } - m->c_standard = standard; - } /*end - standard changed */ - else { - if (standard < MSPSTANDARD_NICAM_BG) { - /* get old value of ident. mode register */ - GetMSP3430Data(m, RD_DSP, 0x00, 0x15, &high, &low); - /* reset Ident-Filter */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x14, 0x00, 0x3F); - /* put back old value to ident. mode register */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x14, 0x00, low); - } - } - - if (standard <= MSPSTANDARD_AUTO) { - m->c_format = MSPFORMAT_1xFM; - } - else if (standard < MSPSTANDARD_NICAM_BG) { - /* set FM prescale */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x30, 0); - /* set FM deemphasis */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0f, - ((standard == MSPSTANDARD_FM_M) ? 0 : 1), 0); - - /* check if FM2 carrier is present */ - /*turn off FM DC Notch */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x17, 0x00, 0x3f); - /*matrix source for Quasi-Peak Detector - stereo: ch2->L ch1->R */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0c, 0x00, 0x20); - - mpause(250); - GetMSP3430Data(m, RD_DSP, 0x00, 0x1A, &high, &low); - peak = (high << 8) | low; -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Second carrier Quasi-Peak detection: %d\n", peak); -#endif - /*turn on FM DC Notch */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x17, 0x00, 0x00); - - if (peak < 5) { - /* if second carrier not detected - only mono from first carrier */ - m->c_format = MSPFORMAT_1xFM; - } - else { - m->c_format = MSPFORMAT_2xFM; - /*start of FM identification process - FM_WAIT - wait at least 0.5s - used 1s - gives beter resolution */ - mpause(1000); - } - } - else { - if (standard == MSPSTANDARD_NICAM_L) { - m->c_format = MSPFORMAT_NICAM_AM; - /* set AM prescale */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x7C, 0); - } - else { - m->c_format = MSPFORMAT_NICAM_FM; - /* set FM prescale */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, 0x30, 0); - } - /* set FM deemphasis */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x0f, 0x00, 0); - /* set NICAM prescale to 0dB */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x10, 0x20, 0); - } - - break; - } /*end - case conector */ - - CheckModeMSP34x5D(m); - - /* Set volume to FAST_MUTE. */ - /*SetMSP3430Data(m, WR_DSP, 0x00, 0x00, 0xFF, 0x00); */ - /*set volume */ - MSP3430SetVolume(m, m->volume); - -__MSPBEEP} /* EnableMSP34x5D ()... */ - -void -CheckModeMSP34x5D(MSP3430Ptr m) -{ - const char stereo_on = 25; - const char stereo_off = 20; - const char dual_on = -stereo_on; - const char dual_off = -stereo_off; - char detect; - CARD8 matrix, fmmatrix, source, high, low; - - fmmatrix = 0; /*no matrix */ - source = 0; - /*FM*/ switch (m->c_format) { - case MSPFORMAT_NICAM_FM: - case MSPFORMAT_NICAM_AM: - case MSPFORMAT_SCART: - source = ((m->c_format == MSPFORMAT_SCART) ? 2 : 1); - switch (m->mode) { - case MSPMODE_MONO: - matrix = 0x30; - /*MONO*/ break; - case MSPMODE_A: - matrix = 0x00; - /*A*/ break; - case MSPMODE_B: - matrix = 0x10; - /*B*/ break; - default: - matrix = 0x20; - /*STEREO*/ break; - } - break; - default: - case MSPFORMAT_1xFM: - matrix = 0x00; - /*A*/ break; - case MSPFORMAT_2xFM: - switch (m->mode) { - case MSPMODE_MONO: - matrix = 0x30; - /*MONO*/ break; - case MSPMODE_STEREO: - matrix = 0x20; - /*STEREO*/ fmmatrix = ((m->c_standard == MSPSTANDARD_FM_M) ? 2 : 1); - break; - case MSPMODE_AB: - matrix = 0x20; - /*STEREO*/ break; - case MSPMODE_A: - matrix = 0x00; - /*A*/ break; - case MSPMODE_B: - matrix = 0x10; - /*B*/ break; - default: - /*FM_IDENT_CHECK */ - GetMSP3430Data(m, RD_DSP, 0x00, 0x18, &high, &low); - detect = (char) high; -#if __MSPDEBUG__ > 1 - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, - "Stereo Detection Register: %d\n", detect); -#endif - if (detect >= - ((m->c_mode == MSPMODE_STEREO) ? stereo_off : stereo_on)) { - m->c_mode = MSPMODE_STEREO; - matrix = 0x20; - /*STEREO*/ - fmmatrix = ((m->c_standard == MSPSTANDARD_FM_M) ? 2 : 1); - } - else if (detect <= ((m->c_mode == MSPMODE_AB) ? dual_off : dual_on)) { - m->c_mode = MSPMODE_AB; - switch (m->mode) { - case MSPMODE_STEREO_AB: - matrix = 0x20; - break; - case MSPMODE_STEREO_B: - matrix = 0x10; - break; - default: - case MSPMODE_A: - matrix = 0x00; - break; - } - } - else { - m->c_mode = MSPMODE_MONO; - matrix = 0x30; - /*MONO*/} - break; - } /* end - case mode */ - break; - } - - if (m->c_fmmatrix != fmmatrix) { - GetMSP3430Data(m, RD_DSP, 0x00, 0x0e, &high, &low); - SetMSP3430Data(m, WR_DSP, 0x00, 0x0e, high, fmmatrix); - m->c_fmmatrix = fmmatrix; - } - - if ((m->c_matrix != matrix) || (m->c_source != source)) { - /*set chanel source and matrix for loudspeaker */ - SetMSP3430Data(m, WR_DSP, 0x00, 0x08, source, matrix); - - m->c_matrix = matrix; - m->c_source = source; - } - - if (((m->c_format) & 0xF0) == MSPFORMAT_NICAM) - SetMSP3430Data(m, WR_DEM, 0x00, 0x21, 0, 1); - -#if __MSPDEBUG__ > 0 - char *msg; - - switch (matrix) { - case 0x30: - /*MONO*/ msg = "MONO"; - break; - case 0x00: - /*LEFT*/ msg = "MONO/CHANNEL_1"; - break; - case 0x10: - /*RIGHT*/ msg = "MONO/CHANNEL_2"; - break; - case 0x20: - /*LEFT*/ msg = "STEREO"; - break; - default: - msg = "unknown"; - break; - } - xf86DrvMsg(m->d.pI2CBus->scrnIndex, X_INFO, "Audio mode set to: %s\n", msg); -#endif -} diff --git a/xserver/hw/xfree86/i2c/msp3430.h b/xserver/hw/xfree86/i2c/msp3430.h deleted file mode 100644 index ef66e1ed8..000000000 --- a/xserver/hw/xfree86/i2c/msp3430.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef __MSP3430_H__ -#define __MSP3430_H__ - -#include "xf86i2c.h" - -typedef struct { - I2CDevRec d; - - int standard; - int connector; - int mode; - - CARD8 hardware_version, major_revision, product_code, rom_version; -#ifdef MSP_DEBUG - CARD8 registers_present[256]; -#endif - - CARD16 chip_id; - CARD8 chip_family; - Bool recheck; /*reinitialization needed after channel change */ - CARD8 c_format; /*current state of audio format */ - CARD16 c_standard; /*current state of standard register */ - CARD8 c_source; /*current state of source register */ - CARD8 c_matrix; /*current state of matrix register */ - CARD8 c_fmmatrix; /*current state of fmmatrix register */ - int c_mode; /* current state of mode for autoswitchimg */ - CARD8 volume; -} MSP3430Rec, *MSP3430Ptr; - -#define MSP3430_ADDR_1 0x80 -#define MSP3430_ADDR_2 0x84 -#define MSP3430_ADDR_3 0x88 - -#define MSP3430_PAL 1 -#define MSP3430_NTSC 2 -#define MSP3430_PAL_DK1 (0x100 | MSP3430_PAL) -#define MSP3430_SECAM 3 - -#define MSP3430_CONNECTOR_1 1 /* tuner on AIW cards */ -#define MSP3430_CONNECTOR_2 2 /* SVideo on AIW cards */ -#define MSP3430_CONNECTOR_3 3 /* composite on AIW cards */ - -#define MSP3430_ADDR(a) ((a)->d.SlaveAddr) - -#define MSP3430_FAST_MUTE 0xFF -/* a handy volume transform function, -1000..1000 -> 0x01..0x7F */ -#define MSP3430_VOLUME(value) (0x01+(0x7F-0x01)*log(value+1001)/log(2001)) - -/*----------------------------------------------------------*/ - -/* MSP chip families */ -#define MSPFAMILY_UNKNOWN 0 -#define MSPFAMILY_34x0D 1 -#define MSPFAMILY_34x5D 2 -#define MSPFAMILY_34x0G 3 -#define MSPFAMILY_34x5G 4 - -/* values for MSP standard */ -#define MSPSTANDARD_UNKNOWN 0x00 -#define MSPSTANDARD_AUTO 0x01 -#define MSPSTANDARD_FM_M 0x02 -#define MSPSTANDARD_FM_BG 0x03 -#define MSPSTANDARD_FM_DK1 0x04 -#define MSPSTANDARD_FM_DK2 0x04 -#define MSPSTANDARD_NICAM_BG 0x08 -#define MSPSTANDARD_NICAM_L 0x09 -#define MSPSTANDARD_NICAM_I 0x0A -#define MSPSTANDARD_NICAM_DK 0x0B - -/* values for MSP format */ -#define MSPFORMAT_UNKNOWN 0x00 -#define MSPFORMAT_FM 0x10 -#define MSPFORMAT_1xFM 0x00|MSPFORMAT_FM -#define MSPFORMAT_2xFM 0x01|MSPFORMAT_FM -#define MSPFORMAT_NICAM 0x20 -#define MSPFORMAT_NICAM_FM 0x00|MSPFORMAT_NICAM -#define MSPFORMAT_NICAM_AM 0x01|MSPFORMAT_NICAM -#define MSPFORMAT_SCART 0x30 - -/* values for MSP mode */ -#define MSPMODE_UNKNOWN 0 -/* automatic modes */ -#define MSPMODE_STEREO_AB 1 -#define MSPMODE_STEREO_A 2 -#define MSPMODE_STEREO_B 3 -/* forced modes */ -#define MSPMODE_MONO 4 -#define MSPMODE_STEREO 5 -#define MSPMODE_AB 6 -#define MSPMODE_A 7 -#define MSPMODE_B 8 -/*----------------------------------------------------------*/ - -#define xf86_InitMSP3430 InitMSP3430 -extern _X_EXPORT void InitMSP3430(MSP3430Ptr m); - -#define xf86_DetectMSP3430 DetectMSP3430 -extern _X_EXPORT MSP3430Ptr DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr); - -#define xf86_ResetMSP3430 ResetMSP3430 -extern _X_EXPORT void ResetMSP3430(MSP3430Ptr m); - -#define xf86_MSP3430SetVolume MSP3430SetVolume -extern _X_EXPORT void MSP3430SetVolume(MSP3430Ptr m, CARD8 value); - -#define xf86_MSP3430SetSAP MSP3430SetSAP -extern _X_EXPORT void MSP3430SetSAP(MSP3430Ptr m, int mode); - -#define MSP3430SymbolsList \ - "InitMSP3430", \ - "DetectMSP3430", \ - "ResetMSP3430", \ - "MSP3430SetVolume", \ - "MSP3430SetSAP" - -#endif diff --git a/xserver/hw/xfree86/i2c/msp3430_module.c b/xserver/hw/xfree86/i2c/msp3430_module.c deleted file mode 100644 index e177efe7f..000000000 --- a/xserver/hw/xfree86/i2c/msp3430_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo msp3430VersRec = { - "msp3430", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData msp3430ModuleData = { - &msp3430VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/tda8425.c b/xserver/hw/xfree86/i2c/tda8425.c deleted file mode 100644 index 051249b8a..000000000 --- a/xserver/hw/xfree86/i2c/tda8425.c +++ /dev/null @@ -1,83 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86i2c.h" -#include "tda8425.h" -#include "i2c_def.h" - -#define TDA8425(a,b) { \ - data[0]=a; \ - data[1]=b; \ - I2C_WriteRead(&(t->d), data, 2, NULL, 0); \ - } - -TDA8425Ptr -Detect_tda8425(I2CBusPtr b, I2CSlaveAddr addr, Bool force) -{ - TDA8425Ptr t; - - t = calloc(1, sizeof(TDA8425Rec)); - if (t == NULL) - return NULL; - t->d.DevName = "TDA8425 BTSC Stereo Audio Processor"; - t->d.SlaveAddr = addr; - t->d.pI2CBus = b; - t->d.NextDev = NULL; - t->d.StartTimeout = b->StartTimeout; - t->d.BitTimeout = b->BitTimeout; - t->d.AcknTimeout = b->AcknTimeout; - t->d.ByteTimeout = b->ByteTimeout; - - if (!force && !I2CProbeAddress(b, addr)) { - free(t); - return NULL; - } - - /* set default parameters */ - if (!I2CDevInit(&(t->d))) { - free(t); - return NULL; - } - - return t; -} - -Bool -tda8425_init(TDA8425Ptr t) -{ - t->stereo = 3; /* 3 = Spacial 2 = Linear 1 = Pseudo 0 = Forced mono */ - t->v_left = 0xFF; /* FF - C0 */ - t->v_right = 0xFF; /* FF - C0 */ - t->bass = 0xF6; /* 0xFF - 0xF0 */ - t->treble = 0xF6; /* 0xFF - 0xF0 */ - t->src_sel = 3; /* 3 - stereo */ - t->mute = TRUE; - t->mux = 0; /* 0 - source one, 1 -source 2 */ - - tda8425_setaudio(t); - return TRUE; -} - -void -tda8425_setaudio(TDA8425Ptr t) -{ - I2CByte data[2]; - - TDA8425(0x00, t->v_left); - TDA8425(0x01, t->v_right); - TDA8425(0x02, t->bass); - TDA8425(0x03, t->treble); - TDA8425(0x08, - 0xC0 | (t->mute ? 0x20 : 0x0) | (t->stereo << 3) | (t-> - src_sel << 1) | - t->mux); -} - -void -tda8425_mute(TDA8425Ptr t, Bool mute) -{ - t->mute = mute; - tda8425_setaudio(t); -} diff --git a/xserver/hw/xfree86/i2c/tda8425.h b/xserver/hw/xfree86/i2c/tda8425.h deleted file mode 100644 index e3dfb1384..000000000 --- a/xserver/hw/xfree86/i2c/tda8425.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __TDA8425_H__ -#define __TDA8425_H__ - -#include "xf86i2c.h" - -typedef struct { - I2CDevRec d; - - int mux; - int stereo; - int v_left; - int v_right; - int bass; - int treble; - int src_sel; - Bool mute; -} TDA8425Rec, *TDA8425Ptr; - -#define TDA8425_ADDR_1 0x82 - -/* the third parameter is meant to force detection of tda8425. - This is because tda8425 is write-only and complete implementation - of I2C protocol is not always available. Besides address there is no good - way to autodetect it so we have to _know_ it is there anyway */ - -#define xf86_Detect_tda8425 Detect_tda8425 -extern _X_EXPORT TDA8425Ptr Detect_tda8425(I2CBusPtr b, I2CSlaveAddr addr, - Bool force); -#define xf86_tda8425_init tda8425_init -extern _X_EXPORT Bool tda8425_init(TDA8425Ptr t); - -#define xf86_tda8425_setaudio tda8425_setaudio -extern _X_EXPORT void tda8425_setaudio(TDA8425Ptr t); - -#define xf86_tda8425_mute tda8425_mute -extern _X_EXPORT void tda8425_mute(TDA8425Ptr t, Bool mute); - -#define TDA8425SymbolsList \ - "Detect_tda8425", \ - "tda8425_init", \ - "tda8425_setaudio", \ - "tda8425_mute" - -#endif diff --git a/xserver/hw/xfree86/i2c/tda8425_module.c b/xserver/hw/xfree86/i2c/tda8425_module.c deleted file mode 100644 index 74c820f73..000000000 --- a/xserver/hw/xfree86/i2c/tda8425_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo tda8425VersRec = { - "tda8425", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData tda8425ModuleData = { - &tda8425VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/tda9850.c b/xserver/hw/xfree86/i2c/tda9850.c deleted file mode 100644 index d258bda05..000000000 --- a/xserver/hw/xfree86/i2c/tda9850.c +++ /dev/null @@ -1,136 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86i2c.h" -#include "tda9850.h" -#include "i2c_def.h" - -#define TDA9850(a,b) { \ - data[0]=a; \ - data[1]=b; \ - I2C_WriteRead(&(t->d), data, 2, NULL, 0); \ - } - -TDA9850Ptr -Detect_tda9850(I2CBusPtr b, I2CSlaveAddr addr) -{ - TDA9850Ptr t; - I2CByte a; - - t = calloc(1, sizeof(TDA9850Rec)); - if (t == NULL) - return NULL; - switch (addr) { - case TDA9850_ADDR_1: - t->d.DevName = "TDA9850 BTSC Stereo+SAP Audio Processor"; - break; - default: - t->d.DevName = "Generic TDAxxxx"; - break; - } - t->d.SlaveAddr = addr; - t->d.pI2CBus = b; - t->d.NextDev = NULL; - t->d.StartTimeout = b->StartTimeout; - t->d.BitTimeout = b->BitTimeout; - t->d.AcknTimeout = b->AcknTimeout; - t->d.ByteTimeout = b->ByteTimeout; - - if (!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - free(t); - return NULL; - } - - /* set default parameters */ - if (!I2CDevInit(&(t->d))) { - free(t); - return NULL; - } - - return t; -} - -Bool -tda9850_init(TDA9850Ptr t) -{ - t->stereo = 1; - t->sap = 0; - t->mute = TRUE; - t->sap_mute = TRUE; - tda9850_setaudio(t); - return TRUE; -} - -void -tda9850_setaudio(TDA9850Ptr t) -{ - CARD8 data[2]; - - if (t->mux == 2) { - TDA9850(0x04, 0x0F); - TDA9850(0x05, 0x0F); - TDA9850(0x06, 0x58); - TDA9850(0x07, 0x07); - TDA9850(0x08, 0x00); - TDA9850(0x09, 0x00); - TDA9850(0x0A, 0x03); - } - else { - TDA9850(0x04, 0x07); - TDA9850(0x05, 0x07); - TDA9850(0x06, 0x58); - TDA9850(0x07, 0x07); - TDA9850(0x08, 0x10); - TDA9850(0x09, 0x10); - TDA9850(0x0A, 0x03); - } - - TDA9850(0x06, - (t->stereo << 6) | (t->sap << 7) | (t->mute ? 0x8 : 0) | (t-> - sap_mute ? - 0x10 : - 0x0)); -} - -void -tda9850_mute(TDA9850Ptr t, Bool mute) -{ - CARD8 data[2]; - - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, "tda9850_mute %s\n", - mute ? "on" : "off"); - t->mute = mute; - - TDA9850(0x06, - (t->stereo << 6) | (t->sap << 7) | (t->mute ? 0x8 : 0x0) | (t-> - sap_mute - ? 0x10 : - 0x0)); -} - -void -tda9850_sap_mute(TDA9850Ptr t, Bool sap_mute) -{ - CARD8 data[2]; - - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, "tda9850_sap_mute %s\n", - sap_mute ? "on" : "off"); - t->sap_mute = sap_mute; - - TDA9850(0x06, - (t->stereo << 6) | (t->sap << 7) | (t->mute ? 0x8 : 0x0) | (t-> - sap_mute - ? 0x10 : - 0x0)); -} - -CARD16 -tda9850_getstatus(TDA9850Ptr t) -{ - CARD16 status; - - I2C_WriteRead(&(t->d), NULL, 0, (I2CByte *) &status, 2); - return status; -} diff --git a/xserver/hw/xfree86/i2c/tda9850.h b/xserver/hw/xfree86/i2c/tda9850.h deleted file mode 100644 index 7d82095f0..000000000 --- a/xserver/hw/xfree86/i2c/tda9850.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __TDA9850_H__ -#define __TDA9850_H__ - -#include "xf86i2c.h" - -typedef struct { - I2CDevRec d; - - int mux; - int stereo; - int sap; - Bool mute; - Bool sap_mute; -} TDA9850Rec, *TDA9850Ptr; - -#define TDA9850_ADDR_1 0xB4 - -#define xf86_Detect_tda9850 Detect_tda9850 -extern _X_EXPORT TDA9850Ptr Detect_tda9850(I2CBusPtr b, I2CSlaveAddr addr); - -#define xf86_tda9850_init tda9850_init -extern _X_EXPORT Bool tda9850_init(TDA9850Ptr t); - -#define xf86_tda9850_setaudio tda9850_setaudio -extern _X_EXPORT void tda9850_setaudio(TDA9850Ptr t); - -#define xf86_tda9850_mute tda9850_mute -extern _X_EXPORT void tda9850_mute(TDA9850Ptr t, Bool mute); - -#define xf86_tda9850_sap_mute tda9850_sap_mute -extern _X_EXPORT void tda9850_sap_mute(TDA9850Ptr t, Bool sap_mute); - -#define xf86_tda9850_getstatus tda9850_getstatus -extern _X_EXPORT CARD16 tda9850_getstatus(TDA9850Ptr t); - -#define TDA9850SymbolsList \ - "Detect_tda9850", \ - "tda9850_init", \ - "tda9850_setaudio", \ - "tda9850_mute", \ - "tda9850_sap_mute" - -#endif diff --git a/xserver/hw/xfree86/i2c/tda9850_module.c b/xserver/hw/xfree86/i2c/tda9850_module.c deleted file mode 100644 index 197d65a71..000000000 --- a/xserver/hw/xfree86/i2c/tda9850_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo tda9850VersRec = { - "tda9850", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData tda9850ModuleData = { - &tda9850VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/tda9885.c b/xserver/hw/xfree86/i2c/tda9885.c deleted file mode 100644 index fd859bde0..000000000 --- a/xserver/hw/xfree86/i2c/tda9885.c +++ /dev/null @@ -1,100 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86i2c.h" -#include "tda9885.h" -#include "i2c_def.h" - -TDA9885Ptr -Detect_tda9885(I2CBusPtr b, I2CSlaveAddr addr) -{ - TDA9885Ptr t; - I2CByte a; - - t = calloc(1, sizeof(TDA9885Rec)); - if (t == NULL) - return NULL; - switch (addr) { - case TDA9885_ADDR_1: - case TDA9885_ADDR_2: - case TDA9885_ADDR_3: - case TDA9885_ADDR_4: - t->d.DevName = "TDA9885 Alignment-free IF-PLL"; - break; - default: - t->d.DevName = "Generic TDAxxxx"; - break; - } - t->d.SlaveAddr = addr; - t->d.pI2CBus = b; - t->d.NextDev = NULL; - t->d.StartTimeout = b->StartTimeout; - t->d.BitTimeout = b->BitTimeout; - t->d.AcknTimeout = b->AcknTimeout; - t->d.ByteTimeout = b->ByteTimeout; - - if (!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - free(t); - return NULL; - } - - /* set default parameters */ - if (!I2CDevInit(&(t->d))) { - free(t); - return NULL; - } - - return t; -} - -Bool -tda9885_init(TDA9885Ptr t) -{ - t->forced_mute_audio = 1; - return TRUE; -} - -void -tda9885_getstatus(TDA9885Ptr t) -{ - CARD8 value; - - I2C_WriteRead(&(t->d), NULL, 0, &value, 1); - t->after_reset = value & 1; - t->afc_status = (value >> 1) & 0xf; - t->fm_carrier = (value >> 5) & 1; - t->vif_level = (value >> 6) & 1; - t->afc_win = (value >> 7) & 1; -} - -void -tda9885_setparameters(TDA9885Ptr t) -{ - CARD8 data[4]; - - data[0] = 0; /* start with subaddress 0 */ - data[1] = (t->sound_trap & 1) | ((t->auto_mute_fm & 1) << 1) | ((t->carrier_mode & 1) << 2) | ((t->modulation & 3) << 3) | ((t->forced_mute_audio & 1) << 5) | ((t->port1 & 1) << 6) | ((t->port2 & 1) << 7); /* B data */ - data[2] = (t->top_adjustment & 0x1f) | ((t->deemphasis & 0x3) << 5) | ((t->audio_gain & 1) << 7); /* C data */ - data[3] = (t->standard_sound_carrier & 0x3) | ((t->standard_video_if & 0x07) << 2) | ((t->minimum_gain & 0x01) << 5) | ((t->gating & 0x01) << 6) | ((t->vif_agc & 0x01) << 7); /* E data */ - - I2C_WriteRead(&(t->d), data, 4, NULL, 0); - - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "TDA9885 setparam: B data: %x, C data: %x, E data: %x\n", - data[1], data[2], data[3]); -} - -void -tda9885_dumpstatus(TDA9885Ptr t) -{ - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "TDA9885 status: after_reset=%d afc_status=%d (%3.1f kHz off) fm_carrier=%d vif_level=%d afc_win=%d %s\n", - t->after_reset, t->afc_status, - (t->afc_status < - 8) ? -12.5 - t->afc_status * 25.0 : -12.5 + (16 - - t->afc_status) * - 25.0, t->fm_carrier, t->vif_level, t->afc_win, - t->afc_win ? "VCO in" : "VCO out"); -} diff --git a/xserver/hw/xfree86/i2c/tda9885.h b/xserver/hw/xfree86/i2c/tda9885.h deleted file mode 100644 index 2d8a8af15..000000000 --- a/xserver/hw/xfree86/i2c/tda9885.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __TDA9885_H__ -#define __TDA9885_H__ - -#include "xf86i2c.h" - -typedef struct { - I2CDevRec d; - - /* write-only parameters */ - /* B DATA */ - CARD8 sound_trap; - CARD8 auto_mute_fm; - CARD8 carrier_mode; - CARD8 modulation; - CARD8 forced_mute_audio; - CARD8 port1; - CARD8 port2; - /* C DATA */ - CARD8 top_adjustment; - CARD8 deemphasis; - CARD8 audio_gain; - /* E DATA */ - CARD8 standard_sound_carrier; - CARD8 standard_video_if; - CARD8 minimum_gain; - CARD8 gating; - CARD8 vif_agc; - /* read-only values */ - - CARD8 after_reset; - CARD8 afc_status; - CARD8 vif_level; - CARD8 afc_win; - CARD8 fm_carrier; -} TDA9885Rec, *TDA9885Ptr; - -#define TDA9885_ADDR_1 0x86 -#define TDA9885_ADDR_2 0x84 -#define TDA9885_ADDR_3 0x96 -#define TDA9885_ADDR_4 0x94 - -#define xf86_Detect_tda9885 Detect_tda9885 -extern _X_EXPORT TDA9885Ptr Detect_tda9885(I2CBusPtr b, I2CSlaveAddr addr); - -#define xf86_tda9885_init tda9885_init -extern _X_EXPORT Bool tda9885_init(TDA9885Ptr t); - -#define xf86_tda9885_setparameters tda9885_setparameters -extern _X_EXPORT void tda9885_setparameters(TDA9885Ptr t); - -#define xf86_tda9885_getstatus tda9885_getstatus -extern _X_EXPORT void tda9885_getstatus(TDA9885Ptr t); - -#define xf86_tda9885_dumpstatus tda9885_dumpstatus -extern _X_EXPORT void tda9885_dumpstatus(TDA9885Ptr t); - -#define TDA9885SymbolsList \ - "Detect_tda9885", \ - "tda9885_init", \ - "tda9885_setaudio", \ - "tda9885_mute" - -#endif diff --git a/xserver/hw/xfree86/i2c/tda9885_module.c b/xserver/hw/xfree86/i2c/tda9885_module.c deleted file mode 100644 index e71bd6061..000000000 --- a/xserver/hw/xfree86/i2c/tda9885_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo tda9885VersRec = { - "tda9885", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData tda9885ModuleData = { - &tda9885VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/uda1380.c b/xserver/hw/xfree86/i2c/uda1380.c deleted file mode 100644 index 87226877b..000000000 --- a/xserver/hw/xfree86/i2c/uda1380.c +++ /dev/null @@ -1,196 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2005 Bogdan D. bogdand@users.sourceforge.net - * - * 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 AUTHOR 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 author 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 author. - * - ************************************************************************************/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86i2c.h" -#include "uda1380.h" -#include "i2c_def.h" - -UDA1380Ptr -Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr) -{ - UDA1380Ptr t; - I2CByte a; - - t = calloc(1, sizeof(UDA1380Rec)); - if (t == NULL) - return NULL; - switch (addr) { - case UDA1380_ADDR_1: - case UDA1380_ADDR_2: - t->d.DevName = "UDA1380 Stereo audion coder-decoder"; - break; - default: - t->d.DevName = "Generic UDAxxxx"; - break; - } - t->d.SlaveAddr = addr; - t->d.pI2CBus = b; - t->d.NextDev = NULL; - t->d.StartTimeout = b->StartTimeout; - t->d.BitTimeout = b->BitTimeout; - t->d.AcknTimeout = b->AcknTimeout; - t->d.ByteTimeout = b->ByteTimeout; - - if (!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { - free(t); - return NULL; - } - - /* set default parameters */ - if (!I2CDevInit(&(t->d))) { - free(t); - return NULL; - } - - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 stereo coder-decoder detected\n"); - - return t; -} - -Bool -uda1380_init(UDA1380Ptr t) -{ - CARD8 data[3]; - CARD16 tmp; - Bool ret; - - /* Power control */ - data[0] = 0x02; - tmp = - (1 << 13) | (1 << 10) | (1 << 8) | (1 << 7) | (1 << 6) | (1 << 3) | (1 - << - 1); - data[1] = (CARD8) ((tmp >> 8) & 0xff); - data[2] = (CARD8) (tmp & 0xff); - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) { - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to initialize\n"); - return FALSE; - } - - /* Analog mixer (AVC) */ - data[0] = 0x03; - /* the analog mixer is muted initially */ - data[1] = 0x3f; - data[2] = 0x3f; - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) { - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to initialize\n"); - return FALSE; - } - - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, "UDA1380 initialized\n"); - - return TRUE; -} - -void -uda1380_shutdown(UDA1380Ptr t) -{ - CARD8 data[3]; - Bool ret; - - /* Power control */ - data[0] = 0x02; - data[1] = 0; - data[2] = 0; - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to shutdown\n"); -} - -void -uda1380_setvolume(UDA1380Ptr t, INT32 value) -{ - CARD8 data[3]; - - /* - * We have to scale the value ranging from -1000 to 1000 to 0x2c to 0 - */ - CARD8 volume = 47 - (CARD8) ((value + 1000) * 47 / 2000); - Bool ret; - - t->analog_mixer_settings = ((volume << 8) & 0x3f00) | (volume & 0x3f); - - /* Analog mixer (AVC) */ - data[0] = 0x03; - data[1] = volume & 0x3f; - data[2] = volume & 0x3f; - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to set volume\n"); -} - -void -uda1380_mute(UDA1380Ptr t, Bool mute) -{ - CARD8 data[3]; - Bool ret; - - if (mute == TRUE) { - /* Analog mixer (AVC) */ - data[0] = 0x03; - data[1] = 0xff; - data[2] = 0xff; - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to mute\n"); - } - else { - /* Analog mixer (AVC) */ - data[0] = 0x03; - data[1] = (CARD8) ((t->analog_mixer_settings >> 8) & 0x3f); - data[2] = (CARD8) (t->analog_mixer_settings & 0x3f); - ret = I2C_WriteRead(&(t->d), data, 3, NULL, 0); - if (ret == FALSE) - xf86DrvMsg(t->d.pI2CBus->scrnIndex, X_INFO, - "UDA1380 failed to unmute\n"); - } -} - -void -uda1380_getstatus(UDA1380Ptr t) -{ -} - -void -uda1380_setparameters(UDA1380Ptr t) -{ -} - -void -uda1380_dumpstatus(UDA1380Ptr t) -{ -} diff --git a/xserver/hw/xfree86/i2c/uda1380.h b/xserver/hw/xfree86/i2c/uda1380.h deleted file mode 100644 index f0bc6167a..000000000 --- a/xserver/hw/xfree86/i2c/uda1380.h +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2005 Bogdan D. bogdand@users.sourceforge.net - * - * 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 AUTHOR 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 author 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 author. - * - * Revision 1.3 2005/09/24 21:56:00 bogdand - * Changed the license to a X/MIT one - * - * Revision 1.2 2005/07/01 22:43:11 daniels - * Change all misc.h and os.h references to . - * - * - ************************************************************************************/ - -#ifndef __UDA1380_H__ -#define __UDA1380_H__ - -#include "xf86i2c.h" - -typedef struct { - I2CDevRec d; - - CARD16 analog_mixer_settings; /* register 0x03 */ - -} UDA1380Rec, *UDA1380Ptr; - -#define UDA1380_ADDR_1 0x30 -#define UDA1380_ADDR_2 0x34 - -#define xf86_Detect_uda1380 Detect_uda1380 -extern _X_EXPORT UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr); - -#define xf86_uda1380_init uda1380_init -extern _X_EXPORT Bool uda1380_init(UDA1380Ptr t); - -#define xf86_uda1380_shutdown uda1380_shutdown -extern _X_EXPORT void uda1380_shutdown(UDA1380Ptr t); - -#define xf86_uda1380_setvolume uda1380_setvolume -extern _X_EXPORT void uda1380_setvolume(UDA1380Ptr t, INT32); - -#define xf86_uda1380_mute uda1380_mute -extern _X_EXPORT void uda1380_mute(UDA1380Ptr t, Bool); - -#define xf86_uda1380_setparameters uda1380_setparameters -extern _X_EXPORT void uda1380_setparameters(UDA1380Ptr t); - -#define xf86_uda1380_getstatus uda1380_getstatus -extern _X_EXPORT void uda1380_getstatus(UDA1380Ptr t); - -#define xf86_uda1380_dumpstatus uda1380_dumpstatus -extern _X_EXPORT void uda1380_dumpstatus(UDA1380Ptr t); - -#define UDA1380SymbolsList \ - "Detect_uda1380", \ - "uda1380_init", \ - "uda1380_shutdown", \ - "uda1380_setvolume", \ - "uda1380_mute", \ - "uda1380_setparameters", \ - "uda1380_getstatus", \ - "uda1380_dumpstatus" - -#endif diff --git a/xserver/hw/xfree86/i2c/uda1380_module.c b/xserver/hw/xfree86/i2c/uda1380_module.c deleted file mode 100644 index dca834b12..000000000 --- a/xserver/hw/xfree86/i2c/uda1380_module.c +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static XF86ModuleVersionInfo uda1380VersRec = { - "uda1380", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData uda1380ModuleData = { - &uda1380VersRec, - NULL, - NULL -}; diff --git a/xserver/hw/xfree86/i2c/xf86i2c.c b/xserver/hw/xfree86/i2c/xf86i2c.c index 2d261d4ce..cf2cd0971 100644 --- a/xserver/hw/xfree86/i2c/xf86i2c.c +++ b/xserver/hw/xfree86/i2c/xf86i2c.c @@ -1,7 +1,7 @@ /* * Copyright (C) 1998 Itai Nahshon, Michael Schimek * - * The original code was derived from and inspired by + * The original code was derived from and inspired by * the I2C driver from the Linux kernel. * (c) 1998 Gerd Knorr */ @@ -52,7 +52,7 @@ I2CUDelay(I2CBusPtr b, int usec) if (usec > 0) { X_GETTIMEOFDAY(&begin); do { - /* It would be nice to use {xf86}usleep, + /* It would be nice to use {xf86}usleep, * but usleep (1) takes >10000 usec ! */ X_GETTIMEOFDAY(&cur); @@ -74,7 +74,7 @@ I2CUDelay(I2CBusPtr b, int usec) #define RISEFALLTIME 2 /* usec, actually 300 to 1000 ns according to the i2c specs */ -/* Some devices will hold SCL low to slow down the bus or until +/* Some devices will hold SCL low to slow down the bus or until * ready for transmission. * * This condition will be noticed when the master tries to raise @@ -206,7 +206,7 @@ I2CReadBit(I2CBusPtr b, int *psda, int timeout) /* This is the default I2CPutByte function if not supplied by the driver. * * A single byte is sent to the device. - * The function returns FALSE if a timeout occurs, you should send + * The function returns FALSE if a timeout occurs, you should send * a stop condition afterwards to reset the bus. * * A timeout occurs, @@ -267,7 +267,7 @@ I2CPutByte(I2CDevPtr d, I2CByte data) * A single byte is read from the device. * The function returns FALSE if a timeout occurs, you should send * a stop condition afterwards to reset the bus. - * + * * A timeout occurs, * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs, * or slows down the bus for more than b->BitTimeout usecs for each bit. @@ -275,7 +275,7 @@ I2CPutByte(I2CDevPtr d, I2CByte data) * ByteTimeout must be at least b->HoldTime, the other timeouts can be * zero according to the comment on I2CRaiseSCL. * - * For the byte in a sequence the acknowledge bit NACK (1), + * For the byte in a sequence the acknowledge bit NACK (1), * otherwise ACK (0) will be sent. */ @@ -311,11 +311,11 @@ I2CGetByte(I2CDevPtr d, I2CByte * data, Bool last) * * It creates the start condition, followed by the d->SlaveAddr. * Higher level functions must call this routine rather than - * I2CStart/PutByte because a hardware I2C master may not be able + * I2CStart/PutByte because a hardware I2C master may not be able * to send a slave address without a start condition. * * The same timeouts apply as with I2CPutByte and additional a - * StartTimeout, similar to the ByteTimeout but for the start + * StartTimeout, similar to the ByteTimeout but for the start * condition. * * In case of a timeout, the bus is left in a clean idle condition. @@ -325,7 +325,7 @@ I2CGetByte(I2CDevPtr d, I2CByte * data, Bool last) * in the least significant byte. This is, the slave address must include the * R/_W flag as least significant bit. * - * The most significant byte of the address will be sent _after_ the LSB, + * The most significant byte of the address will be sent _after_ the LSB, * but only if the LSB indicates: * a) an 11 bit address, this is LSB = 1111 0xxx. * b) a 'general call address', this is LSB = 0000 000x - see the I2C specs @@ -354,7 +354,7 @@ I2CAddress(I2CDevPtr d, I2CSlaveAddr addr) * ======================================================== */ -/* Function for probing. Just send the slave address +/* Function for probing. Just send the slave address * and return true if the device responds. The slave address * must have the lsb set to reflect a read (1) or write (0) access. * Don't expect a read- or write-only device will respond otherwise. @@ -403,7 +403,7 @@ xf86I2CProbeAddress(I2CBusPtr b, I2CSlaveAddr addr) * * The functions exits immediately when an error occures, * not proceeding any data left. However, step 3 will - * be executed anyway to leave the bus in clean idle state. + * be executed anyway to leave the bus in clean idle state. */ static Bool @@ -470,7 +470,7 @@ xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte) return xf86I2CWriteRead(d, &subaddr, 1, pbyte, 1); } -/* Read bytes from subsequent registers determined by the +/* Read bytes from subsequent registers determined by the * sub-address of the first register. */ @@ -480,7 +480,7 @@ xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte * pbyte, int n) return xf86I2CWriteRead(d, &subaddr, 1, pbyte, n); } -/* Read a word (high byte, then low byte) from one of the registers +/* Read a word (high byte, then low byte) from one of the registers * determined by its sub-address. */ @@ -511,7 +511,7 @@ xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte) return xf86I2CWriteRead(d, wb, 2, NULL, 0); } -/* Write bytes to subsequent registers determined by the +/* Write bytes to subsequent registers determined by the * sub-address of the first register. */ @@ -537,7 +537,7 @@ xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, return r; } -/* Write a word (high byte, then low byte) to one of the registers +/* Write a word (high byte, then low byte) to one of the registers * determined by its sub-address. */ @@ -553,7 +553,7 @@ xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word) return xf86I2CWriteRead(d, wb, 3, NULL, 0); } -/* Write a vector of bytes to not adjacent registers. This vector is, +/* Write a vector of bytes to not adjacent registers. This vector is, * 1st byte sub-address, 2nd byte value, 3rd byte sub-address asf. * This function is intended to initialize devices. Note this function * exits immediately when an error occurs, some registers may @@ -637,7 +637,7 @@ xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc) /* I2C transmissions are related to an I2CDevRec you must link to a * previously registered bus (see xf86I2CBusInit) before attempting * to read and write data. You may call xf86I2CProbeAddress first to - * see if the device in question is present on this bus. + * see if the device in question is present on this bus. * * xf86I2CDevInit will not allocate an I2CBusRec for you, instead you * may enter a pointer to a statically allocated I2CDevRec or the (modified) @@ -779,9 +779,9 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too) Bool xf86I2CBusInit(I2CBusPtr b) { - /* I2C buses must be identified by a unique scrnIndex - * and name. If scrnIndex is unspecified (a negative value), - * then the name must be unique throughout the server. + /* I2C buses must be identified by a unique scrnIndex + * and name. If scrnIndex is unspecified (a negative value), + * then the name must be unique throughout the server. */ if (b->BusName == NULL || xf86I2CFindBus(b->scrnIndex, b->BusName) != NULL) diff --git a/xserver/hw/xfree86/i2c/xf86i2c.h b/xserver/hw/xfree86/i2c/xf86i2c.h index 26303ff6f..7b0ccdf70 100644 --- a/xserver/hw/xfree86/i2c/xf86i2c.h +++ b/xserver/hw/xfree86/i2c/xf86i2c.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1998 Itai Nahshon, Michael Schimek */ diff --git a/xserver/hw/xfree86/int10/Makefile.in b/xserver/hw/xfree86/int10/Makefile.in index eff2531c4..dc3afb49e 100644 --- a/xserver/hw/xfree86/int10/Makefile.in +++ b/xserver/hw/xfree86/int10/Makefile.in @@ -281,6 +281,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/int10/generic.c b/xserver/hw/xfree86/int10/generic.c index abbd36f3c..8d5c4daf3 100644 --- a/xserver/hw/xfree86/int10/generic.c +++ b/xserver/hw/xfree86/int10/generic.c @@ -20,6 +20,42 @@ #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) +#include /* needed for memmove */ + +static __inline__ uint32_t +ldl_u(uint32_t * p) +{ + uint32_t ret; + + memmove(&ret, p, sizeof(*p)); + return ret; +} + +static __inline__ uint16_t +ldw_u(uint16_t * p) +{ + uint16_t ret; + + memmove(&ret, p, sizeof(*p)); + return ret; +} + +static __inline__ void +stl_u(uint32_t val, uint32_t * p) +{ + uint32_t tmp = val; + + memmove(p, &tmp, sizeof(*p)); +} + +static __inline__ void +stw_u(uint16_t val, uint16_t * p) +{ + uint16_t tmp = val; + + memmove(p, &tmp, sizeof(*p)); +} + static uint8_t read_b(xf86Int10InfoPtr pInt, int addr); static uint16_t read_w(xf86Int10InfoPtr pInt, int addr); static uint32_t read_l(xf86Int10InfoPtr pInt, int addr); @@ -63,6 +99,20 @@ static void UnmapVRam(xf86Int10InfoPtr pInt); static void *sysMem = NULL; +static Bool +readIntVec(struct pci_device *dev, unsigned char *buf, int len) +{ + void *map; + + if (pci_device_map_legacy(dev, 0, len, 0, &map)) + return FALSE; + + memcpy(buf, map, len); + pci_device_unmap_legacy(dev, map, len); + + return TRUE; +} + xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags) { @@ -108,7 +158,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) PCI_DEV_MAP_FLAG_WRITABLE, &sysMem); INTPriv(pInt)->sysMem = sysMem; - if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) { + if (!readIntVec(pInt->dev, base, LOW_PAGE_SIZE)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n"); goto error1; } diff --git a/xserver/hw/xfree86/loader/Makefile.in b/xserver/hw/xfree86/loader/Makefile.in index ba2992f5e..47c105d97 100644 --- a/xserver/hw/xfree86/loader/Makefile.in +++ b/xserver/hw/xfree86/loader/Makefile.in @@ -233,6 +233,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/loader/loader.c b/xserver/hw/xfree86/loader/loader.c index 64c69bb8a..31329846a 100644 --- a/xserver/hw/xfree86/loader/loader.c +++ b/xserver/hw/xfree86/loader/loader.c @@ -65,31 +65,12 @@ #include "loaderProcs.h" #include "xf86.h" #include "xf86Priv.h" -#include "compiler.h" #ifdef HAVE_DLFCN_H #include #include -#if defined(DL_LAZY) -#define DLOPEN_LAZY DL_LAZY -#elif defined(RTLD_LAZY) -#define DLOPEN_LAZY RTLD_LAZY -#elif defined(__FreeBSD__) -#define DLOPEN_LAZY 1 -#else -#define DLOPEN_LAZY 0 -#endif - -#if defined(LD_GLOBAL) -#define DLOPEN_GLOBAL LD_GLOBAL -#elif defined(RTLD_GLOBAL) -#define DLOPEN_GLOBAL RTLD_GLOBAL -#else -#define DLOPEN_GLOBAL 0 -#endif - #else #error i have no dynamic linker and i must scream #endif @@ -129,7 +110,7 @@ LoaderOpen(const char *module, int *errmaj, int *errmin) xf86Msg(X_INFO, "Loading %s\n", module); - if (!(ret = dlopen(module, DLOPEN_LAZY | DLOPEN_GLOBAL))) { + if (!(ret = dlopen(module, RTLD_LAZY | RTLD_GLOBAL))) { xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror()); if (errmaj) *errmaj = LDR_NOLOAD; @@ -152,7 +133,7 @@ LoaderSymbol(const char *name) return p; if (!global_scope) - global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL); + global_scope = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); if (global_scope) return dlsym(global_scope, name); diff --git a/xserver/hw/xfree86/loader/loadmod.c b/xserver/hw/xfree86/loader/loadmod.c index e1f649a74..fdf5bd8c9 100644 --- a/xserver/hw/xfree86/loader/loadmod.c +++ b/xserver/hw/xfree86/loader/loadmod.c @@ -77,12 +77,8 @@ typedef struct _pattern { static char *FindModule(const char *, const char *, const char **, PatternPtr); static Bool CheckVersion(const char *, XF86ModuleVersionInfo *, const XF86ModReqInfo *); -static void UnloadModuleOrDriver(ModuleDescPtr mod); static char *LoaderGetCanonicalName(const char *, PatternPtr); static void RemoveChild(ModuleDescPtr); -static ModuleDescPtr doLoadModule(const char *, const char *, const char **, - const char **, void *, - const XF86ModReqInfo *, int *, int *); const ModuleVersions LoaderVersionInfo = { XORG_VERSION_CURRENT, @@ -197,7 +193,6 @@ static const char *stdSubdirs[] = { "", "input/", "drivers/", - "multimedia/", "extensions/", "internal/", NULL @@ -585,7 +580,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, const XF86ModReqInfo * req) { int vercode[4]; - char verstr[4]; long ver = data->xf86version; MessageType errtype; @@ -593,42 +587,15 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, data->modname ? data->modname : "UNKNOWN!", data->vendor ? data->vendor : "UNKNOWN!"); - /* Check for the different scheme used in XFree86 4.0.x releases: - * ((((((((major << 7) | minor) << 7) | subminor) << 5) | beta) << 5) | alpha) - * Since it wasn't used in 4.1.0 or later, limit to versions in the 4.0.x - * range, which limits the overlap with the new version scheme to conflicts - * with 6.71.8.764 through 6.72.39.934. - */ - if ((ver > (4 << 24)) && (ver < ((4 << 24) + (1 << 17)))) { - /* 4.0.x and earlier */ - verstr[1] = verstr[3] = 0; - verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0; - ver >>= 5; - verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0; - ver >>= 5; - vercode[2] = ver & 0x7f; - ver >>= 7; - vercode[1] = ver & 0x7f; - ver >>= 7; - vercode[0] = ver; - xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]); - if (vercode[2] != 0) - xf86ErrorF(".%d", vercode[2]); - xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2, - data->majorversion, data->minorversion, data->patchlevel); - } - else { - vercode[0] = ver / 10000000; - vercode[1] = (ver / 100000) % 100; - vercode[2] = (ver / 1000) % 100; - vercode[3] = ver % 1000; - xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], - vercode[2]); - if (vercode[3] != 0) - xf86ErrorF(".%d", vercode[3]); - xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, - data->minorversion, data->patchlevel); - } + vercode[0] = ver / 10000000; + vercode[1] = (ver / 100000) % 100; + vercode[2] = (ver / 1000) % 100; + vercode[3] = ver % 1000; + xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]); + if (vercode[3] != 0) + xf86ErrorF(".%d", vercode[3]); + xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, + data->minorversion, data->patchlevel); if (data->moduleclass) xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass); @@ -783,8 +750,8 @@ LoadSubModule(void *_parent, const char *module, return NULL; } - submod = doLoadModule(module, NULL, subdirlist, patternlist, options, - modreq, errmaj, errmin); + submod = LoadModule(module, NULL, subdirlist, patternlist, options, + modreq, errmaj, errmin); if (submod && submod != (ModuleDescPtr) 1) { parent->child = AddSibling(parent->child, submod); submod->parent = parent; @@ -847,10 +814,47 @@ static const char *compiled_in_modules[] = { NULL }; -static ModuleDescPtr -doLoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, void *options, - const XF86ModReqInfo * modreq, int *errmaj, int *errmin) +/* + * LoadModule: load a module + * + * module The module name. Normally this is not a filename but the + * module's "canonical name. A full pathname is, however, + * also accepted. + * path A comma separated list of module directories. + * subdirlist A NULL terminated list of subdirectories to search. When + * NULL, the default "stdSubdirs" list is used. The default + * list is also substituted for entries with value DEFAULT_LIST. + * patternlist A NULL terminated list of regular expressions used to find + * module filenames. Each regex should contain exactly one + * subexpression that corresponds to the canonical module name. + * When NULL, the default "stdPatterns" list is used. The + * default list is also substituted for entries with value + * DEFAULT_LIST. + * options A NULL terminated list of Options that are passed to the + * module's SetupProc function. + * modreq An optional XF86ModReqInfo* containing + * version/ABI/vendor-ABI requirements to check for when + * loading the module. The following fields of the + * XF86ModReqInfo struct are checked: + * majorversion - must match the module's majorversion exactly + * minorversion - the module's minorversion must be >= this + * patchlevel - the module's minorversion.patchlevel must be + * >= this. Patchlevel is ignored when + * minorversion is not set. + * abiclass - (string) must match the module's abiclass + * abiversion - must be consistent with the module's + * abiversion (major equal, minor no older) + * moduleclass - string must match the module's moduleclass + * string + * "don't care" values are ~0 for numbers, and NULL for strings + * errmaj Major error return. + * errmin Minor error return. + * + */ +ModuleDescPtr +LoadModule(const char *module, const char *path, const char **subdirlist, + const char **patternlist, void *options, + const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { XF86ModuleData *initdata = NULL; char **pathlist = NULL; @@ -914,7 +918,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, goto LoadModule_fail; } - /* + /* * if the module name is not a full pathname, we need to * check the elements in the path */ @@ -934,7 +938,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, } } - /* + /* * did we find the module? */ if (!found) { @@ -1038,61 +1042,11 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, return ret; } -/* - * LoadModule: load a module - * - * module The module name. Normally this is not a filename but the - * module's "canonical name. A full pathname is, however, - * also accepted. - * path A comma separated list of module directories. - * subdirlist A NULL terminated list of subdirectories to search. When - * NULL, the default "stdSubdirs" list is used. The default - * list is also substituted for entries with value DEFAULT_LIST. - * patternlist A NULL terminated list of regular expressions used to find - * module filenames. Each regex should contain exactly one - * subexpression that corresponds to the canonical module name. - * When NULL, the default "stdPatterns" list is used. The - * default list is also substituted for entries with value - * DEFAULT_LIST. - * options A NULL terminated list of Options that are passed to the - * module's SetupProc function. - * modreq An optional XF86ModReqInfo* containing - * version/ABI/vendor-ABI requirements to check for when - * loading the module. The following fields of the - * XF86ModReqInfo struct are checked: - * majorversion - must match the module's majorversion exactly - * minorversion - the module's minorversion must be >= this - * patchlevel - the module's minorversion.patchlevel must be - * >= this. Patchlevel is ignored when - * minorversion is not set. - * abiclass - (string) must match the module's abiclass - * abiversion - must be consistent with the module's - * abiversion (major equal, minor no older) - * moduleclass - string must match the module's moduleclass - * string - * "don't care" values are ~0 for numbers, and NULL for strings - * errmaj Major error return. - * errmin Minor error return. - * - */ -ModuleDescPtr -LoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, void *options, - const XF86ModReqInfo * modreq, int *errmaj, int *errmin) -{ - return doLoadModule(module, path, subdirlist, patternlist, options, - modreq, errmaj, errmin); -} - void -UnloadModule(void *mod) +UnloadModule(void *_mod) { - UnloadModuleOrDriver((ModuleDescPtr) mod); -} + ModuleDescPtr mod = _mod; -static void -UnloadModuleOrDriver(ModuleDescPtr mod) -{ if (mod == (ModuleDescPtr) 1) return; @@ -1112,9 +1066,9 @@ UnloadModuleOrDriver(ModuleDescPtr mod) } if (mod->child) - UnloadModuleOrDriver(mod->child); + UnloadModule(mod->child); if (mod->sib) - UnloadModuleOrDriver(mod->sib); + UnloadModule(mod->sib); free(mod->path); free(mod->name); free(mod); @@ -1129,7 +1083,7 @@ UnloadSubModule(void *_mod) if (mod == (ModuleDescPtr) 1) return; RemoveChild(mod); - UnloadModuleOrDriver(mod); + UnloadModule(mod); } static void diff --git a/xserver/hw/xfree86/man/Makefile.in b/xserver/hw/xfree86/man/Makefile.in index 312361398..2816ca943 100644 --- a/xserver/hw/xfree86/man/Makefile.in +++ b/xserver/hw/xfree86/man/Makefile.in @@ -233,6 +233,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/man/Xorg.wrap.man b/xserver/hw/xfree86/man/Xorg.wrap.man index 58937c74b..11090f1f4 100644 --- a/xserver/hw/xfree86/man/Xorg.wrap.man +++ b/xserver/hw/xfree86/man/Xorg.wrap.man @@ -33,7 +33,7 @@ Xorg.wrap \- Xorg X server binary wrapper The Xorg X server may need root rights to function properly. To start the Xorg X server with these rights your system is using a suid root wrapper installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real -X server which is installed as __suid_wrapper_dir__/Xorg.bin . +X server which is installed as __suid_wrapper_dir__/Xorg. .PP By default Xorg.wrap will autodetect if root rights are necessary, and if not it will drop its elevated rights before starting the real X server. diff --git a/xserver/hw/xfree86/man/xorg.conf.man b/xserver/hw/xfree86/man/xorg.conf.man index bc33df197..d26c3cc4d 100644 --- a/xserver/hw/xfree86/man/xorg.conf.man +++ b/xserver/hw/xfree86/man/xorg.conf.man @@ -132,14 +132,14 @@ is the path specified with the .B \-configdir command line option (which may be absolute or relative). .PP -Finally, configuration files will also be searched for in directories -reserved for system use. These are to separate configuration files from -the vendor or 3rd party packages from those of local administration. -These files are found in the following directories: +Finally, configuration files will also be searched for in a directory reserved +for system use. +This is to separate configuration files from the vendor or 3rd party packages +from those of local administration. +These files are found in the following directory: .PP .RS 4 .nf -.I /usr/share/X11/__xconfigdir__ .I __datadir__/X11/__xconfigdir__ .fi .RE @@ -1449,12 +1449,6 @@ This optional entry specifies the chip revision number. This can be used to override the auto-detection, but that should only be done when the driver-specific documentation recommends it. .TP 7 -.BI "TextClockFreq " "freq" -This optional entry specifies the pixel clock frequency that is used -for the regular text mode. -The frequency is specified in MHz. -This is rarely used. -.TP 7 .BI "MatchSeat " "seat\-id" Only apply this .B Device @@ -2023,12 +2017,6 @@ Default: false. Disables the Int10 module, a module that uses the int10 call to the BIOS of the graphics card to initialize it. Default: false. -.TP 7 -.BI "Option \*qNoMTRR\*q" -Disables MTRR (Memory Type Range Register) support, a feature of modern -processors which can improve video performance by a factor of up to 2.5. -Some hardware has buggy MTRR support, and some video drivers have been -known to exhibit problems when MTRR's are used. .PP Each .B Screen diff --git a/xserver/hw/xfree86/modes/Makefile.am b/xserver/hw/xfree86/modes/Makefile.am index 220643f7b..6eb162a89 100644 --- a/xserver/hw/xfree86/modes/Makefile.am +++ b/xserver/hw/xfree86/modes/Makefile.am @@ -10,7 +10,6 @@ libxf86modes_la_SOURCES = \ xf86Cursors.c \ xf86cvt.c \ xf86gtf.c \ - xf86DisplayIDModes.c \ xf86EdidModes.c \ xf86Modes.c \ xf86Modes.h \ diff --git a/xserver/hw/xfree86/modes/Makefile.in b/xserver/hw/xfree86/modes/Makefile.in index ffca81526..42ea6d2ee 100644 --- a/xserver/hw/xfree86/modes/Makefile.in +++ b/xserver/hw/xfree86/modes/Makefile.in @@ -76,13 +76,12 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libxf86modes_la_LIBADD = am__libxf86modes_la_SOURCES_DIST = xf86Crtc.c xf86Crtc.h xf86Cursors.c \ - xf86cvt.c xf86gtf.c xf86DisplayIDModes.c xf86EdidModes.c \ - xf86Modes.c xf86Modes.h xf86RandR12.c xf86RandR12.h \ - xf86Rotate.c xf86DiDGA.c + xf86cvt.c xf86gtf.c xf86EdidModes.c xf86Modes.c xf86Modes.h \ + xf86RandR12.c xf86RandR12.h xf86Rotate.c xf86DiDGA.c @DGA_TRUE@am__objects_1 = xf86DiDGA.lo am_libxf86modes_la_OBJECTS = xf86Crtc.lo xf86Cursors.lo xf86cvt.lo \ - xf86gtf.lo xf86DisplayIDModes.lo xf86EdidModes.lo xf86Modes.lo \ - xf86RandR12.lo xf86Rotate.lo $(am__objects_1) + xf86gtf.lo xf86EdidModes.lo xf86Modes.lo xf86RandR12.lo \ + xf86Rotate.lo $(am__objects_1) libxf86modes_la_OBJECTS = $(am_libxf86modes_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -269,6 +268,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -514,7 +514,6 @@ libxf86modes_la_SOURCES = \ xf86Cursors.c \ xf86cvt.c \ xf86gtf.c \ - xf86DisplayIDModes.c \ xf86EdidModes.c \ xf86Modes.c \ xf86Modes.h \ @@ -592,7 +591,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Crtc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DiDGA.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DisplayIDModes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86EdidModes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Modes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RandR12.Plo@am__quote@ diff --git a/xserver/hw/xfree86/modes/xf86Crtc.c b/xserver/hw/xfree86/modes/xf86Crtc.c index 87ba0b74e..9d592a7eb 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.c +++ b/xserver/hw/xfree86/modes/xf86Crtc.c @@ -1072,7 +1072,7 @@ xf86DefaultScreenLimits(ScrnInfoPtr scrn, int *widthp, int *heightp, #define POSITION_UNSET -100000 /* - * check if the user configured any outputs at all + * check if the user configured any outputs at all * with either a position or a relative setting or a mode. */ static Bool @@ -1736,7 +1736,7 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY) xf86ValidateModesReducedBlanking(scrn, default_modes); if (sync_source == sync_config) { - /* + /* * Check output and config modes against sync range from config file */ xf86ValidateModesSync(scrn, output_modes, &mon_rec); diff --git a/xserver/hw/xfree86/modes/xf86Crtc.h b/xserver/hw/xfree86/modes/xf86Crtc.h index eebe6f472..54b6e5cd7 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.h +++ b/xserver/hw/xfree86/modes/xf86Crtc.h @@ -242,7 +242,7 @@ struct _xf86Crtc { /** * Desired state of this CRTC * - * Set when this CRTC should be driving one or more outputs + * Set when this CRTC should be driving one or more outputs */ Bool enabled; @@ -304,7 +304,7 @@ struct _xf86Crtc { */ Bool cursor_argb; /** - * Track whether cursor is within CRTC range + * Track whether cursor is within CRTC range */ Bool cursor_in_range; /** @@ -608,7 +608,7 @@ struct _xf86Output { #else void *randr_output; #endif - /** + /** * Desired initial panning * Added in ABI version 2 */ @@ -732,6 +732,8 @@ xf86CompatOutput(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + if (config->compat_output < 0) + return NULL; return config->output[config->compat_output]; } @@ -922,7 +924,7 @@ extern _X_EXPORT void xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen); /* - * Get a standard string name for a connector type + * Get a standard string name for a connector type */ extern _X_EXPORT const char *xf86ConnectorGetName(xf86ConnectorType connector); @@ -947,7 +949,7 @@ extern _X_EXPORT Bool * Called when anything on the screen is reconfigured. * * Reloads cursor images as needed, then adjusts cursor positions. - * + * * Driver should call this from crtc commit function. */ extern _X_EXPORT void diff --git a/xserver/hw/xfree86/modes/xf86DisplayIDModes.c b/xserver/hw/xfree86/modes/xf86DisplayIDModes.c deleted file mode 100644 index c2e771894..000000000 --- a/xserver/hw/xfree86/modes/xf86DisplayIDModes.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright 2009 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * them 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 MERCHANTIBILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: - * Adam Jackson - */ - -#include "xorg-config.h" -#include "xf86.h" -#include "xf86Modes.h" -#include "xf86str.h" -#include "edid.h" -#include "xf86DDC.h" - -typedef void (*did_proc) (int scrnIndex, unsigned char *data, void *closure); - -#define DID_PRODUCT_ID 0x00 -#define DID_DISPLAY_PARAMETERS 0x01 -#define DID_COLOR_INFO 0x02 -#define DID_TIMING_1_DETAILED 0x03 -#define DID_TIMING_2_DETAILED 0x04 -#define DID_TIMING_3_SHORT 0x05 -#define DID_TIMING_4_DMT 0x06 -#define DID_TIMING_VESA 0x07 -#define DID_TIMING_CEA 0x08 -#define DID_TIMING_RANGE_LIMITS 0x09 -#define DID_PRODUCT_SERIAL 0x0A -#define DID_ASCII_STRING 0x0B -#define DID_DISPLAY_DEVICE 0x0C -#define DID_POWER_SEQUENCING 0x0D -#define DID_TRANSFER_INFO 0x0E -#define DID_DISPLAY_INTERFACE 0x0F -#define DID_STEREO 0x10 -#define DID_VENDOR 0x7F - -#define extract_le16(x, i) ((x[i+1] << 8) + (x[i])) -#define extract_le24(x, i) ((x[i+2] << 16) + (x[i+1] << 8) + (x[i])) - -static DisplayModePtr -modeCalloc(void) -{ - return calloc(1, sizeof(DisplayModeRec)); -} - -/* - * How awesome is it to have two detailed timing formats, neither of which - * are compatible with the format in EDID? So awesome. - */ - -static void -didDetailedTiming1(int i, unsigned char *x, MonPtr mon) -{ - DisplayModePtr m = modeCalloc(); - - if (!m) - return; - - m->Clock = extract_le24(x, 0); - - m->HDisplay = extract_le16(x, 4); - m->HSyncStart = m->HDisplay + (extract_le16(x, 8) & 0x7f); - m->HSyncEnd = m->HSyncStart + extract_le16(x, 10); - m->HTotal = m->HDisplay + extract_le16(x, 6); - m->Flags |= (x[9] & 0x80) ? V_PHSYNC : V_NHSYNC; - - m->VDisplay = extract_le16(x, 12); - m->VSyncStart = m->VDisplay + (extract_le16(x, 16) & 0x7f); - m->VSyncEnd = m->VSyncStart + extract_le16(x, 18); - m->VTotal = m->VDisplay + extract_le16(x, 14); - m->Flags |= (x[17] & 0x80) ? V_PVSYNC : V_NVSYNC; - - m->type = M_T_DRIVER; - if (x[3] & 0x80) - m->type |= M_T_PREFERRED; - - /* XXX double check handling of this */ - if (x[3] & 0x10) - m->Flags |= V_INTERLACE; - - mon->Modes = xf86ModesAdd(mon->Modes, m); -} - -/* XXX no sync bits. what to do? */ -static void -didDetailedTiming2(int i, unsigned char *x, MonPtr mon) -{ - DisplayModePtr mode = modeCalloc(); - - if (!mode) - return; - - mode->Clock = extract_le24(x, 0); - - /* horiz sizes are in character cells, not pixels, hence * 8 */ - mode->HDisplay = ((extract_le16(x, 4) & 0x01ff) + 1) * 8; - mode->HSyncStart = mode->HDisplay + (((x[6] & 0xf0) >> 4) + 1) * 8; - mode->HSyncEnd = mode->HSyncStart + ((x[6] & 0x0f) + 1) * 8; - mode->HTotal = mode->HDisplay + ((x[5] >> 1) + 1) * 8; - - mode->VDisplay = extract_le16(x, 7) & 0x07ff; - mode->VSyncStart = mode->VDisplay + (x[10] >> 4) + 1; - mode->VSyncEnd = mode->VSyncStart + (x[10] & 0x0f) + 1; - mode->VTotal = mode->VDisplay + x[9]; - - mode->status = M_T_DRIVER; - if (x[3] & 0x80) - mode->status |= M_T_PREFERRED; - - /* XXX double check handling of this */ - if (x[3] & 0x10) - mode->Flags |= V_INTERLACE; - - mon->Modes = xf86ModesAdd(mon->Modes, mode); -} - -static void -didShortTiming(int i, unsigned char *x, MonPtr mon) -{ - DisplayModePtr m; - int w, h, r; - - w = (x[1] + 1) * 8; - switch (x[0] & 0x0f) { - case 0: - h = w; - break; - case 1: - h = (w * 4) / 5; - break; - case 2: - h = (w * 3) / 4; - break; - case 3: - h = (w * 9) / 15; - break; - case 4: - h = (w * 9) / 16; - break; - case 5: - h = (w * 10) / 16; - break; - default: - return; - } - r = (x[2] & 0x7f) + 1; - - m = xf86CVTMode(w, h, r, ! !(x[0] & 0x10), ! !(x[2] & 0x80)); - - m->type = M_T_DRIVER; - if (x[0] & 0x80) - m->type |= M_T_PREFERRED; - - mon->Modes = xf86ModesAdd(mon->Modes, m); -} - -static void -didDMTTiming(int i, unsigned char *x, void *closure) -{ - MonPtr mon = closure; - - mon->Modes = xf86ModesAdd(mon->Modes, xf86DuplicateMode(DMTModes + *x)); -} - -#define RB 1 -#define INT 2 -static const struct did_dmt { - short w, h, r, f; -} did_dmt[] = { - /* byte 3 */ - {640, 350, 85, 0}, - {640, 400, 85, 0}, - {720, 400, 85, 0}, - {640, 480, 60, 0}, - {640, 480, 72, 0}, - {640, 480, 75, 0}, - {640, 480, 85, 0}, - {800, 600, 56, 0}, - /* byte 4 */ - {800, 600, 60, 0}, - {800, 600, 72, 0}, - {800, 600, 75, 0}, - {800, 600, 85, 0}, - {800, 600, 120, RB}, - {848, 480, 60, 0}, - {1024, 768, 43, INT}, - {1024, 768, 60, 0}, - /* byte 5 */ - {1024, 768, 70, 0}, - {1024, 768, 75, 0}, - {1024, 768, 85, 0}, - {1024, 768, 120, RB}, - {1152, 864, 75, 0}, - {1280, 768, 60, RB}, - {1280, 768, 60, 0}, - {1280, 768, 75, 0}, - /* byte 6 */ - {1280, 768, 85, 0}, - {1280, 768, 120, RB}, - {1280, 800, 60, RB}, - {1280, 800, 60, 0}, - {1280, 800, 75, 0}, - {1280, 800, 85, 0}, - {1280, 800, 120, RB}, - {1280, 960, 60, 0}, - /* byte 7 */ - {1280, 960, 85, 0}, - {1280, 960, 120, RB}, - {1280, 1024, 60, 0}, - {1280, 1024, 75, 0}, - {1280, 1024, 85, 0}, - {1280, 1024, 120, RB}, - {1360, 768, 60, 0}, - {1360, 768, 120, RB}, - /* byte 8 */ - {1400, 1050, 60, RB}, - {1400, 1050, 60, 0}, - {1400, 1050, 75, 0}, - {1400, 1050, 85, 0}, - {1400, 1050, 120, RB}, - {1440, 900, 60, RB}, - {1440, 900, 60, 0}, - {1440, 900, 75, 0}, - /* byte 9 */ - {1440, 900, 85, 0}, - {1440, 900, 120, RB}, - {1600, 1200, 60, 0}, - {1600, 1200, 65, 0}, - {1600, 1200, 70, 0}, - {1600, 1200, 75, 0}, - {1600, 1200, 85, 0}, - {1600, 1200, 120, RB}, - /* byte a */ - {1680, 1050, 60, RB}, - {1680, 1050, 60, 0}, - {1680, 1050, 75, 0}, - {1680, 1050, 85, 0}, - {1680, 1050, 120, RB}, - {1792, 1344, 60, 0}, - {1792, 1344, 75, 0}, - {1792, 1344, 120, RB}, - /* byte b */ - {1856, 1392, 60, 0}, - {1856, 1392, 75, 0}, - {1856, 1392, 120, RB}, - {1920, 1200, 60, RB}, - {1920, 1200, 60, 0}, - {1920, 1200, 75, 0}, - {1920, 1200, 85, 0}, - {1920, 1200, 120, RB}, - /* byte c */ - {1920, 1440, 60, 0}, - {1920, 1440, 75, 0}, - {1920, 1440, 120, RB}, - {2560, 1600, 60, RB}, - {2560, 1600, 60, 0}, - {2560, 1600, 75, 0}, - {2560, 1600, 85, 0}, - {2560, 1600, 120, RB}, -}; - -static void -didVesaTiming(int scrn, unsigned char *x, MonPtr mon) -{ - int i, j; - - x += 3; - - for (i = 0; i < 10; i++) - for (j = 0; j < 8; j++) - if (x[i] & (1 << j)) { - const struct did_dmt *d = &(did_dmt[i * 8 + j]); - - if (d->f == INT) - continue; - mon->Modes = xf86ModesAdd(mon->Modes, - FindDMTMode(d->w, d->h, d->r, - d->f == RB)); - } - -} - -static void -handleDisplayIDBlock(int scrnIndex, unsigned char *x, void *closure) -{ - MonPtr mon = closure; - - switch (x[0]) { - case DID_DISPLAY_PARAMETERS: - /* w/h are in decimillimeters */ - mon->widthmm = (extract_le16(x, 3) + 5) / 10; - mon->heightmm = (extract_le16(x, 5) + 5) / 10; - /* XXX pixel count, feature flags, gamma, aspect, color depth */ - break; - - case DID_TIMING_RANGE_LIMITS: - { - int n; - - mon->maxPixClock = max(mon->maxPixClock, extract_le24(x, 6) * 10); - - n = mon->nHsync++; - if (n < MAX_HSYNC) { - mon->hsync[n].lo = x[9]; - mon->hsync[n].hi = x[10]; - } - else { - n = MAX_HSYNC; - } - n = mon->nVrefresh++; - if (n < MAX_VREFRESH) { - mon->vrefresh[n].lo = x[13]; - mon->vrefresh[n].hi = x[14]; - } - else { - n = MAX_VREFRESH; - } - break; - } - - case DID_TIMING_1_DETAILED: - { - int i; - - for (i = 0; i < x[2]; i += 20) - didDetailedTiming1(scrnIndex, x + i + 3, mon); - break; - } - - case DID_TIMING_2_DETAILED: - { - int i; - - for (i = 0; i < x[2]; i += 11) - didDetailedTiming2(scrnIndex, x + i + 3, mon); - break; - } - - case DID_TIMING_3_SHORT: - { - int i; - - for (i = 0; i < x[2]; i += 3) - didShortTiming(scrnIndex, x + i + 3, mon); - break; - } - - case DID_TIMING_4_DMT: - { - int i; - - for (i = 0; i < x[2]; i++) - didDMTTiming(scrnIndex, x + i + 3, mon); - break; - } - - case DID_TIMING_VESA: - didVesaTiming(scrnIndex, x, mon); - break; - - /* XXX pixel format, ar, orientation, subpixel, dot pitch, bit depth */ - case DID_DISPLAY_DEVICE: - - /* XXX interface, links, color encoding, ss, drm */ - case DID_DISPLAY_INTERFACE: - - /* XXX stereo */ - case DID_STEREO: - - /* nothing interesting in these */ - case DID_COLOR_INFO: - case DID_PRODUCT_SERIAL: - case DID_ASCII_STRING: - case DID_POWER_SEQUENCING: - case DID_TRANSFER_INFO: - case DID_VENDOR: - break; - - /* warn about anything else */ - default: - xf86DrvMsg(scrnIndex, X_WARNING, - "Unknown DisplayID block type %hx\n", x[0]); - break; - } -} - -static void -forEachDisplayIDBlock(int scrnIndex, unsigned char *did, did_proc proc, - void *closure) -{ - int num_extensions = did[3]; - int section_size = did[1]; - unsigned char *block; - - do { - if ((did[0] & 0xf0) != 0x10) /* not 1.x, abort */ - return; - /* XXX also, checksum */ - - block = did + 4; - - while (section_size > 0) { - int block_size = (block[2] + 2); - - proc(scrnIndex, block, closure); - - section_size -= block_size; - block += block_size; - } - - did += (did[1] + 5); - } while (num_extensions--); -} - -/* - * Fill out MonPtr with xf86MonPtr information. - */ -void -xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC) -{ - if (!mon || !DDC) - return; - - mon->DDC = DDC; - - forEachDisplayIDBlock(scrnIndex, DDC->rawData, handleDisplayIDBlock, mon); -} diff --git a/xserver/hw/xfree86/modes/xf86RandR12.c b/xserver/hw/xfree86/modes/xf86RandR12.c index 4075f6c49..3e4d7011b 100644 --- a/xserver/hw/xfree86/modes/xf86RandR12.c +++ b/xserver/hw/xfree86/modes/xf86RandR12.c @@ -1073,7 +1073,7 @@ xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc) randr_output = output->randr_output; randr_outputs[numOutputs++] = randr_output; /* - * We make copies of modes, so pointer equality + * We make copies of modes, so pointer equality * isn't sufficient */ for (j = 0; j < randr_output->numModes + randr_output->numUserModes; @@ -1891,7 +1891,7 @@ xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - + if (config->randr_provider == provider) { if (config->randr_provider->offload_sink) { DetachOffloadGPU(screen); diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c index 0ddd8408e..9c00a443f 100644 --- a/xserver/hw/xfree86/modes/xf86Rotate.c +++ b/xserver/hw/xfree86/modes/xf86Rotate.c @@ -35,7 +35,6 @@ #include "xf86.h" #include "xf86DDC.h" -#include "fb.h" #include "windowstr.h" #include "xf86Crtc.h" #include "xf86Modes.h" @@ -234,12 +233,22 @@ xf86RotateBlockHandler(ScreenPtr pScreen, ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86RotateRedisplay(pScreen); + /* Unwrap before redisplay in case the software + * cursor layer wants to add its block handler to the + * chain + */ pScreen->BlockHandler = xf86_config->BlockHandler; + + xf86RotateRedisplay(pScreen); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); - /* cannot avoid re-wrapping until all wrapping is audited */ - xf86_config->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = xf86RotateBlockHandler; + + /* Re-wrap if we still need this hook */ + if (xf86_config->rotation_damage != NULL) { + xf86_config->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = xf86RotateBlockHandler; + } else + xf86_config->BlockHandler = NULL; } void @@ -300,6 +309,8 @@ xf86RotateCloseScreen(ScreenPtr screen) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; + /* This has already been destroyed when the root window was destroyed */ + xf86_config->rotation_damage = NULL; for (c = 0; c < xf86_config->num_crtc; c++) xf86RotateDestroy(xf86_config->crtc[c]); } diff --git a/xserver/hw/xfree86/modes/xf86cvt.c b/xserver/hw/xfree86/modes/xf86cvt.c index 8b7bb8b03..b6c1bc81c 100644 --- a/xserver/hw/xfree86/modes/xf86cvt.c +++ b/xserver/hw/xfree86/modes/xf86cvt.c @@ -54,7 +54,7 @@ * likely though). * * About margins; i'm sure that they are to be the bit between HDisplay and - * HBlankStart, HBlankEnd and HTotal, VDisplay and VBlankStart, VBlankEnd and + * HBlankStart, HBlankEnd and HTotal, VDisplay and VBlankStart, VBlankEnd and * VTotal, where the overscan colour is shown. FB seems to call _all_ blanking * outside sync "margin" for some reason. Since we prefer seeing proper * blanking instead of the overscan colour, and since the Crtc* values will @@ -154,7 +154,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, if (!Reduced) { /* simplified GTF calculation */ - /* 4) Minimum time of vertical sync + back porch interval (µs) + /* 4) Minimum time of vertical sync + back porch interval (µs) * default 550.0 */ #define CVT_MIN_VSYNC_BP 550.0 diff --git a/xserver/hw/xfree86/modes/xf86gtf.c b/xserver/hw/xfree86/modes/xf86gtf.c index 0a8078415..17c2f3255 100644 --- a/xserver/hw/xfree86/modes/xf86gtf.c +++ b/xserver/hw/xfree86/modes/xf86gtf.c @@ -5,11 +5,11 @@ * * Copyright (c) 2001, Andy Ritger aritger@nvidia.com * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * o Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * o Redistributions in binary form must reproduce the above copyright @@ -50,7 +50,7 @@ * of suitability for any purpose. The sample code contained within * this standard may be used without restriction. * - * + * * * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive) * implementation of the GTF Timing Standard, is available at: @@ -147,7 +147,7 @@ xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins) * by the calculation must be halved, as the computation calculates * the number of vertical lines per field. In either case, the * number of lines is rounded to the nearest integer. - * + * * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0), * ROUND([V LINES],0)) */ @@ -183,7 +183,7 @@ xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins) margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0); /* 6. If interlace is required, then set variable [INTERLACE]=0.5: - * + * * [INTERLACE]=(IF([INT RQD?]="y",0.5,0)) */ diff --git a/xserver/hw/xfree86/os-support/Makefile.in b/xserver/hw/xfree86/os-support/Makefile.in index bb0ca4840..1841c625c 100644 --- a/xserver/hw/xfree86/os-support/Makefile.in +++ b/xserver/hw/xfree86/os-support/Makefile.in @@ -297,6 +297,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.am b/xserver/hw/xfree86/os-support/bsd/Makefile.am index 9c5d86da7..bf2960072 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.am +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.am @@ -27,9 +27,7 @@ if ALPHA_VIDEO # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. ARCH_SOURCES = \ alpha_video.c \ - bsd_ev56.c \ - bsd_axp.c \ - $(srcdir)/../shared/xf86Axp.c + bsd_ev56.c endif if ARM_VIDEO diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.in b/xserver/hw/xfree86/os-support/bsd/Makefile.in index 4d956c0a4..10279dd04 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.in +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.in @@ -77,11 +77,10 @@ libbsd_la_LIBADD = am__libbsd_la_SOURCES_DIST = $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c bsd_init.c bsd_bell.c alpha_video.c bsd_ev56.c \ - bsd_axp.c $(srcdir)/../shared/xf86Axp.c arm_video.c \ - $(srcdir)/../shared/ioperm_noop.c hppa_video.c i386_video.c \ - luna88k_video.c ppc_video.c sgi_video.c sparc64_video.c \ - bsd_sbus.c $(srcdir)/../shared/agp_noop.c bsd_agp.c \ - $(srcdir)/../shared/pm_noop.c $(srcdir)/bsd_apm.c \ + arm_video.c $(srcdir)/../shared/ioperm_noop.c hppa_video.c \ + i386_video.c luna88k_video.c ppc_video.c sgi_video.c \ + sparc64_video.c bsd_sbus.c $(srcdir)/../shared/agp_noop.c \ + bsd_agp.c $(srcdir)/../shared/pm_noop.c $(srcdir)/bsd_apm.c \ $(srcdir)/bsd_kqueue_apm.c $(srcdir)/../shared/kmod_noop.c \ bsd_kmod.c @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@HPPA_VIDEO_FALSE@@I386_VIDEO_FALSE@@LUNA88K_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SGI_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@am__objects_1 = sparc64_video.lo \ @@ -98,8 +97,7 @@ am__libbsd_la_SOURCES_DIST = $(srcdir)/../shared/posix_tty.c \ @ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@HPPA_VIDEO_TRUE@ ioperm_noop.lo @ALPHA_VIDEO_FALSE@@ARM_VIDEO_TRUE@am__objects_1 = arm_video.lo \ @ALPHA_VIDEO_FALSE@@ARM_VIDEO_TRUE@ ioperm_noop.lo -@ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo bsd_ev56.lo \ -@ALPHA_VIDEO_TRUE@ bsd_axp.lo xf86Axp.lo +@ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo bsd_ev56.lo @AGP_FALSE@am__objects_2 = agp_noop.lo @AGP_TRUE@am__objects_2 = bsd_agp.lo @BSD_APM_FALSE@@BSD_KQUEUE_APM_FALSE@am__objects_3 = pm_noop.lo @@ -267,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -518,9 +517,7 @@ noinst_LTLIBRARIES = libbsd.la # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. @ALPHA_VIDEO_TRUE@ARCH_SOURCES = \ @ALPHA_VIDEO_TRUE@ alpha_video.c \ -@ALPHA_VIDEO_TRUE@ bsd_ev56.c \ -@ALPHA_VIDEO_TRUE@ bsd_axp.c \ -@ALPHA_VIDEO_TRUE@ $(srcdir)/../shared/xf86Axp.c +@ALPHA_VIDEO_TRUE@ bsd_ev56.c @ARM_VIDEO_TRUE@ARCH_SOURCES = arm_video.c \ @ARM_VIDEO_TRUE@ $(srcdir)/../shared/ioperm_noop.c @@ -629,7 +626,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_VTsw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_apm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_axp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_init.Plo@am__quote@ @@ -648,7 +644,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc64_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Axp.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -692,13 +687,6 @@ vidmem.lo: $(srcdir)/../shared/vidmem.c @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) $(AM_CFLAGS) $(CFLAGS) -c -o vidmem.lo `test -f '$(srcdir)/../shared/vidmem.c' || echo '$(srcdir)/'`$(srcdir)/../shared/vidmem.c -xf86Axp.lo: $(srcdir)/../shared/xf86Axp.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) $(AM_CFLAGS) $(CFLAGS) -MT xf86Axp.lo -MD -MP -MF $(DEPDIR)/xf86Axp.Tpo -c -o xf86Axp.lo `test -f '$(srcdir)/../shared/xf86Axp.c' || echo '$(srcdir)/'`$(srcdir)/../shared/xf86Axp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xf86Axp.Tpo $(DEPDIR)/xf86Axp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/xf86Axp.c' object='xf86Axp.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) $(AM_CFLAGS) $(CFLAGS) -c -o xf86Axp.lo `test -f '$(srcdir)/../shared/xf86Axp.c' || echo '$(srcdir)/'`$(srcdir)/../shared/xf86Axp.c - ioperm_noop.lo: $(srcdir)/../shared/ioperm_noop.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) $(AM_CFLAGS) $(CFLAGS) -MT ioperm_noop.lo -MD -MP -MF $(DEPDIR)/ioperm_noop.Tpo -c -o ioperm_noop.lo `test -f '$(srcdir)/../shared/ioperm_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/ioperm_noop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ioperm_noop.Tpo $(DEPDIR)/ioperm_noop.Plo diff --git a/xserver/hw/xfree86/os-support/bsd/alpha_video.c b/xserver/hw/xfree86/os-support/bsd/alpha_video.c index b1359dcfb..8bf779d69 100644 --- a/xserver/hw/xfree86/os-support/bsd/alpha_video.c +++ b/xserver/hw/xfree86/os-support/bsd/alpha_video.c @@ -6,19 +6,19 @@ * 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 names of Rich Murphey and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Rich Murphey and David Wexelblat + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and - * David Wexelblat make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * David Wexelblat make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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 + * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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. * */ @@ -50,69 +50,9 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -axpDevice bsdGetAXP(void); - #ifndef __NetBSD__ extern unsigned long dense_base(void); - -static int axpSystem = -1; -static unsigned long hae_thresh; -static unsigned long hae_mask; - -static unsigned long -memory_base(void) -{ - static unsigned long base = 0; - - if (base == 0) { - size_t len = sizeof(base); - int error; - -#ifdef __OpenBSD__ - int mib[3]; - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CHIPSET; - mib[2] = CPU_CHIPSET_MEM; - - if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0) -#else - if ((error = sysctlbyname("hw.chipset.memory", &base, &len, 0, 0)) < 0) -#endif - FatalError("xf86MapVidMem: can't find memory\n"); - } - - return base; -} - -static int -has_bwx(void) -{ - static int bwx = 0; - size_t len = sizeof(bwx); - int error; - -#ifdef __OpenBSD__ - int mib[3]; - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CHIPSET; - mib[2] = CPU_CHIPSET_BWX; - - if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0) - return FALSE; - else - return bwx; -#else - if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0) - return FALSE; - else - return bwx; -#endif -} #else /* __NetBSD__ */ -static unsigned long hae_thresh = (1UL << 24); -static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */ static struct alpha_bus_window *abw; static int abw_count = -1; @@ -126,16 +66,6 @@ init_abw(void) } } -static int -has_bwx(void) -{ - if (abw_count < 0) - init_abw(); - - xf86Msg(X_INFO, "has_bwx = %d\n", abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */ - return abw[0].abw_abst.abst_flags & ABST_BWX; -} - static unsigned long dense_base(void) { @@ -178,18 +108,12 @@ memory_base(void) "\trefer to xf86(4) for details" #endif -static Bool useDevMem = FALSE; static int devMemFd = -1; #ifdef HAS_APERTURE_DRV #define DEV_APERTURE "/dev/xf86" #endif -static void *mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, void *, unsigned long); -static void *mapVidMemSparse(int, unsigned long, unsigned long, int); -static void unmapVidMemSparse(int, void *, unsigned long); - /* * Check if /dev/mem can be mmap'd. If it can't print a warning when * "warn" is TRUE. @@ -215,7 +139,6 @@ checkDevMem(Bool warn) if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; - useDevMem = TRUE; xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", DEV_APERTURE); return; @@ -236,7 +159,6 @@ checkDevMem(Bool warn) if (base != MAP_FAILED) { munmap((caddr_t) base, 4096); devMemFd = fd; - useDevMem = TRUE; return; } else { @@ -262,7 +184,6 @@ checkDevMem(Bool warn) #endif xf86ErrorF("\tlinear framebuffer access unavailable\n"); } - useDevMem = FALSE; return; } @@ -418,20 +339,9 @@ xf86DisableIO() #endif /* USE_ALPHA_PIO */ -#define vuip volatile unsigned int * - -static void *memSBase = 0; -static void *memBase = 0; - extern int readDense8(void *Base, register unsigned long Offset); extern int readDense16(void *Base, register unsigned long Offset); extern int readDense32(void *Base, register unsigned long Offset); -extern void - writeDenseNB8(int Value, void *Base, register unsigned long Offset); -extern void - writeDenseNB16(int Value, void *Base, register unsigned long Offset); -extern void - writeDenseNB32(int Value, void *Base, register unsigned long Offset); extern void writeDense8(int Value, void *Base, register unsigned long Offset); extern void @@ -439,235 +349,12 @@ extern void extern void writeDense32(int Value, void *Base, register unsigned long Offset); -static int readSparse8(void *Base, register unsigned long Offset); -static int readSparse16(void *Base, register unsigned long Offset); -static int readSparse32(void *Base, register unsigned long Offset); -static void - writeSparseNB8(int Value, void *Base, register unsigned long Offset); -static void - writeSparseNB16(int Value, void *Base, register unsigned long Offset); -static void - writeSparseNB32(int Value, void *Base, register unsigned long Offset); -static void - writeSparse8(int Value, void *Base, register unsigned long Offset); -static void - writeSparse16(int Value, void *Base, register unsigned long Offset); -static void - writeSparse32(int Value, void *Base, register unsigned long Offset); - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -extern int sysarch(int, void *); - -struct parms { - u_int64_t hae; -}; - -static void -sethae(u_int64_t hae) -{ -#ifndef ALPHA_SETHAE -#define ALPHA_SETHAE 0 -#endif - static struct parms p; - - if (p.hae != hae) { - p.hae = hae; - sysarch(ALPHA_SETHAE, (char *) &p); - } -} -#endif - -static void * -mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, - int flags) -{ - static Bool was_here = FALSE; - - if (!was_here) { - was_here = TRUE; - - checkDevMem(FALSE); - - xf86WriteMmio8 = writeSparse8; - xf86WriteMmio16 = writeSparse16; - xf86WriteMmio32 = writeSparse32; - xf86WriteMmioNB8 = writeSparseNB8; - xf86WriteMmioNB16 = writeSparseNB16; - xf86WriteMmioNB32 = writeSparseNB32; - xf86ReadMmio8 = readSparse8; - xf86ReadMmio16 = readSparse16; - xf86ReadMmio32 = readSparse32; - - memBase = mmap((caddr_t) 0, 0x100000000, - PROT_READ | PROT_WRITE, - MAP_SHARED, devMemFd, (off_t) BUS_BASE); - memSBase = mmap((caddr_t) 0, 0x100000000, - PROT_READ | PROT_WRITE, - MAP_SHARED, devMemFd, (off_t) BUS_BASE_BWX); - - if (memSBase == MAP_FAILED || memBase == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n", - strerror(errno)); - } - } - return (void *) ((unsigned long) memBase + Base); -} - -static void -unmapVidMemSparse(int ScreenNum, void *Base, unsigned long Size) -{ -} - -static int -readSparse8(void *Base, register unsigned long Offset) -{ - register unsigned long result, shift; - register unsigned long msb; - - mem_barrier(); - Offset += (unsigned long) Base - (unsigned long) memBase; - shift = (Offset & 0x3) << 3; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - result = *(vuip) ((unsigned long) memSBase + (Offset << 5)); - result >>= shift; - return 0xffUL & result; -} - -static int -readSparse16(void *Base, register unsigned long Offset) -{ - register unsigned long result, shift; - register unsigned long msb; - - mem_barrier(); - Offset += (unsigned long) Base - (unsigned long) memBase; - shift = (Offset & 0x2) << 3; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - result = - *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))); - result >>= shift; - return 0xffffUL & result; -} - -static int -readSparse32(void *Base, register unsigned long Offset) -{ - mem_barrier(); - return *(vuip) ((unsigned long) Base + (Offset)); -} - -static void -writeSparse8(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int b = Value & 0xffU; - - write_mem_barrier(); - Offset += (unsigned long) Base - (unsigned long) memBase; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - *(vuip) ((unsigned long) memSBase + (Offset << 5)) = b * 0x01010101; -} - -static void -writeSparse16(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int w = Value & 0xffffU; - - write_mem_barrier(); - Offset += (unsigned long) Base - (unsigned long) memBase; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))) = - w * 0x00010001; - -} - -static void -writeSparse32(int Value, void *Base, register unsigned long Offset) -{ - write_mem_barrier(); - *(vuip) ((unsigned long) Base + (Offset)) = Value; - return; -} - -static void -writeSparseNB8(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int b = Value & 0xffU; - - Offset += (unsigned long) Base - (unsigned long) memBase; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - *(vuip) ((unsigned long) memSBase + (Offset << 5)) = b * 0x01010101; -} - -static void -writeSparseNB16(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int w = Value & 0xffffU; - - Offset += (unsigned long) Base - (unsigned long) memBase; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - sethae(msb); -#endif - } - *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))) = - w * 0x00010001; -} - -static void -writeSparseNB32(int Value, void *Base, register unsigned long Offset) -{ - *(vuip) ((unsigned long) Base + (Offset)) = Value; - return; -} - void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; -void (*xf86WriteMmioNB8) (int Value, void *Base, unsigned long Offset) - = writeDenseNB8; -void (*xf86WriteMmioNB16) (int Value, void *Base, unsigned long Offset) - = writeDenseNB16; -void (*xf86WriteMmioNB32) (int Value, void *Base, unsigned long Offset) - = writeDenseNB32; int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; int (*xf86ReadMmio16) (void *Base, unsigned long Offset) diff --git a/xserver/hw/xfree86/os-support/bsd/arm_video.c b/xserver/hw/xfree86/os-support/bsd/arm_video.c index 065b527ce..d5f098187 100644 --- a/xserver/hw/xfree86/os-support/bsd/arm_video.c +++ b/xserver/hw/xfree86/os-support/bsd/arm_video.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */ -/* $OpenBSD: arm_video.c,v 1.12 2015/05/27 15:11:12 matthieu Exp $ */ +/* $OpenBSD: arm_video.c,v 1.13 2015/09/16 19:10:23 matthieu Exp $ */ /* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat @@ -69,57 +69,16 @@ #include "xf86_OSlib.h" #include "xf86OSpriv.h" -#ifndef MAP_FAILED -#define MAP_FAILED ((caddr_t)-1) -#endif - /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ -static void* armMapVidMem(int, unsigned long, unsigned long, int flags); -static void armUnmapVidMem(int, void *, unsigned long); - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - pVidMem->linearSupported = TRUE; - pVidMem->mapMem = armMapVidMem; - pVidMem->unmapMem = armUnmapVidMem; pVidMem->initialised = TRUE; } - -volatile unsigned char *ioBase = MAP_FAILED; - -static void* -armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - int fd = xf86Info.consoleFd; - void *base; -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", - Base, Size, fd); -#endif - - base = mmap(0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, Base); - if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)", - "xf86MapVidMem", Size, Base, strerror(errno)); - - return base; -} - -static void -armUnmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - - munmap(Base, Size); -} - int xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, int Len) diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c index 1b929625e..60a19d79a 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c @@ -53,7 +53,7 @@ bsdToXF86(int type) } /* - * APM events can be requested direclty from /dev/apm + * APM events can be requested direclty from /dev/apm */ static int bsdPMGetEventFromOS(int fd, pmEvent * events, int num) diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_axp.c b/xserver/hw/xfree86/os-support/bsd/bsd_axp.c deleted file mode 100644 index e7a36f8bf..000000000 --- a/xserver/hw/xfree86/os-support/bsd/bsd_axp.c +++ /dev/null @@ -1,71 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "shared/xf86Axp.h" -#include -#include "xf86_OSlib.h" -#include -#include - -axpDevice bsdGetAXP(void); - -/* - * BSD does a very nice job providing system information to - * user space programs. Unfortunately it doesn't provide all - * the information required. Therefore we just obtain the - * system type and look up the rest from a list we maintain - * ourselves. - */ - -typedef struct { - char *name; - int type; -} _AXP; - -static _AXP axpList[] = { - {"apecs", APECS}, - {"pyxis", PYXIS}, - {"cia", CIA}, - {"irongate", IRONGATE}, - {"lca", LCA}, - {"t2", T2}, - {"tsunami", TSUNAMI}, - {NULL, SYS_NONE} -}; - -axpDevice -bsdGetAXP(void) -{ - int i; - char sysname[64]; - size_t len = sizeof(sysname); - -#ifdef __OpenBSD__ - int mib[3]; - int error; - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CHIPSET; - mib[2] = CPU_CHIPSET_TYPE; - - if ((error = sysctl(mib, 3, &sysname, &len, NULL, 0)) < 0) -#else - if ((sysctlbyname("hw.chipset.type", &sysname, &len, 0, 0)) < 0) -#endif - FatalError("bsdGetAXP: can't find machine type\n"); -#ifdef DEBUG - xf86Msg(X_INFO, "AXP is a: %s\n", sysname); -#endif - for (i = 0;; i++) { - if (axpList[i].name == NULL) - return SYS_NONE; - if (!strcmp(sysname, axpList[i].name)) - return axpList[i].type; - } -} diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_bell.c b/xserver/hw/xfree86/os-support/bsd/bsd_bell.c index f6643ee62..19d1f4882 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_bell.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_bell.c @@ -6,19 +6,19 @@ * 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 names of Rich Murphey and David Dawes - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Rich Murphey and David Dawes + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and - * David Dawes make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * David Dawes make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES 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 + * RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID DAWES 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. * */ diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c b/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c index 320bb23b6..95883491b 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_ev56.c @@ -25,12 +25,6 @@ __asm(".arch ev56"); int readDense8(void *Base, register unsigned long Offset); int readDense16(void *Base, register unsigned long Offset); int readDense32(void *Base, register unsigned long Offset); -void - writeDenseNB8(int Value, void *Base, register unsigned long Offset); -void - writeDenseNB16(int Value, void *Base, register unsigned long Offset); -void - writeDenseNB32(int Value, void *Base, register unsigned long Offset); void writeDense8(int Value, void *Base, register unsigned long Offset); void @@ -59,24 +53,6 @@ readDense32(void *Base, register unsigned long Offset) return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } -void -writeDenseNB8(int Value, void *Base, register unsigned long Offset) -{ - alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); -} - -void -writeDenseNB16(int Value, void *Base, register unsigned long Offset) -{ - alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); -} - -void -writeDenseNB32(int Value, void *Base, register unsigned long Offset) -{ - *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; -} - void writeDense8(int Value, void *Base, register unsigned long Offset) { diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index 0c4501a25..9f37c14d3 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -668,7 +668,7 @@ int xf86ProcessArgument(int argc, char *argv[], int i) { /* - * Keep server from detaching from controlling tty. This is useful + * Keep server from detaching from controlling tty. This is useful * when debugging (so the server can receive keyboard signals. */ if (!strcmp(argv[i], "-keeptty")) { diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index b82c2ff7c..8e9d09384 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -8,10 +8,10 @@ * 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. @@ -19,7 +19,7 @@ * 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 @@ -86,7 +86,7 @@ bsdToXF86(int type) } /* - * APM events can be requested direclty from /dev/apm + * APM events can be requested direclty from /dev/apm */ static int bsdPMGetEventFromOS(int kq, pmEvent * events, int num) @@ -113,9 +113,9 @@ bsdPMGetEventFromOS(int kq, pmEvent * events, int num) /* * If apmd(8) is running, he will get the events and handle them, - * so, we've nothing to do here. - * Otherwise, opening /dev/apmctl will succeed and we have to send the - * confirmations to /dev/apmctl. + * so, we've nothing to do here. + * Otherwise, opening /dev/apmctl will succeed and we have to send the + * confirmations to /dev/apmctl. */ static pmWait bsdPMConfirmEventToOs(int dummyfd, pmEvent event) diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_sbus.c b/xserver/hw/xfree86/os-support/bsd/bsd_sbus.c index 87a8ddf2b..5cb9dd10f 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_sbus.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_sbus.c @@ -79,7 +79,7 @@ xf86SbusProbe(void) break; } - sbusInfo.fd = -1; + sbusInfo.fd = fd; } _X_EXPORT int @@ -160,13 +160,14 @@ xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp) _X_EXPORT void * xf86MapSbusMem(sbusDevicePtr psdp, unsigned long Base, unsigned long Size) { - return xf86MapVidMem(0, 0, Base, Size); + return mmap((void *)Base, (size_t)Size, PROT_READ|PROT_WRITE, + 0, psdp->fd, 0); } _X_EXPORT void xf86UnmapSbusMem(sbusDevicePtr psdp, void *Base, unsigned long Size) { - xf86UnMapVidMem(0, Base, Size); + munmap(Base, (size_t)Size); } _X_EXPORT void diff --git a/xserver/hw/xfree86/os-support/bsd/i386_video.c b/xserver/hw/xfree86/os-support/bsd/i386_video.c index 359e72ba6..b138d23c1 100644 --- a/xserver/hw/xfree86/os-support/bsd/i386_video.c +++ b/xserver/hw/xfree86/os-support/bsd/i386_video.c @@ -34,26 +34,6 @@ #include #include -#ifdef HAS_MTRR_SUPPORT -#ifndef __NetBSD__ -#include -#else -#include "memrange.h" -#endif -#define X_MTRR_ID "XFree86" -#endif - -#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) -#include -#include -#include -#ifdef __x86_64__ -#define i386_set_mtrr x86_64_set_mtrr -#define i386_get_mtrr x86_64_get_mtrr -#define i386_iopl x86_64_iopl -#endif -#endif - #include "xf86_OSlib.h" #include "xf86OSpriv.h" @@ -84,20 +64,6 @@ static int devMemFd = -1; #define DEV_APERTURE "/dev/xf86" #endif -static void *mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, void *, unsigned long); - -#ifdef HAS_MTRR_SUPPORT -static void *setWC(int, unsigned long, unsigned long, Bool, MessageType); -static void undoWC(int, void *); -static Bool cleanMTRR(void); -#endif -#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) -static void *NetBSDsetWC(int, unsigned long, unsigned long, Bool, - MessageType); -static void NetBSDundoWC(int, void *); -#endif - /* * Check if /dev/mem can be mmap'd. If it can't print a warning when * "warn" is TRUE. @@ -180,123 +146,11 @@ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { checkDevMem(TRUE); - pVidMem->linearSupported = useDevMem; - pVidMem->mapMem = mapVidMem; - pVidMem->unmapMem = unmapVidMem; - if (useDevMem) - pci_system_init_dev_mem(devMemFd); - -#ifdef HAS_MTRR_SUPPORT - if (useDevMem) { - if (cleanMTRR()) { - pVidMem->setWC = setWC; - pVidMem->undoWC = undoWC; - } - } -#endif -#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) - pVidMem->setWC = NetBSDsetWC; - pVidMem->undoWC = NetBSDundoWC; -#endif + pci_system_init_dev_mem(devMemFd); pVidMem->initialised = TRUE; } -static void * -mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - void *base; - - checkDevMem(FALSE); - - if (useDevMem) { - if (devMemFd < 0) { - FatalError("xf86MapVidMem: failed to open %s (%s)", - DEV_MEM, strerror(errno)); - } - base = mmap((caddr_t)0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_FLAGS, devMemFd, (off_t)Base); - if (base == MAP_FAILED) { - FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)", - "xf86MapVidMem", DEV_MEM, Size, Base, - strerror(errno)); - } - return base; - } - - /* else, mmap /dev/vga */ - if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000) { - FatalError("%s: Address 0x%lx outside allowable range", - "xf86MapVidMem", Base); - } - base = mmap(0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_FLAGS, xf86Info.consoleFd, - (unsigned long)Base - 0xA0000); - if (base == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)", - strerror(errno)); - } - return base; -} - -static void -unmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - munmap((caddr_t) Base, Size); -} - -/* - * Read BIOS via mmap()ing DEV_MEM - */ - -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - unsigned char *ptr; - int psize; - int mlen; - - checkDevMem(TRUE); - if (devMemFd == -1) { - return -1; - } - - psize = getpagesize(); - Offset += Base & (psize - 1); - Base &= ~(psize - 1); - mlen = (Offset + Len + psize - 1) & ~(psize - 1); - ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ, - MAP_SHARED, devMemFd, (off_t)Base); - if ((long)ptr == -1) { - xf86Msg(X_WARNING, - "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n", - DEV_MEM, Len, Base, Offset, strerror(errno)); -#ifdef __OpenBSD__ - if (Base < 0xa0000) { - xf86Msg(X_WARNING, SYSCTL_MSG2); - } -#endif - return -1; - } -#ifdef DEBUG - ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", - Base, ptr[0] | (ptr[1] << 8)); -#endif - (void) memcpy(Buf, (void *) (ptr + Offset), Len); - (void) munmap((caddr_t) ptr, mlen); -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)" - "-> %02x %02x %02x %02x...\n", - Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]); -#endif - return Len; -} - #ifdef USE_I386_IOPL /***************************************************************************/ /* I/O Permissions section */ @@ -467,421 +321,6 @@ xf86SetRGBOut() } #endif -#ifdef HAS_MTRR_SUPPORT -/* memory range (MTRR) support for FreeBSD */ - -/* - * This code is experimental. Some parts may be overkill, and other parts - * may be incomplete. - */ - -/* - * getAllRanges returns the full list of memory ranges with attributes set. - */ - -static struct mem_range_desc * -getAllRanges(int *nmr) -{ - struct mem_range_desc *mrd; - struct mem_range_op mro; - - /* - * Find how many ranges there are. If this fails, then the kernel - * probably doesn't have MTRR support. - */ - mro.mo_arg[0] = 0; - if (ioctl(devMemFd, MEMRANGE_GET, &mro)) - return NULL; - *nmr = mro.mo_arg[0]; - mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc)); - mro.mo_arg[0] = *nmr; - mro.mo_desc = mrd; - if (ioctl(devMemFd, MEMRANGE_GET, &mro)) { - free(mrd); - return NULL; - } - return mrd; -} - -/* - * cleanMTRR removes any memory attribute that may be left by a previous - * X server. Normally there won't be any, but this takes care of the - * case where a server crashed without being able finish cleaning up. - */ - -static Bool -cleanMTRR() -{ - struct mem_range_desc *mrd; - struct mem_range_op mro; - int nmr, i; - - /* This shouldn't happen */ - if (devMemFd < 0) - return FALSE; - - if (!(mrd = getAllRanges(&nmr))) - return FALSE; - - for (i = 0; i < nmr; i++) { - if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 && - (mrd[i].mr_flags & MDF_ACTIVE)) { -#ifdef DEBUG - ErrorF("Clean for (0x%lx,0x%lx)\n", - (unsigned long) mrd[i].mr_base, - (unsigned long) mrd[i].mr_len); -#endif - if (mrd[i].mr_flags & MDF_FIXACTIVE) { - mro.mo_arg[0] = MEMRANGE_SET_UPDATE; - mrd[i].mr_flags = MDF_UNCACHEABLE; - } - else { - mro.mo_arg[0] = MEMRANGE_SET_REMOVE; - } - mro.mo_desc = mrd + i; - ioctl(devMemFd, MEMRANGE_SET, &mro); - } - } -#ifdef DEBUG - sleep(10); -#endif - free(mrd); - return TRUE; -} - -typedef struct x_RangeRec { - struct mem_range_desc mrd; - Bool wasWC; - struct x_RangeRec *next; -} RangeRec, *RangePtr; - -static void -freeRangeList(RangePtr range) -{ - RangePtr rp; - - while (range) { - rp = range; - range = rp->next; - free(rp); - } -} - -static RangePtr -dupRangeList(RangePtr list) -{ - RangePtr new = NULL, rp, p; - - rp = list; - while (rp) { - p = xnfalloc(sizeof(RangeRec)); - *p = *rp; - p->next = new; - new = p; - rp = rp->next; - } - return new; -} - -static RangePtr -sortRangeList(RangePtr list) -{ - RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev; - unsigned long minBase; - - /* Sort by base address */ - rp1 = copy = dupRangeList(list); - while (rp1) { - minBase = rp1->mrd.mr_base; - minp = rp1; - minprev = NULL; - prev = rp1; - rp2 = rp1->next; - while (rp2) { - if (rp2->mrd.mr_base < minBase) { - minBase = rp2->mrd.mr_base; - minp = rp2; - minprev = prev; - } - prev = rp2; - rp2 = rp2->next; - } - if (minprev) { - minprev->next = minp->next; - rp1 = copy; - } - else { - rp1 = minp->next; - } - minp->next = sorted; - sorted = minp; - } - return sorted; -} - -/* - * findRanges returns a list of ranges that overlap the specified range. - */ - -static void -findRanges(unsigned long base, unsigned long size, RangePtr * ucp, - RangePtr * wcp) -{ - struct mem_range_desc *mrd; - int nmr, i; - RangePtr rp, *p; - - if (!(mrd = getAllRanges(&nmr))) - return; - - for (i = 0; i < nmr; i++) { - if ((mrd[i].mr_flags & MDF_ACTIVE) && - mrd[i].mr_base < base + size && - mrd[i].mr_base + mrd[i].mr_len > base) { - if (mrd[i].mr_flags & MDF_WRITECOMBINE) - p = wcp; - else if (mrd[i].mr_flags & MDF_UNCACHEABLE) - p = ucp; - else - continue; - rp = xnfalloc(sizeof(RangeRec)); - rp->mrd = mrd[i]; - rp->next = *p; - *p = rp; - } - } - free(mrd); -} - -/* - * This checks if the existing overlapping ranges fully cover the requested - * range. Is this overkill? - */ - -static Bool -fullCoverage(unsigned long base, unsigned long size, RangePtr overlap) -{ - RangePtr rp1, sorted = NULL; - unsigned long end; - - sorted = sortRangeList(overlap); - /* Look for gaps */ - rp1 = sorted; - end = base + size; - while (rp1) { - if (rp1->mrd.mr_base > base) { - freeRangeList(sorted); - return FALSE; - } - else { - base = rp1->mrd.mr_base + rp1->mrd.mr_len; - } - if (base >= end) { - freeRangeList(sorted); - return TRUE; - } - rp1 = rp1->next; - } - freeRangeList(sorted); - return FALSE; -} - -static void * -addWC(int screenNum, unsigned long base, unsigned long size, MessageType from) -{ - RangePtr uc = NULL, wc = NULL, retlist = NULL; - struct mem_range_desc mrd; - struct mem_range_op mro; - - findRanges(base, size, &uc, &wc); - - /* See of the full range is already WC */ - if (!uc && fullCoverage(base, size, wc)) { - xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx) was already set\n", - base, size); - return NULL; - } - - /* Otherwise, try to add the new range */ - mrd.mr_base = base; - mrd.mr_len = size; - strcpy(mrd.mr_owner, X_MTRR_ID); - mrd.mr_flags = MDF_WRITECOMBINE; - mro.mo_desc = &mrd; - mro.mo_arg[0] = MEMRANGE_SET_UPDATE; - if (ioctl(devMemFd, MEMRANGE_SET, &mro)) { - xf86DrvMsg(screenNum, X_WARNING, - "Failed to set write-combining range " - "(0x%lx,0x%lx)\n", base, size); - return NULL; - } - else { - xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx)\n", base, size); - retlist = xnfalloc(sizeof(RangeRec)); - retlist->mrd = mrd; - retlist->wasWC = FALSE; - retlist->next = NULL; - return retlist; - } -} - -static void * -delWC(int screenNum, unsigned long base, unsigned long size, MessageType from) -{ - RangePtr uc = NULL, wc = NULL, retlist = NULL; - struct mem_range_desc mrd; - struct mem_range_op mro; - - findRanges(base, size, &uc, &wc); - - /* - * See of the full range is already not WC, or if there is full - * coverage from UC ranges. - */ - if (!wc || fullCoverage(base, size, uc)) { - xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx) was already clear\n", - base, size); - return NULL; - } - - /* Otherwise, try to add the new range */ - mrd.mr_base = base; - mrd.mr_len = size; - strcpy(mrd.mr_owner, X_MTRR_ID); - mrd.mr_flags = MDF_UNCACHEABLE; - mro.mo_desc = &mrd; - mro.mo_arg[0] = MEMRANGE_SET_UPDATE; - if (ioctl(devMemFd, MEMRANGE_SET, &mro)) { - xf86DrvMsg(screenNum, X_WARNING, - "Failed to remove write-combining range " - "(0x%lx,0x%lx)\n", base, size); - /* XXX Should then remove all of the overlapping WC ranges */ - return NULL; - } - else { - xf86DrvMsg(screenNum, from, - "Removed Write-combining range (0x%lx,0x%lx)\n", - base, size); - retlist = xnfalloc(sizeof(RangeRec)); - retlist->mrd = mrd; - retlist->wasWC = TRUE; - retlist->next = NULL; - return retlist; - } -} - -static void * -setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, - MessageType from) -{ - if (enable) - return addWC(screenNum, base, size, from); - else - return delWC(screenNum, base, size, from); -} - -static void -undoWC(int screenNum, void *list) -{ - RangePtr rp; - struct mem_range_op mro; - Bool failed; - - rp = list; - while (rp) { -#ifdef DEBUG - ErrorF("Undo for (0x%lx,0x%lx), %d\n", - (unsigned long) rp->mrd.mr_base, - (unsigned long) rp->mrd.mr_len, rp->wasWC); -#endif - failed = FALSE; - if (rp->wasWC) { - mro.mo_arg[0] = MEMRANGE_SET_UPDATE; - rp->mrd.mr_flags = MDF_WRITECOMBINE; - strcpy(rp->mrd.mr_owner, "unknown"); - } - else { - mro.mo_arg[0] = MEMRANGE_SET_REMOVE; - } - mro.mo_desc = &rp->mrd; - - if (ioctl(devMemFd, MEMRANGE_SET, &mro)) { - if (!rp->wasWC) { - mro.mo_arg[0] = MEMRANGE_SET_UPDATE; - rp->mrd.mr_flags = MDF_UNCACHEABLE; - strcpy(rp->mrd.mr_owner, "unknown"); - if (ioctl(devMemFd, MEMRANGE_SET, &mro)) - failed = TRUE; - } - else - failed = TRUE; - } - if (failed) { - xf86DrvMsg(screenNum, X_WARNING, - "Failed to restore MTRR range (0x%lx,0x%lx)\n", - (unsigned long) rp->mrd.mr_base, - (unsigned long) rp->mrd.mr_len); - } - rp = rp->next; - } -} - -#endif /* HAS_MTRR_SUPPORT */ - -#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) -static void * -NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, - MessageType from) -{ - struct mtrr *mtrrp; - int n; - - xf86DrvMsg(screenNum, X_WARNING, - "%s MTRR %lx - %lx\n", enable ? "set" : "remove", - base, (base + size)); - - mtrrp = xnfalloc(sizeof(struct mtrr)); - mtrrp->base = base; - mtrrp->len = size; - mtrrp->type = MTRR_TYPE_WC; - - /* - * MTRR_PRIVATE will make this MTRR get reset automatically - * if this process exits, so we have no need for an explicit - * cleanup operation when starting a new server. - */ - - if (enable) - mtrrp->flags = MTRR_VALID | MTRR_PRIVATE; - else - mtrrp->flags = 0; - n = 1; - - if (i386_set_mtrr(mtrrp, &n) < 0) { - free(mtrrp); - return NULL; - } - return mtrrp; -} - -static void -NetBSDundoWC(int screenNum, void *list) -{ - struct mtrr *mtrrp = (struct mtrr *) list; - int n; - - if (mtrrp == NULL) - return; - n = 1; - mtrrp->flags &= ~MTRR_VALID; - i386_set_mtrr(mtrrp, &n); - free(mtrrp); -} -#endif - #ifdef X_PRIVSEP #include diff --git a/xserver/hw/xfree86/os-support/bsd/ppc_video.c b/xserver/hw/xfree86/os-support/bsd/ppc_video.c index 06903692b..702ea9ac3 100644 --- a/xserver/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xserver/hw/xfree86/os-support/bsd/ppc_video.c @@ -44,9 +44,6 @@ #define DEV_MEM "/dev/xf86" #endif -static void *ppcMapVidMem(int, unsigned long, unsigned long, int flags); -static void ppcUnmapVidMem(int, void *, unsigned long); - #ifdef __NetBSD__ Bool xf86EnableIO(void); void xf86DisableIO(void); @@ -57,9 +54,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) { xf86OpenConsole(); - pVidMem->linearSupported = TRUE; - pVidMem->mapMem = ppcMapVidMem; - pVidMem->unmapMem = ppcUnmapVidMem; pVidMem->initialised = TRUE; pci_system_init_dev_mem(xf86Info.consoleFd); @@ -69,33 +63,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) volatile unsigned char *ioBase = MAP_FAILED; -static void * -ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - int fd = xf86Info.consoleFd; - void *base; - -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", - Base, Size, fd); -#endif - - base = mmap(0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, Base); - if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)", - "xf86MapVidMem", Size, Base, strerror(errno)); - - return base; -} - -static void -ppcUnmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - munmap(Base, Size); -} static int kmem = -1; @@ -103,28 +70,8 @@ _X_EXPORT int xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, int Len) { - int rv; - - if (Base < 0x80000000) { - xf86Msg(X_WARNING, "No VGA Base=%#lx\n", Base); - return 0; - } - if (kmem == -1) { - kmem = open(DEV_MEM, 2); - if (kmem == -1) { - FatalError("xf86ReadBIOS: open %s", DEV_MEM); - } - } - -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n", Base, Offset, Len); -#endif - - lseek(kmem, Base + Offset, 0); - rv = read(kmem, Buf, Len); - - return rv; + return -1; } #ifdef X_PRIVSEP diff --git a/xserver/hw/xfree86/os-support/bsd/sgi_video.c b/xserver/hw/xfree86/os-support/bsd/sgi_video.c index ad30b3c27..fd0404811 100644 --- a/xserver/hw/xfree86/os-support/bsd/sgi_video.c +++ b/xserver/hw/xfree86/os-support/bsd/sgi_video.c @@ -34,53 +34,17 @@ #include "xf86_OSlib.h" #include "xf86OSpriv.h" -#ifndef MAP_FAILED -#define MAP_FAILED ((caddr_t)-1) -#endif /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ -static void *sgiMapVidMem(int, unsigned long, unsigned long, int); -static void sgiUnmapVidMem(int, void *, unsigned long); - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - pVidMem->linearSupported = TRUE; - pVidMem->mapMem = sgiMapVidMem; - pVidMem->unmapMem = sgiUnmapVidMem; pVidMem->initialised = TRUE; } -static void * -sgiMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, - int flags) -{ - int fd = xf86Info.consoleFd; - void *base; - -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", - Base, Size, fd); -#endif - - base = mmap(0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, Base); - if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", - "xf86MapVidMem", Size, Base, strerror(errno)); - return base; -} - -static void -sgiUnmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - munmap(Base, Size); -} _X_EXPORT int xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, diff --git a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c index c701f4497..cfee3e1da 100644 --- a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c @@ -6,19 +6,19 @@ * 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 names of Rich Murphey and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Rich Murphey and David Wexelblat + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and - * David Wexelblat make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * David Wexelblat make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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 + * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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. * */ @@ -45,48 +45,10 @@ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { xf86OpenConsole(); - - pVidMem->linearSupported = TRUE; - pVidMem->mapMem = sparc64MapVidMem; - pVidMem->unmapMem = sparc64UnmapVidMem; pci_system_init_dev_mem(xf86Info.consoleFd); pVidMem->initialised = TRUE; } -static void * -sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, - int flags) -{ - int fd = xf86Info.consoleFd; - void *base; - -#ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); -#endif - - base = mmap(0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), MAP_SHARED, fd, Base); - if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", - "xf86MapVidMem", Size, Base, strerror(errno)); - return base; -} - -static void -sparc64UnmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - munmap(Base, Size); -} - -_X_EXPORT int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - - return 0; -} - #ifdef X_PRIVSEP /* * Do all things that need root privileges early diff --git a/xserver/hw/xfree86/os-support/bus/Makefile.in b/xserver/hw/xfree86/os-support/bus/Makefile.in index fd5e5f880..d5911cc93 100644 --- a/xserver/hw/xfree86/os-support/bus/Makefile.in +++ b/xserver/hw/xfree86/os-support/bus/Makefile.in @@ -271,6 +271,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/os-support/bus/xf86Pci.h b/xserver/hw/xfree86/os-support/bus/xf86Pci.h index f69e55b39..210ab3d89 100644 --- a/xserver/hw/xfree86/os-support/bus/xf86Pci.h +++ b/xserver/hw/xfree86/os-support/bus/xf86Pci.h @@ -232,28 +232,7 @@ * Typedefs, etc... */ -/* Primitive Types */ -typedef unsigned long ADDRESS; /* Memory/PCI address */ -typedef unsigned long IOADDRESS _X_DEPRECATED; /* Must be large enough for a pointer */ -typedef CARD32 PCITAG _X_DEPRECATED; - -typedef enum { - PCI_MEM, - PCI_MEM_SIZE, - PCI_MEM_SPARSE_BASE, - PCI_MEM_SPARSE_MASK, - PCI_IO, - PCI_IO_SIZE, - PCI_IO_SPARSE_BASE, - PCI_IO_SPARSE_MASK -} PciAddrType; - /* Public PCI access functions */ extern _X_EXPORT Bool xf86scanpci(void); -/* Domain access functions. Some of these probably shouldn't be public */ -extern _X_EXPORT struct pci_io_handle *xf86MapLegacyIO(struct pci_device *dev); -extern _X_EXPORT void xf86UnmapLegacyIO(struct pci_device *, - struct pci_io_handle *); - #endif /* _XF86PCI_H */ diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.am b/xserver/hw/xfree86/os-support/hurd/Makefile.am index f228c1ce4..38660544a 100644 --- a/xserver/hw/xfree86/os-support/hurd/Makefile.am +++ b/xserver/hw/xfree86/os-support/hurd/Makefile.am @@ -1,6 +1,6 @@ noinst_LTLIBRARIES = libhurd.la -libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ +libhurd_la_SOURCES = hurd_bell.c hurd_init.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.in b/xserver/hw/xfree86/os-support/hurd/Makefile.in index 0bef8dd26..5de2e0646 100644 --- a/xserver/hw/xfree86/os-support/hurd/Makefile.in +++ b/xserver/hw/xfree86/os-support/hurd/Makefile.in @@ -74,9 +74,9 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libhurd_la_LIBADD = -am_libhurd_la_OBJECTS = hurd_bell.lo hurd_init.lo hurd_mmap.lo \ - hurd_video.lo VTsw_noop.lo posix_tty.lo vidmem.lo \ - sigiostubs.lo pm_noop.lo kmod_noop.lo agp_noop.lo +am_libhurd_la_OBJECTS = hurd_bell.lo hurd_init.lo hurd_video.lo \ + VTsw_noop.lo posix_tty.lo vidmem.lo sigiostubs.lo pm_noop.lo \ + kmod_noop.lo agp_noop.lo libhurd_la_OBJECTS = $(am_libhurd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -472,7 +473,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libhurd.la -libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ +libhurd_la_SOURCES = hurd_bell.c hurd_init.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ @@ -542,7 +543,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_init.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_mmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm_noop.Plo@am__quote@ diff --git a/xserver/hw/xfree86/os-support/hurd/hurd_mmap.c b/xserver/hw/xfree86/os-support/hurd/hurd_mmap.c deleted file mode 100644 index 8e089cadb..000000000 --- a/xserver/hw/xfree86/os-support/hurd/hurd_mmap.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 1997 by UCHIYAMA Yasushi - * - * 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 UCHIYAMA Yasushi not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. UCHIYAMA Yasushi makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL UCHIYAMA YASUSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -#define BIOS_SIZE 0x20000 - -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - mach_port_t device, mem_dev; - memory_object_t mem_obj; - vm_address_t addr = (vm_address_t) 0; /* serach starting address */ - kern_return_t err; - - err = get_privileged_ports(NULL, &device); - if (err) { - errno = err; - FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n", - strerror(errno)); - } - err = device_open(device, D_READ | D_WRITE, "mem", &mem_dev); - mach_port_deallocate(mach_task_self(), device); - if (err) { - errno = err; - FatalError("xf86ReadBIOS() can't device_open. (%s)\n", strerror(errno)); - } - err = - device_map(mem_dev, VM_PROT_READ | VM_PROT_WRITE, Base, BIOS_SIZE, - &mem_obj, 0); - if (err) { - errno = err; - FatalError("xf86ReadBIOS() can't device_map. (%s)\n", strerror(errno)); - } - err = vm_map(mach_task_self(), - &addr, - BIOS_SIZE, - 0, - TRUE, - mem_obj, - Base, - FALSE, - VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(), mem_obj); - if (err) { - errno = err; - FatalError("xf86ReadBIOS() can't vm_map. (%s)\n", strerror(errno)); - } - - memcpy(Buf, (void *) ((int) addr + Offset), Len); - - err = vm_deallocate(mach_task_self(), addr, BIOS_SIZE); - if (err) { - errno = err; - FatalError("xf86ReadBIOS() can't vm_deallocate. (%s)\n", - strerror(errno)); - } - - return Len; -} diff --git a/xserver/hw/xfree86/os-support/hurd/hurd_video.c b/xserver/hw/xfree86/os-support/hurd/hurd_video.c index dc1a8e670..ac24f1950 100644 --- a/xserver/hw/xfree86/os-support/hurd/hurd_video.c +++ b/xserver/hw/xfree86/os-support/hurd/hurd_video.c @@ -40,73 +40,11 @@ #include "xf86OSpriv.h" /************************************************************************** - * Video Memory Mapping section + * Video Memory Mapping section ***************************************************************************/ -static void * -mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) -{ - mach_port_t device, mem_dev; - memory_object_t mem_obj; - kern_return_t err; - vm_address_t addr = (vm_address_t) 0; - - err = get_privileged_ports(NULL, &device); - if (err) { - errno = err; - FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n", - strerror(errno)); - } - err = device_open(device, D_READ | D_WRITE, "mem", &mem_dev); - mach_port_deallocate(mach_task_self(), device); - if (err) { - errno = err; - FatalError("xf86MapVidMem() can't device_open. (%s)\n", - strerror(errno)); - } - - err = - device_map(mem_dev, VM_PROT_READ | VM_PROT_WRITE, Base, Size, &mem_obj, - 0); - if (err) { - errno = err; - FatalError("xf86MapVidMem() can't device_map. (%s)\n", strerror(errno)); - } - err = vm_map(mach_task_self(), &addr, Size, 0, /* mask */ - TRUE, /* anywhere */ - mem_obj, (vm_offset_t) Base, FALSE, /* copy on write */ - VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(), mem_obj); - if (err) { - errno = err; - FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n", - strerror(errno)); - } - mach_port_deallocate(mach_task_self(), mem_dev); - if (err) { - errno = err; - FatalError - ("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n", - strerror(errno)); - } - return (void *) addr; -} - -static void -unmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - kern_return_t err = vm_deallocate(mach_task_self(), (int) Base, Size); - - if (err) { - errno = err; - ErrorF("xf86UnMapVidMem: can't dealloc framebuffer space (%s)\n", - strerror(errno)); - } - return; -} /************************************************************************** - * I/O Permissions section + * I/O Permissions section ***************************************************************************/ /* @@ -146,8 +84,5 @@ xf86DisableIO() void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - pVidMem->linearSupported = TRUE; - pVidMem->mapMem = mapVidMem; - pVidMem->unmapMem = unmapVidMem; pVidMem->initialised = TRUE; } diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.am b/xserver/hw/xfree86/os-support/linux/Makefile.am index 1686dc2c1..50fcd1f28 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.am +++ b/xserver/hw/xfree86/os-support/linux/Makefile.am @@ -2,9 +2,6 @@ noinst_LTLIBRARIES = liblinux.la if LINUX_ALPHA noinst_LTLIBRARIES += liblinuxev56.la -PLATFORM_PCI_SUPPORT = \ - $(srcdir)/lnx_axp.c \ - $(srcdir)/../shared/xf86Axp.c liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 @@ -28,23 +25,18 @@ endif liblinux_la_SOURCES = lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ - $(srcdir)/../shared/bios_mmap.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ - $(LOGIND_SRCS) \ - $(PLATFORM_PCI_SUPPORT) + $(LOGIND_SRCS) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) -EXTRA_DIST = \ - $(srcdir)/../shared/xf86Axp.h - if LINUX_ALPHA liblinux_la_LIBADD = liblinuxev56.la endif diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.in b/xserver/hw/xfree86/os-support/linux/Makefile.in index 3cff329a0..3a33c7ea0 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.in +++ b/xserver/hw/xfree86/os-support/linux/Makefile.in @@ -80,19 +80,16 @@ 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 \ - $(srcdir)/../shared/bios_mmap.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 $(srcdir)/lnx_axp.c \ - $(srcdir)/../shared/xf86Axp.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 @LNXACPI_TRUE@am__objects_1 = lnx_acpi.lo lnx_apm.lo @LNXAPM_TRUE@am__objects_2 = lnx_apm.lo @SYSTEMD_LOGIND_TRUE@am__objects_3 = systemd-logind.lo -@LINUX_ALPHA_TRUE@am__objects_4 = lnx_axp.lo xf86Axp.lo am_liblinux_la_OBJECTS = lnx_init.lo lnx_video.lo lnx_agp.lo \ - lnx_kmod.lo lnx_bell.lo lnx_platform.lo bios_mmap.lo \ - VTsw_usl.lo posix_tty.lo vidmem.lo sigio.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) + lnx_kmod.lo lnx_bell.lo lnx_platform.lo VTsw_usl.lo \ + posix_tty.lo vidmem.lo sigio.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) liblinux_la_OBJECTS = $(am_liblinux_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -261,6 +258,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -500,10 +498,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = liblinux.la $(am__append_1) -@LINUX_ALPHA_TRUE@PLATFORM_PCI_SUPPORT = \ -@LINUX_ALPHA_TRUE@ $(srcdir)/lnx_axp.c \ -@LINUX_ALPHA_TRUE@ $(srcdir)/../shared/xf86Axp.c - @LINUX_ALPHA_TRUE@liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 @LINUX_ALPHA_TRUE@liblinuxev56_la_SOURCES = lnx_ev56.c @LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c lnx_apm.c @@ -511,21 +505,16 @@ noinst_LTLIBRARIES = liblinux.la $(am__append_1) @SYSTEMD_LOGIND_TRUE@LOGIND_SRCS = systemd-logind.c liblinux_la_SOURCES = lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ - $(srcdir)/../shared/bios_mmap.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ - $(LOGIND_SRCS) \ - $(PLATFORM_PCI_SUPPORT) + $(LOGIND_SRCS) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) -EXTRA_DIST = \ - $(srcdir)/../shared/xf86Axp.h - @LINUX_ALPHA_TRUE@liblinux_la_LIBADD = liblinuxev56.la all: all-am @@ -584,12 +573,10 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_usl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bios_mmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_acpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_agp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_apm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_axp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_kmod.Plo@am__quote@ @@ -599,7 +586,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systemd-logind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Axp.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -622,13 +608,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -bios_mmap.lo: $(srcdir)/../shared/bios_mmap.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) $(AM_CFLAGS) $(CFLAGS) -MT bios_mmap.lo -MD -MP -MF $(DEPDIR)/bios_mmap.Tpo -c -o bios_mmap.lo `test -f '$(srcdir)/../shared/bios_mmap.c' || echo '$(srcdir)/'`$(srcdir)/../shared/bios_mmap.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bios_mmap.Tpo $(DEPDIR)/bios_mmap.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/bios_mmap.c' object='bios_mmap.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) $(AM_CFLAGS) $(CFLAGS) -c -o bios_mmap.lo `test -f '$(srcdir)/../shared/bios_mmap.c' || echo '$(srcdir)/'`$(srcdir)/../shared/bios_mmap.c - VTsw_usl.lo: $(srcdir)/../shared/VTsw_usl.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) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_usl.lo -MD -MP -MF $(DEPDIR)/VTsw_usl.Tpo -c -o VTsw_usl.lo `test -f '$(srcdir)/../shared/VTsw_usl.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_usl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/VTsw_usl.Tpo $(DEPDIR)/VTsw_usl.Plo @@ -657,20 +636,6 @@ sigio.lo: $(srcdir)/../shared/sigio.c @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) $(AM_CFLAGS) $(CFLAGS) -c -o sigio.lo `test -f '$(srcdir)/../shared/sigio.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigio.c -lnx_axp.lo: $(srcdir)/lnx_axp.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) $(AM_CFLAGS) $(CFLAGS) -MT lnx_axp.lo -MD -MP -MF $(DEPDIR)/lnx_axp.Tpo -c -o lnx_axp.lo `test -f '$(srcdir)/lnx_axp.c' || echo '$(srcdir)/'`$(srcdir)/lnx_axp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lnx_axp.Tpo $(DEPDIR)/lnx_axp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/lnx_axp.c' object='lnx_axp.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) $(AM_CFLAGS) $(CFLAGS) -c -o lnx_axp.lo `test -f '$(srcdir)/lnx_axp.c' || echo '$(srcdir)/'`$(srcdir)/lnx_axp.c - -xf86Axp.lo: $(srcdir)/../shared/xf86Axp.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) $(AM_CFLAGS) $(CFLAGS) -MT xf86Axp.lo -MD -MP -MF $(DEPDIR)/xf86Axp.Tpo -c -o xf86Axp.lo `test -f '$(srcdir)/../shared/xf86Axp.c' || echo '$(srcdir)/'`$(srcdir)/../shared/xf86Axp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xf86Axp.Tpo $(DEPDIR)/xf86Axp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../shared/xf86Axp.c' object='xf86Axp.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) $(AM_CFLAGS) $(CFLAGS) -c -o xf86Axp.lo `test -f '$(srcdir)/../shared/xf86Axp.c' || echo '$(srcdir)/'`$(srcdir)/../shared/xf86Axp.c - liblinuxev56_la-lnx_ev56.lo: lnx_ev56.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) $(liblinuxev56_la_CFLAGS) $(CFLAGS) -MT liblinuxev56_la-lnx_ev56.lo -MD -MP -MF $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo -c -o liblinuxev56_la-lnx_ev56.lo `test -f 'lnx_ev56.c' || echo '$(srcdir)/'`lnx_ev56.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblinuxev56_la-lnx_ev56.Tpo $(DEPDIR)/liblinuxev56_la-lnx_ev56.Plo diff --git a/xserver/hw/xfree86/os-support/linux/int10/linux.c b/xserver/hw/xfree86/os-support/linux/int10/linux.c index 6181eb9c5..6ca118f25 100644 --- a/xserver/hw/xfree86/os-support/linux/int10/linux.c +++ b/xserver/hw/xfree86/os-support/linux/int10/linux.c @@ -70,6 +70,20 @@ static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn); #endif /* DoSubModules */ +static Bool +readLegacy(struct pci_device *dev, unsigned char *buf, int base, int len) +{ + void *map; + + if (pci_device_map_legacy(dev, base, len, 0, &map)) + return FALSE; + + memcpy(buf, map, len); + pci_device_unmap_legacy(dev, man, len); + + return TRUE; +} + xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags) { @@ -222,7 +236,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) Int10Current = pInt; DebugF("Mapping int area\n"); - if (xf86ReadBIOS(0, 0, (unsigned char *) 0, LOW_PAGE_SIZE) < 0) { + /* note: yes, we really are writing the 0 page here */ + if (!readLegacy(pInt->dev, (unsigned char *) 0, 0, LOW_PAGE_SIZE)) { xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); goto error3; } @@ -236,7 +251,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) memset((void *) V_BIOS, 0, SYS_BIOS - V_BIOS); DebugF("Reading BIOS\n"); for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE) - if (xf86ReadBIOS(cs, 0, (void *) cs, V_BIOS_SIZE) < V_BIOS_SIZE) + if (!readLegacy(pInt->dev, (void *)cs, cs, V_BIOS_SIZE)) xf86DrvMsg(screen, X_WARNING, "Unable to retrieve all of segment 0x%06lX.\n", (long) cs); diff --git a/xserver/hw/xfree86/os-support/linux/lnx_agp.c b/xserver/hw/xfree86/os-support/linux/lnx_agp.c index e1fa3f8a7..2a28c6af8 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_agp.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_agp.c @@ -92,8 +92,8 @@ GARTInit(int screenNum) xf86ReleaseGART(-1); #if defined(linux) - /* Per Dave Jones, every effort will be made to keep the - * agpgart interface backwards compatible, so allow all + /* Per Dave Jones, every effort will be made to keep the + * agpgart interface backwards compatible, so allow all * future versions. */ if ( diff --git a/xserver/hw/xfree86/os-support/linux/lnx_axp.c b/xserver/hw/xfree86/os-support/linux/lnx_axp.c deleted file mode 100644 index d65a3a487..000000000 --- a/xserver/hw/xfree86/os-support/linux/lnx_axp.c +++ /dev/null @@ -1,103 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "xf86.h" -#include "shared/xf86Axp.h" - -axpDevice lnxGetAXP(void); - -typedef struct { - char *sysName; - char *sysVari; - char *cpu; - axpDevice sys; -} AXP; - -static AXP axpList[] = { - {"Tsunami", NULL, NULL, TSUNAMI}, - {"Eiger", NULL, NULL, TSUNAMI}, - {"Noname", NULL, NULL, LCA}, - {"AlphaBook1", NULL, NULL, LCA}, - {"EB66", NULL, NULL, LCA}, - {"EB64+", NULL, NULL, APECS}, - {"Noritake", NULL, "EV5", CIA}, - {"Noritake", NULL, "EV56", CIA}, - {"Noritake", NULL, NULL, APECS}, - {"XL", NULL, NULL, APECS}, - {"Avanti", NULL, NULL, APECS}, - {"Mikasa", NULL, "EV5", CIA}, - {"Mikasa", NULL, "EV56", CIA}, - {"Mikasa", NULL, NULL, APECS}, - {"EB164", "EB164", NULL, CIA}, - {"EB164", "PC164", NULL, CIA}, - {"EB164", "LX164", NULL, PYXIS}, - {"EB164", "SX164", NULL, PYXIS}, - {"EB164", "RX164", NULL, POLARIS}, - {"Alcor", NULL, NULL, CIA}, - {"Takara", NULL, NULL, CIA}, - {"Sable", NULL, "EV5", T2_GAMMA}, - {"Sable", NULL, "EV56", T2_GAMMA}, - {"Sable", NULL, NULL, T2}, - {"Rawhide", NULL, NULL, MCPCIA}, - {"Jensen", NULL, NULL, JENSEN}, - {"Miata", NULL, NULL, PYXIS_CIA}, - {"Ruffian", NULL, NULL, PYXIS_CIA}, - {"Nautilus", NULL, NULL, IRONGATE}, - {NULL, NULL, NULL, SYS_NONE} -}; - -axpDevice -lnxGetAXP(void) -{ - FILE *file; - int count = 0; - char res[256]; - char cpu[255]; - char systype[255]; - char sysvari[255]; - - if (!(file = fopen("/proc/cpuinfo", "r"))) - return SYS_NONE; - do { - if (!fgets(res, 0xff, file)) - return SYS_NONE; - switch (count) { - case 1: - sscanf(res, "cpu model : %s", cpu); - DebugF("CPU %s\n", cpu); - break; - case 5: - sscanf(res, "system type : %s", systype); - DebugF("system type : %s\n", systype); - break; - case 6: - sscanf(res, "system variation : %s", sysvari); - DebugF("system variation: %s\n", sysvari); - break; - } - count++; - } while (count < 8); - - fclose(file); - - count = 0; - - do { - if (!axpList[count].sysName || !strcmp(axpList[count].sysName, systype)) { - if (axpList[count].sysVari && - strcmp(axpList[count].sysVari, sysvari)) { - count++; - continue; - }; - if (axpList[count].cpu && strcmp(axpList[count].cpu, cpu)) { - count++; - continue; - } - return axpList[count].sys; - } - count++; - } while (1); -} diff --git a/xserver/hw/xfree86/os-support/linux/lnx_ev56.c b/xserver/hw/xfree86/os-support/linux/lnx_ev56.c index b6950009c..4e886b6ce 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_ev56.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_ev56.c @@ -9,12 +9,6 @@ int readDense8(void *Base, register unsigned long Offset); int readDense16(void *Base, register unsigned long Offset); int readDense32(void *Base, register unsigned long Offset); -void - writeDenseNB8(int Value, void *Base, register unsigned long Offset); -void - writeDenseNB16(int Value, void *Base, register unsigned long Offset); -void - writeDenseNB32(int Value, void *Base, register unsigned long Offset); void writeDense8(int Value, void *Base, register unsigned long Offset); void @@ -43,24 +37,6 @@ readDense32(void *Base, register unsigned long Offset) return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } -void -writeDenseNB8(int Value, void *Base, register unsigned long Offset) -{ - *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; -} - -void -writeDenseNB16(int Value, void *Base, register unsigned long Offset) -{ - *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; -} - -void -writeDenseNB32(int Value, void *Base, register unsigned long Offset) -{ - *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; -} - void writeDense8(int Value, void *Base, register unsigned long Offset) { diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c index 85709c629..94853070d 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_init.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c @@ -76,6 +76,9 @@ switch_to(int vt, const char *from) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + void xf86OpenConsole(void) { @@ -166,7 +169,6 @@ xf86OpenConsole(void) i = 0; while (vcs[i] != NULL) { -#pragma GCC diagnostic ignored "-Wformat-nonliteral" snprintf(vtname, sizeof(vtname), vcs[i], xf86Info.vtno); /* /dev/tty1-64 */ if ((xf86Info.consoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) >= 0) break; @@ -272,6 +274,8 @@ xf86OpenConsole(void) } } +#pragma GCC diagnostic pop + void xf86CloseConsole(void) { diff --git a/xserver/hw/xfree86/os-support/linux/lnx_kmod.c b/xserver/hw/xfree86/os-support/linux/lnx_kmod.c index f5917eefb..6d1222655 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_kmod.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_kmod.c @@ -69,7 +69,7 @@ xf86LoadKernelModule(const char *modName) switch (pid = fork()) { case 0: /* child */ /* change real/effective user ID to 0/0 as we need to - * preinstall agpgart module for some DRM modules + * preinstall agpgart module for some DRM modules */ if (setreuid(0, 0)) { xf86Msg(X_WARNING, "LoadKernelModule: " diff --git a/xserver/hw/xfree86/os-support/linux/lnx_platform.c b/xserver/hw/xfree86/os-support/linux/lnx_platform.c index d660761c5..1d145b362 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_platform.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_platform.c @@ -30,8 +30,8 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) int err = 0; Bool paused, server_fd = FALSE; - major = config_odev_get_int_attribute(attribs, ODEV_ATTRIB_MAJOR, 0); - minor = config_odev_get_int_attribute(attribs, ODEV_ATTRIB_MINOR, 0); + major = attribs->major; + minor = attribs->minor; fd = systemd_logind_take_fd(major, minor, path, &paused); if (fd != -1) { @@ -41,7 +41,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) systemd_logind_release_fd(major, minor, -1); return FALSE; } - config_odev_add_int_attribute(attribs, ODEV_ATTRIB_FD, fd); + attribs->fd = fd; server_fd = TRUE; } @@ -73,8 +73,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; buf = drmGetBusid(fd); - xf86_add_platform_device_attrib(delayed_index, - ODEV_ATTRIB_BUSID, buf); + xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); drmFreeBusid(buf); v = drmGetVersion(fd); @@ -83,8 +82,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) goto out; } - xf86_add_platform_device_attrib(delayed_index, ODEV_ATTRIB_DRIVER, - v->name); + xf86_platform_odev_attributes(delayed_index)->driver = XNFstrdup(v->name); drmFreeVersion(v); out: @@ -96,16 +94,9 @@ out: Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid) { - struct OdevAttribute *attrib; - const char *syspath = NULL; + const char *syspath = device->attribs->syspath; BusType bustype; const char *id; - xorg_list_for_each_entry(attrib, &device->attribs->list, member) { - if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) { - syspath = attrib->attrib_name; - break; - } - } if (!syspath) return FALSE; @@ -138,8 +129,7 @@ void xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs) { Bool ret; - char *dpath; - dpath = xf86_get_platform_attrib(index, ODEV_ATTRIB_PATH); + char *dpath = attribs->path; ret = get_drm_info(attribs, dpath, index); if (ret == FALSE) { @@ -155,18 +145,16 @@ void xf86PlatformDeviceProbe(struct OdevAttributes *attribs) { int i; - char *path = NULL; + char *path = attribs->path; Bool ret; - path = config_odev_get_attribute(attribs, ODEV_ATTRIB_PATH); if (!path) goto out_free; for (i = 0; i < xf86_num_platform_devices; i++) { - char *dpath; - dpath = xf86_get_platform_attrib(i, ODEV_ATTRIB_PATH); + char *dpath = xf86_platform_odev_attributes(i)->path; - if (!strcmp(path, dpath)) + if (dpath && !strcmp(path, dpath)) break; } @@ -189,7 +177,7 @@ xf86PlatformDeviceProbe(struct OdevAttributes *attribs) return; out_free: - config_odev_free_attribute_list(attribs); + config_odev_free_attributes(attribs); } void NewGPUDeviceRequest(struct OdevAttributes *attribs) @@ -214,21 +202,15 @@ void NewGPUDeviceRequest(struct OdevAttributes *attribs) void DeleteGPUDeviceRequest(struct OdevAttributes *attribs) { - struct OdevAttribute *attrib; int index; - char *syspath = NULL; + char *syspath = attribs->syspath; - xorg_list_for_each_entry(attrib, &attribs->list, member) { - if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) { - syspath = attrib->attrib_name; - break; - } - } + if (!syspath) + goto out; for (index = 0; index < xf86_num_platform_devices; index++) { - char *dspath; - dspath = xf86_get_platform_attrib(index, ODEV_ATTRIB_SYSPATH); - if (!strcmp(syspath, dspath)) + char *dspath = xf86_platform_odev_attributes(index)->syspath; + if (dspath && !strcmp(syspath, dspath)) break; } @@ -242,7 +224,7 @@ void DeleteGPUDeviceRequest(struct OdevAttributes *attribs) else xf86platformRemoveDevice(index); out: - config_odev_free_attribute_list(attribs); + config_odev_free_attributes(attribs); } #endif diff --git a/xserver/hw/xfree86/os-support/linux/lnx_video.c b/xserver/hw/xfree86/os-support/linux/lnx_video.c index 652f963a2..c09d71947 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_video.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_video.c @@ -38,13 +38,6 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" -#ifdef __alpha__ -#include "shared/xf86Axp.h" -#endif - -#ifdef HAS_MTRR_SUPPORT -#include -#endif static Bool ExtendedEnabled = FALSE; @@ -72,405 +65,16 @@ extern int iopl(int __level); #endif -#ifdef __alpha__ -#define BUS_BASE bus_base -#else -#define BUS_BASE (0) -#endif /* __alpha__ */ - /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ -static void *mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, void *, unsigned long); - -#if defined (__alpha__) -extern void sethae(unsigned long hae); -extern unsigned long _bus_base __P((void)) __attribute__ ((const)); -extern unsigned long _bus_base_sparse __P((void)) __attribute__ ((const)); - -static void *mapVidMemSparse(int, unsigned long, unsigned long, int); -extern axpDevice lnxGetAXP(void); -static void unmapVidMemSparse(int, void *, unsigned long); -static axpDevice axpSystem = -1; -static Bool needSparse; -static unsigned long hae_thresh; -static unsigned long hae_mask; -static unsigned long bus_base; -#endif - -#ifdef HAS_MTRR_SUPPORT - -#define SPLIT_WC_REGIONS 1 - -static void *setWC(int, unsigned long, unsigned long, Bool, MessageType); -static void undoWC(int, void *); - -/* The file desc for /proc/mtrr. Once opened, left opened, and the mtrr - driver will clean up when we exit. */ -#define MTRR_FD_UNOPENED (-1) /* We have yet to open /proc/mtrr */ -#define MTRR_FD_PROBLEM (-2) /* We tried to open /proc/mtrr, but had - a problem. */ -static int mtrr_fd = MTRR_FD_UNOPENED; - -/* Open /proc/mtrr. FALSE on failure. Will always fail on Linux 2.0, - and will fail on Linux 2.2 with MTRR support configured out, - so verbosity should be chosen appropriately. */ -static Bool -mtrr_open(int verbosity) -{ - /* Only report absence of /proc/mtrr once. */ - static Bool warned = FALSE; - - if (mtrr_fd == MTRR_FD_UNOPENED) { - mtrr_fd = open("/proc/mtrr", O_WRONLY); - - if (mtrr_fd < 0) - mtrr_fd = MTRR_FD_PROBLEM; - } - - if (mtrr_fd == MTRR_FD_PROBLEM) { - /* To make sure we only ever warn once, need to check - verbosity outside xf86MsgVerb */ - if (!warned && verbosity <= xf86GetVerbosity()) { - xf86MsgVerb(X_WARNING, verbosity, - "System lacks support for changing MTRRs\n"); - warned = TRUE; - } - - return FALSE; - } - else - return TRUE; -} - -/* - * We maintain a list of WC regions for each physical mapping so they can - * be undone when unmapping. - */ - -struct mtrr_wc_region { - struct mtrr_sentry sentry; - Bool added; /* added WC or removed it */ - struct mtrr_wc_region *next; -}; - -static struct mtrr_wc_region * -mtrr_cull_wc_region(int screenNum, unsigned long base, unsigned long size, - MessageType from) -{ - /* Some BIOS writers thought that setting wc over the mmio - region of a graphics devices was a good idea. Try to fix - it. */ - - struct mtrr_gentry gent; - struct mtrr_wc_region *wcreturn = NULL, *wcr; - int count, ret = 0; - - /* Linux 2.0 users should not get a warning without -verbose */ - if (!mtrr_open(2)) - return NULL; - - for (gent.regnum = 0; - ioctl(mtrr_fd, MTRRIOC_GET_ENTRY, &gent) >= 0; gent.regnum++) { - if (gent.type != MTRR_TYPE_WRCOMB - || gent.base + gent.size <= base || base + size <= gent.base) - continue; - - /* Found an overlapping region. Delete it. */ - - wcr = malloc(sizeof(*wcr)); - if (!wcr) - return NULL; - wcr->sentry.base = gent.base; - wcr->sentry.size = gent.size; - wcr->sentry.type = MTRR_TYPE_WRCOMB; - wcr->added = FALSE; - - count = 3; - while (count-- && - (ret = ioctl(mtrr_fd, MTRRIOC_KILL_ENTRY, &(wcr->sentry))) < 0); - - if (ret >= 0) { - xf86DrvMsg(screenNum, from, - "Removed MMIO write-combining range " - "(0x%lx,0x%lx)\n", - (unsigned long) gent.base, (unsigned long) gent.size); - wcr->next = wcreturn; - wcreturn = wcr; - gent.regnum--; - } - else { - free(wcr); - xf86DrvMsgVerb(screenNum, X_WARNING, 0, - "Failed to remove MMIO " - "write-combining range (0x%lx,0x%lx)\n", - (unsigned long)gent.base, (unsigned long) gent.size); - } - } - return wcreturn; -} - -static struct mtrr_wc_region * -mtrr_remove_offending(int screenNum, unsigned long base, unsigned long size, - MessageType from) -{ - struct mtrr_gentry gent; - struct mtrr_wc_region *wcreturn = NULL, **wcr; - - if (!mtrr_open(2)) - return NULL; - - wcr = &wcreturn; - for (gent.regnum = 0; - ioctl(mtrr_fd, MTRRIOC_GET_ENTRY, &gent) >= 0; gent.regnum++) { - if (gent.type == MTRR_TYPE_WRCOMB - && ((gent.base >= base && gent.base + gent.size < base + size) || - (gent.base > base && gent.base + gent.size <= base + size))) { - *wcr = mtrr_cull_wc_region(screenNum, gent.base, gent.size, from); - if (*wcr) - gent.regnum--; - while (*wcr) { - wcr = &((*wcr)->next); - } - } - } - return wcreturn; -} - -static struct mtrr_wc_region * -mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size, - MessageType from) -{ - struct mtrr_wc_region **wcr, *wcreturn, *curwcr; - - /* - * There can be only one.... - */ - - wcreturn = mtrr_remove_offending(screenNum, base, size, from); - wcr = &wcreturn; - while (*wcr) { - wcr = &((*wcr)->next); - } - - /* Linux 2.0 should not warn, unless the user explicitly asks for - WC. */ - - if (!mtrr_open(from == X_CONFIG ? 0 : 2)) - return wcreturn; - - *wcr = curwcr = malloc(sizeof(**wcr)); - if (!curwcr) - return wcreturn; - - curwcr->sentry.base = base; - curwcr->sentry.size = size; - curwcr->sentry.type = MTRR_TYPE_WRCOMB; - curwcr->added = TRUE; - curwcr->next = NULL; - -#if SPLIT_WC_REGIONS - /* - * Splits up the write-combining region if it is not aligned on a - * size boundary. - */ - - { - unsigned long lbase, d_size = 1; - unsigned long n_size = size; - unsigned long n_base = base; - - for (lbase = n_base, d_size = 1; !(lbase & 1); - lbase = lbase >> 1, d_size <<= 1); - while (d_size > n_size) - d_size = d_size >> 1; - DebugF("WC_BASE: 0x%lx WC_END: 0x%lx\n", base, base + d_size - 1); - n_base += d_size; - n_size -= d_size; - if (n_size) { - xf86DrvMsgVerb(screenNum, X_INFO, 3, "Splitting WC range: " - "base: 0x%lx, size: 0x%lx\n", base, size); - curwcr->next = mtrr_add_wc_region(screenNum, n_base, n_size, from); - } - curwcr->sentry.size = d_size; - } - - /*****************************************************************/ -#endif /* SPLIT_WC_REGIONS */ - - if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &curwcr->sentry) >= 0) { - /* Avoid printing on every VT switch */ - if (xf86ServerIsInitialising()) { - xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx)\n", base, size); - } - return wcreturn; - } - else { - *wcr = curwcr->next; - free(curwcr); - - /* Don't complain about the VGA region: MTRR fixed - regions aren't currently supported, but might be in - the future. */ - if ((unsigned long) base >= 0x100000) { - xf86DrvMsgVerb(screenNum, X_WARNING, 0, - "Failed to set up write-combining range " - "(0x%lx,0x%lx)\n", base, size); - } - return wcreturn; - } -} - -static void -mtrr_undo_wc_region(int screenNum, struct mtrr_wc_region *wcr) -{ - struct mtrr_wc_region *p, *prev; - - if (mtrr_fd >= 0) { - p = wcr; - while (p) { - if (p->added) - ioctl(mtrr_fd, MTRRIOC_DEL_ENTRY, &p->sentry); - prev = p; - p = p->next; - free(prev); - } - } -} - -static void * -setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, - MessageType from) -{ - if (enable) - return mtrr_add_wc_region(screenNum, base, size, from); - else - return mtrr_cull_wc_region(screenNum, base, size, from); -} - -static void -undoWC(int screenNum, void *regioninfo) -{ - mtrr_undo_wc_region(screenNum, regioninfo); -} - -#endif /* HAS_MTRR_SUPPORT */ - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - pVidMem->linearSupported = TRUE; -#ifdef __alpha__ - if (axpSystem == -1) { - axpSystem = lnxGetAXP(); - if ((needSparse = (_bus_base_sparse() > 0))) { - hae_thresh = xf86AXPParams[axpSystem].hae_thresh; - hae_mask = xf86AXPParams[axpSystem].hae_mask; - } - bus_base = _bus_base(); - } - if (needSparse) { - xf86Msg(X_INFO, "Machine needs sparse mapping\n"); - pVidMem->mapMem = mapVidMemSparse; - pVidMem->unmapMem = unmapVidMemSparse; - } - else { - xf86Msg(X_INFO, "Machine type has 8/16 bit access\n"); - pVidMem->mapMem = mapVidMem; - pVidMem->unmapMem = unmapVidMem; - } -#else - pVidMem->mapMem = mapVidMem; - pVidMem->unmapMem = unmapVidMem; -#endif /* __alpha__ */ - -#ifdef HAS_MTRR_SUPPORT - pVidMem->setWC = setWC; - pVidMem->undoWC = undoWC; -#endif pVidMem->initialised = TRUE; } -#ifdef __sparc__ -/* Basically, you simply cannot do this on Sparc. You have to do something portable - * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM - */ -static void * -mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - return NULL; -} -#else -static void * -mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - void *base; - int fd; - int mapflags = MAP_SHARED; - int prot; - memType realBase, alignOff; - - realBase = Base & ~(getpagesize() - 1); - alignOff = Base - realBase; - DebugF("base: %lx, realBase: %lx, alignOff: %lx \n", - Base, realBase, alignOff); - -#if defined(__ia64__) || defined(__arm__) || defined(__s390__) -#ifndef MAP_WRITECOMBINED -#define MAP_WRITECOMBINED 0x00010000 -#endif -#ifndef MAP_NONCACHED -#define MAP_NONCACHED 0x00020000 -#endif - if (flags & VIDMEM_FRAMEBUFFER) - mapflags |= MAP_WRITECOMBINED; - else - mapflags |= MAP_NONCACHED; -#endif - -#if 0 - /* this will disappear when people upgrade their kernels */ - fd = open(DEV_MEM, - ((flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR) | O_SYNC); -#else - fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); -#endif - if (fd < 0) { - FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", - strerror(errno)); - } - - if (flags & VIDMEM_READONLY) - prot = PROT_READ; - else - prot = PROT_READ | PROT_WRITE; - - /* This requires linux-0.99.pl10 or above */ - base = mmap((caddr_t) 0, Size + alignOff, prot, mapflags, fd, - (off_t) realBase + BUS_BASE); - close(fd); - if (base == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap framebuffer" - " (0x%08lx,0x%lx) (%s)\n", Base, Size, strerror(errno)); - } - DebugF("base: %lx aligned base: %lx\n", base, (char *) base + alignOff); - return (char *) base + alignOff; -} -#endif /* !(__sparc__) */ - -static void -unmapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - uintptr_t alignOff = (uintptr_t) Base - - ((uintptr_t) Base & ~(getpagesize() - 1)); - - DebugF("alignment offset: %lx\n", (unsigned long) alignOff); - munmap((void *) ((uintptr_t) Base - alignOff), (Size + alignOff)); -} - /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ @@ -565,17 +169,9 @@ xf86DisableIO(void) #if defined (__alpha__) -#define vuip volatile unsigned int * - extern int readDense8(void *Base, register unsigned long Offset); extern int readDense16(void *Base, register unsigned long Offset); extern int readDense32(void *Base, register unsigned long Offset); -extern void - writeDenseNB8(int Value, void *Base, register unsigned long Offset); -extern void - writeDenseNB16(int Value, void *Base, register unsigned long Offset); -extern void - writeDenseNB32(int Value, void *Base, register unsigned long Offset); extern void writeDense8(int Value, void *Base, register unsigned long Offset); extern void @@ -583,296 +179,12 @@ extern void extern void writeDense32(int Value, void *Base, register unsigned long Offset); -static int readSparse8(void *Base, register unsigned long Offset); -static int readSparse16(void *Base, register unsigned long Offset); -static int readSparse32(void *Base, register unsigned long Offset); -static void - writeSparseNB8(int Value, void *Base, register unsigned long Offset); -static void - writeSparseNB16(int Value, void *Base, register unsigned long Offset); -static void - writeSparseNB32(int Value, void *Base, register unsigned long Offset); -static void - writeSparse8(int Value, void *Base, register unsigned long Offset); -static void - writeSparse16(int Value, void *Base, register unsigned long Offset); -static void - writeSparse32(int Value, void *Base, register unsigned long Offset); - -#define DENSE_BASE 0x2ff00000000UL -#define SPARSE_BASE 0x30000000000UL - -static unsigned long msb_set = 0; - -static void * -mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, - int flags) -{ - int fd, prot; - unsigned long ret, rets = 0; - - static Bool was_here = FALSE; - - if (!was_here) { - was_here = TRUE; - - xf86WriteMmio8 = writeSparse8; - xf86WriteMmio16 = writeSparse16; - xf86WriteMmio32 = writeSparse32; - xf86WriteMmioNB8 = writeSparseNB8; - xf86WriteMmioNB16 = writeSparseNB16; - xf86WriteMmioNB32 = writeSparseNB32; - xf86ReadMmio8 = readSparse8; - xf86ReadMmio16 = readSparse16; - xf86ReadMmio32 = readSparse32; - } - - fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); - if (fd < 0) { - FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", - strerror(errno)); - } - -#if 0 - xf86Msg(X_INFO, "mapVidMemSparse: try Base 0x%lx size 0x%lx flags 0x%x\n", - Base, Size, flags); -#endif - - if (flags & VIDMEM_READONLY) - prot = PROT_READ; - else - prot = PROT_READ | PROT_WRITE; - - /* This requirers linux-0.99.pl10 or above */ - - /* - * Always do DENSE mmap, since read32/write32 currently require it. - */ - ret = (unsigned long) mmap((caddr_t) (DENSE_BASE + Base), Size, - prot, MAP_SHARED, fd, (off_t) (bus_base + Base)); - - /* - * Do SPARSE mmap only when MMIO and not MMIO_32BIT, or FRAMEBUFFER - * and SPARSE (which should require the use of read/write macros). - * - * By not SPARSE mmapping an 8MB framebuffer, we can save approx. 256K - * bytes worth of pagetable (32 pages). - */ - if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) || - ((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE))) { - rets = (unsigned long) mmap((caddr_t) (SPARSE_BASE + (Base << 5)), - Size << 5, prot, MAP_SHARED, fd, - (off_t) _bus_base_sparse() + (Base << 5)); - } - - close(fd); - - if (ret == (unsigned long) MAP_FAILED) { - FatalError("xf86MapVidMemSparse: Could not (dense) mmap fb (%s)\n", - strerror(errno)); - } - - if (((flags & VIDMEM_MMIO) && !(flags & VIDMEM_MMIO_32BIT)) || - ((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE))) { - if (rets == (unsigned long) MAP_FAILED || - rets != (SPARSE_BASE + (Base << 5))) { - FatalError("mapVidMemSparse: Could not (sparse) mmap fb (%s)\n", - strerror(errno)); - } - } - -#if 1 - if (rets) - xf86Msg(X_INFO, "mapVidMemSparse: mapped Base 0x%lx size 0x%lx" - " to DENSE at 0x%lx and SPARSE at 0x%lx\n", - Base, Size, ret, rets); - else - xf86Msg(X_INFO, "mapVidMemSparse: mapped Base 0x%lx size 0x%lx" - " to DENSE only at 0x%lx\n", Base, Size, ret); - -#endif - return (void *) ret; -} - -static void -unmapVidMemSparse(int ScreenNum, void *Base, unsigned long Size) -{ - unsigned long Offset = (unsigned long) Base - DENSE_BASE; - -#if 1 - xf86Msg(X_INFO, "unmapVidMemSparse: unmapping Base 0x%lx Size 0x%lx\n", - Base, Size); -#endif - /* Unmap DENSE always. */ - munmap((caddr_t) Base, Size); - - /* Unmap SPARSE always, and ignore error in case we did not map it. */ - munmap((caddr_t) (SPARSE_BASE + (Offset << 5)), Size << 5); -} - -static int -readSparse8(void *Base, register unsigned long Offset) -{ - register unsigned long result, shift; - register unsigned long msb; - - mem_barrier(); - Offset += (unsigned long) Base - DENSE_BASE; - shift = (Offset & 0x3) << 3; - if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - - mem_barrier(); - result = *(vuip) (SPARSE_BASE + (Offset << 5)); - result >>= shift; - return 0xffUL & result; -} - -static int -readSparse16(void *Base, register unsigned long Offset) -{ - register unsigned long result, shift; - register unsigned long msb; - - mem_barrier(); - Offset += (unsigned long) Base - DENSE_BASE; - shift = (Offset & 0x2) << 3; - if (Offset >= hae_thresh) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - - mem_barrier(); - result = *(vuip) (SPARSE_BASE + (Offset << 5) + (1 << (5 - 2))); - result >>= shift; - return 0xffffUL & result; -} - -static int -readSparse32(void *Base, register unsigned long Offset) -{ - /* NOTE: this is really using DENSE. */ - mem_barrier(); - return *(vuip) ((unsigned long) Base + (Offset)); -} - -static void -writeSparse8(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int b = Value & 0xffU; - - write_mem_barrier(); - Offset += (unsigned long) Base - DENSE_BASE; - if (Offset >= hae_thresh) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - - write_mem_barrier(); - *(vuip) (SPARSE_BASE + (Offset << 5)) = b * 0x01010101; -} - -static void -writeSparse16(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int w = Value & 0xffffU; - - write_mem_barrier(); - Offset += (unsigned long) Base - DENSE_BASE; - if (Offset >= hae_thresh) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - - write_mem_barrier(); - *(vuip) (SPARSE_BASE + (Offset << 5) + (1 << (5 - 2))) = w * 0x00010001; -} - -static void -writeSparse32(int Value, void *Base, register unsigned long Offset) -{ - /* NOTE: this is really using DENSE. */ - write_mem_barrier(); - *(vuip) ((unsigned long) Base + (Offset)) = Value; - return; -} - -static void -writeSparseNB8(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int b = Value & 0xffU; - - Offset += (unsigned long) Base - DENSE_BASE; - if (Offset >= hae_thresh) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - *(vuip) (SPARSE_BASE + (Offset << 5)) = b * 0x01010101; -} - -static void -writeSparseNB16(int Value, void *Base, register unsigned long Offset) -{ - register unsigned long msb; - register unsigned int w = Value & 0xffffU; - - Offset += (unsigned long) Base - DENSE_BASE; - if (Offset >= hae_thresh) { - msb = Offset & hae_mask; - Offset -= msb; - if (msb_set != msb) { - sethae(msb); - msb_set = msb; - } - } - *(vuip) (SPARSE_BASE + (Offset << 5) + (1 << (5 - 2))) = w * 0x00010001; -} - -static void -writeSparseNB32(int Value, void *Base, register unsigned long Offset) -{ - /* NOTE: this is really using DENSE. */ - *(vuip) ((unsigned long) Base + (Offset)) = Value; - return; -} - void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; -void (*xf86WriteMmioNB8) (int Value, void *Base, unsigned long Offset) - = writeDenseNB8; -void (*xf86WriteMmioNB16) (int Value, void *Base, unsigned long Offset) - = writeDenseNB16; -void (*xf86WriteMmioNB32) (int Value, void *Base, unsigned long Offset) - = writeDenseNB32; int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; int (*xf86ReadMmio16) (void *Base, unsigned long Offset) diff --git a/xserver/hw/xfree86/os-support/linux/systemd-logind.c b/xserver/hw/xfree86/os-support/linux/systemd-logind.c index 73a8d55bf..4ad41a374 100644 --- a/xserver/hw/xfree86/os-support/linux/systemd-logind.c +++ b/xserver/hw/xfree86/os-support/linux/systemd-logind.c @@ -40,8 +40,6 @@ #include "systemd-logind.h" -#define DBUS_TIMEOUT 500 /* Wait max 0.5 seconds */ - struct systemd_logind_info { DBusConnection *conn; char *session; @@ -130,7 +128,7 @@ systemd_logind_take_fd(int _major, int _minor, const char *path, } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to take device %s: %s\n", path, error.message); @@ -207,7 +205,7 @@ systemd_logind_release_fd(int _major, int _minor, int fd) } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to release device: %s\n", error.message); @@ -289,7 +287,7 @@ systemd_logind_ack_pause(struct systemd_logind_info *info, } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to ack pause: %s\n", error.message); @@ -313,6 +311,9 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) dbus_int32_t major, minor; char *pause_str; + if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_error_init(&error); if (dbus_message_is_signal(message, @@ -387,7 +388,7 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) LogMessage(X_INFO, "systemd-logind: got %s for %u:%u\n", pause ? "pause" : "resume", major, minor); - pdev = xf86_find_platform_device_by_devnum(major, minor); + pdev = xf86_find_platform_device_by_devnum(major, minor); if (!pdev) pInfo = systemd_logind_find_info_ptr_by_devnum(xf86InputDevs, major, minor); @@ -454,7 +455,7 @@ connect_hook(DBusConnection *connection, void *data) } reply = dbus_connection_send_with_reply_and_block(connection, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to get session: %s\n", error.message); @@ -489,7 +490,7 @@ connect_hook(DBusConnection *connection, void *data) } reply = dbus_connection_send_with_reply_and_block(connection, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: TakeControl failed: %s\n", error.message); @@ -561,7 +562,7 @@ systemd_logind_release_control(struct systemd_logind_info *info) } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: ReleaseControl failed: %s\n", error.message); diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in index 2808d9c86..f03e31016 100644 --- a/xserver/hw/xfree86/os-support/misc/Makefile.in +++ b/xserver/hw/xfree86/os-support/misc/Makefile.in @@ -232,6 +232,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/os-support/misc/SlowBcopy.c b/xserver/hw/xfree86/os-support/misc/SlowBcopy.c index 254748ff6..4f4881ce2 100644 --- a/xserver/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/xserver/hw/xfree86/os-support/misc/SlowBcopy.c @@ -2,14 +2,14 @@ for Alpha Linux *******************************************************************************/ -/* +/* * Create a dependency that should be immune from the effect of register * renaming as is commonly seen in superscalar processors. This should * insert a minimum of 100-ns delays between reads/writes at clock rates * up to 100 MHz---GGL - * - * Slowbcopy(char *src, char *dst, int count) - * + * + * Slowbcopy(char *src, char *dst, int count) + * */ #ifdef HAVE_XORG_CONFIG_H diff --git a/xserver/hw/xfree86/os-support/shared/bios_mmap.c b/xserver/hw/xfree86/os-support/shared/bios_mmap.c deleted file mode 100644 index e000dc9c8..000000000 --- a/xserver/hw/xfree86/os-support/shared/bios_mmap.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 1993 by David Wexelblat - * - * 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 David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -/* - * Read BIOS via mmap()ing DEV_MEM - */ - -#ifndef __alpha__ -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - int fd; - unsigned char *ptr; - int psize; - int mlen; - - if ((fd = open(DEV_MEM, O_RDONLY)) < 0) { - xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n", - DEV_MEM, strerror(errno)); - return -1; - } - psize = getpagesize(); - Offset += Base & (psize - 1); - Base &= ~(psize - 1); - mlen = (Offset + Len + psize - 1) & ~(psize - 1); - ptr = (unsigned char *) mmap((caddr_t) 0, mlen, PROT_READ, - MAP_SHARED, fd, (off_t) Base); - if (ptr == MAP_FAILED) { - xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed (%s)\n", - DEV_MEM, strerror(errno)); - close(fd); - return -1; - } - DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", - Base, ptr[0] | (ptr[1] << 8)); - (void) memcpy(Buf, (void *) (ptr + Offset), Len); - (void) munmap((caddr_t) ptr, mlen); - (void) close(fd); - return Len; -} - -#else /* __alpha__ */ - - /* - * We trick "mmap" into mapping BUS memory for us via BUS_BASE, - * which is the KSEG address of the start of the DENSE memory - * area. - */ - - /* - * NOTE: there prolly ought to be more validity checks and all - * re: boundaries and sizes and such... - */ - -#ifdef linux - -extern unsigned long _bus_base(void); - -#define BUS_BASE _bus_base() - -#else - -extern u_int64_t dense_base(void); - -#define BUS_BASE dense_base() - -#endif - -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - caddr_t base; - int fd; - int psize; - int mlen; - - if ((fd = open(DEV_MEM, O_RDONLY)) < 0) { - xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n", - DEV_MEM, strerror(errno)); - return -1; - } - - psize = getpagesize(); - Offset += Base & (psize - 1); - Base &= ~(psize - 1); - mlen = (Offset + Len + psize - 1) & ~(psize - 1); - base = mmap((caddr_t) 0, mlen, PROT_READ, - MAP_SHARED, fd, (off_t) (Base + BUS_BASE)); - - if (base == MAP_FAILED) { - xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to mmap %s (%s)\n", - DEV_MEM, strerror(errno)); - return -1; - } - - xf86SlowBCopyFromBus((unsigned char *) (base + Offset), Buf, Len); - - munmap((caddr_t) base, mlen); - close(fd); - return Len; -} - -#endif /* __alpha__ */ diff --git a/xserver/hw/xfree86/os-support/shared/ioperm_noop.c b/xserver/hw/xfree86/os-support/shared/ioperm_noop.c index eeacee9cc..de5fb9ba4 100644 --- a/xserver/hw/xfree86/os-support/shared/ioperm_noop.c +++ b/xserver/hw/xfree86/os-support/shared/ioperm_noop.c @@ -22,7 +22,7 @@ */ /* - * Some platforms don't bother with I/O permissions, + * Some platforms don't bother with I/O permissions, * or the permissions are implicit with opening/enabling the console. */ diff --git a/xserver/hw/xfree86/os-support/shared/sigio.c b/xserver/hw/xfree86/os-support/shared/sigio.c index f3c153b89..45949f7a3 100644 --- a/xserver/hw/xfree86/os-support/shared/sigio.c +++ b/xserver/hw/xfree86/os-support/shared/sigio.c @@ -10,11 +10,11 @@ * 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 @@ -22,7 +22,7 @@ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * * Authors: Rickard E. (Rik) Faith */ /* diff --git a/xserver/hw/xfree86/os-support/shared/vidmem.c b/xserver/hw/xfree86/os-support/shared/vidmem.c index f473293c7..a6bf677f5 100644 --- a/xserver/hw/xfree86/os-support/shared/vidmem.c +++ b/xserver/hw/xfree86/os-support/shared/vidmem.c @@ -42,119 +42,7 @@ * This file contains the common part of the video memory mapping functions */ -/* - * Get a piece of the ScrnInfoRec. At the moment, this is only used to hold - * the MTRR option information, but it is likely to be expanded if we do - * auto unmapping of memory at VT switch. - * - */ - -typedef struct { - unsigned long size; - void *virtBase; - void *mtrrInfo; -} MappingRec, *MappingPtr; - -typedef struct { - int numMappings; - MappingPtr *mappings; - Bool mtrrEnabled; - MessageType mtrrFrom; - Bool mtrrOptChecked; - ScrnInfoPtr pScrn; -} VidMapRec, *VidMapPtr; - -static int vidMapIndex = -1; - -#define VIDMAPPTR(p) ((VidMapPtr)((p)->privates[vidMapIndex].ptr)) - static VidMemInfo vidMemInfo = { FALSE, }; -static VidMapRec vidMapRec = { 0, NULL, TRUE, X_DEFAULT, FALSE, NULL }; - -static VidMapPtr -getVidMapRec(int scrnIndex) -{ - VidMapPtr vp; - ScrnInfoPtr pScrn; - - if ((scrnIndex < 0) || !(pScrn = xf86Screens[scrnIndex])) - return &vidMapRec; - - if (vidMapIndex < 0) - vidMapIndex = xf86AllocateScrnInfoPrivateIndex(); - - if (VIDMAPPTR(pScrn) != NULL) - return VIDMAPPTR(pScrn); - - vp = pScrn->privates[vidMapIndex].ptr = xnfcalloc(sizeof(VidMapRec), 1); - vp->mtrrEnabled = TRUE; /* default to enabled */ - vp->mtrrFrom = X_DEFAULT; - vp->mtrrOptChecked = FALSE; - vp->pScrn = pScrn; - return vp; -} - -static MappingPtr -newMapping(VidMapPtr vp) -{ - vp->mappings = xnfrealloc(vp->mappings, sizeof(MappingPtr) * - (vp->numMappings + 1)); - vp->mappings[vp->numMappings] = xnfcalloc(sizeof(MappingRec), 1); - return vp->mappings[vp->numMappings++]; -} - -static MappingPtr -findMapping(VidMapPtr vp, void *vbase, unsigned long size) -{ - int i; - - for (i = 0; i < vp->numMappings; i++) { - if (vp->mappings[i]->virtBase == vbase && vp->mappings[i]->size == size) - return vp->mappings[i]; - } - return NULL; -} - -static void -removeMapping(VidMapPtr vp, MappingPtr mp) -{ - int i, found = 0; - - for (i = 0; i < vp->numMappings; i++) { - if (vp->mappings[i] == mp) { - found = 1; - free(vp->mappings[i]); - } - else if (found) { - vp->mappings[i - 1] = vp->mappings[i]; - } - } - vp->numMappings--; - vp->mappings[vp->numMappings] = NULL; -} - -enum { OPTION_MTRR }; - -static const OptionInfoRec opts[] = { - {OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE}, - {-1, NULL, OPTV_NONE, {0}, FALSE} -}; - -static void -checkMtrrOption(VidMapPtr vp) -{ - if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) { - OptionInfoPtr options; - - options = xnfalloc(sizeof(opts)); - (void) memcpy(options, opts, sizeof(opts)); - xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options, options); - if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled)) - vp->mtrrFrom = X_CONFIG; - free(options); - vp->mtrrOptChecked = TRUE; - } -} void xf86InitVidMem(void) @@ -164,96 +52,3 @@ xf86InitVidMem(void) xf86OSInitVidMem(&vidMemInfo); } } - -void * -xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size) -{ - void *vbase = NULL; - VidMapPtr vp; - MappingPtr mp; - - if (((Flags & VIDMEM_FRAMEBUFFER) && - (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT)))) - FatalError("Mapping memory with more than one type\n"); - - xf86InitVidMem(); - if (!vidMemInfo.initialised || !vidMemInfo.mapMem) - return NULL; - - vbase = vidMemInfo.mapMem(ScreenNum, Base, Size, Flags); - - if (!vbase || vbase == (void *) -1) - return NULL; - - vp = getVidMapRec(ScreenNum); - mp = newMapping(vp); - mp->size = Size; - mp->virtBase = vbase; - - /* - * Check the "mtrr" option even when MTRR isn't supported to avoid - * warnings about unrecognised options. - */ - checkMtrrOption(vp); - - if (vp->mtrrEnabled && vidMemInfo.setWC) { - if (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT)) - mp->mtrrInfo = - vidMemInfo.setWC(ScreenNum, Base, Size, FALSE, vp->mtrrFrom); - else if (Flags & VIDMEM_FRAMEBUFFER) - mp->mtrrInfo = - vidMemInfo.setWC(ScreenNum, Base, Size, TRUE, vp->mtrrFrom); - } - return vbase; -} - -void -xf86UnMapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - VidMapPtr vp; - MappingPtr mp; - - if (!vidMemInfo.initialised || !vidMemInfo.unmapMem) { - xf86DrvMsg(ScreenNum, X_WARNING, - "xf86UnMapVidMem() called before xf86MapVidMem()\n"); - return; - } - - vp = getVidMapRec(ScreenNum); - mp = findMapping(vp, Base, Size); - if (!mp) { - xf86DrvMsg(ScreenNum, X_WARNING, - "xf86UnMapVidMem: cannot find region for [%p,0x%lx]\n", - Base, Size); - return; - } - if (vp->mtrrEnabled && vidMemInfo.undoWC && mp) - vidMemInfo.undoWC(ScreenNum, mp->mtrrInfo); - - vidMemInfo.unmapMem(ScreenNum, Base, Size); - removeMapping(vp, mp); -} - -Bool -xf86CheckMTRR(int ScreenNum) -{ - VidMapPtr vp = getVidMapRec(ScreenNum); - - /* - * Check the "mtrr" option even when MTRR isn't supported to avoid - * warnings about unrecognised options. - */ - checkMtrrOption(vp); - - if (vp->mtrrEnabled && vidMemInfo.setWC) - return TRUE; - - return FALSE; -} - -Bool -xf86LinearVidMem(void) -{ - xf86InitVidMem(); - return vidMemInfo.linearSupported; -} diff --git a/xserver/hw/xfree86/os-support/shared/xf86Axp.c b/xserver/hw/xfree86/os-support/shared/xf86Axp.c deleted file mode 100644 index 5f2f3985e..000000000 --- a/xserver/hw/xfree86/os-support/shared/xf86Axp.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2000 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_XORG_CONFIG_H -#include -#endif - -#include "xf86Axp.h" - -axpParams xf86AXPParams[] = { - {SYS_NONE, 0, 0, 0} - , - {TSUNAMI, 0, 0, 0} - , - {LCA, 1 << 24, 0xf8000000, 1UL << 32} - , - {APECS, 1 << 24, 0xf8000000, 1UL << 32} - , - {T2, 0, 0xFC000000, 1UL << 31} - , - {T2_GAMMA, 0, 0xFC000000, 1UL << 31} - , - {CIA, 0, 0xE0000000, 1UL << 34} - , - {MCPCIA, 0, 0xf8000000, 1UL << 31} - , - {JENSEN, 0, 0xE000000, 1UL << 32} - , - {POLARIS, 0, 0, 0} - , - {PYXIS, 0, 0, 0} - , - {PYXIS_CIA, 0, 0xE0000000, 1UL << 34} - , - {IRONGATE, 0, 0, 0} -}; diff --git a/xserver/hw/xfree86/os-support/shared/xf86Axp.h b/xserver/hw/xfree86/os-support/shared/xf86Axp.h deleted file mode 100644 index fded9d8c9..000000000 --- a/xserver/hw/xfree86/os-support/shared/xf86Axp.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#ifndef _XF86_AXP_H_ -#define _XF86_AXP_H_ - -typedef enum { - SYS_NONE, - TSUNAMI, - LCA, - APECS, - T2, - T2_GAMMA, - CIA, - MCPCIA, - JENSEN, - POLARIS, - PYXIS, - PYXIS_CIA, - IRONGATE -} axpDevice; - -typedef struct { - axpDevice id; - unsigned long hae_thresh; - unsigned long hae_mask; - unsigned long size; -} axpParams; - -extern axpParams xf86AXPParams[]; - -#endif diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.in b/xserver/hw/xfree86/os-support/solaris/Makefile.in index cbba4d87e..350aff275 100644 --- a/xserver/hw/xfree86/os-support/solaris/Makefile.in +++ b/xserver/hw/xfree86/os-support/solaris/Makefile.in @@ -287,6 +287,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/os-support/solaris/sun_apm.c b/xserver/hw/xfree86/os-support/solaris/sun_apm.c index 38fa5ecf2..4d4dbc105 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_apm.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_apm.c @@ -129,7 +129,7 @@ sunToXF86(int type) } /* - * APM events can be requested direclty from /dev/apm + * APM events can be requested direclty from /dev/apm */ static int sunPMGetEventFromOS(int fd, pmEvent * events, int num) diff --git a/xserver/hw/xfree86/os-support/solaris/sun_init.c b/xserver/hw/xfree86/os-support/solaris/sun_init.c index 16fc1b739..cc50f36c4 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_init.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_init.c @@ -46,15 +46,12 @@ #define SOL_CONSOLE_DEV "/dev/console" static Bool KeepTty = FALSE; -static Bool Protect0 = FALSE; static Bool UseConsole = FALSE; #ifdef HAS_USL_VTS static int VTnum = -1; static int xf86StartVT = -1; static int vtEnabled = 0; -extern void xf86VTAcquire(int); -extern void xf86VTRelease(int); #endif /* Device to open as xf86Info.consoleFd */ @@ -97,27 +94,6 @@ xf86OpenConsole(void) if (geteuid() != 0) FatalError("xf86OpenConsole: Server must be suid root\n"); - /* Protect page 0 to help find NULL dereferencing */ - /* mprotect() doesn't seem to work */ - if (Protect0) { - int fd = -1; - - if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0) { - xf86Msg(X_WARNING, - "xf86OpenConsole: cannot open /dev/zero (%s)\n", - strerror(errno)); - } - else { - if (mmap(0, 0x1000, PROT_NONE, - MAP_FIXED | MAP_SHARED, fd, 0) == MAP_FAILED) - xf86Msg(X_WARNING, - "xf86OpenConsole: failed to protect page 0 (%s)\n", - strerror(errno)); - - close(fd); - } - } - #ifdef HAS_USL_VTS /* @@ -370,15 +346,6 @@ xf86ProcessArgument(int argc, char **argv, int i) return 1; } - /* - * Undocumented flag to protect page 0 from read/write to help catch NULL - * pointer dereferences. This is purely a debugging flag. - */ - if (!strcmp(argv[i], "-protect0")) { - Protect0 = TRUE; - return 1; - } - /* * Use /dev/console as the console device. */ diff --git a/xserver/hw/xfree86/os-support/solaris/sun_vid.c b/xserver/hw/xfree86/os-support/solaris/sun_vid.c index fc464871d..25f76181c 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_vid.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_vid.c @@ -63,152 +63,12 @@ /* Video Memory Mapping section */ /***************************************************************************/ -static char *apertureDevName = NULL; -static int apertureDevFD_ro = -1; -static int apertureDevFD_rw = -1; - -static Bool -solOpenAperture(void) -{ - if (apertureDevName == NULL) { - apertureDevName = "/dev/xsvc"; - if ((apertureDevFD_rw = open(apertureDevName, O_RDWR)) < 0) { - xf86MsgVerb(X_WARNING, 0, - "solOpenAperture: failed to open %s (%s)\n", - apertureDevName, strerror(errno)); - apertureDevName = "/dev/fbs/aperture"; - apertureDevFD_rw = open(apertureDevName, O_RDWR); - } - apertureDevFD_ro = open(apertureDevName, O_RDONLY); - - if ((apertureDevFD_rw < 0) || (apertureDevFD_ro < 0)) { - xf86MsgVerb(X_WARNING, 0, - "solOpenAperture: failed to open %s (%s)\n", - apertureDevName, strerror(errno)); - xf86MsgVerb(X_WARNING, 0, - "solOpenAperture: either /dev/fbs/aperture" - " or /dev/xsvc required\n"); - - apertureDevName = NULL; - - if (apertureDevFD_rw >= 0) { - close(apertureDevFD_rw); - } - apertureDevFD_rw = -1; - - if (apertureDevFD_ro >= 0) { - close(apertureDevFD_ro); - } - apertureDevFD_ro = -1; - - return FALSE; - } - } - return TRUE; -} - -static void * -solMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) -{ - void *base; - int fd; - int prot; - - if (Flags & VIDMEM_READONLY) { - fd = apertureDevFD_ro; - prot = PROT_READ; - } - else { - fd = apertureDevFD_rw; - prot = PROT_READ | PROT_WRITE; - } - - if (fd < 0) { - xf86DrvMsg(ScreenNum, X_ERROR, - "solMapVidMem: failed to open %s (%s)\n", - apertureDevName, strerror(errno)); - return NULL; - } - - base = mmap(NULL, Size, prot, MAP_SHARED, fd, (off_t) Base); - - if (base == MAP_FAILED) { - xf86DrvMsg(ScreenNum, X_ERROR, - "solMapVidMem: failed to mmap %s (0x%08lx,0x%lx) (%s)\n", - apertureDevName, Base, Size, strerror(errno)); - return NULL; - } - - return base; -} - -/* ARGSUSED */ -static void -solUnMapVidMem(int ScreenNum, void *Base, unsigned long Size) -{ - if (munmap(Base, Size) != 0) { - xf86DrvMsgVerb(ScreenNum, X_WARNING, 0, - "solUnMapVidMem: failed to unmap %s" - " (0x%p,0x%lx) (%s)\n", - apertureDevName, Base, Size, strerror(errno)); - } -} - _X_HIDDEN void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - pVidMem->linearSupported = solOpenAperture(); - if (pVidMem->linearSupported) { - pVidMem->mapMem = solMapVidMem; - pVidMem->unmapMem = solUnMapVidMem; - } - else { - xf86MsgVerb(X_WARNING, 0, - "xf86OSInitVidMem: linear memory access disabled\n"); - } pVidMem->initialised = TRUE; } -/* - * Read BIOS via mmap()ing physical memory. - */ -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - unsigned char *ptr; - int psize; - int mlen; - - psize = getpagesize(); - Offset += Base & (psize - 1); - Base &= ~(psize - 1); - mlen = (Offset + Len + psize - 1) & ~(psize - 1); - - if (solOpenAperture() == FALSE) { - xf86Msg(X_WARNING, - "xf86ReadBIOS: Failed to open aperture to read BIOS\n"); - return -1; - } - - ptr = (unsigned char *) mmap(NULL, mlen, PROT_READ, - MAP_SHARED, apertureDevFD_ro, (off_t) Base); - if (ptr == MAP_FAILED) { - xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed [0x%08lx, 0x%04x]\n", - apertureDevName, Base, mlen); - return -1; - } - - (void) memcpy(Buf, (void *) (ptr + Offset), Len); - if (munmap((caddr_t) ptr, mlen) != 0) { - xf86MsgVerb(X_WARNING, 0, - "xf86ReadBIOS: failed to unmap %s (0x%p,0x%x) (%s)\n", - apertureDevName, ptr, mlen, strerror(errno)); - } - - return Len; -} - /***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.am b/xserver/hw/xfree86/os-support/stub/Makefile.am index a39e17d55..19468c6de 100644 --- a/xserver/hw/xfree86/os-support/stub/Makefile.am +++ b/xserver/hw/xfree86/os-support/stub/Makefile.am @@ -14,6 +14,5 @@ libstub_la_SOURCES = \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ stub_bell.c \ - stub_bios.c \ stub_init.c \ stub_video.c diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.in b/xserver/hw/xfree86/os-support/stub/Makefile.in index 4e9ea05ab..00b96d4cd 100644 --- a/xserver/hw/xfree86/os-support/stub/Makefile.in +++ b/xserver/hw/xfree86/os-support/stub/Makefile.in @@ -76,7 +76,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libstub_la_LIBADD = am_libstub_la_OBJECTS = VTsw_noop.lo agp_noop.lo ioperm_noop.lo \ kmod_noop.lo pm_noop.lo vidmem.lo posix_tty.lo sigio.lo \ - stub_bell.lo stub_bios.lo stub_init.lo stub_video.lo + stub_bell.lo stub_init.lo stub_video.lo libstub_la_OBJECTS = $(am_libstub_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -484,7 +485,6 @@ libstub_la_SOURCES = \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ stub_bell.c \ - stub_bios.c \ stub_init.c \ stub_video.c @@ -550,7 +550,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix_tty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_bell.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_bios.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vidmem.Plo@am__quote@ diff --git a/xserver/hw/xfree86/os-support/stub/stub_bios.c b/xserver/hw/xfree86/os-support/stub/stub_bios.c deleted file mode 100644 index dbc92fcdb..000000000 --- a/xserver/hw/xfree86/os-support/stub/stub_bios.c +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86_OSlib.h" - -int -xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, - int Len) -{ - return -1; -} diff --git a/xserver/hw/xfree86/os-support/xf86OSpriv.h b/xserver/hw/xfree86/os-support/xf86OSpriv.h index 7f003e8ce..ce1ec33a1 100644 --- a/xserver/hw/xfree86/os-support/xf86OSpriv.h +++ b/xserver/hw/xfree86/os-support/xf86OSpriv.h @@ -32,21 +32,8 @@ #ifndef _XF86OSPRIV_H #define _XF86OSPRIV_H -typedef void *(*MapMemProcPtr) (int, unsigned long, unsigned long, int); -typedef void (*UnmapMemProcPtr) (int, void *, unsigned long); -typedef void *(*SetWCProcPtr) (int, unsigned long, unsigned long, Bool, - MessageType); -typedef void (*ProtectMemProcPtr) (int, void *, unsigned long, Bool); -typedef void (*UndoWCProcPtr) (int, void *); - typedef struct { Bool initialised; - MapMemProcPtr mapMem; - UnmapMemProcPtr unmapMem; - ProtectMemProcPtr protectMem; - SetWCProcPtr setWC; - UndoWCProcPtr undoWC; - Bool linearSupported; } VidMemInfo, *VidMemInfoPtr; void xf86OSInitVidMem(VidMemInfoPtr); diff --git a/xserver/hw/xfree86/os-support/xf86_OSlib.h b/xserver/hw/xfree86/os-support/xf86_OSlib.h index eb0a338c9..6190fe6a0 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSlib.h +++ b/xserver/hw/xfree86/os-support/xf86_OSlib.h @@ -15,19 +15,19 @@ * 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 names of the above listed copyright holders - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of the above listed copyright holders + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed - * copyright holders make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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 + * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. * */ @@ -37,7 +37,7 @@ * * Copyright 1997 * Digital Equipment Corporation. All rights reserved. - * This software is furnished under license and may be used and copied only in + * This software is furnished under license and may be used and copied only in * accordance with the following terms and conditions. Subject to these * conditions, you may download, copy, install, use, modify and distribute * this software in source and/or binary form. No title or ownership is @@ -47,7 +47,7 @@ * this copyright notice and list of conditions as they appear in the * source file. * - * 2) No right is granted to use any trade name, trademark, or logo of Digital + * 2) No right is granted to use any trade name, trademark, or logo of Digital * Equipment Corporation. Neither the "Digital Equipment Corporation" * name nor any trademark or logo of Digital Equipment Corporation may be * used to endorse or promote products derived from this software without @@ -59,9 +59,9 @@ * In no event shall DIGITAL be liable for any damages whatsoever, and in * particular, DIGITAL shall not be liable for special, indirect, * consequential, or incidental damages or damages for lost profits, loss - * of revenue or loss of use, whether such damages arise in contract, + * of revenue or loss of use, whether such damages arise in contract, * negligence, tort, under statute, in equity, at law or otherwise, even - * if advised of the possibility of such damage. + * if advised of the possibility of such damage. * */ @@ -134,10 +134,15 @@ #endif #include #include + +extern _X_HIDDEN void xf86VTAcquire(int); +extern _X_HIDDEN void xf86VTRelease(int); #endif #if defined(sun) #include +extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; + #include #include @@ -331,7 +336,7 @@ struct pcvtid { /* For PATH_MAX */ #include "misc.h" -/* +/* * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere, * and it's safe, so just do it. */ @@ -364,8 +369,4 @@ struct pcvtid { #define XF86_OS_PRIVS #include "xf86_OSproc.h" -#ifndef NO_COMPILER_H -#include "compiler.h" -#endif - #endif /* _XF86_OSLIB_H */ diff --git a/xserver/hw/xfree86/os-support/xf86_OSproc.h b/xserver/hw/xfree86/os-support/xf86_OSproc.h index 8d27e8b7b..fa3ff0ee3 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSproc.h +++ b/xserver/hw/xfree86/os-support/xf86_OSproc.h @@ -14,19 +14,19 @@ * 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 names of the above listed copyright holders - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of the above listed copyright holders + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed - * copyright holders make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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 + * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. * */ @@ -36,7 +36,7 @@ * * Copyright 1997 * Digital Equipment Corporation. All rights reserved. - * This software is furnished under license and may be used and copied only in + * This software is furnished under license and may be used and copied only in * accordance with the following terms and conditions. Subject to these * conditions, you may download, copy, install, use, modify and distribute * this software in source and/or binary form. No title or ownership is @@ -46,7 +46,7 @@ * this copyright notice and list of conditions as they appear in the * source file. * - * 2) No right is granted to use any trade name, trademark, or logo of Digital + * 2) No right is granted to use any trade name, trademark, or logo of Digital * Equipment Corporation. Neither the "Digital Equipment Corporation" * name nor any trademark or logo of Digital Equipment Corporation may be * used to endorse or promote products derived from this software without @@ -58,9 +58,9 @@ * In no event shall DIGITAL be liable for any damages whatsoever, and in * particular, DIGITAL shall not be liable for special, indirect, * consequential, or incidental damages or damages for lost profits, loss - * of revenue or loss of use, whether such damages arise in contract, + * of revenue or loss of use, whether such damages arise in contract, * negligence, tort, under statute, in equity, at law or otherwise, even - * if advised of the possibility of such damage. + * if advised of the possibility of such damage. * */ @@ -73,24 +73,6 @@ * stuff like sys/stat.h, etc. This casues problem for loadable modules. */ -/* - * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The - * flags may be used as hints. For example it would be permissible to - * enable write combining for memory marked only for framebuffer use. - */ - -#define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */ -#define VIDMEM_MMIO 0x02 /* memory for I/O use */ -#define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */ -#define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */ -#define VIDMEM_SPARSE 0x10 /* sparse mapping required - * assumed when VIDMEM_MMIO is - * set. May be used with - * VIDMEM_FRAMEBUFFER) */ -#define VIDMEM_READONLY 0x20 /* read-only mapping - * used when reading BIOS images - * through xf86MapVidMem() */ - /* * OS-independent modem state flags for xf86SetSerialModemState() and * xf86GetSerialModemState(). @@ -130,14 +112,6 @@ _XFUNCPROTOBEGIN /* public functions */ -extern _X_EXPORT Bool xf86LinearVidMem(void); -extern _X_EXPORT _X_DEPRECATED Bool xf86CheckMTRR(int); -extern _X_EXPORT _X_DEPRECATED void *xf86MapVidMem(int, int, unsigned long, - unsigned long); -extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, void *, - unsigned long); -extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, - int); extern _X_EXPORT Bool xf86EnableIO(void); extern _X_EXPORT void xf86DisableIO(void); diff --git a/xserver/hw/xfree86/parser/Configint.h b/xserver/hw/xfree86/parser/Configint.h index e85322006..31035ae2d 100644 --- a/xserver/hw/xfree86/parser/Configint.h +++ b/xserver/hw/xfree86/parser/Configint.h @@ -1,17 +1,17 @@ /* - * + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. @@ -52,7 +52,7 @@ * authorization from the copyright holder(s) and author(s). */ -/* +/* * These definitions are used through out the configuration file parser, but * they should not be visible outside of the parser. */ @@ -122,7 +122,7 @@ else\ xf86parseError (__VA_ARGS__); CLEANUP (ptr); return NULL; \ } while (0) -/* +/* * These are defines for error messages to promote consistency. * error messages are preceded by the line number, section and file name, * so these messages should be about the specific keyword and syntax in error. diff --git a/xserver/hw/xfree86/parser/DRI.c b/xserver/hw/xfree86/parser/DRI.c index 6be32d7ea..9ed5b9ea9 100644 --- a/xserver/hw/xfree86/parser/DRI.c +++ b/xserver/hw/xfree86/parser/DRI.c @@ -11,11 +11,11 @@ * 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 @@ -23,8 +23,8 @@ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * - * + * + * */ #ifdef HAVE_XORG_CONFIG_H diff --git a/xserver/hw/xfree86/parser/Device.c b/xserver/hw/xfree86/parser/Device.c index d3ac29351..7e49843bd 100644 --- a/xserver/hw/xfree86/parser/Device.c +++ b/xserver/hw/xfree86/parser/Device.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -83,7 +83,6 @@ xf86ConfigSymTabRec DeviceTab[] = { {CARD, "card"}, {DRIVER, "driver"}, {BUSID, "busid"}, - {TEXTCLOCKFRQ, "textclockfreq"}, {IRQ, "irq"}, {SCREEN, "screen"}, {-1, ""}, @@ -212,11 +211,6 @@ xf86parseDeviceSection(void) ptr->dev_clocks = i; xf86unGetToken(token); break; - case TEXTCLOCKFRQ: - if ((token = xf86getSubToken(&(ptr->dev_comment))) != NUMBER) - Error(NUMBER_MSG, "TextClockFreq"); - ptr->dev_textclockfreq = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); - break; case MATCHSEAT: if (xf86getSubToken(&(ptr->dev_comment)) != STRING) Error(QUOTE_MSG, "MatchSeat"); @@ -312,10 +306,6 @@ xf86printDeviceSection(FILE * cf, XF86ConfDevicePtr ptr) fprintf(cf, "%.1f ", (double) ptr->dev_clock[i] / 1000.0); fprintf(cf, "\n"); } - if (ptr->dev_textclockfreq) { - fprintf(cf, "\tTextClockFreq %.1f\n", - (double) ptr->dev_textclockfreq / 1000.0); - } if (ptr->dev_busid) fprintf(cf, "\tBusID \"%s\"\n", ptr->dev_busid); if (ptr->dev_screen > 0) diff --git a/xserver/hw/xfree86/parser/Files.c b/xserver/hw/xfree86/parser/Files.c index 24940a9c2..849bf92bb 100644 --- a/xserver/hw/xfree86/parser/Files.c +++ b/xserver/hw/xfree86/parser/Files.c @@ -1,16 +1,16 @@ -/* +/* * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -18,11 +18,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Flags.c b/xserver/hw/xfree86/parser/Flags.c index 71b50acf7..516966508 100644 --- a/xserver/hw/xfree86/parser/Flags.c +++ b/xserver/hw/xfree86/parser/Flags.c @@ -1,16 +1,16 @@ -/* +/* * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -18,11 +18,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -100,7 +100,7 @@ xf86parseFlagsSection(void) case COMMENT: ptr->flg_comment = xf86addComment(ptr->flg_comment, xf86_lex_val.str); break; - /* + /* * these old keywords are turned into standard generic options. * we fall through here on purpose */ diff --git a/xserver/hw/xfree86/parser/Input.c b/xserver/hw/xfree86/parser/Input.c index 1bfe5c100..cfacd4eee 100644 --- a/xserver/hw/xfree86/parser/Input.c +++ b/xserver/hw/xfree86/parser/Input.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Layout.c b/xserver/hw/xfree86/parser/Layout.c index 994b31ae4..0ace5da4a 100644 --- a/xserver/hw/xfree86/parser/Layout.c +++ b/xserver/hw/xfree86/parser/Layout.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Makefile.in b/xserver/hw/xfree86/parser/Makefile.in index 56b4ae003..4d8b773da 100644 --- a/xserver/hw/xfree86/parser/Makefile.in +++ b/xserver/hw/xfree86/parser/Makefile.in @@ -290,6 +290,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/parser/Module.c b/xserver/hw/xfree86/parser/Module.c index e2d9120cb..0dcf4bac4 100644 --- a/xserver/hw/xfree86/parser/Module.c +++ b/xserver/hw/xfree86/parser/Module.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Monitor.c b/xserver/hw/xfree86/parser/Monitor.c index 8aebce079..0a8c08178 100644 --- a/xserver/hw/xfree86/parser/Monitor.c +++ b/xserver/hw/xfree86/parser/Monitor.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -553,7 +553,7 @@ xf86parseMonitorSection(void) if ((token = xf86getSubToken(&(ptr->mon_comment))) != STRING) Error(QUOTE_MSG, "UseModes"); - /* add to the end of the list of modes sections + /* add to the end of the list of modes sections referenced here */ mptr = calloc(1, sizeof(XF86ConfModesLinkRec)); mptr->list.next = NULL; diff --git a/xserver/hw/xfree86/parser/Pointer.c b/xserver/hw/xfree86/parser/Pointer.c index fe60d95aa..2f9d505ff 100644 --- a/xserver/hw/xfree86/parser/Pointer.c +++ b/xserver/hw/xfree86/parser/Pointer.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Screen.c b/xserver/hw/xfree86/parser/Screen.c index 0e9746ae5..9d8eda277 100644 --- a/xserver/hw/xfree86/parser/Screen.c +++ b/xserver/hw/xfree86/parser/Screen.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Vendor.c b/xserver/hw/xfree86/parser/Vendor.c index 2c870ae7f..4f6e510bb 100644 --- a/xserver/hw/xfree86/parser/Vendor.c +++ b/xserver/hw/xfree86/parser/Vendor.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/Video.c b/xserver/hw/xfree86/parser/Video.c index 93209c499..666b0ab9a 100644 --- a/xserver/hw/xfree86/parser/Video.c +++ b/xserver/hw/xfree86/parser/Video.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/read.c b/xserver/hw/xfree86/parser/read.c index 22f6e6af4..327c02a4d 100644 --- a/xserver/hw/xfree86/parser/read.c +++ b/xserver/hw/xfree86/parser/read.c @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -68,7 +68,7 @@ static xf86ConfigSymTabRec TopLevelTab[] = { #define CLEANUP xf86freeConfig -/* +/* * This function resolves name references and reports errors if the named * objects cannot be found. */ @@ -221,7 +221,7 @@ xf86readConfigFile(void) #undef CLEANUP -/* +/* * adds an item to the end of the linked list. Any record whose first field * is a GenericListRec can be cast to this type and used with this function. * A pointer to the head of the list is returned to handle the addition of @@ -246,7 +246,7 @@ xf86addListItem(GenericListPtr head, GenericListPtr new) return new; } -/* +/* * Test if one chained list contains the other. * In this case both list have the same endpoint (provided they don't loop) */ diff --git a/xserver/hw/xfree86/parser/scan.c b/xserver/hw/xfree86/parser/scan.c index a6c12957b..b8a08cf5d 100644 --- a/xserver/hw/xfree86/parser/scan.c +++ b/xserver/hw/xfree86/parser/scan.c @@ -1,16 +1,16 @@ -/* +/* * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -18,11 +18,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -241,7 +241,7 @@ xf86getNextLine(void) return ret; } -/* +/* * xf86getToken -- * Read next Token from the config file. Handle the global variable * pushToken. @@ -251,7 +251,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) { int c, i; - /* + /* * First check whether pushToken has a different value than LOCK_TOKEN. * In this case rBuf[] contains a valid STRING/TOKEN/NUMBER. But in the * oth * case the next token must be read from the input. @@ -266,9 +266,9 @@ xf86getToken(xf86ConfigSymTabRec * tab) c = configBuf[configPos]; - /* + /* * Get start of next Token. EOF is handled, - * whitespaces are skipped. + * whitespaces are skipped. */ again: @@ -344,7 +344,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) return DASH; } - /* + /* * Numbers are returned immediately ... */ if (isdigit(c)) { @@ -379,7 +379,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) return NUMBER; } - /* + /* * All Strings START with a \" ... */ else if (c == '\"') { @@ -394,7 +394,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) return STRING; } - /* + /* * ... and now we MUST have a valid token. The search is * handled later along with the pushed tokens. */ @@ -414,7 +414,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) } else { - /* + /* * Here we deal with pushed tokens. Reinitialize pushToken again. If * the pushed token was NUMBER || STRING return them again ... */ @@ -428,7 +428,7 @@ xf86getToken(xf86ConfigSymTabRec * tab) return temp; } - /* + /* * Joop, at last we have to lookup the token ... */ if (tab) { @@ -1018,7 +1018,7 @@ xf86setSection(const char *section) configSection = strdup(section); } -/* +/* * xf86getToken -- * Lookup a string if it is actually a token in disguise. */ @@ -1040,7 +1040,7 @@ StringToToken(const char *str, xf86ConfigSymTabRec * tab) return ERROR_TOKEN; } -/* +/* * Compare two names. The characters '_', ' ', and '\t' are ignored * in the comparison. */ diff --git a/xserver/hw/xfree86/parser/write.c b/xserver/hw/xfree86/parser/write.c index 472b27ba1..8792783ef 100644 --- a/xserver/hw/xfree86/parser/write.c +++ b/xserver/hw/xfree86/parser/write.c @@ -1,16 +1,16 @@ -/* +/* * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -18,11 +18,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. diff --git a/xserver/hw/xfree86/parser/xf86Optrec.h b/xserver/hw/xfree86/parser/xf86Optrec.h index ea0cb1329..dfa907989 100644 --- a/xserver/hw/xfree86/parser/xf86Optrec.h +++ b/xserver/hw/xfree86/parser/xf86Optrec.h @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2001 by The XFree86 Project, Inc. @@ -52,7 +52,7 @@ * authorization from the copyright holder(s) and author(s). */ -/* +/* * This file contains the Option Record that is passed between the Parser, * and Module setup procs. */ diff --git a/xserver/hw/xfree86/parser/xf86Parser.h b/xserver/hw/xfree86/parser/xf86Parser.h index 3fa5b716d..43e17550c 100644 --- a/xserver/hw/xfree86/parser/xf86Parser.h +++ b/xserver/hw/xfree86/parser/xf86Parser.h @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -52,7 +52,7 @@ * authorization from the copyright holder(s) and author(s). */ -/* +/* * This file contains the external interfaces for the XFree86 configuration * file parser. */ @@ -211,7 +211,6 @@ typedef struct { const char *dev_ramdac; int dev_dacSpeeds[CONF_MAXDACSPEEDS]; int dev_videoram; - int dev_textclockfreq; unsigned long dev_bios_base; unsigned long dev_mem_base; unsigned long dev_io_base; diff --git a/xserver/hw/xfree86/parser/xf86tokens.h b/xserver/hw/xfree86/parser/xf86tokens.h index 5c01ce701..9c44970ea 100644 --- a/xserver/hw/xfree86/parser/xf86tokens.h +++ b/xserver/hw/xfree86/parser/xf86tokens.h @@ -1,17 +1,17 @@ -/* - * +/* + * * Copyright (c) 1997 Metro Link Incorporated - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), + * 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 @@ -19,11 +19,11 @@ * 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 Metro Link shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from Metro Link. - * + * */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -62,7 +62,7 @@ /* Undefine symbols that some OSs might define */ #undef IOBASE -/* +/* * Each token should have a unique value regardless of the section * it is used in. */ @@ -187,7 +187,6 @@ typedef enum { CHIPREV, CARD, BUSID, - TEXTCLOCKFRQ, IRQ, /* Keyboard tokens */ diff --git a/xserver/hw/xfree86/ramdac/IBM.c b/xserver/hw/xfree86/ramdac/IBM.c index 45876cfb7..6822be5f1 100644 --- a/xserver/hw/xfree86/ramdac/IBM.c +++ b/xserver/hw/xfree86/ramdac/IBM.c @@ -576,7 +576,7 @@ IBMramdac526LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); int i; - /* + /* * Output the cursor data. The realize function has put the planes into * their correct order, so we can just blast this out. */ @@ -591,7 +591,7 @@ IBMramdac640LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn); int i; - /* + /* * Output the cursor data. The realize function has put the planes into * their correct order, so we can just blast this out. */ diff --git a/xserver/hw/xfree86/ramdac/Makefile.in b/xserver/hw/xfree86/ramdac/Makefile.in index 8bb4c19fc..ebe00cabe 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.in +++ b/xserver/hw/xfree86/ramdac/Makefile.in @@ -263,6 +263,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/ramdac/TI.c b/xserver/hw/xfree86/ramdac/TI.c index 2492bb531..f8081caea 100644 --- a/xserver/hw/xfree86/ramdac/TI.c +++ b/xserver/hw/xfree86/ramdac/TI.c @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, * - * Modified from IBM.c to support TI RAMDAC routines + * Modified from IBM.c to support TI RAMDAC routines * by Jens Owen, . */ diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.c b/xserver/hw/xfree86/ramdac/xf86Cursor.c index fac682210..04496d531 100644 --- a/xserver/hw/xfree86/ramdac/xf86Cursor.c +++ b/xserver/hw/xfree86/ramdac/xf86Cursor.c @@ -332,8 +332,10 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, ScreenPriv->HotX = cursor->bits->xhot; ScreenPriv->HotY = cursor->bits->yhot; - if (!infoPtr->pScrn->vtSema) + if (!infoPtr->pScrn->vtSema) { ScreenPriv->SavedCursor = cursor; + return; + } if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) && (ScreenPriv->ForceHWCursorCount || @@ -347,7 +349,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, (cursor->bits->height <= infoPtr->MaxHeight) && (cursor->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) { - + if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x, y); diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c index 953c86abc..be7154e0f 100644 --- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -214,7 +214,7 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; #ifdef ARGB_CURSOR - /* recoloring isn't applicable to ARGB cursors and drivers + /* recoloring isn't applicable to ARGB cursors and drivers shouldn't have to ignore SetCursorColors requests */ if (pCurs->bits->argb) return; diff --git a/xserver/hw/xfree86/ramdac/xf86RamDac.h b/xserver/hw/xfree86/ramdac/xf86RamDac.h index 50a659a22..af16b7faa 100644 --- a/xserver/hw/xfree86/ramdac/xf86RamDac.h +++ b/xserver/hw/xfree86/ramdac/xf86RamDac.h @@ -12,8 +12,8 @@ typedef struct _RamDacRegRec { /* This is probably the nastiest assumption, we allocate 1024 slots for - * ramdac registers, should be enough. I've checked IBM and TVP series - * and they seem o.k + * ramdac registers, should be enough. I've checked IBM and TVP series + * and they seem o.k * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME */ unsigned short DacRegs[0x400]; /* register set */ diff --git a/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c b/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c index fa7a86663..2a0f75569 100644 --- a/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c +++ b/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c @@ -35,7 +35,6 @@ #include "micmap.h" #include "xf86.h" -#include "compiler.h" #include "colormapst.h" #include "xf86RamDacPriv.h" diff --git a/xserver/hw/xfree86/sdksyms.sh b/xserver/hw/xfree86/sdksyms.sh index f48078584..8344d0b67 100644 --- a/xserver/hw/xfree86/sdksyms.sh +++ b/xserver/hw/xfree86/sdksyms.sh @@ -8,6 +8,7 @@ cat > sdksyms.c << EOF #include #endif + /* These must be included first */ #include "misc.h" #include "miscstruct.h" @@ -215,10 +216,7 @@ cat > sdksyms.c << EOF #include "mizerarc.h" #include "micoord.h" #include "mifillarc.h" -#include "mispans.h" -#include "miwideline.h" #include "mistruct.h" -#include "mifpoly.h" #include "mioverlay.h" @@ -311,14 +309,6 @@ cat > sdksyms.c << EOF EOF -case `gcc -dumpversion` in - [23].*) - n=2 - ;; - 4.*) - n=3 - ;; -esac topdir=$1 shift LC_ALL=C @@ -359,14 +349,26 @@ BEGIN { /^extern[ ]/ { if (sdk) { n = 3; - printf("/* %s */\n", $0) + + # skip line numbers GCC 5 adds before __attribute__ + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + # skip attribute, if any while ($n ~ /^(__attribute__|__global)/ || # skip modifiers, if any $n ~ /^\*?(unsigned|const|volatile|struct|_X_EXPORT)$/ || # skip pointer - $n ~ /^[a-zA-Z0-9_]*\*$/) + $n ~ /^[a-zA-Z0-9_]*\*$/) { n++; + # skip line numbers GCC 5 adds after __attribute__ + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + } # type specifier may not be set, as in # extern _X_EXPORT unsigned name(...) diff --git a/xserver/hw/xfree86/shadowfb/Makefile.in b/xserver/hw/xfree86/shadowfb/Makefile.in index 198d5da70..330a1dfa1 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.in +++ b/xserver/hw/xfree86/shadowfb/Makefile.in @@ -267,6 +267,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/shadowfb/shadowfb.h b/xserver/hw/xfree86/shadowfb/shadowfb.h index bcf59f9b2..b3dd44872 100644 --- a/xserver/hw/xfree86/shadowfb/shadowfb.h +++ b/xserver/hw/xfree86/shadowfb/shadowfb.h @@ -26,7 +26,7 @@ extern _X_EXPORT Bool * ShadowFBInit2 is a more featureful refinement of the original shadowfb. * ShadowFBInit2 allows you to specify two callbacks, one to be called * immediately before an operation that modifies the framebuffer, and another - * to be called immediately after. + * to be called immediately after. * * Returns FALSE in the event of an error */ diff --git a/xserver/hw/xfree86/utils/Makefile.in b/xserver/hw/xfree86/utils/Makefile.in index 7e8c7d22b..f9cfc1efc 100644 --- a/xserver/hw/xfree86/utils/Makefile.in +++ b/xserver/hw/xfree86/utils/Makefile.in @@ -238,6 +238,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/utils/cvt/Makefile.in b/xserver/hw/xfree86/utils/cvt/Makefile.in index 27bf6d9b8..62537761c 100644 --- a/xserver/hw/xfree86/utils/cvt/Makefile.in +++ b/xserver/hw/xfree86/utils/cvt/Makefile.in @@ -260,6 +260,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/utils/gtf/Makefile.in b/xserver/hw/xfree86/utils/gtf/Makefile.in index fb3b898e4..e65ca6a95 100644 --- a/xserver/hw/xfree86/utils/gtf/Makefile.in +++ b/xserver/hw/xfree86/utils/gtf/Makefile.in @@ -259,6 +259,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/utils/gtf/gtf.c b/xserver/hw/xfree86/utils/gtf/gtf.c index 15503bb35..e88387df0 100644 --- a/xserver/hw/xfree86/utils/gtf/gtf.c +++ b/xserver/hw/xfree86/utils/gtf/gtf.c @@ -4,11 +4,11 @@ * * Copyright (c) 2001, Andy Ritger aritger@nvidia.com * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * o Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * o Redistributions in binary form must reproduce the above copyright @@ -33,7 +33,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * + * * * This program is based on the Generalized Timing Formula(GTF TM) * Standard Version: 1.0, Revision: 1.0 @@ -52,7 +52,7 @@ * of suitability for any purpose. The sample code contained within * this standard may be used without restriction. * - * + * * * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive) * implementation of the GTF Timing Standard, is available at: @@ -77,12 +77,12 @@ * any experience with this, and 2) neither XServer modelines nor * fbset fb.modes provide an obvious way for margin timings to be * included in their mode descriptions (needs more investigation). - * + * * The GTF provides for computation of interlaced mode timings; * I've implemented the computations but not enabled them, yet. * I should probably enable and test this at some point. * - * + * * * TODO: * @@ -95,7 +95,7 @@ * o It would be nice if this were more general purpose to do things * outside the scope of the GTF: like generate double scan mode * timings, for example. - * + * * o Printing digits to the right of the decimal point when the * digits are 0 annoys me. * @@ -191,7 +191,7 @@ print_xf86_mode(mode * m) * to the portion of the hblank before and after the sync pulse * by conceptually wrapping the portion of the blank after the pulse * to infront of the visible region; ie: - * + * * * Timing description I'm accustomed to: * @@ -202,7 +202,7 @@ print_xf86_mode(mode * m) * |-------------------|_______| |_______ * * R SS SE FL - * + * * 1: visible image * 2: blank before sync (aka front porch) * 3: sync pulse @@ -216,10 +216,10 @@ print_xf86_mode(mode * m) * But the fb.modes format is: * * - * <--4--> <--------1--------> <--2--> <--3--> + * <--4--> <--------1--------> <--2--> <--3--> * _________ * _______|-------------------|_______| | - * + * * The fb.modes(8) manpage refers to <4> and <2> as the left and * right "margin" (as well as upper and lower margin in the vertical * direction) -- note that this has nothing to do with the term @@ -312,7 +312,7 @@ vert_refresh(int h_pixels, int v_lines, float freq, int interlaced, int margins) * by the calculation must be halved, as the computation calculates * the number of vertical lines per field. In either case, the * number of lines is rounded to the nearest integer. - * + * * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0), * ROUND([V LINES],0)) */ @@ -356,7 +356,7 @@ vert_refresh(int h_pixels, int v_lines, float freq, int interlaced, int margins) print_value(5, "[BOT MARGIN (LINES)]", bottom_margin); /* 6. If interlace is required, then set variable [INTERLACE]=0.5: - * + * * [INTERLACE]=(IF([INT RQD?]="y",0.5,0)) */ diff --git a/xserver/hw/xfree86/utils/man/Makefile.in b/xserver/hw/xfree86/utils/man/Makefile.in index 0c0450636..eecccb6ba 100644 --- a/xserver/hw/xfree86/utils/man/Makefile.in +++ b/xserver/hw/xfree86/utils/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/vbe/Makefile.in b/xserver/hw/xfree86/vbe/Makefile.in index 8ad9996e2..9fd68dfbc 100644 --- a/xserver/hw/xfree86/vbe/Makefile.in +++ b/xserver/hw/xfree86/vbe/Makefile.in @@ -265,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/vbe/vbe.c b/xserver/hw/xfree86/vbe/vbe.c index d41e61ba8..5ea019733 100644 --- a/xserver/hw/xfree86/vbe/vbe.c +++ b/xserver/hw/xfree86/vbe/vbe.c @@ -3,10 +3,10 @@ * XFree86 vbe module * Copyright 2000 Egbert Eich * - * The mode query/save/set/restore functions from the vesa driver + * The mode query/save/set/restore functions from the vesa driver * have been moved here. * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) - * Authors: Paulo César Pereira de Andrade + * Authors: Paulo César Pereira de Andrade */ #ifdef HAVE_XORG_CONFIG_H diff --git a/xserver/hw/xfree86/vbe/vbe.h b/xserver/hw/xfree86/vbe/vbe.h index bc3653334..c8fb4e48f 100644 --- a/xserver/hw/xfree86/vbe/vbe.h +++ b/xserver/hw/xfree86/vbe/vbe.h @@ -3,10 +3,10 @@ * XFree86 vbe module * Copyright 2000 Egbert Eich * - * The mode query/save/set/restore functions from the vesa driver + * The mode query/save/set/restore functions from the vesa driver * have been moved here. * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) - * Authors: Paulo César Pereira de Andrade + * Authors: Paulo César Pereira de Andrade */ #ifndef _VBE_H diff --git a/xserver/hw/xfree86/vgahw/Makefile.am b/xserver/hw/xfree86/vgahw/Makefile.am index 4b718b489..b8196a695 100644 --- a/xserver/hw/xfree86/vgahw/Makefile.am +++ b/xserver/hw/xfree86/vgahw/Makefile.am @@ -6,5 +6,3 @@ AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = vgaHW.h - -EXTRA_DIST = vgaCmap.c diff --git a/xserver/hw/xfree86/vgahw/Makefile.in b/xserver/hw/xfree86/vgahw/Makefile.in index ec4aa6507..7f75bbdbb 100644 --- a/xserver/hw/xfree86/vgahw/Makefile.in +++ b/xserver/hw/xfree86/vgahw/Makefile.in @@ -266,6 +266,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -510,7 +511,6 @@ libvgahw_la_SOURCES = vgaHW.c vgaHWmodule.c AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = vgaHW.h -EXTRA_DIST = vgaCmap.c all: all-am .SUFFIXES: diff --git a/xserver/hw/xfree86/vgahw/vgaCmap.c b/xserver/hw/xfree86/vgahw/vgaCmap.c deleted file mode 100644 index 6e028a7f5..000000000 --- a/xserver/hw/xfree86/vgahw/vgaCmap.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * - * 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 Thomas Roell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Thomas Roell makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include "windowstr.h" -#include "compiler.h" -#include "mipointer.h" -#include "micmap.h" - -#include "xf86.h" -#include "vgaHW.h" - -#include -#include "dgaproc.h" - -#define NOMAPYET (ColormapPtr) 0 - -int -vgaListInstalledColormaps(pScreen, pmaps) -ScreenPtr pScreen; -Colormap *pmaps; -{ - /* By the time we are processing requests, we can guarantee that there - * is always a colormap installed */ - - *pmaps = GetInstalledmiColormap(pScreen)->mid; - return 1; -} - -int -vgaGetInstalledColormaps(pScreen, pmaps) -ScreenPtr pScreen; -ColormapPtr *pmaps; -{ - /* By the time we are processing requests, we can guarantee that there - * is always a colormap installed */ - - *pmaps = GetInstalledmiColormap(pScreen); - return 1; -} - -int -vgaCheckColorMap(ColormapPtr pmap) -{ - return (pmap != GetInstalledmiColormap(pmap->pScreen)); -} - -void -vgaStoreColors(pmap, ndef, pdefs) -ColormapPtr pmap; -int ndef; -xColorItem *pdefs; -{ - int i; - unsigned char *cmap, *tmp = NULL; - xColorItem directDefs[256]; - Bool new_overscan = FALSE; - Bool writeColormap; - int scrnIndex = pmap->pScreen->myNum; - ScrnInfoPtr scrninfp = xf86ScreenToScrn(pmap->pScreen); - vgaHWPtr hwp = VGAHWPTR(scrninfp); - - unsigned char overscan = hwp->ModeReg.Attribute[OVERSCAN]; - unsigned char tmp_overscan = 0; - - if (vgaCheckColorMap(pmap)) - return; - - if ((pmap->pVisual->class | DynamicClass) == DirectColor) { - ndef = miExpandDirectColors(pmap, ndef, pdefs, directDefs); - pdefs = directDefs; - } - - writeColormap = scrninfp->vtSema; - if (DGAScreenAvailable(pmap->pScreen)) { - writeColormap = writeColormap || - (DGAGetDirectMode(scrnIndex) && - !(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) || - (DGAGetFlags(scrnIndex) & XF86DGAHasColormap); - } - - if (writeColormap) - hwp->enablePalette(hwp); - - for (i = 0; i < ndef; i++) { - if (pdefs[i].pixel == overscan) { - new_overscan = TRUE; - } - cmap = &(hwp->ModeReg.DAC[pdefs[i].pixel * 3]); - if (scrninfp->rgbBits == 8) { - cmap[0] = pdefs[i].red >> 8; - cmap[1] = pdefs[i].green >> 8; - cmap[2] = pdefs[i].blue >> 8; - } - else { - cmap[0] = pdefs[i].red >> 10; - cmap[1] = pdefs[i].green >> 10; - cmap[2] = pdefs[i].blue >> 10; - } -#if 0 - if (clgd6225Lcd) { - /* The LCD doesn't like white */ - if (cmap[0] == 63) - cmap[0] = 62; - if (cmap[1] == 63) - cmap[1] = 62; - if (cmap[2] == 63) - cmap[2] = 62; - } -#endif - - if (writeColormap) { - if (hwp->ShowOverscan && i == 255) - continue; - hwp->writeDacWriteAddr(hwp, pdefs[i].pixel); - DACDelay(hwp); - hwp->writeDacData(hwp, cmap[0]); - DACDelay(hwp); - hwp->writeDacData(hwp, cmap[1]); - DACDelay(hwp); - hwp->writeDacData(hwp, cmap[2]); - DACDelay(hwp); - } - } - if (new_overscan && !hwp->ShowOverscan) { - new_overscan = FALSE; - for (i = 0; i < ndef; i++) { - if (pdefs[i].pixel == overscan) { - if ((pdefs[i].red != 0) || - (pdefs[i].green != 0) || (pdefs[i].blue != 0)) { - new_overscan = TRUE; - tmp_overscan = overscan; - tmp = &(hwp->ModeReg.DAC[pdefs[i].pixel * 3]); - } - break; - } - } - if (new_overscan) { - /* - * Find a black pixel, or the nearest match. - */ - for (i = 255; i >= 0; i--) { - cmap = &(hwp->ModeReg.DAC[i * 3]); - if ((cmap[0] == 0) && (cmap[1] == 0) && (cmap[2] == 0)) { - overscan = i; - break; - } - else { - if ((cmap[0] < tmp[0]) && - (cmap[1] < tmp[1]) && (cmap[2] < tmp[2])) { - tmp = cmap; - tmp_overscan = i; - } - } - } - if (i < 0) { - overscan = tmp_overscan; - } - hwp->ModeReg.Attribute[OVERSCAN] = overscan; - if (writeColormap) { - hwp->writeAttr(hwp, OVERSCAN, overscan); - } - } - } - - if (writeColormap) - hwp->disablePalette(hwp); -} - -void -vgaInstallColormap(pmap) -ColormapPtr pmap; -{ - ColormapPtr oldmap = GetInstalledmiColormap(pmap->pScreen); - int entries; - Pixel *ppix; - xrgb *prgb; - xColorItem *defs; - int i; - - if (pmap == oldmap) - return; - - if ((pmap->pVisual->class | DynamicClass) == DirectColor) - entries = (pmap->pVisual->redMask | - pmap->pVisual->greenMask | pmap->pVisual->blueMask) + 1; - else - entries = pmap->pVisual->ColormapEntries; - - ppix = (Pixel *) malloc(entries * sizeof(Pixel)); - prgb = (xrgb *) malloc(entries * sizeof(xrgb)); - defs = (xColorItem *) malloc(entries * sizeof(xColorItem)); - - if (oldmap != NOMAPYET) - WalkTree(pmap->pScreen, TellLostMap, &oldmap->mid); - - SetInstalledmiColormap(pmap->pScreen, pmap); - - for (i = 0; i < entries; i++) - ppix[i] = i; - - QueryColors(pmap, entries, ppix, prgb, serverClient); - - for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */ - defs[i].pixel = ppix[i]; - defs[i].red = prgb[i].red; - defs[i].green = prgb[i].green; - defs[i].blue = prgb[i].blue; - defs[i].flags = DoRed | DoGreen | DoBlue; - } - pmap->pScreen->StoreColors(pmap, entries, defs); - - WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid); - - free(ppix); - free(prgb); - free(defs); -} - -void -vgaUninstallColormap(pmap) -ColormapPtr pmap; -{ - - ColormapPtr defColormap; - - if (pmap != GetInstalledmiColormap(pmap->pScreen)) - return; - - dixLookupResourceByType((void **) &defColormap, - pmap->pScreen->defColormap, RT_COLORMAP, - serverClient, DixInstallAccess); - - if (defColormap == GetInstalledmiColormap(pmap->pScreen)) - return; - - (*pmap->pScreen->InstallColormap) (defColormap); -} - -void -vgaHandleColormaps(ScreenPtr pScreen, ScrnInfoPtr scrnp) -{ - if (scrnp->bitsPerPixel > 1) { - if (scrnp->bitsPerPixel <= 8) { /* For 8bpp SVGA and VGA16 */ - pScreen->InstallColormap = vgaInstallColormap; - pScreen->UninstallColormap = vgaUninstallColormap; - pScreen->ListInstalledColormaps = vgaListInstalledColormaps; - pScreen->StoreColors = vgaStoreColors; - } - } -} diff --git a/xserver/hw/xfree86/vgahw/vgaHW.c b/xserver/hw/xfree86/vgahw/vgaHW.c index a64f4f85d..7223fc031 100644 --- a/xserver/hw/xfree86/vgahw/vgaHW.c +++ b/xserver/hw/xfree86/vgahw/vgaHW.c @@ -1109,7 +1109,7 @@ vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save) hwp->writeDacData(hwp, save->DAC[i]); if (readError) { - /* + /* * save the default lookup table */ memmove(save->DAC, defaultDAC, 768); @@ -1184,7 +1184,7 @@ vgaHWInit(ScrnInfoPtr scrninfp, DisplayModePtr mode) regp = &hwp->ModeReg; /* - * compute correct Hsync & Vsync polarity + * compute correct Hsync & Vsync polarity */ if ((mode->Flags & (V_PHSYNC | V_NHSYNC)) && (mode->Flags & (V_PVSYNC | V_NVSYNC))) { @@ -1439,7 +1439,7 @@ vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8); CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8; - /* If width is not known nBits should be 0. In this + /* If width is not known nBits should be 0. In this * case BitMask is set to 0 so we can check for it. */ CARD32 BitMask = (nBits < 7) ? 0 : ((1 << nExtBits) - 1); int VBlankStart = (mode->CrtcVBlankStart - 1) & 0xFF; @@ -1885,7 +1885,7 @@ vgaHWHandleColormaps(ScreenPtr pScreen) } /* ----------------------- DDC support ------------------------*/ -/* +/* * Adjust v_active, v_blank, v_sync, v_sync_end, v_blank_end, v_total * to read out EDID at a faster rate. Allowed maximum is 25kHz with * 20 usec v_sync active. Set positive v_sync polarity, turn off lightpen diff --git a/xserver/hw/xfree86/vgahw/vgaHW.h b/xserver/hw/xfree86/vgahw/vgaHW.h index 63a10f42b..b979b85a6 100644 --- a/xserver/hw/xfree86/vgahw/vgaHW.h +++ b/xserver/hw/xfree86/vgahw/vgaHW.h @@ -116,7 +116,7 @@ typedef struct _vgaHWRec { = mmioreg */ void *FontInfo1; /* save area for fonts in plane 2 */ - void *FontInfo2; /* save area for fonts in + void *FontInfo2; /* save area for fonts in plane 3 */ void *TextInfo; /* save area for text */ vgaRegRec SavedReg; /* saved registers */ diff --git a/xserver/hw/xfree86/x86emu/Makefile.in b/xserver/hw/xfree86/x86emu/Makefile.in index 4fd8b37ec..8c4ca341d 100644 --- a/xserver/hw/xfree86/x86emu/Makefile.in +++ b/xserver/hw/xfree86/x86emu/Makefile.in @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xfree86/x86emu/debug.c b/xserver/hw/xfree86/x86emu/debug.c index 1a8d1d6c4..cbea9947f 100644 --- a/xserver/hw/xfree86/x86emu/debug.c +++ b/xserver/hw/xfree86/x86emu/debug.c @@ -103,11 +103,11 @@ disassemble_forward(u16 seg, u16 off, int n) * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to * the preprocessor. The TRACE_REGS macro expands to: * - * if (debug&DEBUG_DISASSEMBLE) + * if (debug&DEBUG_DISASSEMBLE) * {just_disassemble(); goto EndOfInstruction;} * if (debug&DEBUG_TRACE) trace_regs(r,m); * - * ...... and at the last line of the routine. + * ...... and at the last line of the routine. * * EndOfInstruction: end_instr(); * diff --git a/xserver/hw/xfree86/x86emu/ops.c b/xserver/hw/xfree86/x86emu/ops.c index b50badb28..853792e7e 100644 --- a/xserver/hw/xfree86/x86emu/ops.c +++ b/xserver/hw/xfree86/x86emu/ops.c @@ -5530,7 +5530,7 @@ x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { @@ -5658,7 +5658,7 @@ x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { @@ -5690,7 +5690,7 @@ x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1)) } #endif /* - * Know operation, decode the mod byte to find the addressing + * Know operation, decode the mod byte to find the addressing * mode. */ switch (mod) { @@ -5853,7 +5853,7 @@ x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: @@ -5977,7 +5977,7 @@ x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: @@ -7472,7 +7472,7 @@ x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1)) CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR "); /* XXX - * + * * Hooked interrupt vectors calling into our "BIOS" will cause * problems unless all intersegment stuff is checked for BIOS * access. Check needed here. For moment, let it alone. @@ -8688,7 +8688,7 @@ x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { @@ -8797,7 +8797,7 @@ x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { @@ -9700,7 +9700,7 @@ x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: @@ -9795,7 +9795,7 @@ x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { case 0: @@ -11538,7 +11538,7 @@ x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1)) if (DEBUG_DECODE()) { /* XXX DECODE_PRINTF may be changed to something more general, so that it is important to leave the strings - in the same format, even though the result is that the + in the same format, even though the result is that the above test is done twice. */ switch (rh) { diff --git a/xserver/hw/xfree86/x86emu/prim_ops.c b/xserver/hw/xfree86/x86emu/prim_ops.c index 24f76b47f..5604c7e81 100644 --- a/xserver/hw/xfree86/x86emu/prim_ops.c +++ b/xserver/hw/xfree86/x86emu/prim_ops.c @@ -883,9 +883,9 @@ rcl_byte(u8 d, u8 s) /* s is the rotate distance. It varies from 0 - 8. */ /* have - CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 + CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 - want to rotate through the carry by "s" bits. We could + want to rotate through the carry by "s" bits. We could loop, but that's inefficient. So the width is 9, and we split into three parts: @@ -895,12 +895,12 @@ rcl_byte(u8 d, u8 s) The new rotate is done mod 9, and given this, for a rotation of n bits (mod 9) the new carry flag is - then located n bits from the MSB. The low part is + then located n bits from the MSB. The low part is then shifted up cnt bits, and the high part is or'd - in. Using CAPS for new values, and lowercase for the + in. Using CAPS for new values, and lowercase for the original values, this can be expressed as: - IF n > 0 + IF n > 0 1) CF <- b_(8-n) 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 3) B_(n-1) <- cf @@ -912,17 +912,17 @@ rcl_byte(u8 d, u8 s) /* CF <- b_(8-n) */ cf = (d >> (8 - cnt)) & 0x1; - /* get the low stuff which rotated + /* get the low stuff which rotated into the range B_7 .. B_cnt */ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */ /* note that the right hand side done by the mask */ res = (d << cnt) & 0xff; - /* now the high stuff which rotated around + /* now the high stuff which rotated around into the positions B_cnt-2 .. B_0 */ /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ - /* shift it downward, 7-(n-2) = 9-n positions. - and mask off the result before or'ing in. + /* shift it downward, 7-(n-2) = 9-n positions. + and mask off the result before or'ing in. */ mask = (1 << (cnt - 1)) - 1; res |= (d >> (9 - cnt)) & mask; @@ -934,7 +934,7 @@ rcl_byte(u8 d, u8 s) } /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); - /* OVERFLOW is set *IFF* cnt==1, then it is the + /* OVERFLOW is set *IFF* cnt==1, then it is the xor of CF and the most significant bit. Blecck. */ /* parenthesized this expression since it appears to be causing OF to be misset */ @@ -1003,22 +1003,22 @@ rcr_byte(u8 d, u8 s) u32 mask, cf, ocf = 0; /* rotate right through carry */ - /* + /* s is the rotate distance. It varies from 0 - 8. - d is the byte object rotated. + d is the byte object rotated. - have + have - CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 + CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 The new rotate is done mod 9, and given this, for a rotation of n bits (mod 9) the new carry flag is - then located n bits from the LSB. The low part is + then located n bits from the LSB. The low part is then shifted up cnt bits, and the high part is or'd - in. Using CAPS for new values, and lowercase for the + in. Using CAPS for new values, and lowercase for the original values, this can be expressed as: - IF n > 0 + IF n > 0 1) CF <- b_(n-1) 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) 3) B_(8-n) <- cf @@ -1033,7 +1033,7 @@ rcr_byte(u8 d, u8 s) /* note hackery here. Access_flag(..) evaluates to either 0 if flag not set non-zero if flag is set. - doing access_flag(..) != 0 casts that into either + doing access_flag(..) != 0 casts that into either 0..1 in any representation of the flags register (i.e. packed bit array or unpacked.) */ @@ -1044,19 +1044,19 @@ rcr_byte(u8 d, u8 s) /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */ /* note that the right hand side done by the mask - This is effectively done by shifting the + This is effectively done by shifting the object to the right. The result must be masked, - in case the object came in and was treated + in case the object came in and was treated as a negative number. Needed??? */ mask = (1 << (8 - cnt)) - 1; res = (d >> cnt) & mask; - /* now the high stuff which rotated around + /* now the high stuff which rotated around into the positions B_cnt-2 .. B_0 */ /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ - /* shift it downward, 7-(n-2) = 9-n positions. - and mask off the result before or'ing in. + /* shift it downward, 7-(n-2) = 9-n positions. + and mask off the result before or'ing in. */ res |= (d << (9 - cnt)); @@ -1067,7 +1067,7 @@ rcr_byte(u8 d, u8 s) } /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); - /* OVERFLOW is set *IFF* cnt==1, then it is the + /* OVERFLOW is set *IFF* cnt==1, then it is the xor of CF and the most significant bit. Blecck. */ /* parenthesized... */ if (cnt == 1) { @@ -1154,18 +1154,18 @@ rol_byte(u8 d, u8 s) register unsigned int res, cnt, mask; /* rotate left */ - /* + /* s is the rotate distance. It varies from 0 - 8. - d is the byte object rotated. + d is the byte object rotated. - have + have - CF B_7 ... B_0 + CF B_7 ... B_0 The new rotate is done mod 8. Much simpler than the "rcl" or "rcr" operations. - IF n > 0 + IF n > 0 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) 2) B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */ @@ -1256,17 +1256,17 @@ ror_byte(u8 d, u8 s) register unsigned int res, cnt, mask; /* rotate right */ - /* + /* s is the rotate distance. It varies from 0 - 8. - d is the byte object rotated. + d is the byte object rotated. - have + have - B_7 ... B_0 + B_7 ... B_0 The rotate is done mod 8. - IF n > 0 + IF n > 0 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) 2) B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */ @@ -1279,7 +1279,7 @@ ror_byte(u8 d, u8 s) mask = (1 << (8 - cnt)) - 1; res |= (d >> (cnt)) & mask; - /* set the new carry flag, Note that it is the low order + /* set the new carry flag, Note that it is the low order bit of the result!!! */ CONDITIONAL_SET_FLAG(res & 0x80, F_CF); /* OVERFLOW is set *IFF* s==1, then it is the diff --git a/xserver/hw/xfree86/x86emu/sys.c b/xserver/hw/xfree86/x86emu/sys.c index c514ddeea..5eba35856 100644 --- a/xserver/hw/xfree86/x86emu/sys.c +++ b/xserver/hw/xfree86/x86emu/sys.c @@ -183,7 +183,7 @@ RETURNS: Byte value read from emulator memory. REMARKS: -Reads a byte value from the emulator memory. +Reads a byte value from the emulator memory. ****************************************************************************/ u8 X86API rdb(u32 addr) @@ -241,7 +241,7 @@ addr - Emulator memory address to read RETURNS: Long value read from emulator memory. REMARKS: -Reads a long value from the emulator memory. +Reads a long value from the emulator memory. ****************************************************************************/ u32 X86API rdl(u32 addr) @@ -323,7 +323,7 @@ addr - Emulator memory address to read val - Value to store REMARKS: -Writes a long value to emulator memory. +Writes a long value to emulator memory. ****************************************************************************/ void X86API wrl(u32 addr, u32 val) diff --git a/xserver/hw/xfree86/x86emu/x86emu/regs.h b/xserver/hw/xfree86/x86emu/x86emu/regs.h index 3a7456e4c..c040259fa 100644 --- a/xserver/hw/xfree86/x86emu/x86emu/regs.h +++ b/xserver/hw/xfree86/x86emu/x86emu/regs.h @@ -109,7 +109,7 @@ struct i386_special_regs { u32 FLAGS; }; -/* +/* * Segment registers here represent the 16 bit quantities * CS, DS, ES, SS. */ @@ -196,8 +196,8 @@ struct i386_segment_regs { #define F_ALWAYS_ON (0x0002) /* flag bits always on */ /* - * Define a mask for only those flag bits we will ever pass back - * (via PUSHF) + * Define a mask for only those flag bits we will ever pass back + * (via PUSHF) */ #define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF) @@ -279,8 +279,8 @@ typedef struct { * Delayed flag set 3 bits (zero, signed, parity) * reserved 6 bits * interrupt # 8 bits instruction raised interrupt - * BIOS video segregs 4 bits - * Interrupt Pending 1 bits + * BIOS video segregs 4 bits + * Interrupt Pending 1 bits * Extern interrupt 1 bits * Halted 1 bits */ diff --git a/xserver/hw/xfree86/x86emu/x86emu/x86emui.h b/xserver/hw/xfree86/x86emu/x86emu/x86emui.h index 5e20d9705..01bd92a6f 100644 --- a/xserver/hw/xfree86/x86emu/x86emu/x86emui.h +++ b/xserver/hw/xfree86/x86emu/x86emu/x86emui.h @@ -46,7 +46,7 @@ * dramatically in this case). */ -#if defined(__cplusplus) && !defined(_NO_INLINE) +#if defined(__cplusplus) #define _INLINE inline #else #define _INLINE static diff --git a/xserver/hw/xfree86/xorg-wrapper.c b/xserver/hw/xfree86/xorg-wrapper.c index 4ea47331b..22e97ad5d 100644 --- a/xserver/hw/xfree86/xorg-wrapper.c +++ b/xserver/hw/xfree86/xorg-wrapper.c @@ -255,18 +255,18 @@ int main(int argc, char *argv[]) } } - snprintf(buf, sizeof(buf), "%s/Xorg.bin", SUID_WRAPPER_DIR); + snprintf(buf, sizeof(buf), "%s/Xorg", SUID_WRAPPER_DIR); /* Check if the server is executable by our real uid */ if (access(buf, X_OK) != 0) { - fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n", - progname, SUID_WRAPPER_DIR, strerror(errno)); + fprintf(stderr, "%s: Missing execute permissions for %s: %s\n", + progname, buf, strerror(errno)); exit(1); } argv[0] = buf; (void) execv(argv[0], argv); - fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n", - progname, SUID_WRAPPER_DIR, strerror(errno)); + 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 95c334308..8d9d35621 100644 --- a/xserver/hw/xnest/Color.c +++ b/xserver/hw/xnest/Color.c @@ -239,7 +239,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) xnestNumOldInstalledColormapWindows = icws.numWindows; #ifdef DUMB_WINDOW_MANAGERS - /* + /* This code is for dumb window managers. This will only work with default local visual colormaps. */ diff --git a/xserver/hw/xnest/GC.c b/xserver/hw/xnest/GC.c index 0ec60fcdc..96af6eb91 100644 --- a/xserver/hw/xnest/GC.c +++ b/xserver/hw/xnest/GC.c @@ -194,11 +194,12 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) BoxPtr pBox; XRectangle *pRects; - xnestDestroyClipHelper(pGC); + xnestDestroyClip(pGC); switch (type) { case CT_NONE: XSetClipMask(xnestDisplay, xnestGC(pGC), None); + pValue = NULL; break; case CT_REGION: @@ -224,11 +225,9 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) * Need to change into region, so subsequent uses are with * current pixmap contents. */ - pGC->clientClip = - (void *) (*pGC->pScreen->BitmapToRegion) ((PixmapPtr) pValue); + pGC->clientClip = (*pGC->pScreen->BitmapToRegion) ((PixmapPtr) pValue); (*pGC->pScreen->DestroyPixmap) ((PixmapPtr) pValue); pValue = pGC->clientClip; - type = CT_REGION; break; case CT_UNSORTED: @@ -264,65 +263,34 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) case CT_YSORTED: case CT_YXSORTED: case CT_YXBANDED: - - /* - * other parts of server can only deal with CT_NONE, - * CT_PIXMAP and CT_REGION client clips. - */ - pGC->clientClip = (void *) RegionFromRects(nRects, - (xRectangle *) pValue, - type); + /* server clip representation is a region */ + pGC->clientClip = RegionFromRects(nRects, (xRectangle *) pValue, type); free(pValue); pValue = pGC->clientClip; - type = CT_REGION; - break; } - pGC->clientClipType = type; pGC->clientClip = pValue; } void xnestDestroyClip(GCPtr pGC) { - xnestDestroyClipHelper(pGC); - - XSetClipMask(xnestDisplay, xnestGC(pGC), None); - - pGC->clientClipType = CT_NONE; - pGC->clientClip = NULL; -} - -void -xnestDestroyClipHelper(GCPtr pGC) -{ - switch (pGC->clientClipType) { - default: - case CT_NONE: - break; - - case CT_REGION: + if (pGC->clientClip) { RegionDestroy(pGC->clientClip); - break; + XSetClipMask(xnestDisplay, xnestGC(pGC), None); + pGC->clientClip = NULL; } } void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc) { - RegionPtr pRgn; - - switch (pGCSrc->clientClipType) { - default: - case CT_NONE: - xnestDestroyClip(pGCDst); - break; - - case CT_REGION: - pRgn = RegionCreate(NULL, 1); + if (pGCSrc->clientClip) { + RegionPtr pRgn = RegionCreate(NULL, 1); RegionCopy(pRgn, pGCSrc->clientClip); xnestChangeClip(pGCDst, CT_REGION, pRgn, 0); - break; + } else { + xnestDestroyClip(pGCDst); } } diff --git a/xserver/hw/xnest/Keyboard.c b/xserver/hw/xnest/Keyboard.c index 2cf16246b..ae8375ee3 100644 --- a/xserver/hw/xnest/Keyboard.c +++ b/xserver/hw/xnest/Keyboard.c @@ -16,8 +16,13 @@ is" without express or implied warranty. #include #endif +#ifdef WIN32 +#include +#endif + #include #include +#include #include #include "screenint.h" #include "inputstr.h" @@ -247,7 +252,11 @@ xnestUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { - if (key_is_down(pDev, key, KEY_PROCESSED)) + if (mask == XCB_MOD_MASK_LOCK) { + xnestQueueKeyEvent(KeyPress, key); + xnestQueueKeyEvent(KeyRelease, key); + } + else if (key_is_down(pDev, key, KEY_PROCESSED)) xnestQueueKeyEvent(KeyRelease, key); if (--count == 0) @@ -261,6 +270,8 @@ 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) + xnestQueueKeyEvent(KeyRelease, key); break; } } diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in index b53a6595f..2340b1239 100644 --- a/xserver/hw/xnest/Makefile.in +++ b/xserver/hw/xnest/Makefile.in @@ -283,6 +283,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xnest/Window.c b/xserver/hw/xnest/Window.c index fc87e823e..8d9c67205 100644 --- a/xserver/hw/xnest/Window.c +++ b/xserver/hw/xnest/Window.c @@ -386,7 +386,7 @@ xnestWindowExposurePredicate(Display * dpy, XEvent * event, XPointer ptr) } void -xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed) +xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn) { XEvent event; Window window; @@ -410,7 +410,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed) XPutBackEvent(xnestDisplay, &event); } - miWindowExposures(pWin, pRgn, other_exposed); + miWindowExposures(pWin, pRgn); } void diff --git a/xserver/hw/xnest/XNGC.h b/xserver/hw/xnest/XNGC.h index e2f10fb9c..974173e50 100644 --- a/xserver/hw/xnest/XNGC.h +++ b/xserver/hw/xnest/XNGC.h @@ -37,7 +37,6 @@ void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); void xnestDestroyGC(GCPtr pGC); void xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects); void xnestDestroyClip(GCPtr pGC); -void xnestDestroyClipHelper(GCPtr pGC); void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc); #endif /* XNESTGC_H */ diff --git a/xserver/hw/xnest/XNWindow.h b/xserver/hw/xnest/XNWindow.h index 02b0f3f36..6320ede5e 100644 --- a/xserver/hw/xnest/XNWindow.h +++ b/xserver/hw/xnest/XNWindow.h @@ -66,8 +66,7 @@ Bool xnestRealizeWindow(WindowPtr pWin); Bool xnestUnrealizeWindow(WindowPtr pWin); void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion); void xnestClipNotify(WindowPtr pWin, int dx, int dy); -void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, - RegionPtr other_exposed); +void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn); void xnestSetShape(WindowPtr pWin, int kind); void xnestShapeWindow(WindowPtr pWin); diff --git a/xserver/hw/xnest/Xnest.h b/xserver/hw/xnest/Xnest.h index adb9daf8b..37ea6e532 100644 --- a/xserver/hw/xnest/Xnest.h +++ b/xserver/hw/xnest/Xnest.h @@ -28,7 +28,7 @@ from the X Consortium. */ -/* +/* ** Machines with a 64 bit library interface and a 32 bit server require ** name changes to protect the guilty. */ diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in index 56ec8eae1..879378b13 100644 --- a/xserver/hw/xnest/man/Makefile.in +++ b/xserver/hw/xnest/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/GL/Makefile.in b/xserver/hw/xquartz/GL/Makefile.in index f70a9d302..f05e29d95 100644 --- a/xserver/hw/xquartz/GL/Makefile.in +++ b/xserver/hw/xquartz/GL/Makefile.in @@ -233,6 +233,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/Makefile.in b/xserver/hw/xquartz/Makefile.in index 6da2977a6..a4c0323d0 100644 --- a/xserver/hw/xquartz/Makefile.in +++ b/xserver/hw/xquartz/Makefile.in @@ -289,6 +289,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/bundle/Makefile.in b/xserver/hw/xquartz/bundle/Makefile.in index 83f6c895c..9914fec7f 100644 --- a/xserver/hw/xquartz/bundle/Makefile.in +++ b/xserver/hw/xquartz/bundle/Makefile.in @@ -237,6 +237,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/darwin.c b/xserver/hw/xquartz/darwin.c index 29c6438a0..340343672 100644 --- a/xserver/hw/xquartz/darwin.c +++ b/xserver/hw/xquartz/darwin.c @@ -343,16 +343,16 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what) InitValuatorAxisStruct(pPointer, 1, axes_labels[1], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Absolute); - InitValuatorAxisStruct(pPointer, 2, axes_labels[2], + InitValuatorAxisStruct(pPointer, 2, axes_labels[2], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); - InitValuatorAxisStruct(pPointer, 3, axes_labels[3], + InitValuatorAxisStruct(pPointer, 3, axes_labels[3], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); - InitValuatorAxisStruct(pPointer, 4, axes_labels[4], + InitValuatorAxisStruct(pPointer, 4, axes_labels[4], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); - InitValuatorAxisStruct(pPointer, 5, axes_labels[5], + InitValuatorAxisStruct(pPointer, 5, axes_labels[5], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); diff --git a/xserver/hw/xquartz/darwinEvents.c b/xserver/hw/xquartz/darwinEvents.c index b41c6fdac..5a5e4dad2 100644 --- a/xserver/hw/xquartz/darwinEvents.c +++ b/xserver/hw/xquartz/darwinEvents.c @@ -596,7 +596,7 @@ DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } darwinEvents_unlock(); } void @@ -645,7 +645,7 @@ DarwinSendScrollEvents(double scroll_x, double scroll_y) { QueuePointerEvents(darwinPointer, MotionNotify, 0, POINTER_RELATIVE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } darwinEvents_unlock(); } /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to diff --git a/xserver/hw/xquartz/mach-startup/Makefile.in b/xserver/hw/xquartz/mach-startup/Makefile.in index 406fb3b2b..98f10d951 100644 --- a/xserver/hw/xquartz/mach-startup/Makefile.in +++ b/xserver/hw/xquartz/mach-startup/Makefile.in @@ -268,6 +268,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/man/Makefile.in b/xserver/hw/xquartz/man/Makefile.in index dae566e92..f2bc36e2d 100644 --- a/xserver/hw/xquartz/man/Makefile.in +++ b/xserver/hw/xquartz/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/pbproxy/Makefile.in b/xserver/hw/xquartz/pbproxy/Makefile.in index 28e696b38..b45b556f4 100644 --- a/xserver/hw/xquartz/pbproxy/Makefile.in +++ b/xserver/hw/xquartz/pbproxy/Makefile.in @@ -263,6 +263,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/xpr/Makefile.in b/xserver/hw/xquartz/xpr/Makefile.in index 9b427cfdb..3e8892ff4 100644 --- a/xserver/hw/xquartz/xpr/Makefile.in +++ b/xserver/hw/xquartz/xpr/Makefile.in @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xquartz/xpr/dri.c b/xserver/hw/xquartz/xpr/dri.c index 014709b04..565d94f5f 100644 --- a/xserver/hw/xquartz/xpr/dri.c +++ b/xserver/hw/xquartz/xpr/dri.c @@ -138,15 +138,6 @@ DRIFinishScreenInit(ScreenPtr pScreen) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); /* Wrap DRI support */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = DRICopyWindow; @@ -582,24 +573,6 @@ DRIDrawablePrivDelete(void *pResource, XID id) return TRUE; } -void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if (pDRIDrawablePriv) { - /* FIXME: something? */ - } - - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - - (*pScreen->WindowExposures)(pWin, prgn, bsreg); - - pScreen->WindowExposures = DRIWindowExposures; -} - void DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { @@ -624,51 +597,6 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) pScreen->CopyWindow = DRICopyWindow; } -int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - int returnValue; - - /* unwrap */ - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - - /* call lower layers */ - returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pScreen->ValidateTree = DRIValidateTree; - - return returnValue; -} - -void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen; - DRIScreenPrivPtr pDRIPriv; - - if (pParent) { - pScreen = pParent->drawable.pScreen; - } - else { - pScreen = pChild->drawable.pScreen; - } - pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv->wrap.PostValidateTree) { - /* unwrap */ - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - - /* call lower layers */ - (*pScreen->PostValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pScreen->PostValidateTree = DRIPostValidateTree; - } -} - void DRIClipNotify(WindowPtr pWin, int dx, int dy) { diff --git a/xserver/hw/xquartz/xpr/dri.h b/xserver/hw/xquartz/xpr/dri.h index 70cb8b6d6..a4400a220 100644 --- a/xserver/hw/xquartz/xpr/dri.h +++ b/xserver/hw/xquartz/xpr/dri.h @@ -51,10 +51,7 @@ typedef void (*ClipNotifyPtr)(WindowPtr, int, int); * overridden by the driver in its [driver]DRIScreenInit function. */ typedef struct { - WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; ClipNotifyProcPtr ClipNotify; } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; @@ -107,18 +104,9 @@ DRIGetWrappedFuncs(ScreenPtr pScreen); extern void DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -extern int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind); - -extern void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind); - extern void DRIClipNotify(WindowPtr pWin, int dx, int dy); -extern void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg); - extern void DRISurfaceNotify(xp_surface_id id, int kind); diff --git a/xserver/hw/xwayland/Makefile.am b/xserver/hw/xwayland/Makefile.am index 4e0e1bb00..ab1bbb6a5 100644 --- a/xserver/hw/xwayland/Makefile.am +++ b/xserver/hw/xwayland/Makefile.am @@ -26,7 +26,6 @@ Xwayland_LDADD = \ $(XWAYLAND_LIBS) \ $(XWAYLAND_SYS_LIBS) \ $(XSERVER_SYS_LIBS) -Xwayland_DEPENDENCIES = $(XWAYLAND_LIBS) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) @@ -44,6 +43,7 @@ xwayland-glamor.c : $(nodist_Xwayland_SOURCES) glamor_lib = $(top_builddir)/glamor/libglamor.la Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL +Xwayland_DEPENDENCIES = $(glamor_lib) endif EXTRA_DIST = drm.xml diff --git a/xserver/hw/xwayland/Makefile.in b/xserver/hw/xwayland/Makefile.in index fde4d0387..791a36ba2 100644 --- a/xserver/hw/xwayland/Makefile.in +++ b/xserver/hw/xwayland/Makefile.in @@ -53,6 +53,9 @@ 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_FALSE@Xwayland_DEPENDENCIES = $(glamor_lib) \ +@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +@GLAMOR_EGL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) subdir = hw/xwayland DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -256,6 +259,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -508,7 +512,6 @@ Xwayland_SOURCES = xwayland.c xwayland-input.c xwayland-cursor.c \ $(top_srcdir)/mi/miinitext.c $(am__append_1) Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) $(XWAYLAND_SYS_LIBS) \ $(XSERVER_SYS_LIBS) $(am__append_2) -Xwayland_DEPENDENCIES = $(XWAYLAND_LIBS) Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) @GLAMOR_EGL_TRUE@nodist_Xwayland_SOURCES = \ @GLAMOR_EGL_TRUE@ drm-client-protocol.h \ @@ -516,6 +519,7 @@ Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) @GLAMOR_EGL_TRUE@CLEANFILES = $(nodist_Xwayland_SOURCES) @GLAMOR_EGL_TRUE@glamor_lib = $(top_builddir)/glamor/libglamor.la +@GLAMOR_EGL_TRUE@Xwayland_DEPENDENCIES = $(glamor_lib) EXTRA_DIST = drm.xml all: all-am diff --git a/xserver/hw/xwayland/xwayland-cursor.c b/xserver/hw/xwayland/xwayland-cursor.c index 5a9d1fe70..c137e1ec0 100644 --- a/xserver/hw/xwayland/xwayland-cursor.c +++ b/xserver/hw/xwayland/xwayland-cursor.c @@ -82,6 +82,23 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) return xwl_shm_destroy_pixmap(pixmap); } +static void +frame_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_seat *xwl_seat = data; + xwl_seat->cursor_frame_cb = NULL; + if (xwl_seat->cursor_needs_update) { + xwl_seat->cursor_needs_update = FALSE; + xwl_seat_set_cursor(xwl_seat); + } +} + +static const struct wl_callback_listener frame_listener = { + frame_callback +}; + void xwl_seat_set_cursor(struct xwl_seat *xwl_seat) { @@ -98,6 +115,11 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) return; } + if (xwl_seat->cursor_frame_cb) { + xwl_seat->cursor_needs_update = TRUE; + return; + } + cursor = xwl_seat->x_cursor; pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); stride = cursor->bits->width * 4; @@ -117,6 +139,10 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) wl_surface_damage(xwl_seat->cursor, 0, 0, xwl_seat->x_cursor->bits->width, xwl_seat->x_cursor->bits->height); + + xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor); + wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat); + wl_surface_commit(xwl_seat->cursor); } diff --git a/xserver/hw/xwayland/xwayland-glamor.c b/xserver/hw/xwayland/xwayland-glamor.c index 4be883fa3..d574d9407 100644 --- a/xserver/hw/xwayland/xwayland-glamor.c +++ b/xserver/hw/xwayland/xwayland-glamor.c @@ -137,6 +137,9 @@ xwl_glamor_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, int depth) glGenTextures(1, &xwl_pixmap->texture); glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); glBindTexture(GL_TEXTURE_2D, 0); @@ -307,7 +310,7 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen) } if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { - ErrorF("GL_OES_EGL_image no available"); + ErrorF("GL_OES_EGL_image not available\n"); return; } @@ -326,7 +329,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) xwl_screen->drm_fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); if (xwl_screen->drm_fd == -1) { - ErrorF("wayland-egl: could not open %s (%s)", + ErrorF("wayland-egl: could not open %s (%s)\n", xwl_screen->device_name, strerror(errno)); return; } @@ -398,9 +401,8 @@ xwl_screen_init_glamor(struct xwl_screen *xwl_screen, } void -glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) +glamor_egl_destroy_pixmap_image(PixmapPtr pixmap) { - glamor_destroy_textured_pixmap(pixmap); } int diff --git a/xserver/hw/xwayland/xwayland-input.c b/xserver/hw/xwayland/xwayland-input.c index 990cb82d8..4639048d9 100644 --- a/xserver/hw/xwayland/xwayland-input.c +++ b/xserver/hw/xwayland/xwayland-input.c @@ -43,7 +43,7 @@ static int xwl_pointer_proc(DeviceIntPtr device, int what) { #define NBUTTONS 10 -#define NAXES 2 +#define NAXES 4 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; @@ -67,8 +67,10 @@ xwl_pointer_proc(DeviceIntPtr device, int what) axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL); + axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); - if (!InitValuatorClassDeviceStruct(device, 2, btn_labels, + if (!InitValuatorClassDeviceStruct(device, NAXES, btn_labels, GetMotionHistorySize(), Absolute)) return BadValue; @@ -77,6 +79,13 @@ xwl_pointer_proc(DeviceIntPtr device, int what) 0, 0xFFFF, 10000, 0, 10000, Absolute); InitValuatorAxisStruct(device, 1, axes_labels[1], 0, 0xFFFF, 10000, 0, 10000, Absolute); + InitValuatorAxisStruct(device, 2, axes_labels[2], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative); + InitValuatorAxisStruct(device, 3, axes_labels[3], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative); + + SetScrollValuator(device, 2, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE); + SetScrollValuator(device, 3, SCROLL_TYPE_VERTICAL, 1.0, SCROLL_FLAG_PREFERRED); if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; @@ -152,6 +161,15 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, ScreenPtr pScreen = xwl_seat->xwl_screen->screen; ValuatorMask mask; + /* There's a race here where if we create and then immediately + * destroy a surface, we might end up in a state where the Wayland + * compositor sends us an event for a surface that doesn't exist. + * + * Don't process enter events in this case. + */ + if (surface == NULL) + return; + xwl_seat->xwl_screen->serial = serial; xwl_seat->pointer_enter_serial = serial; @@ -224,6 +242,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, xwl_seat->xwl_screen->serial = serial; switch (button) { + case BTN_LEFT: + index = 1; + break; case BTN_MIDDLE: index = 2; break; @@ -231,7 +252,9 @@ pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, index = 3; break; default: - index = button - BTN_LEFT + 1; + /* Skip indexes 4-7: they are used for vertical and horizontal scroll. + The rest of the buttons go in order: BTN_SIDE becomes 8, etc. */ + index = 8 + button - BTN_SIDE; break; } @@ -245,54 +268,24 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct xwl_seat *xwl_seat = data; - int index, count; - int i, val; + int index; const int divisor = 10; ValuatorMask mask; - if (time - xwl_seat->scroll_time > 2000) { - xwl_seat->vertical_scroll = 0; - xwl_seat->horizontal_scroll = 0; - } - xwl_seat->scroll_time = time; - - /* FIXME: Need to do proper smooth scrolling here! */ switch (axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: - xwl_seat->vertical_scroll += value / divisor; - val = wl_fixed_to_int(xwl_seat->vertical_scroll); - xwl_seat->vertical_scroll -= wl_fixed_from_int(val); - - if (val <= -1) - index = 4; - else if (val >= 1) - index = 5; - else - return; + index = 3; break; case WL_POINTER_AXIS_HORIZONTAL_SCROLL: - xwl_seat->horizontal_scroll += value / divisor; - val = wl_fixed_to_int(xwl_seat->horizontal_scroll); - xwl_seat->horizontal_scroll -= wl_fixed_from_int(val); - - if (val <= -1) - index = 6; - else if (val >= 1) - index = 7; - else - return; + index = 2; break; default: return; } valuator_mask_zero(&mask); - - count = abs(val); - for (i = 0; i < count; i++) { - QueuePointerEvents(xwl_seat->pointer, ButtonPress, index, 0, &mask); - QueuePointerEvents(xwl_seat->pointer, ButtonRelease, index, 0, &mask); - } + valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); + QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); } static const struct wl_pointer_listener pointer_listener = { @@ -491,31 +484,43 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, { struct xwl_seat *xwl_seat = data; - if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->pointer == NULL) { + if (caps & WL_SEAT_CAPABILITY_POINTER && xwl_seat->wl_pointer == NULL) { xwl_seat->wl_pointer = wl_seat_get_pointer(seat); wl_pointer_add_listener(xwl_seat->wl_pointer, &pointer_listener, xwl_seat); - xwl_seat_set_cursor(xwl_seat); - xwl_seat->pointer = - add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); - } - else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->pointer) { + + if (xwl_seat->pointer) + EnableDevice(xwl_seat->pointer, TRUE); + else { + xwl_seat_set_cursor(xwl_seat); + xwl_seat->pointer = + add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); + } + } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { wl_pointer_release(xwl_seat->wl_pointer); - RemoveDevice(xwl_seat->pointer, FALSE); - xwl_seat->pointer = NULL; + xwl_seat->wl_pointer = NULL; + + if (xwl_seat->pointer) + DisableDevice(xwl_seat->pointer, TRUE); } - if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->keyboard == NULL) { + if (caps & WL_SEAT_CAPABILITY_KEYBOARD && xwl_seat->wl_keyboard == NULL) { xwl_seat->wl_keyboard = wl_seat_get_keyboard(seat); wl_keyboard_add_listener(xwl_seat->wl_keyboard, &keyboard_listener, xwl_seat); - xwl_seat->keyboard = - add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); - } - else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->keyboard) { + + if (xwl_seat->keyboard) + EnableDevice(xwl_seat->keyboard, TRUE); + else { + xwl_seat->keyboard = + add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); + } + } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { wl_keyboard_release(xwl_seat->wl_keyboard); - RemoveDevice(xwl_seat->keyboard, FALSE); - xwl_seat->keyboard = NULL; + xwl_seat->wl_keyboard = NULL; + + if (xwl_seat->keyboard) + DisableDevice(xwl_seat->keyboard, TRUE); } xwl_seat->xwl_screen->expecting_event--; @@ -541,7 +546,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) xwl_seat = calloc(sizeof *xwl_seat, 1); if (xwl_seat == NULL) { - ErrorF("create_input ENOMEM"); + ErrorF("create_input ENOMEM\n"); return; } @@ -564,6 +569,8 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) RemoveDevice(xwl_seat->keyboard, FALSE); wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); + if (xwl_seat->cursor_frame_cb) + wl_callback_destroy(xwl_seat->cursor_frame_cb); wl_array_release(&xwl_seat->keys); free(xwl_seat); } diff --git a/xserver/hw/xwayland/xwayland-output.c b/xserver/hw/xwayland/xwayland-output.c index 778914c61..155cbc109 100644 --- a/xserver/hw/xwayland/xwayland-output.c +++ b/xserver/hw/xwayland/xwayland-output.c @@ -159,7 +159,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) xwl_output = calloc(sizeof *xwl_output, 1); if (xwl_output == NULL) { - ErrorF("create_output ENOMEM"); + ErrorF("create_output ENOMEM\n"); return NULL; } @@ -168,7 +168,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t 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"); + ErrorF("create_output ENOMEM\n"); free(xwl_output); return NULL; } diff --git a/xserver/hw/xwayland/xwayland.c b/xserver/hw/xwayland/xwayland.c index 17b7bf7fd..bc92beb38 100644 --- a/xserver/hw/xwayland/xwayland.c +++ b/xserver/hw/xwayland/xwayland.c @@ -308,6 +308,9 @@ xwl_unrealize_window(WindowPtr window) xorg_list_del(&xwl_window->link_damage); DamageUnregister(xwl_window->damage); DamageDestroy(xwl_window->damage); + if (xwl_window->frame_callback) + wl_callback_destroy(xwl_window->frame_callback); + free(xwl_window); dixSetPrivate(&window->devPrivates, &xwl_window_private_key, NULL); @@ -320,21 +323,36 @@ xwl_save_screen(ScreenPtr pScreen, int on) return TRUE; } +static void +frame_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_window *xwl_window = data; + xwl_window->frame_callback = NULL; +} + +static const struct wl_callback_listener frame_listener = { + frame_callback +}; + static void xwl_screen_post_damage(struct xwl_screen *xwl_screen) { - struct xwl_window *xwl_window; + struct xwl_window *xwl_window, *next_xwl_window; RegionPtr region; BoxPtr box; - int count, i; struct wl_buffer *buffer; PixmapPtr pixmap; - xorg_list_for_each_entry(xwl_window, &xwl_screen->damage_window_list, - link_damage) { - region = DamageRegion(xwl_window->damage); - count = RegionNumRects(region); + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &xwl_screen->damage_window_list, link_damage) { + /* If we're waiting on a frame callback from the server, + * don't attach a new buffer. */ + if (xwl_window->frame_callback) + continue; + region = DamageRegion(xwl_window->damage); pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); #if GLAMOR_HAS_GBM @@ -345,17 +363,19 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) buffer = xwl_shm_pixmap_get_wl_buffer(pixmap); wl_surface_attach(xwl_window->surface, buffer, 0, 0); - for (i = 0; i < count; i++) { - box = &RegionRects(region)[i]; - wl_surface_damage(xwl_window->surface, - box->x1, box->y1, - box->x2 - box->x1, box->y2 - box->y1); - } + + box = RegionExtents(region); + wl_surface_damage(xwl_window->surface, box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + + xwl_window->frame_callback = wl_surface_frame(xwl_window->surface); + wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window); + wl_surface_commit(xwl_window->surface); DamageEmpty(xwl_window->damage); - } - xorg_list_init(&xwl_screen->damage_window_list); + xorg_list_del(&xwl_window->link_damage); + } } static void @@ -463,7 +483,7 @@ listen_on_fds(struct xwl_screen *xwl_screen) int i; for (i = 0; i < xwl_screen->listen_fd_count; i++) - ListenOnOpenFD(xwl_screen->listen_fds[i], TRUE); + ListenOnOpenFD(xwl_screen->listen_fds[i], FALSE); } static void @@ -493,9 +513,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) int ret, bpc, green_bpc, i; xwl_screen = calloc(sizeof *xwl_screen, 1); - xwl_screen->wm_fd = -1; if (xwl_screen == NULL) return FALSE; + xwl_screen->wm_fd = -1; if (!dixRegisterPrivateKey(&xwl_screen_private_key, PRIVATE_SCREEN, 0)) return FALSE; @@ -636,6 +656,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) return ret; } +_X_NORETURN static void _X_ATTRIBUTE_PRINTF(1, 0) xwl_log_handler(const char *format, va_list args) { @@ -681,4 +702,6 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) if (AddScreen(xwl_screen_init, argc, argv) == -1) { FatalError("Couldn't add screen\n"); } + + LocalAccessScopeUser(); } diff --git a/xserver/hw/xwayland/xwayland.h b/xserver/hw/xwayland/xwayland.h index fc6855044..28b0c995e 100644 --- a/xserver/hw/xwayland/xwayland.h +++ b/xserver/hw/xwayland/xwayland.h @@ -27,7 +27,6 @@ #define XWAYLAND_H #include -#include #include #include @@ -103,6 +102,7 @@ struct xwl_window { WindowPtr window; DamagePtr damage; struct xorg_list link_damage; + struct wl_callback *frame_callback; }; #define MODIFIER_META 0x01 @@ -115,16 +115,14 @@ struct xwl_seat { struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_array keys; - struct wl_surface *cursor; struct xwl_window *focus_window; uint32_t id; uint32_t pointer_enter_serial; struct xorg_list link; CursorPtr x_cursor; - - wl_fixed_t horizontal_scroll; - wl_fixed_t vertical_scroll; - uint32_t scroll_time; + struct wl_surface *cursor; + struct wl_callback *cursor_frame_cb; + Bool cursor_needs_update; size_t keymap_size; char *keymap; diff --git a/xserver/hw/xwin/InitInput.c b/xserver/hw/xwin/InitInput.c index 38203c906..6cd9e060a 100644 --- a/xserver/hw/xwin/InitInput.c +++ b/xserver/hw/xwin/InitInput.c @@ -39,7 +39,6 @@ #ifdef XWIN_CLIPBOARD int winProcEstablishConnection(ClientPtr /* client */ ); -int winProcSetSelectionOwner(ClientPtr /* client */ ); #endif /* @@ -53,7 +52,7 @@ DeviceIntPtr g_pwinKeyboard; /* * All of our keys generate up and down transition notifications, * so all of our keys can be used as modifiers. - * + * * An example of a modifier is mapping the A key to the Control key. * A has to be a legal modifier. I think. */ diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c index 6b5c38d92..654c58c14 100644 --- a/xserver/hw/xwin/InitOutput.c +++ b/xserver/hw/xwin/InitOutput.c @@ -66,24 +66,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, /* * References to external symbols */ -#ifdef XWIN_CLIPBOARD -extern Bool g_fUnicodeClipboard; -extern Bool g_fClipboardLaunched; -extern Bool g_fClipboardStarted; -extern pthread_t g_ptClipboardProc; -extern HWND g_hwndClipboard; -extern Bool g_fClipboard; -#endif /* * Function prototypes */ -#ifdef XWIN_CLIPBOARD -static void - winClipboardShutdown(void); -#endif - static Bool winCheckDisplayNumber(void); @@ -125,31 +112,6 @@ static PixmapFormatRec g_PixmapFormats[] = { const int NUMFORMATS = sizeof(g_PixmapFormats) / sizeof(g_PixmapFormats[0]); -#ifdef XWIN_CLIPBOARD -static void -winClipboardShutdown(void) -{ - /* Close down clipboard resources */ - if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted) { - /* Synchronously destroy the clipboard window */ - if (g_hwndClipboard != NULL) { - SendMessage(g_hwndClipboard, WM_DESTROY, 0, 0); - /* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */ - } - else - return; - - /* Wait for the clipboard thread to exit */ - pthread_join(g_ptClipboardProc, NULL); - - g_fClipboardLaunched = FALSE; - g_fClipboardStarted = FALSE; - - winDebug("winClipboardShutdown - Clipboard thread has exited.\n"); - } -} -#endif - static const ExtensionModule xwinExtensions[] = { #ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, @@ -666,9 +628,9 @@ OsVendorInit(void) if (!g_fLogInited) { /* keep this order. If LogInit fails it calls Abort which then calls - * ddxGiveUp where LogInit is called again and creates an infinite - * recursion. If we set g_fLogInited to TRUE before the init we - * avoid the second call + * ddxGiveUp where LogInit is called again and creates an infinite + * recursion. If we set g_fLogInited to TRUE before the init we + * avoid the second call */ g_fLogInited = TRUE; g_pszLogFile = LogInit(g_pszLogFile, NULL); @@ -773,12 +735,6 @@ winUseMsg(void) "\t\t1 - Shadow GDI\n" "\t\t2 - Shadow DirectDraw\n" "\t\t4 - Shadow DirectDraw4 Non-Locking\n" -#ifdef XWIN_PRIMARYFB - "\t\t8 - Primary DirectDraw - obsolete\n" -#endif -#ifdef XWIN_NATIVEGDI - "\t\t16 - Native GDI - experimental\n" -#endif ); ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n"); @@ -837,6 +793,10 @@ winUseMsg(void) #ifdef XWIN_CLIPBOARD ErrorF("-nounicodeclipboard\n" "\tDo not use Unicode clipboard even if on a NT-based platform.\n"); + + ErrorF("-[no]primary\n" + "\tWhen clipboard integration is enabled, map the X11 PRIMARY selection\n" + "\tto the Windows clipboard. Default is enabled.\n"); #endif ErrorF("-refresh rate_in_Hz\n" @@ -929,7 +889,7 @@ ddxUseMsg(void) /* See Porting Layer Definition - p. 20 */ /* * Do any global initialization, then initialize each screen. - * + * * NOTE: We use ddxProcessArgument, so we don't need to touch argc and argv */ @@ -1048,7 +1008,7 @@ winCheckDisplayNumber(void) int nDisp; HANDLE mutex; char name[MAX_PATH]; - char *pszPrefix = '\0'; + const char *pszPrefix = '\0'; OSVERSIONINFO osvi = { 0 }; /* Check display range */ diff --git a/xserver/hw/xwin/Makefile.am b/xserver/hw/xwin/Makefile.am index 4ee963227..0ea8ba769 100644 --- a/xserver/hw/xwin/Makefile.am +++ b/xserver/hw/xwin/Makefile.am @@ -3,19 +3,16 @@ bin_PROGRAMS = XWin if XWIN_CLIPBOARD SRCS_CLIPBOARD = \ winclipboardinit.c \ - winclipboardtextconv.c \ - winclipboardthread.c \ - winclipboardwndproc.c \ - winclipboardwrappers.c \ - winclipboardxevents.c + winclipboardwrappers.c DEFS_CLIPBOARD = -DXWIN_CLIPBOARD +CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la endif if XWIN_GLX_WINDOWS GLX_DIR = glx DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la -XWIN_GLX_LINK_FLAGS = -lopengl32 +XWIN_GLX_SYS_LIBS = -lopengl32 endif if XWIN_MULTIWINDOW @@ -27,7 +24,7 @@ SRCS_MULTIWINDOW = \ propertystore.h \ winSetAppUserModelID.c DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -MULTIWINDOW_LIBS = -lshlwapi -lole32 +MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 endif if XWIN_MULTIWINDOWEXTWM @@ -40,27 +37,6 @@ DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la endif -if XWIN_NATIVEGDI -SRCS_NATIVEGDI = \ - winclip.c \ - winfillsp.c \ - winfont.c \ - wingc.c \ - wingetsp.c \ - winnativegdi.c \ - winpixmap.c \ - winpolyline.c \ - winrop.c \ - winsetsp.c -DEFS_NATIVEGDI = -DXWIN_NATIVEGDI -endif - -if XWIN_PRIMARYFB -SRCS_PRIMARYFB = \ - winpfbdd.c -DEFS_PRIMARYFB = -DXWIN_PRIMARYFB -endif - if XWIN_RANDR SRCS_RANDR = \ winrandr.c @@ -110,7 +86,6 @@ SRCS = InitInput.c \ winwindow.c \ winwndproc.c \ ddraw.h \ - winclipboard.h \ winconfig.h \ win.h \ winglobals.h \ @@ -126,6 +101,8 @@ SRCS = InitInput.c \ winprefs.h \ winresource.h \ winwindow.h \ + windisplay.c \ + windisplay.h \ XWin.rc \ $(top_srcdir)/mi/miinitext.c \ $(SRCS_CLIPBOARD) \ @@ -150,11 +127,31 @@ XWin_SOURCES = $(SRCS) AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid -XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ - $(top_builddir)/Xi/libXistubs.la -XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) + +XWIN_LIBS += \ + $(top_builddir)/pseudoramiX/libPseudoramiX.la \ + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la + +XWin_DEPENDENCIES = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(CLIPBOARD_LIBS) \ + $(XSERVER_LIBS) + + +XWin_LDADD = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(CLIPBOARD_LIBS) \ + $(XSERVER_LIBS) \ + $(XWIN_GLX_SYS_LIBS) \ + $(XSERVER_SYS_LIBS) \ + $(XWIN_SYS_LIBS) \ + $(MULTIWINDOW_SYS_LIBS) + XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) @@ -191,5 +188,5 @@ EXTRA_DIST = \ relink: $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) -SUBDIRS = man $(GLX_DIR) . -DIST_SUBDIRS = man glx . +SUBDIRS = man $(GLX_DIR) winclipboard . +DIST_SUBDIRS = man glx winclipboard . diff --git a/xserver/hw/xwin/Makefile.in b/xserver/hw/xwin/Makefile.in index 65c8a9605..96fbe965a 100644 --- a/xserver/hw/xwin/Makefile.in +++ b/xserver/hw/xwin/Makefile.in @@ -85,27 +85,19 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ winmultiwindowicons.c winprefs.c winprefsyacc.y winprefslex.l \ winprocarg.c winscrinit.c winshaddd.c winshadddnl.c \ winshadgdi.c wintaskbar.c wintrayicon.c winvalargs.c \ - winwakeup.c winwindow.c winwndproc.c ddraw.h winclipboard.h \ - winconfig.h win.h winglobals.h winkeybd.h winkeynames.h \ - winlayouts.h winmessages.h winmonitors.h winmsg.h winms.h \ + winwakeup.c winwindow.c winwndproc.c ddraw.h winconfig.h win.h \ + winglobals.h winkeybd.h winkeynames.h winlayouts.h \ + winmessages.h winmonitors.h winmsg.h winms.h \ winmultiwindowclass.h winmultiwindowicons.h winprefs.h \ - winresource.h winwindow.h XWin.rc $(top_srcdir)/mi/miinitext.c \ - winclipboardinit.c winclipboardtextconv.c winclipboardthread.c \ - winclipboardwndproc.c winclipboardwrappers.c \ - winclipboardxevents.c winmultiwindowshape.c \ + winresource.h winwindow.h windisplay.c windisplay.h XWin.rc \ + $(top_srcdir)/mi/miinitext.c winclipboardinit.c \ + winclipboardwrappers.c winmultiwindowshape.c \ winmultiwindowwindow.c winmultiwindowwm.c \ winmultiwindowwndproc.c propertystore.h winSetAppUserModelID.c \ winwin32rootless.c winwin32rootlesswindow.c \ - winwin32rootlesswndproc.c winwindowswm.c winclip.c winfillsp.c \ - winfont.c wingc.c wingetsp.c winnativegdi.c winpixmap.c \ - winpolyline.c winrop.c winsetsp.c winpfbdd.c winrandr.c \ - winvideo.c + winwin32rootlesswndproc.c winwindowswm.c winrandr.c winvideo.c @XWIN_CLIPBOARD_TRUE@am__objects_1 = winclipboardinit.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardtextconv.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardthread.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwndproc.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardxevents.$(OBJEXT) +@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.$(OBJEXT) @XWIN_MULTIWINDOW_TRUE@am__objects_2 = winmultiwindowshape.$(OBJEXT) \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.$(OBJEXT) \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwm.$(OBJEXT) \ @@ -116,16 +108,9 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswndproc.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwindowswm.$(OBJEXT) -@XWIN_NATIVEGDI_TRUE@am__objects_4 = winclip.$(OBJEXT) \ -@XWIN_NATIVEGDI_TRUE@ winfillsp.$(OBJEXT) winfont.$(OBJEXT) \ -@XWIN_NATIVEGDI_TRUE@ wingc.$(OBJEXT) wingetsp.$(OBJEXT) \ -@XWIN_NATIVEGDI_TRUE@ winnativegdi.$(OBJEXT) \ -@XWIN_NATIVEGDI_TRUE@ winpixmap.$(OBJEXT) winpolyline.$(OBJEXT) \ -@XWIN_NATIVEGDI_TRUE@ winrop.$(OBJEXT) winsetsp.$(OBJEXT) -@XWIN_PRIMARYFB_TRUE@am__objects_5 = winpfbdd.$(OBJEXT) -@XWIN_RANDR_TRUE@am__objects_6 = winrandr.$(OBJEXT) -@XWIN_XV_TRUE@am__objects_7 = winvideo.$(OBJEXT) -am__objects_8 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ +@XWIN_RANDR_TRUE@am__objects_4 = winrandr.$(OBJEXT) +@XWIN_XV_TRUE@am__objects_5 = winvideo.$(OBJEXT) +am__objects_6 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ winallpriv.$(OBJEXT) winauth.$(OBJEXT) winblock.$(OBJEXT) \ wincmap.$(OBJEXT) winconfig.$(OBJEXT) wincreatewnd.$(OBJEXT) \ wincursor.$(OBJEXT) windialogs.$(OBJEXT) winengine.$(OBJEXT) \ @@ -138,16 +123,16 @@ am__objects_8 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ winscrinit.$(OBJEXT) winshaddd.$(OBJEXT) winshadddnl.$(OBJEXT) \ winshadgdi.$(OBJEXT) wintaskbar.$(OBJEXT) \ wintrayicon.$(OBJEXT) winvalargs.$(OBJEXT) winwakeup.$(OBJEXT) \ - winwindow.$(OBJEXT) winwndproc.$(OBJEXT) XWin.$(OBJEXT) \ - miinitext.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) $(am__objects_4) $(am__objects_5) \ - $(am__objects_6) $(am__objects_7) -am_XWin_OBJECTS = $(am__objects_8) + winwindow.$(OBJEXT) winwndproc.$(OBJEXT) windisplay.$(OBJEXT) \ + XWin.$(OBJEXT) miinitext.$(OBJEXT) $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_4) \ + $(am__objects_5) +am_XWin_OBJECTS = $(am__objects_6) XWin_OBJECTS = $(am_XWin_OBJECTS) -am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(top_builddir)/pseudoramiX/libPseudoramiX.la \ +am__DEPENDENCIES_1 = $(top_builddir)/pseudoramiX/libPseudoramiX.la \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la +am__DEPENDENCIES_2 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -397,6 +382,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -638,17 +624,14 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @XWIN_CLIPBOARD_TRUE@SRCS_CLIPBOARD = \ @XWIN_CLIPBOARD_TRUE@ winclipboardinit.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardtextconv.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardthread.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwndproc.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardxevents.c +@XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.c @XWIN_CLIPBOARD_TRUE@DEFS_CLIPBOARD = -DXWIN_CLIPBOARD +@XWIN_CLIPBOARD_TRUE@CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la @XWIN_GLX_WINDOWS_TRUE@GLX_DIR = glx @XWIN_GLX_WINDOWS_TRUE@DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS @XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la -@XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_LINK_FLAGS = -lopengl32 +@XWIN_GLX_WINDOWS_TRUE@XWIN_GLX_SYS_LIBS = -lopengl32 @XWIN_MULTIWINDOW_TRUE@SRCS_MULTIWINDOW = \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowshape.c \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.c \ @@ -658,7 +641,7 @@ top_srcdir = @top_srcdir@ @XWIN_MULTIWINDOW_TRUE@ winSetAppUserModelID.c @XWIN_MULTIWINDOW_TRUE@DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -@XWIN_MULTIWINDOW_TRUE@MULTIWINDOW_LIBS = -lshlwapi -lole32 +@XWIN_MULTIWINDOW_TRUE@MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 @XWIN_MULTIWINDOWEXTWM_TRUE@SRCS_MULTIWINDOWEXTWM = \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootless.c \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.c \ @@ -667,23 +650,6 @@ top_srcdir = @top_srcdir@ @XWIN_MULTIWINDOWEXTWM_TRUE@DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM @XWIN_MULTIWINDOWEXTWM_TRUE@MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la -@XWIN_NATIVEGDI_TRUE@SRCS_NATIVEGDI = \ -@XWIN_NATIVEGDI_TRUE@ winclip.c \ -@XWIN_NATIVEGDI_TRUE@ winfillsp.c \ -@XWIN_NATIVEGDI_TRUE@ winfont.c \ -@XWIN_NATIVEGDI_TRUE@ wingc.c \ -@XWIN_NATIVEGDI_TRUE@ wingetsp.c \ -@XWIN_NATIVEGDI_TRUE@ winnativegdi.c \ -@XWIN_NATIVEGDI_TRUE@ winpixmap.c \ -@XWIN_NATIVEGDI_TRUE@ winpolyline.c \ -@XWIN_NATIVEGDI_TRUE@ winrop.c \ -@XWIN_NATIVEGDI_TRUE@ winsetsp.c - -@XWIN_NATIVEGDI_TRUE@DEFS_NATIVEGDI = -DXWIN_NATIVEGDI -@XWIN_PRIMARYFB_TRUE@SRCS_PRIMARYFB = \ -@XWIN_PRIMARYFB_TRUE@ winpfbdd.c - -@XWIN_PRIMARYFB_TRUE@DEFS_PRIMARYFB = -DXWIN_PRIMARYFB @XWIN_RANDR_TRUE@SRCS_RANDR = \ @XWIN_RANDR_TRUE@ winrandr.c @@ -729,7 +695,6 @@ SRCS = InitInput.c \ winwindow.c \ winwndproc.c \ ddraw.h \ - winclipboard.h \ winconfig.h \ win.h \ winglobals.h \ @@ -745,6 +710,8 @@ SRCS = InitInput.c \ winprefs.h \ winresource.h \ winwindow.h \ + windisplay.c \ + windisplay.h \ XWin.rc \ $(top_srcdir)/mi/miinitext.c \ $(SRCS_CLIPBOARD) \ @@ -757,8 +724,24 @@ SRCS = InitInput.c \ XWin_SOURCES = $(SRCS) AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless -XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_DEPENDENCIES = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(CLIPBOARD_LIBS) \ + $(XSERVER_LIBS) + +XWin_LDADD = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(CLIPBOARD_LIBS) \ + $(XSERVER_LIBS) \ + $(XWIN_GLX_SYS_LIBS) \ + $(XSERVER_SYS_LIBS) \ + $(XWIN_SYS_LIBS) \ + $(MULTIWINDOW_SYS_LIBS) + XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c CLEANFILES = $(BUILT_SOURCES) @@ -777,8 +760,8 @@ EXTRA_DIST = \ XWin.rc \ XWin.exe.manifest -SUBDIRS = man $(GLX_DIR) . -DIST_SUBDIRS = man glx . +SUBDIRS = man $(GLX_DIR) winclipboard . +DIST_SUBDIRS = man glx winclipboard . all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -877,24 +860,16 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winallpriv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winauth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winblock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardinit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardtextconv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardthread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardwndproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardwrappers.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardxevents.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wincmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wincreatewnd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wincursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windialogs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windisplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winengine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winerror.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winfillsp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winfont.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wingc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wingetsp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winglobals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winkeybd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winkeyhook.Po@am__quote@ @@ -909,18 +884,12 @@ 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)/winnativegdi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winpfbdd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winpixmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winpolyline.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)/winrop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winscrinit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winsetsp.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@ diff --git a/xserver/hw/xwin/XWin.rc b/xserver/hw/xwin/XWin.rc index a142f3070..a54e0fdbb 100644 --- a/xserver/hw/xwin/XWin.rc +++ b/xserver/hw/xwin/XWin.rc @@ -93,6 +93,7 @@ BEGIN POPUP "TRAYICON_MENU" BEGIN MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT + MENUITEM "Clipboard may use &PRIMARY selection", ID_APP_MONITOR_PRIMARY MENUITEM "&About...", ID_APP_ABOUT MENUITEM SEPARATOR MENUITEM "E&xit...", ID_APP_EXIT diff --git a/xserver/hw/xwin/ddraw.h b/xserver/hw/xwin/ddraw.h index 1871d9551..4c9af772e 100644 --- a/xserver/hw/xwin/ddraw.h +++ b/xserver/hw/xwin/ddraw.h @@ -1346,7 +1346,7 @@ extern "C" { /***************************************************************************** * IDirectDraw2 interface */ -/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of +/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of * arguments of SetDisplayMode has changed ! */ #undef INTERFACE @@ -1742,7 +1742,7 @@ extern "C" { /***************************************************************************** * IDirectDrawSurface2 interface */ -/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters +/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters * have been converted to LPDIRECTDRAWSURFACE2. */ #undef INTERFACE @@ -1861,7 +1861,7 @@ extern "C" { /***************************************************************************** * IDirectDrawSurface3 interface */ -/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters +/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters * have been converted to LPDIRECTDRAWSURFACE3. */ #undef INTERFACE diff --git a/xserver/hw/xwin/glx/Makefile.in b/xserver/hw/xwin/glx/Makefile.in index ceefa104b..bf112168b 100644 --- a/xserver/hw/xwin/glx/Makefile.in +++ b/xserver/hw/xwin/glx/Makefile.in @@ -268,6 +268,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xwin/glx/gen_gl_wrappers.py b/xserver/hw/xwin/glx/gen_gl_wrappers.py index cdbba638a..b9e8dda75 100644 --- a/xserver/hw/xwin/glx/gen_gl_wrappers.py +++ b/xserver/hw/xwin/glx/gen_gl_wrappers.py @@ -100,13 +100,16 @@ reg = Registry() tree = etree.parse(regFilename) reg.loadElementTree(tree) -allVersions = '.*' +if shim: + versions = '1\.[012]' +else: + versions = '.*' genOpts = CGeneratorOptions( apiname = prefix, profile = 'compatibility', - versions = allVersions, - emitversions = allVersions, + versions = versions, + emitversions = versions, defaultExtensions = prefix, # Default extensions for GL protectFile = protect, protectFeature = protect, @@ -120,6 +123,36 @@ else: errWarn = sys.stderr diag = open(diagFilename, 'w') +def ParseCmdRettype(cmd): + proto=noneStr(cmd.elem.find('proto')) + rettype=noneStr(proto.text) + if rettype.lower()!="void ": + plist = ([t for t in proto.itertext()]) + rettype = ''.join(plist[:-1]) + rettype=rettype.strip() + return rettype + +def ParseCmdParams(cmd): + params = cmd.elem.findall('param') + plist=[] + for param in params: + # construct the formal parameter definition from ptype and name + # elements, also using any text found around these in the + # param element, in the order it appears in the document + paramtype = '' + # also extract the formal parameter name from the name element + paramname = '' + for t in param.iter(): + if t.tag == 'ptype' or t.tag == 'param': + paramtype = paramtype + noneStr(t.text) + if t.tag == 'name': + paramname = t.text + '_' + paramtype = paramtype + ' ' + paramname + if t.tail is not None: + paramtype = paramtype + t.tail.strip() + plist.append((paramtype, paramname)) + return plist + class PreResolveOutputGenerator(OutputGenerator): def __init__(self, errFile = sys.stderr, @@ -176,25 +209,15 @@ class WrapperOutputGenerator(OutputGenerator): if prefix == 'wgl' and not name in used_wgl_ext_fns: return - proto=noneStr(cmd.elem.find('proto')) - rettype=noneStr(proto.text) - if rettype.lower()!="void ": - plist = ([t for t in proto.itertext()]) - rettype = ''.join(plist[:-1]) - rettype=rettype.strip() + rettype=ParseCmdRettype(cmd) + if staticwrappers: self.outFile.write("static ") self.outFile.write("%s %sWrapper("%(rettype, name)) - params = cmd.elem.findall('param') - plist=[] - for param in params: - paramlist = ([t for t in param.itertext()]) - paramtype = ''.join(paramlist[:-1]) - paramname = paramlist[-1] - plist.append((paramtype, paramname)) + plist=ParseCmdParams(cmd) Comma="" if len(plist): for ptype, pname in plist: - self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + self.outFile.write("%s%s"%(Comma, ptype)) Comma=", " else: self.outFile.write("void") @@ -215,7 +238,7 @@ class WrapperOutputGenerator(OutputGenerator): Comma="" for ptype, pname in plist: - self.outFile.write("%s%s_"%(Comma, pname)) + self.outFile.write("%s%s"%(Comma, pname)) Comma=", " # for GL 1.2+ functions, generate stdcall wrappers which use wglGetProcAddress() @@ -241,7 +264,7 @@ class WrapperOutputGenerator(OutputGenerator): Comma="" for ptype, pname in plist: - self.outFile.write("%s%s_"%(Comma, pname)) + self.outFile.write("%s%s"%(Comma, pname)) Comma=", " self.outFile.write(" );\n}\n\n") @@ -257,7 +280,7 @@ class ThunkOutputGenerator(OutputGenerator): pass def beginFeature(self, interface, emit): OutputGenerator.beginFeature(self, interface, emit) - self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') + self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1']) def endFeature(self): OutputGenerator.endFeature(self) def genType(self, typeinfo, name): @@ -267,24 +290,14 @@ class ThunkOutputGenerator(OutputGenerator): def genCmd(self, cmd, name): OutputGenerator.genCmd(self, cmd, name) - proto=noneStr(cmd.elem.find('proto')) - rettype=noneStr(proto.text) - if rettype.lower()!="void ": - plist = ([t for t in proto.itertext()]) - rettype = ''.join(plist[:-1]) - rettype=rettype.strip() + rettype=ParseCmdRettype(cmd) self.outFile.write("%s %sWrapper("%(rettype, name)) - params = cmd.elem.findall('param') - plist=[] - for param in params: - paramlist = ([t for t in param.itertext()]) - paramtype = ''.join(paramlist[:-1]) - paramname = paramlist[-1] - plist.append((paramtype, paramname)) + plist=ParseCmdParams(cmd) + Comma="" if len(plist): for ptype, pname in plist: - self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + self.outFile.write("%s%s"%(Comma, ptype)) Comma=", " else: self.outFile.write("void") @@ -300,7 +313,7 @@ class ThunkOutputGenerator(OutputGenerator): Comma="" for ptype, pname in plist: - self.outFile.write("%s%s_"%(Comma, pname)) + self.outFile.write("%s%s"%(Comma, pname)) Comma=", " # for GL 1.2+ functions, generate wrappers which use wglGetProcAddress() @@ -314,7 +327,7 @@ class ThunkOutputGenerator(OutputGenerator): Comma="" for ptype, pname in plist: - self.outFile.write("%s%s_"%(Comma, pname)) + self.outFile.write("%s%s"%(Comma, pname)) Comma=", " self.outFile.write(" );\n}\n\n") @@ -355,7 +368,7 @@ class ShimOutputGenerator(OutputGenerator): pass def beginFeature(self, interface, emit): OutputGenerator.beginFeature(self, interface, emit) - self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') or self.featureName.startswith('GL_VERSION_1_2') or self.featureName.startswith('GL_ARB_imaging') or self.featureName.startswith('GL_ARB_multitexture') or self.featureName.startswith('GL_ARB_texture_compression') + self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1', 'GL_VERSION_1_2', 'GL_ARB_imaging', 'GL_ARB_multitexture', 'GL_ARB_texture_compression']) def endFeature(self): OutputGenerator.endFeature(self) def genType(self, typeinfo, name): @@ -369,24 +382,14 @@ class ShimOutputGenerator(OutputGenerator): return # for GL functions which are in the ABI, generate a shim which calls the function via GetProcAddress - proto=noneStr(cmd.elem.find('proto')) - rettype=noneStr(proto.text) - if rettype.lower()!="void ": - plist = ([t for t in proto.itertext()]) - rettype = ''.join(plist[:-1]) - rettype=rettype.strip() + rettype=ParseCmdRettype(cmd) self.outFile.write("%s %s("%(rettype, name)) - params = cmd.elem.findall('param') - plist=[] - for param in params: - paramlist = ([t for t in param.itertext()]) - paramtype = ''.join(paramlist[:-1]) - paramname = paramlist[-1] - plist.append((paramtype, paramname)) + plist=ParseCmdParams(cmd) + Comma="" if len(plist): for ptype, pname in plist: - self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + self.outFile.write("%s%s"%(Comma, ptype)) Comma=", " else: self.outFile.write("void") @@ -398,7 +401,7 @@ class ShimOutputGenerator(OutputGenerator): if len(plist): Comma="" for ptype, pname in plist: - self.outFile.write("%s %s %s_"%(Comma, ptype, pname)) + self.outFile.write("%s %s"%(Comma, ptype)) Comma=", " else: self.outFile.write("void") @@ -414,7 +417,7 @@ class ShimOutputGenerator(OutputGenerator): Comma="" for ptype, pname in plist: - self.outFile.write("%s%s_"%(Comma, pname)) + self.outFile.write("%s%s"%(Comma, pname)) Comma=", " self.outFile.write(" );\n}\n\n") diff --git a/xserver/hw/xwin/glx/glshim.c b/xserver/hw/xwin/glx/glshim.c index 7109196c0..df5a932ff 100644 --- a/xserver/hw/xwin/glx/glshim.c +++ b/xserver/hw/xwin/glx/glshim.c @@ -36,6 +36,7 @@ #endif #define GL_GLEXT_LEGACY +#define GL_GLEXT_PROTOTYPES #include #undef GL_ARB_imaging #undef GL_VERSION_1_3 @@ -46,6 +47,8 @@ #include "glwindows.h" #include +extern void *glXGetProcAddressARB(const char *); + static HMODULE hMod = NULL; /* diff --git a/xserver/hw/xwin/glx/glwindows.h b/xserver/hw/xwin/glx/glwindows.h index 4f859b498..34ff24c24 100644 --- a/xserver/hw/xwin/glx/glwindows.h +++ b/xserver/hw/xwin/glx/glwindows.h @@ -28,6 +28,9 @@ * DEALINGS IN THE SOFTWARE. */ +#ifndef GLWINDOWS_H +#define GLWINDOWS_H + #include typedef struct { @@ -53,3 +56,5 @@ int glWinSelectImplementation(int native); #define GLWIN_TRACE_MSG(a, ...) #define GLWIN_DEBUG_MSG(a, ...) #endif + +#endif diff --git a/xserver/hw/xwin/glx/indirect.c b/xserver/hw/xwin/glx/indirect.c index 9bfaac03d..93cdb29d6 100644 --- a/xserver/hw/xwin/glx/indirect.c +++ b/xserver/hw/xwin/glx/indirect.c @@ -738,9 +738,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - // Override the GL extensions string set by __glXScreenInit() - screen->base.GLextensions = strdup(gl_extensions); - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) { unsigned int buffer_size = @@ -893,13 +890,6 @@ glxWinDrawableSwapBuffers(ClientPtr client, __GLXdrawable * base) ("glxWinSwapBuffers on drawable %p, last context %p (native ctx %p)", base, draw->drawContext, draw->drawContext->ctx); - /* - draw->drawContext->base.drawPriv will not be set if the context is not current anymore, - but if it is, it should point to this drawable.... - */ - assert((draw->drawContext->base.drawPriv == NULL) || - (draw->drawContext->base.drawPriv == base)); - dc = glxWinMakeDC(draw->drawContext, draw, &dc, &hwnd); if (dc == NULL) return GL_FALSE; @@ -1123,7 +1113,6 @@ glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, fbConfigToPixelFormatIndex(hdc, gc->base.config, drawableTypeOverride, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage()); return FALSE; } @@ -1306,7 +1295,7 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) glxWinScreen *winScreen; int pixelFormat; - // XXX: which DC are supposed to use??? + // XXX: which DC are we supposed to use??? HDC screenDC = GetDC(NULL); if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT)) { @@ -1319,10 +1308,8 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) pixelFormat = fbConfigToPixelFormatIndex(screenDC, gc->base.config, - GLX_DRAWABLE_PBUFFER, winScreen); + GLX_PBUFFER_BIT, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", - glxWinErrorMessage()); return; } @@ -1761,7 +1748,7 @@ fbConfigToPixelFormatIndex(HDC hdc, __GLXconfig * mode, SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_EXCHANGE_ARB); if (mode->swapMethod == GLX_SWAP_COPY_OML) - SET_ATTR_VALUE(WGL_SWAP_COPY_ARB, TRUE); + SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_COPY_ARB); // XXX: this should probably be the other way around, but that messes up drawableTypeOverride if (mode->visualRating == GLX_SLOW_VISUAL_EXT) diff --git a/xserver/hw/xwin/glx/winpriv.c b/xserver/hw/xwin/glx/winpriv.c index 4f6e4ffd5..9b4baf381 100644 --- a/xserver/hw/xwin/glx/winpriv.c +++ b/xserver/hw/xwin/glx/winpriv.c @@ -51,7 +51,7 @@ winGetWindowInfo(WindowPtr pWin) if (pWinPriv->hWnd == NULL) { winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + winDebug("winGetWindowInfo: forcing window to exist\n"); } if (pWinPriv->hWnd != NULL) { diff --git a/xserver/hw/xwin/man/Makefile.in b/xserver/hw/xwin/man/Makefile.in index f7f370757..08014b786 100644 --- a/xserver/hw/xwin/man/Makefile.in +++ b/xserver/hw/xwin/man/Makefile.in @@ -230,6 +230,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/hw/xwin/man/XWin.man b/xserver/hw/xwin/man/XWin.man index c71f6a154..15a57db02 100644 --- a/xserver/hw/xwin/man/XWin.man +++ b/xserver/hw/xwin/man/XWin.man @@ -174,7 +174,7 @@ on remote hosts, when that information is available and it's useful to do so. .SH OPTIONS CONTROLLING WINDOWS INTEGRATION .TP 8 .B \-[no]clipboard -Enables [disables] the integration between the Cygwin/X clipboard and +Enables [disables] the integration between the X11 clipboard and \fIWindows\fP clipboard. The default is enabled. .TP 8 .B "\-emulate3buttons [\fItimeout\fP]" @@ -200,6 +200,10 @@ prevents the \fIWindows\fP mouse cursor from being drawn on top of the X cursor. This parameter has no effect unless \fB-swcursor\fP is also specified. .TP 8 +.B \-[no]primary +Clipboard integration may [will not] use the PRIMARY selection. +The default is enabled. +.TP 8 .B \-swcursor Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead. .TP 8 @@ -261,10 +265,6 @@ Shadow GDI Shadow DirectDraw .IP 4 4 Shadow DirectDraw Non-Locking -.IP 8 4 -Primary DirectDraw (unsupported, obsolete) -.IP 16 4 -Native GDI (unsupported, experimental and barely functional) .RE .SH FULLSCREEN OPTIONS diff --git a/xserver/hw/xwin/win.h b/xserver/hw/xwin/win.h index a738a5940..b7d20ca73 100644 --- a/xserver/hw/xwin/win.h +++ b/xserver/hw/xwin/win.h @@ -103,12 +103,6 @@ #define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */ #define WIN_SERVER_SHADOW_DD 0x2L /* 2 */ #define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */ -#ifdef XWIN_PRIMARYFB -#define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */ -#endif -#ifdef XWIN_NATIVEGDI -#define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */ -#endif #define AltMapIndex Mod1MapIndex #define NumLockMapIndex Mod2MapIndex @@ -304,12 +298,6 @@ typedef Bool (*winFinishCreateWindowsWindowProcPtr) (WindowPtr pWin); typedef Bool (*winCreateScreenResourcesProc) (ScreenPtr); -#ifdef XWIN_NATIVEGDI -/* Typedefs for native GDI wrappers */ -typedef Bool (*RealizeFontPtr) (ScreenPtr pScreen, FontPtr pFont); -typedef Bool (*UnrealizeFontPtr) (ScreenPtr pScreen, FontPtr pFont); -#endif - /* * GC (graphics context) privates */ @@ -582,12 +570,6 @@ typedef struct _winPrivScreenRec { SetShapeProcPtr SetShape; winCursorRec cursor; - -#ifdef XWIN_NATIVEGDI - RealizeFontPtr RealizeFont; - UnrealizeFontPtr UnrealizeFont; -#endif - } winPrivScreenRec; #ifdef XWIN_MULTIWINDOWEXTWM @@ -724,7 +706,7 @@ extern FARPROC g_fpDirectDrawCreateClipper; winPrivWinPtr pWinPriv = winGetWindowPriv(pWin) /* - * wrapper macros + * wrapper macros */ #define _WIN_WRAP(priv, real, mem, func) {\ priv->mem = real->mem; \ @@ -775,15 +757,6 @@ void winBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadMask); -#ifdef XWIN_NATIVEGDI -/* - * winclip.c - */ - -RegionPtr - winPixmapToRegionNativeGDI(PixmapPtr pPix); -#endif - #ifdef XWIN_CLIPBOARD /* * winclipboardinit.c @@ -793,7 +766,7 @@ Bool winInitClipboard(void); void - winFixClipboardChain(void); + winClipboardShutdown(void); #endif /* @@ -859,52 +832,6 @@ void winMessageBoxF(const char *pszError, UINT uType, ...) _X_ATTRIBUTE_PRINTF(1, 3); -#ifdef XWIN_NATIVEGDI -/* - * winfillsp.c - */ - -void - -winFillSpansNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, - int nSpans, - DDXPointPtr pPoints, int *pWidths, int fSorted); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * winfont.c - */ - -Bool - winRealizeFontNativeGDI(ScreenPtr pScreen, FontPtr pFont); - -Bool - winUnrealizeFontNativeGDI(ScreenPtr pScreen, FontPtr pFont); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * wingc.c - */ - -Bool - winCreateGCNativeGDI(GCPtr pGC); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * wingetsp.c - */ - -void - -winGetSpansNativeGDI(DrawablePtr pDrawable, - int wMax, - DDXPointPtr pPoints, int *pWidths, int nSpans, char *pDst); -#endif - /* * winglobals.c */ @@ -956,23 +883,12 @@ void * winmisc.c */ -#ifdef XWIN_NATIVEGDI -void - -winQueryBestSizeNativeGDI(int class, unsigned short *pWidth, - unsigned short *pHeight, ScreenPtr pScreen); -#endif - CARD8 winCountBits(DWORD dw); Bool winUpdateFBPointer(ScreenPtr pScreen, void *pbits); -#ifdef XWIN_NATIVEGDI -BOOL winPaintBackground(HWND hwnd, COLORREF colorref); -#endif - /* * winmouse.c */ @@ -994,60 +910,6 @@ winMouseButtonsHandle(ScreenPtr pScreen, void winEnqueueMotion(int x, int y); -#ifdef XWIN_NATIVEGDI -/* - * winnativegdi.c - */ - -HBITMAP -winCreateDIBNativeGDI(int iWidth, int iHeight, int iDepth, - BYTE ** ppbBits, BITMAPINFO ** ppbmi); - -Bool - winSetEngineFunctionsNativeGDI(ScreenPtr pScreen); -#endif - -#ifdef XWIN_PRIMARYFB -/* - * winpfbddd.c - */ - -Bool - winSetEngineFunctionsPrimaryDD(ScreenPtr pScreen); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * winpixmap.c - */ - -PixmapPtr - -winCreatePixmapNativeGDI(ScreenPtr pScreen, int width, int height, int depth, - unsigned usage_hint); - -Bool - winDestroyPixmapNativeGDI(PixmapPtr pPixmap); - -Bool - -winModifyPixmapHeaderNativeGDI(PixmapPtr pPixmap, - int iWidth, int iHeight, - int iDepth, - int iBitsPerPixel, - int devKind, void *pPixData); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * winpolyline.c - */ - -void - -winPolyLineNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr ppt); -#endif /* * winscrinit.c */ @@ -1058,26 +920,6 @@ Bool Bool winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv); -#if defined(XWIN_NATIVEGDI) -Bool - -winFinishScreenInitNativeGDI(int i, - ScreenPtr pScreen, int argc, char **argv); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * winsetsp.c - */ - -void - -winSetSpansNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, - char *pSrc, - DDXPointPtr pPoints, int *pWidth, int nSpans, int fSorted); -#endif - /* * winshaddd.c */ @@ -1112,30 +954,6 @@ winWakeupHandler(ScreenPtr pScreen, * winwindow.c */ -#ifdef XWIN_NATIVEGDI -Bool - winCreateWindowNativeGDI(WindowPtr pWin); - -Bool - winDestroyWindowNativeGDI(WindowPtr pWin); - -Bool - winPositionWindowNativeGDI(WindowPtr pWin, int x, int y); - -void - -winCopyWindowNativeGDI(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - -Bool - winChangeWindowAttributesNativeGDI(WindowPtr pWin, unsigned long mask); - -Bool - winUnmapWindowNativeGDI(WindowPtr pWindow); - -Bool - winMapWindowNativeGDI(WindowPtr pWindow); -#endif - Bool winCreateWindowRootless(WindowPtr pWindow); diff --git a/xserver/hw/xwin/winSetAppUserModelID.c b/xserver/hw/xwin/winSetAppUserModelID.c index 41615e19c..f9cb92cdd 100644 --- a/xserver/hw/xwin/winSetAppUserModelID.c +++ b/xserver/hw/xwin/winSetAppUserModelID.c @@ -90,7 +90,7 @@ winSetAppUserModelID(HWND hWnd, const char *AppID) return; } - winDebug("winSetAppUserMOdelID - hwnd 0x%08x appid '%s'\n", hWnd, AppID); + winDebug("winSetAppUserMOdelID - hwnd 0x%p appid '%s'\n", hWnd, AppID); hr = g_pSHGetPropertyStoreForWindow(hWnd, &IID_IPropertyStore, (void **) &pps); diff --git a/xserver/hw/xwin/winclip.c b/xserver/hw/xwin/winclip.c deleted file mode 100644 index 941e9483a..000000000 --- a/xserver/hw/xwin/winclip.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* Look at mfb/mfbclip.c for sample implementation */ -RegionPtr -winPixmapToRegionNativeGDI(PixmapPtr pPix) -{ - ErrorF("winPixmapToRegion()\n"); - return NULL; -} diff --git a/xserver/hw/xwin/winclipboard.h b/xserver/hw/xwin/winclipboard.h deleted file mode 100644 index cb7769510..000000000 --- a/xserver/hw/xwin/winclipboard.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef _WINCLIPBOARD_H_ -#define _WINCLIPBOARD_H_ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -/* Standard library headers */ -#include -#include -#include -#include -#ifdef __CYGWIN__ -#include -#else -#include -#endif -#include -#include -#include - -/* X headers */ -#include -#include -#include -#include -#include - -/* Windows headers */ -#include - -/* Clipboard module constants */ -#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip" -#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip" -#ifdef HAS_DEVWINDOWS -#define WIN_MSG_QUEUE_FNAME "/dev/windows" -#endif -#define WIN_CONNECT_RETRIES 40 -#define WIN_CONNECT_DELAY 4 -#define WIN_JMP_OKAY 0 -#define WIN_JMP_ERROR_IO 2 -#define WIN_LOCAL_PROPERTY "CYGX_CUT_BUFFER" -#define WIN_XEVENTS_SUCCESS 0 -#define WIN_XEVENTS_CONVERT 2 -#define WIN_XEVENTS_NOTIFY 3 -#define WIN_CLIPBOARD_RETRIES 40 -#define WIN_CLIPBOARD_DELAY 1 - -#define WM_WM_REINIT (WM_USER + 1) - -/* - * References to external symbols - */ - -extern char *display; -extern void winDebug(const char *format, ...); -extern void winErrorFVerb(int verb, const char *format, ...); - -/* - * winclipboardinit.c - */ - -Bool - winInitClipboard(void); - -HWND winClipboardCreateMessagingWindow(void); - -/* - * winclipboardtextconv.c - */ - -void - winClipboardDOStoUNIX(char *pszData, int iLength); - -void - winClipboardUNIXtoDOS(char **ppszData, int iLength); - -/* - * winclipboardthread.c - */ - -void *winClipboardProc(void *); - -/* - * winclipboardwndproc.c - */ - -BOOL winClipboardFlushWindowsMessageQueue(HWND hwnd); - -LRESULT CALLBACK -winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); - -/* - * winclipboardxevents.c - */ - -int - -winClipboardFlushXEvents(HWND hwnd, - int iWindow, Display * pDisplay, Bool fUnicodeSupport); -#endif diff --git a/xserver/hw/xwin/winclipboard/Makefile.am b/xserver/hw/xwin/winclipboard/Makefile.am new file mode 100644 index 000000000..a1079aec6 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/Makefile.am @@ -0,0 +1,25 @@ +noinst_LTLIBRARIES = libXWinclipboard.la + +libXWinclipboard_la_SOURCES = \ + winclipboard.h \ + textconv.c \ + thread.c \ + wndproc.c \ + xevents.c + +libXWinclipboard_la_CFLAGS = -DHAVE_XWIN_CONFIG_H \ + $(DIX_CFLAGS) \ + $(XWINMODULES_CFLAGS) + +libXWinclipboard_la_LDFLAGS = -static -no-undefined + +bin_PROGRAMS = xwinclip + +xwinclip_SOURCES = xwinclip.c debug.c + +xwinclip_CFLAGS = $(XWINMODULES_CFLAGS) + +xwinclip_LDADD = libXWinclipboard.la $(XWINMODULES_LIBS) -lgdi32 -lpthread + +include $(top_srcdir)/manpages.am +appman_PRE = xwinclip.man diff --git a/xserver/hw/xwin/winclipboard/Makefile.in b/xserver/hw/xwin/winclipboard/Makefile.in new file mode 100644 index 000000000..772a40230 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/Makefile.in @@ -0,0 +1,1063 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = xwinclip$(EXEEXT) +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp $(top_srcdir)/manpages.am +subdir = hw/xwin/winclipboard +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-config.h \ + $(top_builddir)/include/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libXWinclipboard_la_LIBADD = +am_libXWinclipboard_la_OBJECTS = libXWinclipboard_la-textconv.lo \ + libXWinclipboard_la-thread.lo libXWinclipboard_la-wndproc.lo \ + libXWinclipboard_la-xevents.lo +libXWinclipboard_la_OBJECTS = $(am_libXWinclipboard_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 = +libXWinclipboard_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libXWinclipboard_la_CFLAGS) $(CFLAGS) \ + $(libXWinclipboard_la_LDFLAGS) $(LDFLAGS) -o $@ +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \ + "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)" +PROGRAMS = $(bin_PROGRAMS) +am_xwinclip_OBJECTS = xwinclip-xwinclip.$(OBJEXT) \ + xwinclip-debug.$(OBJEXT) +xwinclip_OBJECTS = $(am_xwinclip_OBJECTS) +am__DEPENDENCIES_1 = +xwinclip_DEPENDENCIES = libXWinclipboard.la $(am__DEPENDENCIES_1) +xwinclip_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(xwinclip_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libXWinclipboard_la_SOURCES) $(xwinclip_SOURCES) +DIST_SOURCES = $(libXWinclipboard_la_SOURCES) $(xwinclip_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; }; \ + } +DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFAULT_XDG_DATA_HOME = @DEFAULT_XDG_DATA_HOME@ +DEFAULT_XDG_DATA_HOME_LOGDIR = @DEFAULT_XDG_DATA_HOME_LOGDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@ +DRI3PROTO_LIBS = @DRI3PROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GBM_CFLAGS = @GBM_CFLAGS@ +GBM_LIBS = @GBM_LIBS@ +GLAMOR_CFLAGS = @GLAMOR_CFLAGS@ +GLAMOR_LIBS = @GLAMOR_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_DOT = @HAVE_DOT@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ + +# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS +# 's|/,|/, |g' will add a space to help font path formatting +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ + 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ + 's|__sysconfdir__|$(sysconfdir)|g' -e \ + 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ + 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|__XKB_DFLT_RULES__|$(XKB_DFLT_RULES)|g' -e \ + 's|__XKB_DFLT_MODEL__|$(XKB_DFLT_MODEL)|g' -e \ + 's|__XKB_DFLT_LAYOUT__|$(XKB_DFLT_LAYOUT)|g' -e \ + 's|__XKB_DFLT_VARIANT__|$(XKB_DFLT_VARIANT)|g' -e \ + 's|__XKB_DFLT_OPTIONS__|$(XKB_DFLT_OPTIONS)|g' -e \ + 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' -e \ + 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|__suid_wrapper_dir__|$(SUID_WRAPPER_DIR)|g' -e \ + 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ + '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +PYTHON3 = @PYTHON3@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SUID_WRAPPER_DIR = @SUID_WRAPPER_DIR@ +SYSCONFDIR = @SYSCONFDIR@ +SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ +SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ +TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WAYLAND_SCANNER = @WAYLAND_SCANNER@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +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@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@ +XSHMFENCE_LIBS = @XSHMFENCE_LIBS@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWAYLANDMODULES_CFLAGS = @XWAYLANDMODULES_CFLAGS@ +XWAYLANDMODULES_LIBS = @XWAYLANDMODULES_LIBS@ +XWAYLAND_LIBS = @XWAYLAND_LIBS@ +XWAYLAND_SYS_LIBS = @XWAYLAND_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libXWinclipboard.la +libXWinclipboard_la_SOURCES = \ + winclipboard.h \ + textconv.c \ + thread.c \ + wndproc.c \ + xevents.c + +libXWinclipboard_la_CFLAGS = -DHAVE_XWIN_CONFIG_H \ + $(DIX_CFLAGS) \ + $(XWINMODULES_CFLAGS) + +libXWinclipboard_la_LDFLAGS = -static -no-undefined +xwinclip_SOURCES = xwinclip.c debug.c +xwinclip_CFLAGS = $(XWINMODULES_CFLAGS) +xwinclip_LDADD = libXWinclipboard.la $(XWINMODULES_LIBS) -lgdi32 -lpthread +appmandir = $(APP_MAN_DIR) +#appman_PRE = list of application man page files set by calling Makefile.am +appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) +drivermandir = $(DRIVER_MAN_DIR) +#driverman_PRE = list of driver man page files set by calling Makefile.am +driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) +filemandir = $(FILE_MAN_DIR) +#fileman_PRE = list of file man page files set by calling Makefile.am +fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) + +# The calling Makefile should only contain man page targets +# Otherwise the following three global variables may conflict +EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) +CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) +SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man +appman_PRE = xwinclip.man +all: all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xwin/winclipboard/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xwin/winclipboard/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/manpages.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libXWinclipboard.la: $(libXWinclipboard_la_OBJECTS) $(libXWinclipboard_la_DEPENDENCIES) $(EXTRA_libXWinclipboard_la_DEPENDENCIES) + $(AM_V_CCLD)$(libXWinclipboard_la_LINK) $(libXWinclipboard_la_OBJECTS) $(libXWinclipboard_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +xwinclip$(EXEEXT): $(xwinclip_OBJECTS) $(xwinclip_DEPENDENCIES) $(EXTRA_xwinclip_DEPENDENCIES) + @rm -f xwinclip$(EXEEXT) + $(AM_V_CCLD)$(xwinclip_LINK) $(xwinclip_OBJECTS) $(xwinclip_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXWinclipboard_la-textconv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXWinclipboard_la-thread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXWinclipboard_la-wndproc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXWinclipboard_la-xevents.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwinclip-debug.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwinclip-xwinclip.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libXWinclipboard_la-textconv.lo: textconv.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -MT libXWinclipboard_la-textconv.lo -MD -MP -MF $(DEPDIR)/libXWinclipboard_la-textconv.Tpo -c -o libXWinclipboard_la-textconv.lo `test -f 'textconv.c' || echo '$(srcdir)/'`textconv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libXWinclipboard_la-textconv.Tpo $(DEPDIR)/libXWinclipboard_la-textconv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='textconv.c' object='libXWinclipboard_la-textconv.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -c -o libXWinclipboard_la-textconv.lo `test -f 'textconv.c' || echo '$(srcdir)/'`textconv.c + +libXWinclipboard_la-thread.lo: thread.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -MT libXWinclipboard_la-thread.lo -MD -MP -MF $(DEPDIR)/libXWinclipboard_la-thread.Tpo -c -o libXWinclipboard_la-thread.lo `test -f 'thread.c' || echo '$(srcdir)/'`thread.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libXWinclipboard_la-thread.Tpo $(DEPDIR)/libXWinclipboard_la-thread.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='thread.c' object='libXWinclipboard_la-thread.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -c -o libXWinclipboard_la-thread.lo `test -f 'thread.c' || echo '$(srcdir)/'`thread.c + +libXWinclipboard_la-wndproc.lo: wndproc.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -MT libXWinclipboard_la-wndproc.lo -MD -MP -MF $(DEPDIR)/libXWinclipboard_la-wndproc.Tpo -c -o libXWinclipboard_la-wndproc.lo `test -f 'wndproc.c' || echo '$(srcdir)/'`wndproc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libXWinclipboard_la-wndproc.Tpo $(DEPDIR)/libXWinclipboard_la-wndproc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wndproc.c' object='libXWinclipboard_la-wndproc.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -c -o libXWinclipboard_la-wndproc.lo `test -f 'wndproc.c' || echo '$(srcdir)/'`wndproc.c + +libXWinclipboard_la-xevents.lo: xevents.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -MT libXWinclipboard_la-xevents.lo -MD -MP -MF $(DEPDIR)/libXWinclipboard_la-xevents.Tpo -c -o libXWinclipboard_la-xevents.lo `test -f 'xevents.c' || echo '$(srcdir)/'`xevents.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libXWinclipboard_la-xevents.Tpo $(DEPDIR)/libXWinclipboard_la-xevents.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xevents.c' object='libXWinclipboard_la-xevents.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) $(libXWinclipboard_la_CFLAGS) $(CFLAGS) -c -o libXWinclipboard_la-xevents.lo `test -f 'xevents.c' || echo '$(srcdir)/'`xevents.c + +xwinclip-xwinclip.o: xwinclip.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwinclip_CFLAGS) $(CFLAGS) -MT xwinclip-xwinclip.o -MD -MP -MF $(DEPDIR)/xwinclip-xwinclip.Tpo -c -o xwinclip-xwinclip.o `test -f 'xwinclip.c' || echo '$(srcdir)/'`xwinclip.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xwinclip-xwinclip.Tpo $(DEPDIR)/xwinclip-xwinclip.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwinclip.c' object='xwinclip-xwinclip.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) $(xwinclip_CFLAGS) $(CFLAGS) -c -o xwinclip-xwinclip.o `test -f 'xwinclip.c' || echo '$(srcdir)/'`xwinclip.c + +xwinclip-xwinclip.obj: xwinclip.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwinclip_CFLAGS) $(CFLAGS) -MT xwinclip-xwinclip.obj -MD -MP -MF $(DEPDIR)/xwinclip-xwinclip.Tpo -c -o xwinclip-xwinclip.obj `if test -f 'xwinclip.c'; then $(CYGPATH_W) 'xwinclip.c'; else $(CYGPATH_W) '$(srcdir)/xwinclip.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xwinclip-xwinclip.Tpo $(DEPDIR)/xwinclip-xwinclip.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwinclip.c' object='xwinclip-xwinclip.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) $(xwinclip_CFLAGS) $(CFLAGS) -c -o xwinclip-xwinclip.obj `if test -f 'xwinclip.c'; then $(CYGPATH_W) 'xwinclip.c'; else $(CYGPATH_W) '$(srcdir)/xwinclip.c'; fi` + +xwinclip-debug.o: debug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwinclip_CFLAGS) $(CFLAGS) -MT xwinclip-debug.o -MD -MP -MF $(DEPDIR)/xwinclip-debug.Tpo -c -o xwinclip-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xwinclip-debug.Tpo $(DEPDIR)/xwinclip-debug.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='xwinclip-debug.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) $(xwinclip_CFLAGS) $(CFLAGS) -c -o xwinclip-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c + +xwinclip-debug.obj: debug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwinclip_CFLAGS) $(CFLAGS) -MT xwinclip-debug.obj -MD -MP -MF $(DEPDIR)/xwinclip-debug.Tpo -c -o xwinclip-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xwinclip-debug.Tpo $(DEPDIR)/xwinclip-debug.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='xwinclip-debug.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) $(xwinclip_CFLAGS) $(CFLAGS) -c -o xwinclip-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(appmandir)" || 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_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir) +install-drivermanDATA: $(driverman_DATA) + @$(NORMAL_INSTALL) + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || 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_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ + done + +uninstall-drivermanDATA: + @$(NORMAL_UNINSTALL) + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) +install-filemanDATA: $(fileman_DATA) + @$(NORMAL_INSTALL) + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(filemandir)" || 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_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ + done + +uninstall-filemanDATA: + @$(NORMAL_UNINSTALL) + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-appmanDATA install-drivermanDATA \ + install-filemanDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-drivermanDATA uninstall-filemanDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstLTLIBRARIES cscopelist \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-appmanDATA \ + install-binPROGRAMS install-data install-data-am \ + install-drivermanDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-filemanDATA install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-drivermanDATA uninstall-filemanDATA + + +.man.$(APP_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(DRIVER_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(FILE_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xserver/hw/xwin/winclipboard/debug.c b/xserver/hw/xwin/winclipboard/debug.c new file mode 100644 index 000000000..78ab6d902 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/debug.c @@ -0,0 +1,52 @@ +// +// Copyright © Jon TURNEY 2013 +// +// This file is part of xwinclip. +// +// 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. +// + +#include +#include + +#if 1 +int +winDebug(const char *format, ...) +{ + int count; + va_list ap; + va_start(ap, format); + count = fprintf(stderr, "xwinclip: "); + count += vfprintf(stderr, format, ap); + va_end(ap); + return count; +} +#endif + +int +ErrorF(const char *format, ...) +{ + int count; + va_list ap; + va_start(ap, format); + count = vfprintf(stderr, format, ap); + va_end(ap); + return count; +} diff --git a/xserver/hw/xwin/winclipboardtextconv.c b/xserver/hw/xwin/winclipboard/textconv.c similarity index 93% rename from xserver/hw/xwin/winclipboardtextconv.c rename to xserver/hw/xwin/winclipboard/textconv.c index fd405a02e..9c9cb3529 100644 --- a/xserver/hw/xwin/winclipboardtextconv.c +++ b/xserver/hw/xwin/winclipboard/textconv.c @@ -31,14 +31,18 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif -#include "win.h" -#include -#include -void - winClipboardDOStoUNIX(char *pszSrc, int iLength); -void - winClipboardUNIXtoDOS(char **ppszData, int iLength); +/* + * Including any server header might define the macro _XSERVER64 on 64 bit machines. + * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + +#include +#include "internal.h" /* * Convert \r\n to \n diff --git a/xserver/hw/xwin/winclipboardthread.c b/xserver/hw/xwin/winclipboard/thread.c similarity index 56% rename from xserver/hw/xwin/winclipboardthread.c rename to xserver/hw/xwin/winclipboard/thread.c index 33595be7f..50e1e8cb5 100644 --- a/xserver/hw/xwin/winclipboardthread.c +++ b/xserver/hw/xwin/winclipboard/thread.c @@ -35,41 +35,62 @@ #else #define HAS_WINSOCK 1 #endif -#include -#include -#include "winclipboard.h" -#ifdef __CYGWIN__ -#include -#endif -#include "misc.h" /* - * References to external symbols + * Including any server header might define the macro _XSERVER64 on 64 bit machines. + * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. + * So let's undef that macro if necessary. */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif -extern Bool g_fUnicodeClipboard; -extern Bool g_fClipboardStarted; -extern Bool g_fClipboardLaunched; -extern Bool g_fClipboard; -extern HWND g_hwndClipboard; -extern void *g_pClipboardDisplay; -extern Window g_iClipboardWindow; +#include +#include +#include +#include +#include +#include // for MAX() macro + +#ifdef HAS_WINSOCK +#include +#else +#include +#endif + +#include +#include +#include "winclipboard.h" +#include "internal.h" + +#define WIN_CONNECT_RETRIES 40 +#define WIN_CONNECT_DELAY 4 + +#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip" +#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip" +#ifdef HAS_DEVWINDOWS +#define WIN_MSG_QUEUE_FNAME "/dev/windows" +#endif /* * Global variables */ +static HWND g_hwndClipboard = NULL; static jmp_buf g_jmpEntry; -static int clipboardRestarts = 0; static XIOErrorHandler g_winClipboardOldIOErrorHandler; static pthread_t g_winClipboardProcThread; -Bool g_fUseUnicode = FALSE; +int xfixes_event_base; +int xfixes_error_base; /* * Local function prototypes */ +static HWND +winClipboardCreateMessagingWindow(Display *pDisplay, Window iWindow, ClipboardAtoms *atoms); + static int winClipboardErrorHandler(Display * pDisplay, XErrorEvent * pErr); @@ -77,13 +98,15 @@ static int winClipboardIOErrorHandler(Display * pDisplay); /* - * Main thread function + * Create X11 and Win32 messaging windows, and run message processing loop + * + * returns TRUE if shutdown was signalled to loop, FALSE if some error occurred */ -void * -winClipboardProc(void *pvNotUsed) +Bool +winClipboardProc(Bool fUseUnicode, char *szDisplay) { - Atom atomClipboard; + ClipboardAtoms atoms; int iReturn; HWND hwnd = NULL; int iConnectionNumber = 0; @@ -97,19 +120,12 @@ winClipboardProc(void *pvNotUsed) int iMaxDescriptor; Display *pDisplay = NULL; Window iWindow = None; - int iRetries; - Bool fUseUnicode; - char szDisplay[512]; int iSelectError; + Bool fShutdown = FALSE; + static Bool fErrorHandlerSet = FALSE; + ClipboardConversionData data; winDebug("winClipboardProc - Hello\n"); - ++clipboardRestarts; - - /* Do we use Unicode clipboard? */ - fUseUnicode = g_fUnicodeClipboard; - - /* Save the Unicode support flag in a global */ - g_fUseUnicode = fUseUnicode; /* Allow multiple threads to access Xlib */ if (XInitThreads() == 0) { @@ -122,70 +138,29 @@ winClipboardProc(void *pvNotUsed) ErrorF("winClipboardProc - Warning: Locale not supported by X.\n"); } - /* Set error handler */ - XSetErrorHandler(winClipboardErrorHandler); g_winClipboardProcThread = pthread_self(); - g_winClipboardOldIOErrorHandler = - XSetIOErrorHandler(winClipboardIOErrorHandler); + + /* Set error handler */ + if (!fErrorHandlerSet) { + XSetErrorHandler(winClipboardErrorHandler); + g_winClipboardOldIOErrorHandler = + XSetIOErrorHandler(winClipboardIOErrorHandler); + fErrorHandlerSet = TRUE; + } /* Set jump point for Error exits */ - iReturn = setjmp(g_jmpEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO && iReturn != WIN_JMP_OKAY) { - /* setjmp returned an unknown value, exit */ - ErrorF("winClipboardProc - setjmp returned: %d exiting\n", iReturn); - goto winClipboardProc_Exit; - } - else if (iReturn == WIN_JMP_ERROR_IO) { - /* TODO: Cleanup the Win32 window and free any allocated memory */ + if (setjmp(g_jmpEntry)) { ErrorF("winClipboardProc - setjmp returned for IO Error Handler.\n"); - pthread_exit(NULL); + goto winClipboardProc_Done; } - /* Use our generated cookie for authentication */ - winSetAuthorization(); - - /* Initialize retry count */ - iRetries = 0; - - /* Setup the display connection string x */ - /* - * NOTE: Always connect to screen 0 since we require that screen - * numbers start at 0 and increase without gaps. We only need - * to connect to one screen on the display to get events - * for all screens on the display. That is why there is only - * one clipboard client thread. - */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); - - /* Print the display connection string */ - ErrorF("winClipboardProc - DISPLAY=%s\n", szDisplay); - - /* Open the X display */ - do { - pDisplay = XOpenDisplay(szDisplay); - if (pDisplay == NULL) { - ErrorF("winClipboardProc - Could not open display, " - "try: %d, sleeping: %d\n", iRetries + 1, WIN_CONNECT_DELAY); - ++iRetries; - sleep(WIN_CONNECT_DELAY); - continue; - } - else - break; - } - while (pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); - /* Make sure that the display opened */ + pDisplay = XOpenDisplay(szDisplay); if (pDisplay == NULL) { ErrorF("winClipboardProc - Failed opening the display, giving up\n"); goto winClipboardProc_Done; } - /* Save the display in the screen privates */ - g_pClipboardDisplay = pDisplay; - ErrorF("winClipboardProc - XOpenDisplay () returned and " "successfully opened the display.\n"); @@ -201,13 +176,20 @@ winClipboardProc(void *pvNotUsed) } /* Find max of our file descriptors */ - iMaxDescriptor = max(fdMessageQueue, iConnectionNumber) + 1; + iMaxDescriptor = MAX(fdMessageQueue, iConnectionNumber) + 1; #else iMaxDescriptor = iConnectionNumber + 1; #endif - /* Create atom */ - atomClipboard = XInternAtom(pDisplay, "CLIPBOARD", False); + if (!XFixesQueryExtension(pDisplay, &xfixes_event_base, &xfixes_error_base)) + ErrorF ("winClipboardProc - XFixes extension not present\n"); + + /* Create atoms */ + atoms.atomClipboard = XInternAtom(pDisplay, "CLIPBOARD", False); + atoms.atomLocalProperty = XInternAtom (pDisplay, "CYGX_CUT_BUFFER", False); + atoms.atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False); + atoms.atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False); + atoms.atomTargets = XInternAtom (pDisplay, "TARGETS", False); /* Create a messaging window */ iWindow = XCreateSimpleWindow(pDisplay, @@ -229,13 +211,27 @@ winClipboardProc(void *pvNotUsed) ErrorF("winClipboardProc - XSelectInput generated BadWindow " "on messaging window\n"); - /* Save the window in the screen privates */ - g_iClipboardWindow = iWindow; + XFixesSelectSelectionInput (pDisplay, + iWindow, + XA_PRIMARY, + XFixesSetSelectionOwnerNotifyMask | + XFixesSelectionWindowDestroyNotifyMask | + XFixesSelectionClientCloseNotifyMask); + XFixesSelectSelectionInput (pDisplay, + iWindow, + atoms.atomClipboard, + XFixesSetSelectionOwnerNotifyMask | + XFixesSelectionWindowDestroyNotifyMask | + XFixesSelectionClientCloseNotifyMask); + + + /* Initialize monitored selection state */ + winClipboardInitMonitoredSelections(); /* Create Windows messaging window */ - hwnd = winClipboardCreateMessagingWindow(); + hwnd = winClipboardCreateMessagingWindow(pDisplay, iWindow, &atoms); - /* Save copy of HWND in screen privates */ + /* Save copy of HWND */ g_hwndClipboard = hwnd; /* Assert ownership of selections if Win32 clipboard is owned */ @@ -250,32 +246,34 @@ winClipboardProc(void *pvNotUsed) } /* CLIPBOARD */ - iReturn = XSetSelectionOwner(pDisplay, atomClipboard, + iReturn = XSetSelectionOwner(pDisplay, atoms.atomClipboard, iWindow, CurrentTime); if (iReturn == BadAtom || iReturn == BadWindow || - XGetSelectionOwner(pDisplay, atomClipboard) != iWindow) { + XGetSelectionOwner(pDisplay, atoms.atomClipboard) != iWindow) { ErrorF("winClipboardProc - Could not set CLIPBOARD owner\n"); goto winClipboardProc_Done; } } - /* Pre-flush X events */ - /* - * NOTE: Apparently you'll freeze if you don't do this, - * because there may be events in local data structures - * already. - */ - winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode); + data.fUseUnicode = fUseUnicode; - /* Pre-flush Windows messages */ - if (!winClipboardFlushWindowsMessageQueue(hwnd)) - return 0; - - /* Signal that the clipboard client has started */ - g_fClipboardStarted = TRUE; - - /* Loop for X events */ + /* Loop for events */ while (1) { + + /* Process X events */ + winClipboardFlushXEvents(hwnd, + iWindow, pDisplay, &data, &atoms); + + /* Process Windows messages */ + if (!winClipboardFlushWindowsMessageQueue(hwnd)) { + ErrorF("winClipboardProc - winClipboardFlushWindowsMessageQueue trapped " + "WM_QUIT message, exiting main loop.\n"); + break; + } + + /* We need to ensure that all pending requests are sent */ + XFlush(pDisplay); + /* Setup the file descriptor set */ /* * NOTE: You have to do this before every call to select @@ -322,10 +320,9 @@ winClipboardProc(void *pvNotUsed) break; } - /* Branch on which descriptor became active */ if (FD_ISSET(iConnectionNumber, &fdsRead)) { - /* Process X events */ - winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode); + winDebug + ("winClipboardProc - X connection ready, pumping X event queue\n"); } #ifdef HAS_DEVWINDOWS @@ -335,27 +332,26 @@ winClipboardProc(void *pvNotUsed) if (1) #endif { - /* Process Windows messages */ - if (!winClipboardFlushWindowsMessageQueue(hwnd)) { - ErrorF("winClipboardProc - " - "winClipboardFlushWindowsMessageQueue trapped " - "WM_QUIT message, exiting main loop.\n"); - break; - } + winDebug + ("winClipboardProc - /dev/windows ready, pumping Windows message queue\n"); } + +#ifdef HAS_DEVWINDOWS + if (!(FD_ISSET(iConnectionNumber, &fdsRead)) && + !(FD_ISSET(fdMessageQueue, &fdsRead))) { + winDebug("winClipboardProc - Spurious wake, select() returned %d\n", iReturn); + } +#endif } winClipboardProc_Exit: - /* disable the clipboard, which means the thread will die */ - g_fClipboard = FALSE; + /* broke out of while loop on a shutdown message */ + fShutdown = TRUE; winClipboardProc_Done: /* Close our Windows window */ if (g_hwndClipboard) { - /* Destroy the Window window (hwnd) */ - winDebug("winClipboardProc - Destroy Windows window\n"); - PostMessage(g_hwndClipboard, WM_DESTROY, 0, 0); - winClipboardFlushWindowsMessageQueue(g_hwndClipboard); + DestroyWindow(g_hwndClipboard); } /* Close our X window */ @@ -375,8 +371,11 @@ winClipboardProc(void *pvNotUsed) #if 0 /* - * FIXME: XCloseDisplay hangs if we call it, as of 2004/03/26. The - * XSync and XSelectInput calls did not help. + * FIXME: XCloseDisplay hangs if we call it + * + * XCloseDisplay() calls XSync(), so any outstanding errors are reported. + * If we are built into the server, this can deadlock if the server is + * in the process of exiting and waiting for this thread to exit. */ /* Discard any remaining events */ @@ -392,42 +391,64 @@ winClipboardProc(void *pvNotUsed) #endif /* global clipboard variable reset */ - g_fClipboardLaunched = FALSE; - g_fClipboardStarted = FALSE; - g_iClipboardWindow = None; - g_pClipboardDisplay = NULL; g_hwndClipboard = NULL; - /* checking if we need to restart */ - if (clipboardRestarts >= WIN_CLIPBOARD_RETRIES) { - /* terminates clipboard thread but the main server still lives */ - ErrorF - ("winClipboardProc - the clipboard thread has restarted %d times and seems to be unstable, disabling clipboard integration\n", - clipboardRestarts); - g_fClipboard = FALSE; - return NULL; - } + return fShutdown; +} - if (g_fClipboard) { - sleep(WIN_CLIPBOARD_DELAY); - ErrorF("winClipboardProc - trying to restart clipboard thread \n"); - /* Create the clipboard client thread */ - if (!winInitClipboard()) { - ErrorF("winClipboardProc - winClipboardInit failed.\n"); - return NULL; - } +/* + * Create the Windows window that we use to receive Windows messages + */ - winDebug("winClipboardProc - winInitClipboard returned.\n"); - /* Flag that clipboard client has been launched */ - g_fClipboardLaunched = TRUE; - } - else { - ErrorF("winClipboardProc - Clipboard disabled - Exit from server \n"); - /* clipboard thread has exited, stop server as well */ - raise(SIGTERM); - } +static HWND +winClipboardCreateMessagingWindow(Display *pDisplay, Window iWindow, ClipboardAtoms *atoms) +{ + WNDCLASSEX wc; + ClipboardWindowCreationParams cwcp; + HWND hwnd; - return NULL; + /* Setup our window class */ + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = winClipboardWindowProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandle(NULL); + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS; + wc.hIconSm = 0; + RegisterClassEx(&wc); + + /* Information to be passed to WM_CREATE */ + cwcp.pClipboardDisplay = pDisplay; + cwcp.iClipboardWindow = iWindow; + cwcp.atoms = atoms; + + /* Create the window */ + hwnd = CreateWindowExA(0, /* Extended styles */ + WIN_CLIPBOARD_WINDOW_CLASS, /* Class name */ + WIN_CLIPBOARD_WINDOW_TITLE, /* Window name */ + WS_OVERLAPPED, /* Not visible anyway */ + CW_USEDEFAULT, /* Horizontal position */ + CW_USEDEFAULT, /* Vertical position */ + CW_USEDEFAULT, /* Right edge */ + CW_USEDEFAULT, /* Bottom edge */ + (HWND) NULL, /* No parent or owner window */ + (HMENU) NULL, /* No menu */ + GetModuleHandle(NULL), /* Instance handle */ + &cwcp); /* Creation data */ + assert(hwnd != NULL); + + /* I'm not sure, but we may need to call this to start message processing */ + ShowWindow(hwnd, SW_HIDE); + + /* Similarly, we may need a call to this even though we don't paint */ + UpdateWindow(hwnd); + + return hwnd; } /* @@ -457,7 +478,7 @@ winClipboardIOErrorHandler(Display * pDisplay) if (pthread_equal(pthread_self(), g_winClipboardProcThread)) { /* Restart at the main entry point */ - longjmp(g_jmpEntry, WIN_JMP_ERROR_IO); + longjmp(g_jmpEntry, 2); } if (g_winClipboardOldIOErrorHandler) @@ -465,3 +486,19 @@ winClipboardIOErrorHandler(Display * pDisplay) return 0; } + +void +winClipboardWindowDestroy(void) +{ + if (g_hwndClipboard) { + SendMessage(g_hwndClipboard, WM_WM_QUIT, 0, 0); + } +} + +void +winFixClipboardChain(void) +{ + if (g_hwndClipboard) { + PostMessage(g_hwndClipboard, WM_WM_REINIT, 0, 0); + } +} diff --git a/xserver/hw/xwin/winclipboard/winclipboard.h b/xserver/hw/xwin/winclipboard/winclipboard.h new file mode 100644 index 000000000..9c5c568a7 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/winclipboard.h @@ -0,0 +1,38 @@ +// +// Copyright © Jon TURNEY 2013 +// +// 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. +// +// File: winclipboard.h +// Purpose: public interface to winclipboard library +// + +#ifndef WINCLIPBOARD_H +#define WINCLIPBOARD_H + +Bool winClipboardProc(Bool fUseUnicode, char *szDisplay); + +void winFixClipboardChain(void); + +void winClipboardWindowDestroy(void); + +extern Bool fPrimarySelection; + +#endif diff --git a/xserver/hw/xwin/winclipboardwndproc.c b/xserver/hw/xwin/winclipboard/wndproc.c similarity index 65% rename from xserver/hw/xwin/winclipboardwndproc.c rename to xserver/hw/xwin/winclipboard/wndproc.c index 90dc9e0bb..1ea5bc6b7 100644 --- a/xserver/hw/xwin/winclipboardwndproc.c +++ b/xserver/hw/xwin/winclipboard/wndproc.c @@ -33,10 +33,24 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + +/* + * Including any server header might define the macro _XSERVER64 on 64 bit machines. + * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + #include #include +#include + +#include + +#include "internal.h" #include "winclipboard.h" -#include "misc.h" /* * Constants @@ -44,21 +58,14 @@ #define WIN_POLL_TIMEOUT 1 -/* - * References to external symbols - */ - -extern void *g_pClipboardDisplay; -extern Window g_iClipboardWindow; -extern Atom g_atomLastOwnedSelection; /* * Process X events up to specified timeout */ static int -winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, - Bool fUseUnicode, int iTimeoutSec) +winProcessXEventsTimeout(HWND hwnd, Window iWindow, Display * pDisplay, + ClipboardConversionData *data, ClipboardAtoms *atoms, int iTimeoutSec) { int iConnNumber; struct timeval tv; @@ -76,8 +83,18 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, fd_set fdsRead; long remainingTime; - /* We need to ensure that all pending events are processed */ - XSync(pDisplay, FALSE); + /* Process X events */ + iReturn = winClipboardFlushXEvents(hwnd, iWindow, pDisplay, data, atoms); + + winDebug("winProcessXEventsTimeout () - winClipboardFlushXEvents returned %d\n", iReturn); + + if ((WIN_XEVENTS_NOTIFY_DATA == iReturn) || (WIN_XEVENTS_NOTIFY_TARGETS == iReturn) || (WIN_XEVENTS_FAILED == iReturn)) { + /* Bail out */ + return iReturn; + } + + /* We need to ensure that all pending requests are sent */ + XFlush(pDisplay); /* Setup the file descriptor set */ FD_ZERO(&fdsRead); @@ -106,24 +123,8 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, break; } - /* Branch on which descriptor became active */ - if (FD_ISSET(iConnNumber, &fdsRead)) { - /* Process X events */ - /* Exit when we see that server is shutting down */ - iReturn = winClipboardFlushXEvents(hwnd, - iWindow, pDisplay, fUseUnicode); - - winDebug - ("winProcessXEventsTimeout () - winClipboardFlushXEvents returned %d\n", - iReturn); - - if (WIN_XEVENTS_NOTIFY == iReturn) { - /* Bail out if notify processed */ - return iReturn; - } - } - else { - winDebug("winProcessXEventsTimeout - Spurious wake\n"); + if (!FD_ISSET(iConnNumber, &fdsRead)) { + winDebug("winProcessXEventsTimeout - Spurious wake, select() returned %d\n", iReturn); } } @@ -139,6 +140,10 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static HWND s_hwndNextViewer; static Bool s_fCBCInitialized; + static Display *pDisplay; + static Window iWindow; + static ClipboardAtoms *atoms; + static Bool fRunning; /* Branch on message type */ switch (message) { @@ -150,7 +155,13 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ChangeClipboardChain(hwnd, s_hwndNextViewer); s_hwndNextViewer = NULL; + } + return 0; + case WM_WM_QUIT: + { + winDebug("winClipboardWindowProc - WM_WM_QUIT\n"); + fRunning = FALSE; PostQuitMessage(0); } return 0; @@ -159,9 +170,15 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HWND first, next; DWORD error_code = 0; + ClipboardWindowCreationParams *cwcp = (ClipboardWindowCreationParams *)((CREATESTRUCT *)lParam)->lpCreateParams; winDebug("winClipboardWindowProc - WM_CREATE\n"); + pDisplay = cwcp->pClipboardDisplay; + iWindow = cwcp->iClipboardWindow; + 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! */ @@ -185,8 +202,8 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) s_hwndNextViewer = (HWND) lParam; if (s_hwndNextViewer == hwnd) { s_hwndNextViewer = NULL; - winErrorFVerb(1, "winClipboardWindowProc - WM_CHANGECBCHAIN: " - "attempted to set next window to ourselves."); + ErrorF("winClipboardWindowProc - WM_CHANGECBCHAIN: " + "attempted to set next window to ourselves."); } } else if (s_hwndNextViewer) @@ -241,20 +258,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_DRAWCLIPBOARD: { - static Atom atomClipboard; - static int generation; static Bool s_fProcessingDrawClipboard = FALSE; - Display *pDisplay = g_pClipboardDisplay; - Window iWindow = g_iClipboardWindow; int iReturn; winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n"); - if (generation != serverGeneration) { - generation = serverGeneration; - atomClipboard = XInternAtom(pDisplay, "CLIPBOARD", False); - } - /* * We've occasionally seen a loop in the clipboard chain. * Try and fix it on the first hint of recursion. @@ -267,8 +275,8 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) s_fCBCInitialized = FALSE; ChangeClipboardChain(hwnd, s_hwndNextViewer); winFixClipboardChain(); - winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Nested calls detected. Re-initing.\n"); + ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - " + "Nested calls detected. Re-initing.\n"); winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); s_fProcessingDrawClipboard = FALSE; return 0; @@ -302,6 +310,10 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; } + /* Bail when shutting down */ + if (!fRunning) + return 0; + /* * Do not take ownership of the X11 selections when something * other than CF_TEXT or CF_UNICODETEXT has been copied @@ -324,27 +336,27 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Release PRIMARY selection if owned */ iReturn = XGetSelectionOwner(pDisplay, XA_PRIMARY); - if (iReturn == g_iClipboardWindow) { + if (iReturn == iWindow) { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " "PRIMARY selection is owned by us.\n"); XSetSelectionOwner(pDisplay, XA_PRIMARY, None, CurrentTime); } else if (BadWindow == iReturn || BadAtom == iReturn) - winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for PRIMARY: %d\n", - iReturn); + ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - " + "XGetSelectionOwner failed for PRIMARY: %d\n", + iReturn); /* Release CLIPBOARD selection if owned */ - iReturn = XGetSelectionOwner(pDisplay, atomClipboard); - if (iReturn == g_iClipboardWindow) { + iReturn = XGetSelectionOwner(pDisplay, atoms->atomClipboard); + if (iReturn == iWindow) { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "CLIPBOARD selection is owned by us.\n"); - XSetSelectionOwner(pDisplay, atomClipboard, None, CurrentTime); + "CLIPBOARD selection is owned by us, releasing\n"); + XSetSelectionOwner(pDisplay, atoms->atomClipboard, None, CurrentTime); } else if (BadWindow == iReturn || BadAtom == iReturn) - winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for CLIPBOARD: %d\n", - iReturn); + ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - " + "XGetSelectionOwner failed for CLIPBOARD: %d\n", + iReturn); winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); s_fProcessingDrawClipboard = FALSE; @@ -358,8 +370,8 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) XA_PRIMARY, iWindow, CurrentTime); if (iReturn == BadAtom || iReturn == BadWindow || XGetSelectionOwner(pDisplay, XA_PRIMARY) != iWindow) { - winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Could not reassert ownership of PRIMARY\n"); + ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - " + "Could not reassert ownership of PRIMARY\n"); } else { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " @@ -368,12 +380,12 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Reassert ownership of the CLIPBOARD */ iReturn = XSetSelectionOwner(pDisplay, - atomClipboard, iWindow, CurrentTime); + atoms->atomClipboard, iWindow, CurrentTime); if (iReturn == BadAtom || iReturn == BadWindow || - XGetSelectionOwner(pDisplay, atomClipboard) != iWindow) { - winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Could not reassert ownership of CLIPBOARD\n"); + XGetSelectionOwner(pDisplay, atoms->atomClipboard) != iWindow) { + ErrorF("winClipboardWindowProc - WM_DRAWCLIPBOARD - " + "Could not reassert ownership of CLIPBOARD\n"); } else { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " @@ -405,96 +417,151 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winDebug("winClipboardWindowProc - WM_DESTROYCLIPBOARD - Ignored.\n"); return 0; - case WM_RENDERFORMAT: case WM_RENDERALLFORMATS: + winDebug("winClipboardWindowProc - WM_RENDERALLFORMATS - Hello.\n"); + + /* + WM_RENDERALLFORMATS is sent as we are shutting down, to render the + clipboard so it's contents remains available to other applications. + + Unfortunately, this can't work without major changes. The server is + already waiting for us to stop, so we can't ask for the rendering of + clipboard text now. + */ + + return 0; + + case WM_RENDERFORMAT: { int iReturn; - Display *pDisplay = g_pClipboardDisplay; - Window iWindow = g_iClipboardWindow; Bool fConvertToUnicode; + Bool pasted = FALSE; + Atom selection; + ClipboardConversionData data; + int best_target = 0; - winDebug("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n"); + winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n", + wParam); /* Flag whether to convert to Unicode or not */ - if (message == WM_RENDERALLFORMATS) - fConvertToUnicode = FALSE; - else - fConvertToUnicode = (CF_UNICODETEXT == wParam); + fConvertToUnicode = (CF_UNICODETEXT == wParam); - /* Request the selection contents */ - iReturn = XConvertSelection(pDisplay, - g_atomLastOwnedSelection, - XInternAtom(pDisplay, - "COMPOUND_TEXT", False), - XInternAtom(pDisplay, - "CYGX_CUT_BUFFER", False), - iWindow, CurrentTime); - if (iReturn == BadAtom || iReturn == BadWindow) { - winErrorFVerb(1, "winClipboardWindowProc - WM_RENDER*FORMAT - " - "XConvertSelection () failed\n"); - break; + selection = winClipboardGetLastOwnedSelectionAtom(atoms); + if (selection == None) { + ErrorF("winClipboardWindowProc - no monitored selection is owned\n"); + goto fake_paste; } - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) { - /* We must open and empty the clipboard */ + winDebug("winClipboardWindowProc - requesting targets for selection from owner\n"); - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow() == hwnd) { - CloseClipboard(); - } + /* Request the selection's supported conversion targets */ + XConvertSelection(pDisplay, + selection, + atoms->atomTargets, + atoms->atomLocalProperty, + iWindow, CurrentTime); - if (!OpenClipboard(hwnd)) { - winErrorFVerb(1, "winClipboardWindowProc - WM_RENDER*FORMATS - " - "OpenClipboard () failed: %08x\n", - GetLastError()); - break; - } - - if (!EmptyClipboard()) { - winErrorFVerb(1, "winClipboardWindowProc - WM_RENDER*FORMATS - " - "EmptyClipboard () failed: %08x\n", - GetLastError()); - break; - } - } - - /* Process the SelectionNotify event */ + /* Process X events */ + data.fUseUnicode = fConvertToUnicode; iReturn = winProcessXEventsTimeout(hwnd, iWindow, pDisplay, - fConvertToUnicode, WIN_POLL_TIMEOUT); + &data, + atoms, + WIN_POLL_TIMEOUT); + + if (WIN_XEVENTS_NOTIFY_TARGETS != iReturn) { + ErrorF + ("winClipboardWindowProc - timed out waiting for WIN_XEVENTS_NOTIFY_TARGETS\n"); + goto fake_paste; + } + + /* Choose the most preferred target */ + { + struct target_priority + { + Atom target; + unsigned int priority; + }; + + struct target_priority target_priority_table[] = + { + { atoms->atomCompoundText, 0 }, +#ifdef X_HAVE_UTF8_STRING + { atoms->atomUTF8String, 1 }, +#endif + { XA_STRING, 2 }, + }; + + int best_priority = INT_MAX; + + int i,j; + for (i = 0 ; data.targetList[i] != 0; i++) + { + for (j = 0; j < sizeof(target_priority_table)/sizeof(struct target_priority); j ++) + { + if ((data.targetList[i] == target_priority_table[j].target) && + (target_priority_table[j].priority < best_priority)) + { + best_target = target_priority_table[j].target; + best_priority = target_priority_table[j].priority; + } + } + } + } + + free(data.targetList); + data.targetList = 0; + + winDebug("winClipboardWindowProc - best target is %d\n", best_target); + + /* No useful targets found */ + if (best_target == 0) + goto fake_paste; + + winDebug("winClipboardWindowProc - requesting selection from owner\n"); + + /* Request the selection contents */ + XConvertSelection(pDisplay, + selection, + best_target, + atoms->atomLocalProperty, + iWindow, CurrentTime); + + /* Process X events */ + iReturn = winProcessXEventsTimeout(hwnd, + iWindow, + pDisplay, + &data, + atoms, + WIN_POLL_TIMEOUT); /* - * The last call to winProcessXEventsTimeout - * from above had better have seen a notify event, or else we - * are dealing with a buggy or old X11 app. In these cases we - * have to paste some fake data to the Win32 clipboard to - * satisfy the requirement that we write something to it. + * winProcessXEventsTimeout had better have seen a notify event, + * or else we are dealing with a buggy or old X11 app. */ - if (WIN_XEVENTS_NOTIFY != iReturn) { + if (WIN_XEVENTS_NOTIFY_DATA != iReturn) { + ErrorF + ("winClipboardWindowProc - timed out waiting for WIN_XEVENTS_NOTIFY_DATA\n"); + } + else { + pasted = TRUE; + } + + /* + * If we couldn't get the data from the X clipboard, we + * have to paste some fake data to the Win32 clipboard to + * satisfy the requirement that we write something to it. + */ + fake_paste: + if (!pasted) + { /* Paste no data, to satisfy required call to SetClipboardData */ SetClipboardData(CF_UNICODETEXT, NULL); SetClipboardData(CF_TEXT, NULL); + } - ErrorF - ("winClipboardWindowProc - timed out waiting for WIN_XEVENTS_NOTIFY\n"); - } - - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) { - /* We must close the clipboard */ - - if (!CloseClipboard()) { - winErrorFVerb(1, - "winClipboardWindowProc - WM_RENDERALLFORMATS - " - "CloseClipboard () failed: %08x\n", - GetLastError()); - break; - } - } - - winDebug("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n"); + winDebug("winClipboardWindowProc - WM_RENDERFORMAT - Returning.\n"); return 0; } } @@ -507,7 +574,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) * Process any pending Windows messages */ -BOOL +Bool winClipboardFlushWindowsMessageQueue(HWND hwnd) { MSG msg; diff --git a/xserver/hw/xwin/winclipboardxevents.c b/xserver/hw/xwin/winclipboard/xevents.c similarity index 71% rename from xserver/hw/xwin/winclipboardxevents.c rename to xserver/hw/xwin/winclipboard/xevents.c index 7d3c30e85..835195b52 100644 --- a/xserver/hw/xwin/winclipboardxevents.c +++ b/xserver/hw/xwin/winclipboard/xevents.c @@ -33,8 +33,156 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + +/* + * Including any server header might define the macro _XSERVER64 on 64 bit machines. + * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + +#include +#include +#include +#include +#include + #include "winclipboard.h" -#include "misc.h" +#include "internal.h" + +/* + * Constants + */ + +#define CLIP_NUM_SELECTIONS 2 +#define CLIP_OWN_NONE -1 +#define CLIP_OWN_PRIMARY 0 +#define CLIP_OWN_CLIPBOARD 1 + +/* + * Global variables + */ + +extern int xfixes_event_base; +Bool fPrimarySelection = TRUE; + +/* + * Local variables + */ + +static Window s_iOwners[CLIP_NUM_SELECTIONS] = { None, None }; +static const char *szSelectionNames[CLIP_NUM_SELECTIONS] = + { "PRIMARY", "CLIPBOARD" }; + +static unsigned int lastOwnedSelectionIndex = CLIP_OWN_NONE; + +static void +MonitorSelection(XFixesSelectionNotifyEvent * e, unsigned int i) +{ + /* Look for owned -> not owned transition */ + if (None == e->owner && None != s_iOwners[i]) { + unsigned int other_index; + + winDebug("MonitorSelection - %s - Going from owned to not owned.\n", + szSelectionNames[i]); + + /* If this selection is not owned, the other monitored selection must be the most + recently owned, if it is owned at all */ + if (i == CLIP_OWN_PRIMARY) + other_index = CLIP_OWN_CLIPBOARD; + if (i == CLIP_OWN_CLIPBOARD) + other_index = CLIP_OWN_PRIMARY; + if (None != s_iOwners[other_index]) + lastOwnedSelectionIndex = other_index; + else + lastOwnedSelectionIndex = CLIP_OWN_NONE; + } + + /* Save last owned selection */ + if (None != e->owner) { + lastOwnedSelectionIndex = i; + } + + /* Save new selection owner or None */ + s_iOwners[i] = e->owner; + winDebug("MonitorSelection - %s - Now owned by XID %x\n", + szSelectionNames[i], e->owner); +} + +Atom +winClipboardGetLastOwnedSelectionAtom(ClipboardAtoms *atoms) +{ + if (lastOwnedSelectionIndex == CLIP_OWN_NONE) + return None; + + if (lastOwnedSelectionIndex == CLIP_OWN_PRIMARY) + return XA_PRIMARY; + + if (lastOwnedSelectionIndex == CLIP_OWN_CLIPBOARD) + return atoms->atomClipboard; + + return None; +} + + +void +winClipboardInitMonitoredSelections(void) +{ + /* Initialize static variables */ + int i; + for (i = 0; i < CLIP_NUM_SELECTIONS; ++i) + s_iOwners[i] = None; + + lastOwnedSelectionIndex = CLIP_OWN_NONE; +} + +static int +winClipboardSelectionNotifyTargets(HWND hwnd, Window iWindow, Display *pDisplay, ClipboardConversionData *data, ClipboardAtoms *atoms) +{ + Atom type; + int format; + unsigned long nitems; + unsigned long after; + Atom *prop; + + /* Retrieve the selection data and delete the property */ + int iReturn = XGetWindowProperty(pDisplay, + iWindow, + atoms->atomLocalProperty, + 0, + INT_MAX, + True, + AnyPropertyType, + &type, + &format, + &nitems, + &after, + (unsigned char **)&prop); + if (iReturn != Success) { + ErrorF("winClipboardFlushXEvents - SelectionNotify - " + "XGetWindowProperty () failed, aborting: %d\n", iReturn); + } else { + int i; + data->targetList = malloc((nitems+1)*sizeof(Atom)); + + for (i = 0; i < nitems; i++) + { + Atom atom = prop[i]; + char *pszAtomName = XGetAtomName(pDisplay, atom); + data->targetList[i] = atom; + winDebug("winClipboardFlushXEvents - SelectionNotify - target[%d] %d = %s\n", i, atom, pszAtomName); + XFree(pszAtomName); + } + + data->targetList[nitems] = 0; + + XFree(prop); + } + + return WIN_XEVENTS_NOTIFY_TARGETS; +} /* * Process any pending X events @@ -42,21 +190,13 @@ int winClipboardFlushXEvents(HWND hwnd, - int iWindow, Display * pDisplay, Bool fUseUnicode) + Window iWindow, Display * pDisplay, ClipboardConversionData *data, ClipboardAtoms *atoms) { - static Atom atomLocalProperty; - static Atom atomCompoundText; - static Atom atomUTF8String; - static Atom atomTargets; - static int generation; - - if (generation != serverGeneration) { - generation = serverGeneration; - atomLocalProperty = XInternAtom(pDisplay, WIN_LOCAL_PROPERTY, False); - atomUTF8String = XInternAtom(pDisplay, "UTF8_STRING", False); - atomCompoundText = XInternAtom(pDisplay, "COMPOUND_TEXT", False); - atomTargets = XInternAtom(pDisplay, "TARGETS", False); - } + Atom atomClipboard = atoms->atomClipboard; + Atom atomLocalProperty = atoms->atomLocalProperty; + Atom atomUTF8String = atoms->atomUTF8String; + Atom atomCompoundText = atoms->atomCompoundText; + Atom atomTargets = atoms->atomTargets; /* Process all pending events */ while (XPending(pDisplay)) { @@ -69,15 +209,11 @@ winClipboardFlushXEvents(HWND hwnd, int iReturn; HGLOBAL hGlobal = NULL; XICCEncodingStyle xiccesStyle; - int iConvertDataLen = 0; char *pszConvertData = NULL; char *pszTextList[2] = { NULL }; int iCount; char **ppszTextList = NULL; wchar_t *pwszUnicodeStr = NULL; - int iUnicodeLen = 0; - int iReturnDataLen = 0; - int i; Bool fAbort = FALSE; Bool fCloseClipboard = FALSE; Bool fSetClipboardData = TRUE; @@ -184,7 +320,7 @@ winClipboardFlushXEvents(HWND hwnd, fCloseClipboard = TRUE; /* Check that clipboard format is available */ - if (fUseUnicode && !IsClipboardFormatAvailable(CF_UNICODETEXT)) { + if (data->fUseUnicode && !IsClipboardFormatAvailable(CF_UNICODETEXT)) { static int count; /* Hack to stop acroread spamming the log */ static HWND lasthwnd; /* I've not seen any other client get here repeatedly? */ @@ -201,7 +337,7 @@ winClipboardFlushXEvents(HWND hwnd, fAbort = TRUE; goto winClipboardFlushXEvents_SelectionRequest_Done; } - else if (!fUseUnicode && !IsClipboardFormatAvailable(CF_TEXT)) { + else if (!data->fUseUnicode && !IsClipboardFormatAvailable(CF_TEXT)) { ErrorF("winClipboardFlushXEvents - CF_TEXT is not " "available from Win32 clipboard. Aborting.\n"); @@ -223,7 +359,7 @@ winClipboardFlushXEvents(HWND hwnd, xiccesStyle = XStringStyle; /* Get a pointer to the clipboard text, in desired format */ - if (fUseUnicode) { + if (data->fUseUnicode) { /* Retrieve clipboard data */ hGlobal = GetClipboardData(CF_UNICODETEXT); } @@ -242,8 +378,8 @@ winClipboardFlushXEvents(HWND hwnd, pszGlobalData = (char *) GlobalLock(hGlobal); /* Convert the Unicode string to UTF8 (MBCS) */ - if (fUseUnicode) { - iConvertDataLen = WideCharToMultiByte(CP_UTF8, + if (data->fUseUnicode) { + int iConvertDataLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) pszGlobalData, -1, NULL, 0, NULL, NULL); @@ -258,7 +394,6 @@ winClipboardFlushXEvents(HWND hwnd, } else { pszConvertData = strdup(pszGlobalData); - iConvertDataLen = strlen(pszConvertData) + 1; } /* Convert DOS string to UNIX string */ @@ -273,7 +408,7 @@ winClipboardFlushXEvents(HWND hwnd, xtpText.nitems = 0; /* Create the text property from the text list */ - if (fUseUnicode) { + if (data->fUseUnicode) { #ifdef X_HAVE_UTF8_STRING iReturn = Xutf8TextListToTextProperty(pDisplay, pszTextList, @@ -403,7 +538,6 @@ winClipboardFlushXEvents(HWND hwnd, */ case SelectionNotify: - winDebug("winClipboardFlushXEvents - SelectionNotify\n"); { char *pszAtomName; @@ -418,75 +552,31 @@ winClipboardFlushXEvents(HWND hwnd, } /* - * Request conversion of UTF8 and CompoundText targets. - */ + SelectionNotify with property of None indicates either: + + (i) Generated by the X server if no owner for the specified selection exists + (perhaps it's disappeared on us mid-transaction), or + (ii) Sent by the selection owner when the requested selection conversion could + not be performed or server errors prevented the conversion data being returned + */ if (event.xselection.property == None) { - if (event.xselection.target == XA_STRING) { - winDebug("winClipboardFlushXEvents - SelectionNotify - " - "XA_STRING\n"); - - return WIN_XEVENTS_CONVERT; - } - else if (event.xselection.target == atomUTF8String) { - winDebug("winClipboardFlushXEvents - SelectionNotify - " - "Requesting conversion of UTF8 target.\n"); - - XConvertSelection(pDisplay, - event.xselection.selection, - XA_STRING, - atomLocalProperty, iWindow, CurrentTime); - - /* Process the ConvertSelection event */ - XFlush(pDisplay); - return WIN_XEVENTS_CONVERT; - } -#ifdef X_HAVE_UTF8_STRING - else if (event.xselection.target == atomCompoundText) { - winDebug("winClipboardFlushXEvents - SelectionNotify - " - "Requesting conversion of CompoundText target.\n"); - - XConvertSelection(pDisplay, - event.xselection.selection, - atomUTF8String, - atomLocalProperty, iWindow, CurrentTime); - - /* Process the ConvertSelection event */ - XFlush(pDisplay); - return WIN_XEVENTS_CONVERT; - } -#endif - else { ErrorF("winClipboardFlushXEvents - SelectionNotify - " - "Unknown format. Cannot request conversion, " - "aborting.\n"); - break; + "Conversion to format %d refused.\n", + event.xselection.target); + return WIN_XEVENTS_FAILED; } + + if (event.xselection.target == atomTargets) { + return winClipboardSelectionNotifyTargets(hwnd, iWindow, pDisplay, data, atoms); } - /* Retrieve the size of the stored data */ - iReturn = XGetWindowProperty(pDisplay, iWindow, atomLocalProperty, 0, 0, /* Don't get data, just size */ - False, - AnyPropertyType, - &xtpText.encoding, - &xtpText.format, - &xtpText.nitems, - &ulReturnBytesLeft, &xtpText.value); - if (iReturn != Success) { - ErrorF("winClipboardFlushXEvents - SelectionNotify - " - "XGetWindowProperty () failed, aborting: %d\n", iReturn); - break; - } - - winDebug("SelectionNotify - returned data %d left %d\n", - xtpText.nitems, ulReturnBytesLeft); - - /* Request the selection data */ + /* Retrieve the selection data and delete the property */ iReturn = XGetWindowProperty(pDisplay, iWindow, atomLocalProperty, 0, - ulReturnBytesLeft, - False, + INT_MAX, + True, AnyPropertyType, &xtpText.encoding, &xtpText.format, @@ -495,7 +585,7 @@ winClipboardFlushXEvents(HWND hwnd, if (iReturn != Success) { ErrorF("winClipboardFlushXEvents - SelectionNotify - " "XGetWindowProperty () failed, aborting: %d\n", iReturn); - break; + goto winClipboardFlushXEvents_SelectionNotify_Done; } { @@ -509,7 +599,7 @@ winClipboardFlushXEvents(HWND hwnd, pszAtomName = NULL; } - if (fUseUnicode) { + if (data->fUseUnicode) { #ifdef X_HAVE_UTF8_STRING /* Convert the text property to a text list */ iReturn = Xutf8TextPropertyToTextList(pDisplay, @@ -525,7 +615,8 @@ winClipboardFlushXEvents(HWND hwnd, if (iReturn == Success || iReturn > 0) { /* Conversion succeeded or some unconvertible characters */ if (ppszTextList != NULL) { - iReturnDataLen = 0; + int i; + int iReturnDataLen = 0; for (i = 0; i < iCount; i++) { iReturnDataLen += strlen(ppszTextList[i]); } @@ -574,14 +665,14 @@ winClipboardFlushXEvents(HWND hwnd, /* Convert the X clipboard string to DOS format */ winClipboardUNIXtoDOS(&pszReturnData, strlen(pszReturnData)); - if (fUseUnicode) { + if (data->fUseUnicode) { /* Find out how much space needed to convert MBCS to Unicode */ - iUnicodeLen = MultiByteToWideChar(CP_UTF8, + int iUnicodeLen = MultiByteToWideChar(CP_UTF8, 0, pszReturnData, -1, NULL, 0); - /* Allocate memory for the Unicode string */ - pwszUnicodeStr = malloc(sizeof(wchar_t) * (iUnicodeLen + 1)); + /* NOTE: iUnicodeLen includes space for null terminator */ + pwszUnicodeStr = malloc(sizeof(wchar_t) * iUnicodeLen); if (!pwszUnicodeStr) { ErrorF("winClipboardFlushXEvents - SelectionNotify " "malloc failed for pwszUnicodeStr, aborting.\n"); @@ -599,9 +690,10 @@ winClipboardFlushXEvents(HWND hwnd, /* Allocate global memory for the X clipboard data */ hGlobal = GlobalAlloc(GMEM_MOVEABLE, - sizeof(wchar_t) * (iUnicodeLen + 1)); + sizeof(wchar_t) * iUnicodeLen); } else { + int iConvertDataLen = 0; pszConvertData = strdup(pszReturnData); iConvertDataLen = strlen(pszConvertData) + 1; @@ -633,9 +725,8 @@ winClipboardFlushXEvents(HWND hwnd, } /* Copy the returned string into the global memory */ - if (fUseUnicode) { - memcpy(pszGlobalData, - pwszUnicodeStr, sizeof(wchar_t) * (iUnicodeLen + 1)); + if (data->fUseUnicode) { + wcscpy((wchar_t *)pszGlobalData, pwszUnicodeStr); free(pwszUnicodeStr); pwszUnicodeStr = NULL; } @@ -650,7 +741,7 @@ winClipboardFlushXEvents(HWND hwnd, pszGlobalData = NULL; /* Push the selection data to the Windows clipboard */ - if (fUseUnicode) + if (data->fUseUnicode) SetClipboardData(CF_UNICODETEXT, hGlobal); else SetClipboardData(CF_TEXT, hGlobal); @@ -680,7 +771,7 @@ winClipboardFlushXEvents(HWND hwnd, SetClipboardData(CF_UNICODETEXT, NULL); SetClipboardData(CF_TEXT, NULL); } - return WIN_XEVENTS_NOTIFY; + return WIN_XEVENTS_NOTIFY_DATA; case SelectionClear: winDebug("SelectionClear - doing nothing\n"); @@ -693,8 +784,78 @@ winClipboardFlushXEvents(HWND hwnd, break; default: - ErrorF("winClipboardFlushXEvents - unexpected event type %d\n", - event.type); + if (event.type == XFixesSetSelectionOwnerNotify + xfixes_event_base) { + XFixesSelectionNotifyEvent *e = + (XFixesSelectionNotifyEvent *) & event; + + winDebug("winClipboardFlushXEvents - XFixesSetSelectionOwnerNotify\n"); + + /* Save selection owners for monitored selections, ignore other selections */ + if ((e->selection == XA_PRIMARY) && fPrimarySelection) { + MonitorSelection(e, CLIP_OWN_PRIMARY); + } + else if (e->selection == atomClipboard) { + MonitorSelection(e, CLIP_OWN_CLIPBOARD); + } + else + break; + + /* Selection is being disowned */ + if (e->owner == None) { + winDebug + ("winClipboardFlushXEvents - No window, returning.\n"); + break; + } + + /* + XXX: there are all kinds of wacky edge cases we might need here: + - we own windows clipboard, but neither PRIMARY nor CLIPBOARD have an owner, so we should disown it? + - root window is taking ownership? + */ + + /* If we are the owner of the most recently owned selection, don't go all recursive :) */ + if ((lastOwnedSelectionIndex != CLIP_OWN_NONE) && + (s_iOwners[lastOwnedSelectionIndex] == iWindow)) { + winDebug("winClipboardFlushXEvents - Ownership changed to us, aborting.\n"); + break; + } + + /* Close clipboard if we have it open already (possible? correct??) */ + if (GetOpenClipboardWindow() == hwnd) { + CloseClipboard(); + } + + /* Access the Windows clipboard */ + if (!OpenClipboard(hwnd)) { + ErrorF("winClipboardFlushXEvents - OpenClipboard () failed: %08x\n", + (int) GetLastError()); + break; + } + + /* Take ownership of the Windows clipboard */ + if (!EmptyClipboard()) { + ErrorF("winClipboardFlushXEvents - EmptyClipboard () failed: %08x\n", + (int) GetLastError()); + break; + } + + /* Advertise regular text and unicode */ + SetClipboardData(CF_UNICODETEXT, NULL); + SetClipboardData(CF_TEXT, NULL); + + /* Release the clipboard */ + if (!CloseClipboard()) { + ErrorF("winClipboardFlushXEvents - CloseClipboard () failed: %08x\n", + (int) GetLastError()); + break; + } + } + /* XFixesSelectionWindowDestroyNotifyMask */ + /* XFixesSelectionClientCloseNotifyMask */ + else { + ErrorF("winClipboardFlushXEvents - unexpected event type %d\n", + event.type); + } break; } } diff --git a/xserver/hw/xwin/winclipboard/xwinclip.c b/xserver/hw/xwin/winclipboard/xwinclip.c new file mode 100644 index 000000000..856c4dd54 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/xwinclip.c @@ -0,0 +1,134 @@ +/* + *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. + *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. + *Copyright (C) Colin Harrison 2005-2008 + * + *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 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. + * + *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). + * + * Authors: Harold L Hunt II + * Colin Harrison + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +/* + * Including any server header might define the macro _XSERVER64 on 64 bit machines. + * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + +#include +#include +#include + +/* X headers */ +#include +#ifdef X_LOCALE +#include +#else /* X_LOCALE */ +#include +#endif /* X_LOCALE */ + +#include "winclipboard.h" + +/* + * Main function + */ + +int +main (int argc, char *argv[]) +{ + int i; + char *pszDisplay = NULL; + int fUnicodeClipboard = 1; + + /* Parse command-line parameters */ + for (i = 1; i < argc; ++i) + { + /* Look for -display "display_name" or --display "display_name" */ + if (i < argc - 1 + && (!strcmp (argv[i], "-display") + || !strcmp (argv[i], "--display"))) + { + /* Grab a pointer to the display parameter */ + pszDisplay = argv[i + 1]; + + /* Skip the display argument */ + i++; + continue; + } + + /* Look for -nounicodeclipboard */ + if (!strcmp (argv[i], "-nounicodeclipboard")) + { + fUnicodeClipboard = 0; + continue; + } + + /* Look for -noprimary */ + if (!strcmp (argv[i], "-noprimary")) + { + fPrimarySelection = False; + continue; + } + + /* Yack when we find a parameter that we don't know about */ + printf ("Unknown parameter: %s\nExiting.\n", argv[i]); + exit (1); + } + + /* Do we have Unicode support? */ + if (fUnicodeClipboard) + { + printf ("Unicode clipboard I/O\n"); + } + else + { + printf ("Non Unicode clipboard I/O\n"); + } + + /* Apply locale specified in the LANG environment variable */ + if (!setlocale (LC_ALL, "")) + { + printf ("setlocale() error\n"); + exit (1); + } + + /* See if X supports the current locale */ + if (XSupportsLocale () == False) + { + printf ("Locale not supported by X, falling back to 'C' locale.\n"); + setlocale(LC_ALL, "C"); + } + + winClipboardProc(fUnicodeClipboard, pszDisplay); + + return 0; +} diff --git a/xserver/hw/xwin/winclipboard/xwinclip.man b/xserver/hw/xwin/winclipboard/xwinclip.man new file mode 100644 index 000000000..a53dc3029 --- /dev/null +++ b/xserver/hw/xwin/winclipboard/xwinclip.man @@ -0,0 +1,64 @@ +.TH xwinclip 1 __xorgversion__ +.SH NAME +xwinclip - An X11 and Windows clipboard integration tool + +.SH SYNOPSIS +.B xwinclip [OPTION]... + +.SH DESCRIPTION +\fIxwinclip\fP is a tool for copying and pasting text between the Windows and X11 clipboard systems. + +\fIxwinclip\fP watches for updates to either clipboard and copies data between them when either one is updated. + +\fIxwinclip\fP monitors the X PRIMARY and CLIBPOARD selections for changes in ownership, and makes +the contents of the most recent one to change available to paste from the Windows clipboard. + +It also monitors the contents of the Windows clipboard for changes, taking ownership of the PRIMARY and +CLIPBOARD selections, and making the contents of the Windows clipboard available in them. + +.B Note well: +The \fIXWin(1)\fP X server has internal clipboard integration that is enabled by default. +Do \fINOT\fP run \fIxwinclip\fP unless \fIXWin(1)\fP has been started with the -noclipboard option. + +.SH OPTIONS +\fIxwinclip\fP accepts the following optional command line switches: + +.TP 8 +.B \-display [display] +Specifies the X server display to connect to. +.TP 8 +.B \-nounicodeclipboard +Do not use unicode text on the clipboard. +.TP 8 +.B \-noprimary +Do not monitor the PRIMARY selection. + +.SH "SEE ALSO" +XWin(1) + +.SH BUGS +Only text clipboard contents are supported. + +The INCR (Incrememntal transfer) clipboard protocol for clipboard contents larger than the maximum size of an +X request is not supported. + +Some X clients, notably ones written in Tcl/Tk, do not re-assert ownership of the PRIMARY selection or update +it's timestamp when it's contents change, which currently prevents \fIxwinclip\fP from correctly noticing that +the PRIMARY selection's contents have changed. + +Windows clipboard rendering is synchronous in the WM_RENDER*FORMAT message (that is, we must have placed the +contents onto the clipboard by the time we return from processing this message), but we must wait for the X +client which owns the selection to convert the selection to our requested format. This is currently achieved +using a fixed timeout of one second. + +The XWin(1) server should indicate somehow (by placing an atom on the root window?) that it is running with it's +internal clipboard integration enabled, and xwinclip should notice this and exit with an appropriate error. + +Probably many other bugs. + +.SH "CONFORMING TO" +ICCCM (Inter-Client Communication Conventions Manual) 2.0 + +.SH AUTHORS +Contributors to xwinclip include Benjamin Riefenstahl, Roland Cassard, Brian Genisio, Colin Harrison, +Harold L Hunt II, Matsuzaki Kensuke, Jon Turney, Chris Twiner and Jeremy Wilkins. diff --git a/xserver/hw/xwin/winclipboardinit.c b/xserver/hw/xwin/winclipboardinit.c index 157006dab..8aef8fe02 100644 --- a/xserver/hw/xwin/winclipboardinit.c +++ b/xserver/hw/xwin/winclipboardinit.c @@ -31,25 +31,79 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif -#include "dixstruct.h" -#include "winclipboard.h" + +#include +#include + +#include "win.h" +#include "winclipboard/winclipboard.h" +#include "windisplay.h" + +#define WIN_CLIPBOARD_RETRIES 40 +#define WIN_CLIPBOARD_DELAY 1 /* - * Local typedefs + * Local variables */ -typedef int (*winDispatchProcPtr) (ClientPtr); - -int winProcSetSelectionOwner(ClientPtr /* client */ ); +static pthread_t g_ptClipboardProc; /* - * References to external symbols + * */ +static void * +winClipboardThreadProc(void *arg) +{ + char szDisplay[512]; + int clipboardRestarts = 0; -extern pthread_t g_ptClipboardProc; -extern winDispatchProcPtr winProcSetSelectionOwnerOrig; -extern Bool g_fClipboard; -extern HWND g_hwndClipboard; + while (1) + { + Bool fShutdown; + + ++clipboardRestarts; + + /* Use our generated cookie for authentication */ + winSetAuthorization(); + + /* Setup the display connection string */ + /* + * NOTE: Always connect to screen 0 since we require that screen + * numbers start at 0 and increase without gaps. We only need + * to connect to one screen on the display to get events + * for all screens on the display. That is why there is only + * one clipboard client thread. + */ + winGetDisplayName(szDisplay, 0); + + /* Print the display connection string */ + ErrorF("winClipboardThreadProc - DISPLAY=%s\n", szDisplay); + + /* Flag that clipboard client has been launched */ + g_fClipboardStarted = TRUE; + + fShutdown = winClipboardProc(g_fUnicodeClipboard, szDisplay); + + /* Flag that clipboard client has stopped */ + g_fClipboardStarted = FALSE; + + if (fShutdown) + break; + + /* checking if we need to restart */ + if (clipboardRestarts >= WIN_CLIPBOARD_RETRIES) { + /* terminates clipboard thread but the main server still lives */ + ErrorF("winClipboardProc - the clipboard thread has restarted %d times and seems to be unstable, disabling clipboard integration\n", clipboardRestarts); + g_fClipboard = FALSE; + break; + } + + sleep(WIN_CLIPBOARD_DELAY); + ErrorF("winClipboardProc - trying to restart clipboard thread \n"); + } + + return NULL; +} /* * Intialize the Clipboard module @@ -60,14 +114,8 @@ winInitClipboard(void) { winDebug("winInitClipboard ()\n"); - /* Wrap some internal server functions */ - if (ProcVector[X_SetSelectionOwner] != winProcSetSelectionOwner) { - winProcSetSelectionOwnerOrig = ProcVector[X_SetSelectionOwner]; - ProcVector[X_SetSelectionOwner] = winProcSetSelectionOwner; - } - /* Spawn a thread for the Clipboard module */ - if (pthread_create(&g_ptClipboardProc, NULL, winClipboardProc, NULL)) { + if (pthread_create(&g_ptClipboardProc, NULL, winClipboardThreadProc, NULL)) { /* Bail if thread creation failed */ ErrorF("winInitClipboard - pthread_create failed.\n"); return FALSE; @@ -76,59 +124,19 @@ winInitClipboard(void) return TRUE; } -/* - * Create the Windows window that we use to receive Windows messages - */ - -HWND -winClipboardCreateMessagingWindow(void) -{ - WNDCLASSEX wc; - HWND hwnd; - - /* Setup our window class */ - wc.cbSize = sizeof(WNDCLASSEX); - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = winClipboardWindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = GetModuleHandle(NULL); - wc.hIcon = 0; - wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS; - wc.hIconSm = 0; - RegisterClassEx(&wc); - - /* Create the window */ - hwnd = CreateWindowExA(0, /* Extended styles */ - WIN_CLIPBOARD_WINDOW_CLASS, /* Class name */ - WIN_CLIPBOARD_WINDOW_TITLE, /* Window name */ - WS_OVERLAPPED, /* Not visible anyway */ - CW_USEDEFAULT, /* Horizontal position */ - CW_USEDEFAULT, /* Vertical position */ - CW_USEDEFAULT, /* Right edge */ - CW_USEDEFAULT, /* Bottom edge */ - (HWND) NULL, /* No parent or owner window */ - (HMENU) NULL, /* No menu */ - GetModuleHandle(NULL), /* Instance handle */ - NULL); /* Creation data */ - assert(hwnd != NULL); - - /* I'm not sure, but we may need to call this to start message processing */ - ShowWindow(hwnd, SW_HIDE); - - /* Similarly, we may need a call to this even though we don't paint */ - UpdateWindow(hwnd); - - return hwnd; -} - void -winFixClipboardChain(void) +winClipboardShutdown(void) { - if (g_fClipboard && g_hwndClipboard) { - PostMessage(g_hwndClipboard, WM_WM_REINIT, 0, 0); - } + /* Close down clipboard resources */ + if (g_fClipboard && g_fClipboardStarted) { + /* Synchronously destroy the clipboard window */ + winClipboardWindowDestroy(); + + /* Wait for the clipboard thread to exit */ + pthread_join(g_ptClipboardProc, NULL); + + g_fClipboardStarted = FALSE; + + winDebug("winClipboardShutdown - Clipboard thread has exited.\n"); + } } diff --git a/xserver/hw/xwin/winclipboardwrappers.c b/xserver/hw/xwin/winclipboardwrappers.c index bfd6bff8b..2e6b63287 100644 --- a/xserver/hw/xwin/winclipboardwrappers.c +++ b/xserver/hw/xwin/winclipboardwrappers.c @@ -33,36 +33,15 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + #include "win.h" #include "dixstruct.h" -#include - -/* - * Constants - */ - -#define CLIP_NUM_SELECTIONS 2 -#define CLIP_OWN_PRIMARY 0 -#define CLIP_OWN_CLIPBOARD 1 /* * Local function prototypes */ DISPATCH_PROC(winProcEstablishConnection); -DISPATCH_PROC(winProcSetSelectionOwner); - -/* - * References to external symbols - */ - -extern Bool g_fClipboardLaunched; -extern Bool g_fClipboardStarted; -extern Bool g_fClipboard; -extern Window g_iClipboardWindow; -extern Atom g_atomLastOwnedSelection; -extern HWND g_hwndClipboard; - /* * Wrapper for internal EstablishConnection function. @@ -127,13 +106,6 @@ winProcEstablishConnection(ClientPtr client) /* Clear original function pointer */ winProcEstablishConnectionOrig = NULL; - /* If the clipboard client has already been started, abort */ - if (g_fClipboardLaunched) { - ErrorF("winProcEstablishConnection - Clipboard client already " - "launched, returning.\n"); - return iReturn; - } - /* Startup the clipboard client if clipboard mode is being used */ if (g_fClipboard) { /* @@ -163,207 +135,5 @@ winProcEstablishConnection(ClientPtr client) ErrorF("winProcEstablishConnection - winInitClipboard returned.\n"); } - /* Flag that clipboard client has been launched */ - g_fClipboardLaunched = TRUE; - return iReturn; } - -/* - * Wrapper for internal SetSelectionOwner function. - * Grabs ownership of Windows clipboard when X11 clipboard owner changes. - */ - -int -winProcSetSelectionOwner(ClientPtr client) -{ - int i; - DrawablePtr pDrawable; - WindowPtr pWindow = None; - Bool fOwnedToNotOwned = FALSE; - static Window s_iOwners[CLIP_NUM_SELECTIONS] = { None }; - static unsigned long s_ulServerGeneration = 0; - - REQUEST(xSetSelectionOwnerReq); - - REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - - winDebug("winProcSetSelectionOwner - Hello.\n"); - - /* Watch for server reset */ - if (s_ulServerGeneration != serverGeneration) { - /* Save new generation number */ - s_ulServerGeneration = serverGeneration; - - /* Initialize static variables */ - for (i = 0; i < CLIP_NUM_SELECTIONS; ++i) - s_iOwners[i] = None; - } - - /* Abort if clipboard not completely initialized yet */ - if (!g_fClipboardStarted) { - /* ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, " - "aborting.\n"); */ - goto winProcSetSelectionOwner_Done; - } - - /* Grab window if we have one */ - if (None != stuff->window) { - /* Grab the Window from the request */ - int rc = - dixLookupWindow(&pWindow, stuff->window, client, DixReadAccess); - if (rc != Success) { - ErrorF("winProcSetSelectionOwner - Found BadWindow, aborting.\n"); - goto winProcSetSelectionOwner_Done; - } - } - - /* Now we either have a valid window or None */ - - /* Save selection owners for monitored selections, ignore other selections */ - if (XA_PRIMARY == stuff->selection) { - /* Look for owned -> not owned transition */ - if (None == stuff->window && None != s_iOwners[CLIP_OWN_PRIMARY]) { - fOwnedToNotOwned = TRUE; - - winDebug("winProcSetSelectionOwner - PRIMARY - Going from " - "owned to not owned.\n"); - - /* Adjust last owned selection */ - if (None != s_iOwners[CLIP_OWN_CLIPBOARD]) - g_atomLastOwnedSelection = MakeAtom("CLIPBOARD", 9, TRUE); - else - g_atomLastOwnedSelection = None; - } - - /* Save new selection owner or None */ - s_iOwners[CLIP_OWN_PRIMARY] = stuff->window; - - winDebug("winProcSetSelectionOwner - PRIMARY - Now owned by: %d\n", - stuff->window); - } - else if (MakeAtom("CLIPBOARD", 9, TRUE) == stuff->selection) { - /* Look for owned -> not owned transition */ - if (None == stuff->window && None != s_iOwners[CLIP_OWN_CLIPBOARD]) { - fOwnedToNotOwned = TRUE; - - winDebug("winProcSetSelectionOwner - CLIPBOARD - Going from " - "owned to not owned.\n"); - - /* Adjust last owned selection */ - if (None != s_iOwners[CLIP_OWN_PRIMARY]) - g_atomLastOwnedSelection = XA_PRIMARY; - else - g_atomLastOwnedSelection = None; - } - - /* Save new selection owner or None */ - s_iOwners[CLIP_OWN_CLIPBOARD] = stuff->window; - - winDebug("winProcSetSelectionOwner - CLIPBOARD - Now owned by: %d\n", - stuff->window); - - } - else - goto winProcSetSelectionOwner_Done; - - /* - * At this point, if one of the selections is still owned by the - * clipboard manager then it should be marked as unowned since - * we will be taking ownership of the Win32 clipboard. - */ - if (g_iClipboardWindow == s_iOwners[CLIP_OWN_PRIMARY]) - s_iOwners[CLIP_OWN_PRIMARY] = None; - if (g_iClipboardWindow == s_iOwners[CLIP_OWN_CLIPBOARD]) - s_iOwners[CLIP_OWN_CLIPBOARD] = None; - - /* - * Handle case when selection is being disowned, - * WM_DRAWCLIPBOARD did not do the disowning, - * both monitored selections are no longer owned, - * an owned to not owned transition was detected, - * and we currently own the Win32 clipboard. - */ - if (stuff->window == None - && s_iOwners[CLIP_OWN_PRIMARY] == None - && s_iOwners[CLIP_OWN_CLIPBOARD] == None - && fOwnedToNotOwned - && g_hwndClipboard != NULL && g_hwndClipboard == GetClipboardOwner()) { - winDebug("winProcSetSelectionOwner - We currently own the " - "clipboard and neither the PRIMARY nor the CLIPBOARD " - "selections are owned, releasing ownership of Win32 " - "clipboard.\n"); - - /* Release ownership of the Windows clipboard */ - OpenClipboard(NULL); - EmptyClipboard(); - CloseClipboard(); - - goto winProcSetSelectionOwner_Done; - } - - /* Abort if no window at this point */ - if (None == stuff->window) { - winDebug("winProcSetSelectionOwner - No window, returning.\n"); - goto winProcSetSelectionOwner_Done; - } - - /* Abort if invalid selection */ - if (!ValidAtom(stuff->selection)) { - ErrorF("winProcSetSelectionOwner - Found BadAtom, aborting.\n"); - goto winProcSetSelectionOwner_Done; - } - - /* Cast Window to Drawable */ - pDrawable = (DrawablePtr) pWindow; - - /* Abort if clipboard manager is owning the selection */ - if (pDrawable->id == g_iClipboardWindow) { - winDebug("winProcSetSelectionOwner - We changed ownership, " - "aborting.\n"); - goto winProcSetSelectionOwner_Done; - } - - /* Abort if root window is taking ownership */ - if (pDrawable->id == 0) { - ErrorF("winProcSetSelectionOwner - Root window taking ownership, " - "aborting\n"); - goto winProcSetSelectionOwner_Done; - } - - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow() == g_hwndClipboard) { - CloseClipboard(); - } - - /* Access the Windows clipboard */ - if (!OpenClipboard(g_hwndClipboard)) { - ErrorF("winProcSetSelectionOwner - OpenClipboard () failed: %08x\n", - (int) GetLastError()); - goto winProcSetSelectionOwner_Done; - } - - /* Take ownership of the Windows clipboard */ - if (!EmptyClipboard()) { - ErrorF("winProcSetSelectionOwner - EmptyClipboard () failed: %08x\n", - (int) GetLastError()); - goto winProcSetSelectionOwner_Done; - } - - /* Advertise regular text and unicode */ - SetClipboardData(CF_UNICODETEXT, NULL); - SetClipboardData(CF_TEXT, NULL); - - /* Save handle to last owned selection */ - g_atomLastOwnedSelection = stuff->selection; - - /* Release the clipboard */ - if (!CloseClipboard()) { - ErrorF("winProcSetSelectionOwner - CloseClipboard () failed: " - "%08x\n", (int) GetLastError()); - goto winProcSetSelectionOwner_Done; - } - - winProcSetSelectionOwner_Done: - return (*winProcSetSelectionOwnerOrig) (client); -} diff --git a/xserver/hw/xwin/wincmap.c b/xserver/hw/xwin/wincmap.c index 5dcc8bceb..1bdc7df70 100644 --- a/xserver/hw/xwin/wincmap.c +++ b/xserver/hw/xwin/wincmap.c @@ -270,7 +270,7 @@ winCreateColormap(ColormapPtr pmap) * FIXME: This is some evil hackery to help in handling some X clients * that expect the top pixel to be white. This "help" only lasts until * some client overwrites the top colormap entry. - * + * * We don't want to actually allocate the top entry, as that causes * problems with X clients that need 7 planes (128 colors) in the default * colormap, such as Magic 7.1. diff --git a/xserver/hw/xwin/winconfig.c b/xserver/hw/xwin/winconfig.c index a6d3c0a1f..321dfeed2 100644 --- a/xserver/hw/xwin/winconfig.c +++ b/xserver/hw/xwin/winconfig.c @@ -239,7 +239,7 @@ winConfigKeyboard(DeviceIntPtr pDevice) XkbGetRulesDflts(&g_winInfo.xkb); /* - * Query the windows autorepeat settings and change the xserver defaults. + * Query the windows autorepeat settings and change the xserver defaults. */ { int kbd_delay; @@ -277,7 +277,7 @@ winConfigKeyboard(DeviceIntPtr pDevice) 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. + different layout numbers set. Map them to a single entry. Same might apply for chinese, korean and other symbol languages too */ layoutNum = (layoutNum & 0xffff); @@ -358,7 +358,7 @@ winConfigKeyboard(DeviceIntPtr pDevice) kbdfrom = X_CMDLINE; /* - * Until the layout code is finished, I search for the keyboard + * Until the layout code is finished, I search for the keyboard * device and configure the server with it. */ @@ -653,7 +653,7 @@ winSetPercentOption(void *optlist, const char *name, double deflt) /* * Compare two strings for equality. This is caseinsensitive and - * The characters '_', ' ' (space) and '\t' (tab) are treated as + * The characters '_', ' ' (space) and '\t' (tab) are treated as * not existing. */ @@ -696,7 +696,7 @@ winNameCompare(const char *s1, const char *s2) #ifdef XWIN_XF86CONFIG /* - * Find the named option in the list. + * Find the named option in the list. * @return the pointer to the option record, or NULL if not found. */ diff --git a/xserver/hw/xwin/winconfig.h b/xserver/hw/xwin/winconfig.h index 798c779a6..f079368c7 100644 --- a/xserver/hw/xwin/winconfig.h +++ b/xserver/hw/xwin/winconfig.h @@ -57,7 +57,6 @@ typedef struct { Bool active; Bool inUse; int videoRam; - int textClockFreq; void *options; int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; diff --git a/xserver/hw/xwin/wincreatewnd.c b/xserver/hw/xwin/wincreatewnd.c index 6732dcb58..6c5b21dfa 100644 --- a/xserver/hw/xwin/wincreatewnd.c +++ b/xserver/hw/xwin/wincreatewnd.c @@ -110,20 +110,8 @@ winCreateBoundingWindowFullScreen(ScreenPtr pScreen) GetModuleHandle(NULL), /* Instance handle */ pScreenPriv); /* ScreenPrivates */ - /* Branch on the server engine */ - switch (pScreenInfo->dwEngine) { -#ifdef XWIN_NATIVEGDI - case WIN_SERVER_SHADOW_GDI: - /* Show the window */ - ShowWindow(*phwnd, SW_SHOWMAXIMIZED); - break; -#endif - - default: - /* Hide the window */ - ShowWindow(*phwnd, SW_SHOWNORMAL); - break; - } + /* Hide the window */ + ShowWindow(*phwnd, SW_SHOWNORMAL); /* Send first paint message */ UpdateWindow(*phwnd); @@ -172,8 +160,8 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) && !pScreenInfo->fMultiWindow #endif ) { - /* Try to handle startup via run.exe. run.exe instructs Windows to - * hide all created windows. Detect this case and make sure the + /* Try to handle startup via run.exe. run.exe instructs Windows to + * hide all created windows. Detect this case and make sure the * window is shown nevertheless */ STARTUPINFO startupInfo; @@ -474,12 +462,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) } } -#ifdef XWIN_NATIVEGDI - /* Paint window background blue */ - if (pScreenInfo->dwEngine == WIN_SERVER_NATIVE_GDI) - winPaintBackground(*phwnd, RGB(0x00, 0x00, 0xFF)); -#endif - winDebug("winCreateBoundingWindowWindowed - Returning\n"); return TRUE; diff --git a/xserver/hw/xwin/wincursor.c b/xserver/hw/xwin/wincursor.c index f3ac0f7ae..bddd6b7ed 100644 --- a/xserver/hw/xwin/wincursor.c +++ b/xserver/hw/xwin/wincursor.c @@ -106,7 +106,7 @@ winPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) MapWindowPoints(pScreenPriv->hwndScreen, HWND_DESKTOP, (LPPOINT) &rcClient, 2); - /* + /* * Update the Windows cursor position so that we don't * immediately warp back to the current position. */ @@ -169,7 +169,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) pCursor->bits->width, pCursor->bits->height, pCursor->bits->xhot, pCursor->bits->yhot); - /* We can use only White and Black, so calc brightness of color + /* We can use only White and Black, so calc brightness of color * Also check if the cursor is inverted */ dForeY = BRIGHTNESS(pCursor->fore); dBackY = BRIGHTNESS(pCursor->back); @@ -184,8 +184,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) pCursor->bits->width, pCursor->bits->height); } - /* Get the number of bytes required to store the whole cursor image - * This is roughly (sm_cx * sm_cy) / 8 + /* Get the number of bytes required to store the whole cursor image + * This is roughly (sm_cx * sm_cy) / 8 * round up to 8 pixel boundary so we can convert whole bytes */ nBytes = bits_to_bytes(pScreenPriv->cursor.sm_cx) * pScreenPriv->cursor.sm_cy; @@ -199,7 +199,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) memset(pAnd, 0xFF, nBytes); pXor = calloc(1, nBytes); - /* Convert the X11 bitmap to a win32 bitmap + /* Convert the X11 bitmap to a win32 bitmap * The first is for an empty mask */ if (pCursor->bits->emptyMask) { int x, y, xmax = bits_to_bytes(nCX); diff --git a/xserver/hw/xwin/windialogs.c b/xserver/hw/xwin/windialogs.c index c9af0e203..6fe3fc442 100644 --- a/xserver/hw/xwin/windialogs.c +++ b/xserver/hw/xwin/windialogs.c @@ -36,13 +36,6 @@ #include #include "winprefs.h" -/* - * References to external globals - */ - -#ifdef XWIN_CLIPBOARD -extern Bool g_fClipboardStarted; -#endif /* * Local function prototypes */ @@ -396,8 +389,8 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv) } /* - * Display a notification to the user that the visual - * will not be displayed until the Windows display depth + * Display a notification to the user that the visual + * will not be displayed until the Windows display depth * is restored to the original value. */ g_hDlgDepthChange = CreateDialogParam(g_hInstance, @@ -418,7 +411,7 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv) /* * Process messages for the dialog that is displayed for - * disruptive screen depth changes. + * disruptive screen depth changes. */ static INT_PTR CALLBACK @@ -444,8 +437,8 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, s_pScreenInfo = s_pScreenPriv->pScreenInfo; #if CYGDEBUG - winDebug("winChangeDepthDlgProc - WM_INITDIALOG - s_pScreenPriv: %08x, " - "s_pScreenInfo: %08x\n", + winDebug("winChangeDepthDlgProc - WM_INITDIALOG - s_pScreenPriv: %p, " + "s_pScreenInfo: %p\n", s_pScreenPriv, s_pScreenInfo); #endif @@ -488,7 +481,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, case IDCANCEL: winDebug("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); - /* + /* * User dismissed the dialog, hide it until the * display mode is restored. */ diff --git a/xserver/hw/xwin/windisplay.c b/xserver/hw/xwin/windisplay.c new file mode 100644 index 000000000..17f0c7789 --- /dev/null +++ b/xserver/hw/xwin/windisplay.c @@ -0,0 +1,64 @@ +/* + * File: windisplay.c + * Purpose: Retrieve server display name + * + * Copyright (C) Jon TURNEY 2009 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include // for display +#include "windisplay.h" +#include "winmsg.h" + +#define XSERV_t +#define TRANS_SERVER +#include + +/* + Generate a display name string referring to the display of this server, + using a transport we know is enabled +*/ + +void +winGetDisplayName(char *szDisplay, unsigned int screen) +{ + if (_XSERVTransIsListening("local")) { + snprintf(szDisplay, 512, ":%s.%d", display, screen); + } + else if (_XSERVTransIsListening("inet")) { + snprintf(szDisplay, 512, "127.0.0.1:%s.%d", display, screen); + } + else if (_XSERVTransIsListening("inet6")) { + snprintf(szDisplay, 512, "::1:%s.%d", display, screen); + } + else { + // this can't happen! + ErrorF("winGetDisplay: Don't know what to use for DISPLAY\n"); + snprintf(szDisplay, 512, "localhost:%s.%d", display, screen); + } + + winDebug("winGetDisplay: DISPLAY=%s\n", szDisplay); +} diff --git a/xserver/hw/xwin/windisplay.h b/xserver/hw/xwin/windisplay.h new file mode 100644 index 000000000..d1d4549bf --- /dev/null +++ b/xserver/hw/xwin/windisplay.h @@ -0,0 +1,34 @@ +/* + * File: windisplay.h + * Purpose: Interface to retrieve server display name + * + * Copyright (C) Jon TURNEY 2009 + * + * 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 WINDISPLAY_H +#define WINDISPLAY_H + +void +winGetDisplayName(char *szDisplay, unsigned int screen); + +#endif /* !WINDISPLAY_H */ diff --git a/xserver/hw/xwin/winengine.c b/xserver/hw/xwin/winengine.c index 1f55ada58..b473b3ac0 100644 --- a/xserver/hw/xwin/winengine.c +++ b/xserver/hw/xwin/winengine.c @@ -59,10 +59,6 @@ winDetectSupportedEngines(void) /* Initialize the engine support flags */ g_dwEnginesSupported = WIN_SERVER_SHADOW_GDI; -#ifdef XWIN_NATIVEGDI - g_dwEnginesSupported |= WIN_SERVER_NATIVE_GDI; -#endif - /* Get operating system version information */ ZeroMemory(&osvi, sizeof(osvi)); osvi.dwOSVersionInfoSize = sizeof(osvi); @@ -94,15 +90,6 @@ winDetectSupportedEngines(void) winErrorFVerb(2, "winDetectSupportedEngines - DirectDraw installed, allowing ShadowDD\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD; - -#ifdef XWIN_PRIMARYFB - /* Allow PrimaryDD engine if NT */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { - g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD; - winErrorFVerb(2, - "winDetectSupportedEngines - Windows NT, allowing PrimaryDD\n"); - } -#endif } /* Try to query for DirectDraw4 interface */ @@ -206,16 +193,6 @@ winSetEngine(ScreenPtr pScreen) case WIN_SERVER_SHADOW_DDNL: winSetEngineFunctionsShadowDDNL(pScreen); break; -#ifdef XWIN_PRIMARYFB - case WIN_SERVER_PRIMARY_DD: - winSetEngineFunctionsPrimaryDD(pScreen); - break; -#endif -#ifdef XWIN_NATIVEGDI - case WIN_SERVER_NATIVE_GDI: - winSetEngineFunctionsNativeGDI(pScreen); - break; -#endif default: FatalError("winSetEngine - Invalid engine type\n"); } diff --git a/xserver/hw/xwin/winfillsp.c b/xserver/hw/xwin/winfillsp.c deleted file mode 100644 index bd0a15e8a..000000000 --- a/xserver/hw/xwin/winfillsp.c +++ /dev/null @@ -1,842 +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: Harold L Hunt II - * Alan Hourihane - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -extern void ROP16(HDC hdc, int rop); - -#define TRANSLATE_COLOR(color) \ -{ \ - if (pDrawable->depth == 15) \ - color = ((color & 0x1F) << 19) | ((color & 0x03E0) << 6) | \ - ((color & 0xF800) >> 8); \ - else if (pDrawable->depth == 16) \ - color = ((color & 0x1F) << 19) | ((color & 0x07E0) << 5) | \ - ((color & 0xF800) >> 8); \ - else if (pDrawable->depth == 24 || pDrawable->depth == 32) \ - color = ((color & 0xFF) << 16) | (color & 0xFF00) | \ - ((color & 0xFF0000) >> 16); \ -} - -/* See Porting Layer Definition - p. 54 */ -void -winFillSpansNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, - int iSpans, - DDXPointPtr pPoints, int *piWidths, int fSorted) -{ - winGCPriv(pGC); - HBITMAP hbmpOrig = NULL, hbmpOrigStipple = NULL; - HBITMAP hPenOrig = NULL; - HBITMAP hBitmap = NULL; - PixmapPtr pPixmap = NULL; - winPrivPixmapPtr pPixmapPriv = NULL; - PixmapPtr pStipple = NULL; - winPrivPixmapPtr pStipplePriv = NULL; - PixmapPtr pTile = NULL; - winPrivPixmapPtr pTilePriv = NULL; - HDC hdcStipple = NULL, hdcTile = NULL; - HPEN hPen = NULL; - int iX; - int fg, bg; - RegionPtr pClip = pGC->pCompositeClip; - BoxPtr pextent, pbox; - int nbox; - int extentX1, extentX2, extentY1, extentY2; - int fullX1, fullX2, fullY1; - HRGN hrgn = NULL, combined = NULL; - - nbox = RegionNumRects(pClip); - pbox = RegionRects(pClip); - - if (!nbox) - return; - - combined = CreateRectRgn(pbox->x1, pbox->y1, pbox->x2, pbox->y2); - nbox--; - pbox++; - - while (nbox--) { - hrgn = CreateRectRgn(pbox->x1, pbox->y1, pbox->x2, pbox->y2); - CombineRgn(combined, combined, hrgn, RGN_OR); - DeleteObject(hrgn); - hrgn = NULL; - pbox++; - } - - pextent = RegionExtents(pClip); - extentX1 = pextent->x1; - extentY1 = pextent->y1; - extentX2 = pextent->x2; - extentY2 = pextent->y2; - - /* Branch on the type of drawable we have */ - switch (pDrawable->type) { - case DRAWABLE_PIXMAP: - - SelectClipRgn(pGCPriv->hdcMem, combined); - DeleteObject(combined); - combined = NULL; - - /* Get a pixmap pointer from the drawable pointer, and fetch privates */ - pPixmap = (PixmapPtr) pDrawable; - pPixmapPriv = winGetPixmapPriv(pPixmap); - - /* Select the drawable pixmap into memory hdc */ - hbmpOrig = SelectObject(pGCPriv->hdcMem, pPixmapPriv->hBitmap); - if (hbmpOrig == NULL) - FatalError("winFillSpans - DRAWABLE_PIXMAP - " - "SelectObject () failed on\n\tpPixmapPriv->hBitmap: " - "%p\n", pPixmapPriv->hBitmap); - - /* Branch on the fill type */ - switch (pGC->fillStyle) { - case FillSolid: - - ROP16(pGCPriv->hdcMem, pGC->alu); - - if (pDrawable->depth == 1) { - if (pGC->fgPixel == 0) - hPenOrig = SelectObject(pGCPriv->hdcMem, - GetStockObject(BLACK_PEN)); - else - hPenOrig = SelectObject(pGCPriv->hdcMem, - GetStockObject(WHITE_PEN)); - } - else { - fg = pGC->fgPixel; - TRANSLATE_COLOR(fg); - hPen = CreatePen(PS_SOLID, 0, fg); - hPenOrig = SelectObject(pGCPriv->hdcMem, hPen); - } - - while (iSpans--) { - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - MoveToEx(pGCPriv->hdcMem, fullX1, fullY1, NULL); - LineTo(pGCPriv->hdcMem, fullX2, fullY1); - } - - SetROP2(pGCPriv->hdcMem, R2_COPYPEN); - - /* Give back the Pen */ - SelectObject(pGCPriv->hdcMem, hPenOrig); - - if (pDrawable->depth != 1) - DeleteObject(hPen); - break; - - case FillOpaqueStippled: - - pStipple = pGC->stipple; - pStipplePriv = winGetPixmapPriv(pStipple); - - /* Create a device-dependent bitmap for the stipple */ - hBitmap = CreateDIBitmap(pGCPriv->hdcMem, - (BITMAPINFOHEADER *) pStipplePriv->pbmih, - CBM_INIT, - pStipplePriv->pbBits, - (BITMAPINFO *) pStipplePriv->pbmih, - DIB_RGB_COLORS); - - /* Create a memory DC to hold the stipple */ - hdcStipple = CreateCompatibleDC(pGCPriv->hdcMem); - - /* Select the stipple bitmap into the stipple DC */ - hbmpOrigStipple = SelectObject(hdcStipple, hBitmap); - if (hbmpOrigStipple == NULL) - FatalError("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - " - "SelectObject () failed on hbmpOrigStipple\n"); - - /* Make a temporary copy of the foreground and background colors */ - bg = pGC->bgPixel; - fg = pGC->fgPixel; - - /* Translate the depth-dependent colors to Win32 COLORREFs */ - TRANSLATE_COLOR(fg); - TRANSLATE_COLOR(bg); - SetTextColor(pGCPriv->hdcMem, fg); - SetBkColor(pGCPriv->hdcMem, bg); - - while (iSpans--) { - int width = pStipple->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pStipple->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pStipple->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pStipple->drawable.width) - - pStipple->drawable.width)) % - pStipple->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pStipple->drawable.width) - width = pStipple->drawable.width - xoffset; - - BitBlt(pGCPriv->hdcMem, - iX, fullY1, - width, 1, - hdcStipple, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pStipple->drawable.height) - - pStipple->drawable.height)) % - pStipple->drawable.height, g_copyROP[pGC->alu]); - } - } - - /* Clear the stipple HDC */ - SelectObject(hdcStipple, hbmpOrigStipple); - DeleteDC(hdcStipple); - - /* Delete the device dependent stipple bitmap */ - DeleteObject(hBitmap); - - break; - case FillStippled: - - pStipple = pGC->stipple; - pStipplePriv = winGetPixmapPriv(pStipple); - - /* Create a device-dependent bitmap for the stipple */ - hBitmap = CreateDIBitmap(pGCPriv->hdcMem, - (BITMAPINFOHEADER *) pStipplePriv->pbmih, - CBM_INIT, - pStipplePriv->pbBits, - (BITMAPINFO *) pStipplePriv->pbmih, - DIB_RGB_COLORS); - - /* Create a memory DC to hold the stipple */ - hdcStipple = CreateCompatibleDC(pGCPriv->hdcMem); - - /* Select the stipple bitmap into the stipple DC */ - hbmpOrigStipple = SelectObject(hdcStipple, hBitmap); - if (hbmpOrigStipple == NULL) - FatalError("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - " - "SelectObject () failed on hbmpOrigStipple\n"); - - /* Make a temporary copy of the foreground and background colors */ - bg = pGC->bgPixel; - fg = pGC->fgPixel; - - /* Translate the depth-dependent colors to Win32 COLORREFs */ - TRANSLATE_COLOR(fg); - TRANSLATE_COLOR(bg); - - /* this is fudgy, we should only invert on the last one - * We need to get the black/white pixels right in the - * colormap. But yeah ! it's working.. - */ - if (pGC->bgPixel != -1 && pGC->fgPixel != -1) { - SetTextColor(pGCPriv->hdcMem, fg); - SetBkColor(pGCPriv->hdcMem, bg); - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); - } - else if (pGC->bgPixel == -1) { - SetTextColor(pGCPriv->hdcMem, fg); - SetBkMode(pGCPriv->hdcMem, TRANSPARENT); - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); - } - else if (pGC->fgPixel == -1) { - SetTextColor(pGCPriv->hdcMem, bg); - SetBkMode(pGCPriv->hdcMem, TRANSPARENT); -#if 0 - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); -#endif - } - - while (iSpans--) { - int width = pStipple->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pStipple->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pStipple->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pStipple->drawable.width) - - pStipple->drawable.width)) % - pStipple->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pStipple->drawable.width) - width = pStipple->drawable.width - xoffset; - - BitBlt(pGCPriv->hdcMem, - iX, fullY1, - width, 1, - hdcStipple, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pStipple->drawable.height) - - pStipple->drawable.height)) % - pStipple->drawable.height, g_copyROP[pGC->alu]); - } - } - - /* Clear the stipple HDC */ - SelectObject(hdcStipple, hbmpOrigStipple); - DeleteDC(hdcStipple); - - /* Delete the device dependent stipple bitmap */ - DeleteObject(hBitmap); - - /* Restore the background mode */ - SetBkMode(pGCPriv->hdcMem, OPAQUE); - break; - - case FillTiled: - - /* Get a pixmap pointer from the tile pointer, and fetch privates */ - pTile = (PixmapPtr) pGC->tile.pixmap; - pTilePriv = winGetPixmapPriv(pTile); - - /* Create a memory DC to hold the tile */ - hdcTile = CreateCompatibleDC(pGCPriv->hdcMem); - - /* Select the tile into a DC */ - hbmpOrig = SelectObject(hdcTile, pTilePriv->hBitmap); - if (hbmpOrig == NULL) - FatalError("winFillSpans - DRAWABLE_PIXMAP - FillTiled - " - "SelectObject () failed on pTilePriv->hBitmap\n"); - - while (iSpans--) { - int width = pTile->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pTile->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pTile->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pTile->drawable.width) - - pTile->drawable.width)) % pTile->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pTile->drawable.width) - width = pTile->drawable.width - xoffset; - - BitBlt(pGCPriv->hdcMem, - iX, fullY1, - width, 1, - hdcTile, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pTile->drawable.height) - - pTile->drawable.height)) % pTile->drawable.height, - g_copyROP[pGC->alu]); - } - } - - /* Push the tile pixmap out of the memory HDC */ - SelectObject(hdcTile, hbmpOrig); - - /* Delete the tile */ - DeleteDC(hdcTile); - break; - - default: - ErrorF("winFillSpans - DRAWABLE_PIXMAP - Unknown fillStyle\n"); - break; - } - - /* Reset clip region */ - SelectClipRgn(pGCPriv->hdcMem, NULL); - - /* Push the drawable pixmap out of the GC HDC */ - SelectObject(pGCPriv->hdcMem, hbmpOrig); - break; - - case DRAWABLE_WINDOW: - - SelectClipRgn(pGCPriv->hdc, combined); - DeleteObject(combined); - combined = NULL; - - /* Branch on fill style */ - switch (pGC->fillStyle) { - case FillSolid: - - ROP16(pGCPriv->hdc, pGC->alu); - - if (pDrawable->depth == 1) { - if (pGC->fgPixel == 0) - hPenOrig = SelectObject(pGCPriv->hdc, - GetStockObject(BLACK_PEN)); - else - hPenOrig = SelectObject(pGCPriv->hdc, - GetStockObject(WHITE_PEN)); - } - else { - fg = pGC->fgPixel; - TRANSLATE_COLOR(fg); - hPen = CreatePen(PS_SOLID, 0, fg); - hPenOrig = SelectObject(pGCPriv->hdc, hPen); - } - - while (iSpans--) { - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - MoveToEx(pGCPriv->hdc, fullX1, fullY1, NULL); - LineTo(pGCPriv->hdc, fullX2, fullY1); - } - - SetROP2(pGCPriv->hdc, R2_COPYPEN); - - /* Give back the Brush */ - SelectObject(pGCPriv->hdc, hPenOrig); - - if (pDrawable->depth != 1) - DeleteObject(hPen); - break; - - case FillOpaqueStippled: - - pStipple = pGC->stipple; - pStipplePriv = winGetPixmapPriv(pStipple); - - /* Create a device-dependent bitmap for the stipple */ - hBitmap = CreateDIBitmap(pGCPriv->hdc, - (BITMAPINFOHEADER *) pStipplePriv->pbmih, - CBM_INIT, - pStipplePriv->pbBits, - (BITMAPINFO *) pStipplePriv->pbmih, - DIB_RGB_COLORS); - - /* Create a memory DC to hold the stipple */ - hdcStipple = CreateCompatibleDC(pGCPriv->hdc); - - /* Select the stipple bitmap into the stipple DC */ - hbmpOrigStipple = SelectObject(hdcStipple, hBitmap); - if (hbmpOrigStipple == NULL) - FatalError("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - " - "SelectObject () failed on hbmpOrigStipple\n"); - - /* Make a temporary copy of the foreground and background colors */ - bg = pGC->bgPixel; - fg = pGC->fgPixel; - - /* Translate the depth-dependent colors to Win32 COLORREFs */ - TRANSLATE_COLOR(fg); - TRANSLATE_COLOR(bg); - SetTextColor(pGCPriv->hdc, fg); - SetBkColor(pGCPriv->hdc, bg); - - while (iSpans--) { - int width = pStipple->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pStipple->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pStipple->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pStipple->drawable.width) - - pStipple->drawable.width)) % - pStipple->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pStipple->drawable.width) - width = pStipple->drawable.width - xoffset; - - BitBlt(pGCPriv->hdc, - iX, fullY1, - width, 1, - hdcStipple, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pStipple->drawable.height) - - pStipple->drawable.height)) % - pStipple->drawable.height, g_copyROP[pGC->alu]); - } - } - - /* Clear the stipple HDC */ - SelectObject(hdcStipple, hbmpOrigStipple); - DeleteDC(hdcStipple); - - /* Delete the device dependent stipple bitmap */ - DeleteObject(hBitmap); - - break; - - case FillStippled: - pStipple = pGC->stipple; - pStipplePriv = winGetPixmapPriv(pStipple); - - /* Create a device-dependent bitmap for the stipple */ - hBitmap = CreateDIBitmap(pGCPriv->hdcMem, - (BITMAPINFOHEADER *) pStipplePriv->pbmih, - CBM_INIT, - pStipplePriv->pbBits, - (BITMAPINFO *) pStipplePriv->pbmih, - DIB_RGB_COLORS); - - /* Create a memory DC to hold the stipple */ - hdcStipple = CreateCompatibleDC(pGCPriv->hdc); - - /* Select the stipple bitmap into the stipple DC */ - hbmpOrigStipple = SelectObject(hdcStipple, hBitmap); - if (hbmpOrigStipple == NULL) - FatalError("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - " - "SelectObject () failed on hbmpOrigStipple\n"); - - /* Make a temporary copy of the foreground and background colors */ - bg = pGC->bgPixel; - fg = pGC->fgPixel; - - /* Translate the depth-dependent colors to Win32 COLORREFs */ - TRANSLATE_COLOR(fg); - TRANSLATE_COLOR(bg); - - /* this is fudgy, we should only invert on the last one - * We need to get the black/white pixels right in the - * colormap. But yeah ! it's working.. - */ - if (pGC->bgPixel != -1 && pGC->fgPixel != -1) { - SetTextColor(pGCPriv->hdc, fg); - SetBkColor(pGCPriv->hdc, bg); - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); - } - else if (pGC->bgPixel == -1) { - SetTextColor(pGCPriv->hdc, fg); - SetBkMode(pGCPriv->hdc, TRANSPARENT); - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); - } - else if (pGC->fgPixel == -1) { - SetTextColor(pGCPriv->hdc, bg); - SetBkMode(pGCPriv->hdc, TRANSPARENT); -#if 0 - BitBlt(hdcStipple, - 0, 0, - pStipple->drawable.width, pStipple->drawable.height, - hdcStipple, 0, 0, 0x330008); -#endif - } - - while (iSpans--) { - int width = pStipple->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pStipple->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pStipple->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pStipple->drawable.width) - - pStipple->drawable.width)) % - pStipple->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pStipple->drawable.width) - width = pStipple->drawable.width - xoffset; - - BitBlt(pGCPriv->hdc, - iX, fullY1, - width, 1, - hdcStipple, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pStipple->drawable.height) - - pStipple->drawable.height)) % - pStipple->drawable.height, g_copyROP[pGC->alu]); - } - } - - /* Clear the stipple HDC */ - SelectObject(hdcStipple, hbmpOrigStipple); - DeleteDC(hdcStipple); - - /* Delete the device dependent stipple bitmap */ - DeleteObject(hBitmap); - - /* Restore the background mode */ - SetBkMode(pGCPriv->hdc, OPAQUE); - break; - - case FillTiled: - - /* Get a pixmap pointer from the tile pointer, and fetch privates */ - pTile = (PixmapPtr) pGC->tile.pixmap; - pTilePriv = winGetPixmapPriv(pTile); - - /* Select the tile into a DC */ - hbmpOrig = SelectObject(pGCPriv->hdcMem, pTilePriv->hBitmap); - if (hbmpOrig == NULL) - FatalError("winFillSpans - DRAWABLE_WINDOW - FillTiled - " - "SelectObject () failed on pTilePriv->hBitmap\n"); - - while (iSpans--) { - int width = pTile->drawable.width; - - fullX1 = pPoints->x; - fullY1 = pPoints->y; - fullX2 = fullX1 + (int) *piWidths; - pPoints++; - piWidths++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - for (iX = fullX1; iX < fullX2; iX += width) { - int xoffset; - - if ((iX + pTile->drawable.width) > fullX2) - width = fullX2 - iX; - else - width = pTile->drawable.width; - - if (iX == fullX1) - xoffset = - (fullX1 - - (pDrawable->x + - (pGC->patOrg.x % pTile->drawable.width) - - pTile->drawable.width)) % pTile->drawable.width; - else - xoffset = 0; - - if (xoffset + width > pTile->drawable.width) - width = pTile->drawable.width - xoffset; - - BitBlt(pGCPriv->hdc, - iX, fullY1, - width, 1, - pGCPriv->hdcMem, - xoffset, - (fullY1 - - (pDrawable->y + - (pGC->patOrg.y % pTile->drawable.height) - - pTile->drawable.height)) % pTile->drawable.height, - g_copyROP[pGC->alu]); - } - } - - /* Push the tile pixmap out of the memory HDC */ - SelectObject(pGCPriv->hdcMem, hbmpOrig); - break; - - default: - ErrorF("winFillSpans - DRAWABLE_WINDOW - Unknown fillStyle\n"); - break; - } - - /* Reset clip region */ - SelectClipRgn(pGCPriv->hdc, NULL); - break; - - default: - ErrorF("winFillSpans - Unknown drawable type\n"); - break; - } -} diff --git a/xserver/hw/xwin/winfont.c b/xserver/hw/xwin/winfont.c deleted file mode 100644 index 7bcbce1c7..000000000 --- a/xserver/hw/xwin/winfont.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -#ifdef XWIN_NATIVEGDI -/* See Porting Layer Definition - p. 32 */ -/* See mfb/mfbfont.c - mfbRealizeFont() - which is empty :) */ -Bool -winRealizeFontNativeGDI(ScreenPtr pScreen, FontPtr pFont) -{ - BOOL fResult = TRUE; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winRealizeFont (%p, %p)\n", pScreen, pFont); -#endif - - WIN_UNWRAP(RealizeFont); - if (pScreen->RealizeFont) - fResult = (*pScreen->RealizeFont) (pScreen, pFont); - WIN_WRAP(RealizeFont, winRealizeFontNativeGDI); - - return fResult; -} - -/* See Porting Layer Definition - p. 32 */ -/* See mfb/mfbfont.c - mfbUnrealizeFont() - which is empty :) */ -Bool -winUnrealizeFontNativeGDI(ScreenPtr pScreen, FontPtr pFont) -{ - BOOL fResult = TRUE; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winUnrealizeFont (%p, %p)\n", pScreen, pFont); -#endif - - WIN_UNWRAP(UnrealizeFont); - if (pScreen->UnrealizeFont) - fResult = (*pScreen->UnrealizeFont) (pScreen, pFont); - WIN_WRAP(UnrealizeFont, winUnrealizeFontNativeGDI); - - return fResult; -#if CYGDEBUG - winDebug("winUnrealizeFont()\n"); -#endif - return TRUE; -} -#endif diff --git a/xserver/hw/xwin/wingc.c b/xserver/hw/xwin/wingc.c deleted file mode 100644 index 5986e0a47..000000000 --- a/xserver/hw/xwin/wingc.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* - * Local prototypes - */ - -#if 0 -static void - winChangeGCNativeGDI(GCPtr pGC, unsigned long ulChanges); -#endif - -static void - -winValidateGCNativeGDI(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); - -#if 0 -static void - winCopyGCNativeGDI(GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst); -#endif - -static void - winDestroyGCNativeGDI(GCPtr pGC); - -#if 0 -static void - winChangeClipNativeGDI(GCPtr pGC, int nType, void *pValue, int nRects); - -static void - winDestroyClipNativeGDI(GCPtr pGC); - -static void - winCopyClipNativeGDI(GCPtr pGCdst, GCPtr pGCsrc); -#endif - -#if 0 -/* GC Handling Routines */ -const GCFuncs winGCFuncs = { - winValidateGCNativeGDI, - winChangeGCNativeGDI, - winCopyGCNativeGDI, - winDestroyGCNativeGDI, - winChangeClipNativeGDI, - winDestroyClipNativeGDI, - winCopyClipNativeGDI, -}; -#else -const GCFuncs winGCFuncs = { - winValidateGCNativeGDI, - miChangeGC, - miCopyGC, - winDestroyGCNativeGDI, - miChangeClip, - miDestroyClip, - miCopyClip, -}; -#endif - -/* Drawing Primitives */ -const GCOps winGCOps = { - winFillSpansNativeGDI, - winSetSpansNativeGDI, - miPutImage, - miCopyArea, - miCopyPlane, - miPolyPoint, - winPolyLineNativeGDI, - miPolySegment, - miPolyRectangle, - miPolyArc, - miFillPolygon, - miPolyFillRect, - miPolyFillArc, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, -#if 0 - winImageGlyphBltNativeGDI, - winPolyGlyphBltNativeGDI, -#else - miImageGlyphBlt, - miPolyGlyphBlt, -#endif - miPushPixels, -}; - -/* See Porting Layer Definition - p. 45 */ -/* See mfb/mfbgc.c - mfbCreateGC() */ -/* See Strategies for Porting - pp. 15, 16 */ -Bool -winCreateGCNativeGDI(GCPtr pGC) -{ - winPrivGCPtr pGCPriv = NULL; - winPrivScreenPtr pScreenPriv = NULL; - -#if 0 - ErrorF("winCreateGCNativeGDI - depth: %d\n", pGC->depth); -#endif - - pGC->ops = (GCOps *) &winGCOps; - pGC->funcs = (GCFuncs *) &winGCFuncs; - - /* We want all coordinates passed to spans functions to be screen relative */ - pGC->miTranslate = TRUE; - - /* Allocate privates for this GC */ - pGCPriv = winGetGCPriv(pGC); - if (pGCPriv == NULL) { - ErrorF("winCreateGCNativeGDI () - Privates pointer was NULL\n"); - return FALSE; - } - - /* Create a new screen DC for the display window */ - pScreenPriv = winGetScreenPriv(pGC->pScreen); - pGCPriv->hdc = GetDC(pScreenPriv->hwndScreen); - - /* Allocate a memory DC for the GC */ - pGCPriv->hdcMem = CreateCompatibleDC(pGCPriv->hdc); - - return TRUE; -} - -#if 0 -/* See Porting Layer Definition - p. 45 */ -static void -winChangeGCNativeGDI(GCPtr pGC, unsigned long ulChanges) -{ -#if 0 - ErrorF("winChangeGCNativeGDI () - Doing nothing\n"); -#endif -} -#endif - -static void -winValidateGCNativeGDI(GCPtr pGC, - unsigned long ulChanges, DrawablePtr pDrawable) -{ - if ((ulChanges & - (GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode)) - || (pDrawable->serialNumber != - (pGC->serialNumber & DRAWABLE_SERIAL_BITS))) { - miComputeCompositeClip(pGC, pDrawable); - } -} - -#if 0 -/* See Porting Layer Definition - p. 46 */ -static void -winCopyGCNativeGDI(GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst) -{ - -} -#endif - -/* See Porting Layer Definition - p. 46 */ -static void -winDestroyGCNativeGDI(GCPtr pGC) -{ - winGCPriv(pGC); - winScreenPriv(pGC->pScreen); - - if (pGC->freeCompClip) - RegionDestroy(pGC->pCompositeClip); - - /* Free the memory DC */ - if (pGCPriv->hdcMem != NULL) { - DeleteDC(pGCPriv->hdcMem); - pGCPriv->hdcMem = NULL; - } - - /* Release the screen DC for the display window */ - if (pGCPriv->hdc != NULL) { - ReleaseDC(pScreenPriv->hwndScreen, pGCPriv->hdc); - pGCPriv->hdc = NULL; - } - - /* Invalidate the GC privates pointer */ - winSetGCPriv(pGC, NULL); -} - -#if 0 -/* See Porting Layer Definition - p. 46 */ -static void -winChangeClipNativeGDI(GCPtr pGC, int nType, void *pValue, int nRects) -{ - -} - -/* See Porting Layer Definition - p. 47 */ -static void -winDestroyClipNativeGDI(GCPtr pGC) -{ - -} - -/* See Porting Layer Definition - p. 47 */ -static void -winCopyClipNativeGDI(GCPtr pGCdst, GCPtr pGCsrc) -{ - -} -#endif diff --git a/xserver/hw/xwin/wingetsp.c b/xserver/hw/xwin/wingetsp.c deleted file mode 100644 index 049e2c939..000000000 --- a/xserver/hw/xwin/wingetsp.c +++ /dev/null @@ -1,171 +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: Harold L Hunt II - * Alan Hourihane - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* See Porting Layer Definition - p. 55 */ -void -winGetSpansNativeGDI(DrawablePtr pDrawable, - int nMax, - DDXPointPtr pPoints, - int *piWidths, int iSpans, char *pDsts) -{ - PixmapPtr pPixmap = NULL; - winPrivPixmapPtr pPixmapPriv = NULL; - int iSpan; - DDXPointPtr pPoint = NULL; - int *piWidth = NULL; - char *pDst = pDsts; - HBITMAP hbmpWindow, hbmpOrig, hbmpOrig1; - BYTE *pbWindow = NULL; - HDC hdcMem, hdcMem1; - ScreenPtr pScreen = pDrawable->pScreen; - - winScreenPriv(pScreen); - - /* Branch on the drawable type */ - switch (pDrawable->type) { - case DRAWABLE_PIXMAP: -#if 0 - ErrorF("winGetSpans - DRAWABLE_PIXMAP %08x\n", pDrawable); -#endif - - pPixmap = (PixmapPtr) pDrawable; - pPixmapPriv = winGetPixmapPriv(pPixmap); - - /* Open a memory HDC */ - hdcMem1 = CreateCompatibleDC(NULL); - hdcMem = CreateCompatibleDC(NULL); - - /* Select the drawable pixmap into a DC */ - hbmpOrig1 = SelectObject(hdcMem1, pPixmapPriv->hBitmap); - - if (hbmpOrig1 == NULL) - FatalError("winGetSpans - DRAWABLE_PIXMAP - SelectObject () " - "failed on pPixmapPriv->hBitmap\n"); - - /* Loop through spans */ - for (iSpan = 0; iSpan < iSpans; ++iSpan) { - pPoint = pPoints + iSpan; - piWidth = piWidths + iSpan; - - hbmpWindow = winCreateDIBNativeGDI(*piWidth, 1, - pDrawable->depth, - &pbWindow, NULL); - - hbmpOrig = SelectObject(hdcMem, hbmpWindow); - - /* Transfer the window bits to the window bitmap */ - BitBlt(hdcMem, - 0, 0, *piWidth, 1, hdcMem1, pPoint->x, pPoint->y, SRCCOPY); - - memcpy(pDst, - (char *) pbWindow, - PixmapBytePad(*piWidth, pDrawable->depth)); - - /* Pop the window bitmap out of the HDC and delete the bitmap */ - SelectObject(hdcMem, hbmpOrig); - DeleteObject(hbmpWindow); - -#if 0 - ErrorF("(%dx%dx%d) (%d,%d) w: %d\n", - pDrawable->width, pDrawable->height, pDrawable->depth, - pPoint->x, pPoint->y, *piWidth); -#endif - - /* Calculate offset of next bit destination */ - pDst += PixmapBytePad(*piWidth, pDrawable->depth); - } - - /* Pop the pixmap's bitmap out of the HDC */ - SelectObject(hdcMem1, hbmpOrig1); - - /* Delete the HDCs */ - DeleteDC(hdcMem1); - DeleteDC(hdcMem); - break; - - case DRAWABLE_WINDOW: -#if 0 - ErrorF("winGetSpans - DRAWABLE_WINDOW\n"); -#endif - - /* Open a memory HDC */ - hdcMem = CreateCompatibleDC(NULL); - - /* Loop through spans */ - for (iSpan = 0; iSpan < iSpans; ++iSpan) { - pPoint = pPoints + iSpan; - piWidth = piWidths + iSpan; - - hbmpWindow = winCreateDIBNativeGDI(*piWidth, 1, - pDrawable->depth, - &pbWindow, NULL); - - hbmpOrig = SelectObject(hdcMem, hbmpWindow); - - /* Transfer the window bits to the window bitmap */ - BitBlt(hdcMem, - 0, 0, - *piWidth, 1, - pScreenPriv->hdcScreen, pPoint->x, pPoint->y, SRCCOPY); - - memcpy(pDst, - (char *) pbWindow, - PixmapBytePad(*piWidth, pDrawable->depth)); - - /* Pop the window bitmap out of the HDC */ - SelectObject(hdcMem, hbmpOrig); - - DeleteObject(hbmpWindow); - -#if 0 - ErrorF("(%dx%dx%d) (%d,%d) w: %d\n", - pDrawable->width, pDrawable->height, pDrawable->depth, - pPoint->x, pPoint->y, *piWidth); -#endif - - /* Calculate offset of next bit destination */ - pDst += PixmapBytePad(*piWidth, pDrawable->depth); - } - - /* Delete the window bitmap */ - DeleteDC(hdcMem); - break; - - default: - FatalError("winGetSpans - Unknown drawable type\n"); - break; - } -} diff --git a/xserver/hw/xwin/winglobals.c b/xserver/hw/xwin/winglobals.c index b9ad294d5..ad82b83f6 100644 --- a/xserver/hw/xwin/winglobals.c +++ b/xserver/hw/xwin/winglobals.c @@ -86,7 +86,6 @@ pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; * Wrapped DIX functions */ winDispatchProcPtr winProcEstablishConnectionOrig = NULL; -winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL; /* * Clipboard variables @@ -94,13 +93,7 @@ winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL; Bool g_fUnicodeClipboard = TRUE; Bool g_fClipboard = TRUE; -Bool g_fClipboardLaunched = FALSE; Bool g_fClipboardStarted = FALSE; -pthread_t g_ptClipboardProc; -HWND g_hwndClipboard = NULL; -void *g_pClipboardDisplay = NULL; -Window g_iClipboardWindow = None; -Atom g_atomLastOwnedSelection = None; #endif /* @@ -112,10 +105,4 @@ void winInitializeGlobals(void) { g_dwCurrentThreadID = GetCurrentThreadId(); -#ifdef XWIN_CLIPBOARD - g_iClipboardWindow = None; - g_pClipboardDisplay = NULL; - g_atomLastOwnedSelection = None; - g_hwndClipboard = NULL; -#endif } diff --git a/xserver/hw/xwin/winglobals.h b/xserver/hw/xwin/winglobals.h index 60c00da42..d7b813dbb 100644 --- a/xserver/hw/xwin/winglobals.h +++ b/xserver/hw/xwin/winglobals.h @@ -72,8 +72,10 @@ typedef int (*winDispatchProcPtr) (ClientPtr); * Wrapped DIX functions */ extern winDispatchProcPtr winProcEstablishConnectionOrig; -extern winDispatchProcPtr winProcSetSelectionOwnerOrig; #endif +extern Bool g_fUnicodeClipboard; +extern Bool g_fClipboard; +extern Bool g_fClipboardStarted; /* The global X default icons */ #if defined(XWIN_MULTIWINDOW) diff --git a/xserver/hw/xwin/winlayouts.h b/xserver/hw/xwin/winlayouts.h index 8b6b98407..a61fd7ac1 100644 --- a/xserver/hw/xwin/winlayouts.h +++ b/xserver/hw/xwin/winlayouts.h @@ -23,7 +23,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* Definitions for various keyboard layouts from windows and their +/* Definitions for various keyboard layouts from windows and their * XKB settings. */ diff --git a/xserver/hw/xwin/winmisc.c b/xserver/hw/xwin/winmisc.c index 10f97322f..bea6290c6 100644 --- a/xserver/hw/xwin/winmisc.c +++ b/xserver/hw/xwin/winmisc.c @@ -33,21 +33,6 @@ #endif #include "win.h" -#ifdef XWIN_NATIVEGDI -/* See Porting Layer Definition - p. 33 */ -/* - * Called by clients, returns the best size for a cursor, tile, or - * stipple, specified by class (sometimes called kind) - */ - -void -winQueryBestSizeNativeGDI(int class, unsigned short *pWidth, - unsigned short *pHeight, ScreenPtr pScreen) -{ - ErrorF("winQueryBestSizeNativeGDI\n"); -} -#endif - /* * Count the number of one bits in a color mask. */ @@ -93,51 +78,3 @@ winUpdateFBPointer(ScreenPtr pScreen, void *pbits) return TRUE; } - -#ifdef XWIN_NATIVEGDI -/* - * Paint the window background with the specified color - */ - -BOOL -winPaintBackground(HWND hwnd, COLORREF colorref) -{ - HDC hdc; - HBRUSH hbrush; - RECT rect; - - /* Create an hdc */ - hdc = GetDC(hwnd); - if (hdc == NULL) { - printf("gdiWindowProc - GetDC failed\n"); - exit(1); - } - - /* Create and select blue brush */ - hbrush = CreateSolidBrush(colorref); - if (hbrush == NULL) { - printf("gdiWindowProc - CreateSolidBrush failed\n"); - exit(1); - } - - /* Get window extents */ - if (GetClientRect(hwnd, &rect) == FALSE) { - printf("gdiWindowProc - GetClientRect failed\n"); - exit(1); - } - - /* Fill window with blue brush */ - if (FillRect(hdc, &rect, hbrush) == 0) { - printf("gdiWindowProc - FillRect failed\n"); - exit(1); - } - - /* Delete blue brush */ - DeleteObject(hbrush); - - /* Release the hdc */ - ReleaseDC(hwnd, hdc); - - return TRUE; -} -#endif diff --git a/xserver/hw/xwin/winmsg.h b/xserver/hw/xwin/winmsg.h index b638f2cb3..6c96c4070 100644 --- a/xserver/hw/xwin/winmsg.h +++ b/xserver/hw/xwin/winmsg.h @@ -30,6 +30,8 @@ * Authors: Alexander Gottwald */ +#include + /* * Function prototypes */ diff --git a/xserver/hw/xwin/winmsgwindow.c b/xserver/hw/xwin/winmsgwindow.c index 59f1da503..f5649b722 100644 --- a/xserver/hw/xwin/winmsgwindow.c +++ b/xserver/hw/xwin/winmsgwindow.c @@ -96,7 +96,6 @@ static HWND winCreateMsgWindow(void) { HWND hwndMsg; - wATOM winClass; // register window class { @@ -114,7 +113,7 @@ winCreateMsgWindow(void) wcx.lpszMenuName = NULL; wcx.lpszClassName = WINDOW_CLASS_X_MSG; wcx.hIconSm = NULL; - winClass = RegisterClassEx(&wcx); + RegisterClassEx(&wcx); } // Create the msg window. @@ -136,7 +135,7 @@ winCreateMsgWindow(void) return NULL; } - winDebug("winCreateMsgWindow - Created msg window hwnd 0x%x\n", hwndMsg); + winDebug("winCreateMsgWindow - Created msg window hwnd 0x%p\n", hwndMsg); return hwndMsg; } diff --git a/xserver/hw/xwin/winmultiwindowicons.c b/xserver/hw/xwin/winmultiwindowicons.c index 93d389d46..c22e68874 100644 --- a/xserver/hw/xwin/winmultiwindowicons.c +++ b/xserver/hw/xwin/winmultiwindowicons.c @@ -382,7 +382,7 @@ winXIconToHICON(Display * pDisplay, Window id, int iconSize) static int generation; uint32_t *icon, *icon_data = NULL; unsigned long int size; - unsigned long int type; + Atom type; int format; unsigned long int left; @@ -465,7 +465,7 @@ 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%x\n", id, + winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%p\n", id, xImageIcon); if (hints->icon_mask) diff --git a/xserver/hw/xwin/winmultiwindowshape.c b/xserver/hw/xwin/winmultiwindowshape.c index cb0f38950..73afaea55 100644 --- a/xserver/hw/xwin/winmultiwindowshape.c +++ b/xserver/hw/xwin/winmultiwindowshape.c @@ -47,7 +47,7 @@ winSetShapeMultiWindow(WindowPtr pWin, int kind) winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG - ErrorF("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind); + ErrorF("winSetShapeMultiWindow - pWin: %p kind: %i\n", pWin, kind); #endif WIN_UNWRAP(SetShape); diff --git a/xserver/hw/xwin/winmultiwindowwindow.c b/xserver/hw/xwin/winmultiwindowwindow.c index f2e7907b8..c22d69074 100644 --- a/xserver/hw/xwin/winmultiwindowwindow.c +++ b/xserver/hw/xwin/winmultiwindowwindow.c @@ -286,7 +286,7 @@ winChangeWindowAttributesMultiWindow(WindowPtr pWin, unsigned long mask) winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG - ErrorF("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin); + ErrorF("winChangeWindowAttributesMultiWindow - pWin: %p\n", pWin); #endif WIN_UNWRAP(ChangeWindowAttributes); @@ -315,7 +315,7 @@ winUnmapWindowMultiWindow(WindowPtr pWin) winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG - ErrorF("winUnmapWindowMultiWindow - pWin: %08x\n", pWin); + ErrorF("winUnmapWindowMultiWindow - pWin: %p\n", pWin); #endif WIN_UNWRAP(UnrealizeWindow); @@ -346,7 +346,7 @@ winMapWindowMultiWindow(WindowPtr pWin) winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG - ErrorF("winMapWindowMultiWindow - pWin: %08x\n", pWin); + ErrorF("winMapWindowMultiWindow - pWin: %p\n", pWin); #endif WIN_UNWRAP(RealizeWindow); @@ -378,7 +378,7 @@ winReparentWindowMultiWindow(WindowPtr pWin, WindowPtr pPriorParent) winScreenPriv(pScreen); winDebug - ("winReparentMultiWindow - pWin:%08x XID:0x%x, reparent from pWin:%08x XID:0x%x to pWin:%08x XID:0x%x\n", + ("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); @@ -409,7 +409,7 @@ winRestackWindowMultiWindow(WindowPtr pWin, WindowPtr pOldNextSib) winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG - winTrace("winRestackMultiWindow - %08x\n", pWin); + winTrace("winRestackMultiWindow - %p\n", pWin); #endif WIN_UNWRAP(RestackWindow); @@ -492,7 +492,7 @@ winCreateWindowsWindow(WindowPtr pWin) winInitMultiWindowClass(); - winDebug("winCreateWindowsTopLevelWindow - pWin:%08x XID:0x%x \n", pWin, + winDebug("winCreateWindowsTopLevelWindow - pWin:%p XID:0x%x \n", pWin, pWin->drawable.id); iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN); @@ -618,7 +618,7 @@ winDestroyWindowsWindow(WindowPtr pWin) HICON hIcon; HICON hIconSm; - winDebug("winDestroyWindowsWindow - pWin:%08x XID:0x%x \n", pWin, + winDebug("winDestroyWindowsWindow - pWin:%p XID:0x%x \n", pWin, pWin->drawable.id); /* Bail out if the Windows window handle is invalid */ @@ -700,7 +700,7 @@ winUpdateWindowsWindow(WindowPtr pWin) } /* - * winGetWindowID - + * winGetWindowID - */ XID @@ -720,7 +720,7 @@ winGetWindowID(WindowPtr pWin) } /* - * winFindWindow - + * winFindWindow - */ static void @@ -734,7 +734,7 @@ winFindWindow(void *value, XID id, void *cdata) } /* - * winReorderWindowsMultiWindow - + * winReorderWindowsMultiWindow - */ void diff --git a/xserver/hw/xwin/winmultiwindowwm.c b/xserver/hw/xwin/winmultiwindowwm.c index 618e38121..6599dfba8 100644 --- a/xserver/hw/xwin/winmultiwindowwm.c +++ b/xserver/hw/xwin/winmultiwindowwm.c @@ -61,6 +61,7 @@ #include "pixmapstr.h" #include "windowstr.h" #include "winglobals.h" +#include "windisplay.h" #ifdef XWIN_MULTIWINDOWEXTWM #include @@ -338,7 +339,7 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo) #if 0 /* - * HaveMessage - + * HaveMessage - */ static Bool @@ -1053,8 +1054,7 @@ winMultiWindowXMsgProc(void *pArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); @@ -1446,8 +1446,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); diff --git a/xserver/hw/xwin/winmultiwindowwndproc.c b/xserver/hw/xwin/winmultiwindowwndproc.c index 17823baf2..d296f0f0c 100644 --- a/xserver/hw/xwin/winmultiwindowwndproc.c +++ b/xserver/hw/xwin/winmultiwindowwndproc.c @@ -140,7 +140,7 @@ ConstrainSize(WinXSizeHints hints, int *widthp, int *heightp) * * minAspectX * dheight > minAspectY * dwidth * maxAspectX * dheight < maxAspectY * dwidth - * + * */ if (hints.flags & PAspect) { @@ -271,7 +271,7 @@ winRaiseWindow(WindowPtr pWin) BOOL oldstate = winInRaiseWindow; XID vlist[1] = { 0 }; winInRaiseWindow = TRUE; - /* Call configure window directly to make sure it gets processed + /* Call configure window directly to make sure it gets processed * in time */ ConfigureWindow(pWin, CWStackMode, vlist, serverClient); diff --git a/xserver/hw/xwin/winnativegdi.c b/xserver/hw/xwin/winnativegdi.c deleted file mode 100644 index 1859698a0..000000000 --- a/xserver/hw/xwin/winnativegdi.c +++ /dev/null @@ -1,491 +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: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* - * Local function prototypes - */ - -static Bool - winAllocateFBNativeGDI(ScreenPtr pScreen); - -static void - winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf); - -static Bool - winCloseScreenNativeGDI(ScreenPtr pScreen); - -static Bool - winInitVisualsNativeGDI(ScreenPtr pScreen); - -static Bool - winAdjustVideoModeNativeGDI(ScreenPtr pScreen); - -#if 0 -static Bool - winBltExposedRegionsNativeGDI(ScreenPtr pScreen); -#endif - -static Bool - winActivateAppNativeGDI(ScreenPtr pScreen); - -static Bool - winRedrawScreenNativeGDI(ScreenPtr pScreen); - -static Bool - winRealizeInstalledPaletteNativeGDI(ScreenPtr pScreen); - -static Bool - winInstallColormapNativeGDI(ColormapPtr pColormap); - -static Bool - winStoreColorsNativeGDI(ColormapPtr pmap, int ndef, xColorItem * pdefs); - -static Bool - winCreateColormapNativeGDI(ColormapPtr pColormap); - -static Bool - winDestroyColormapNativeGDI(ColormapPtr pColormap); - -static Bool -winAllocateFBNativeGDI(ScreenPtr pScreen) -{ - FatalError("winAllocateFBNativeGDI\n"); - - return TRUE; -} - -static void -winFreeFBNativeGDI(ScreenPtr pScreen) -{ - FatalError("winFreeFBNativeGDI\n"); -} - -static Bool -winInitScreenNativeGDI(ScreenPtr pScreen) -{ - FatalError("winInitScreenNativeGDI\n"); -} - -/* - * We wrap whatever CloseScreen procedure was specified by fb; - * a pointer to said procedure is stored in our privates. - */ - -static Bool -winCloseScreenNativeGDI(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - ErrorF("winCloseScreenNativeGDI - Freeing screen resources\n"); - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* - * NOTE: mi doesn't use a CloseScreen procedure, so we do not - * need to call a wrapped procedure here. - */ - - /* Delete the window property */ - RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); - - ErrorF("winCloseScreenNativeGDI - Destroying window\n"); - - /* 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; - } - - /* Invalidate our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; - - /* Free the screen privates for this screen */ - free(pScreenPriv); - - ErrorF("winCloseScreenNativeGDI - Returning\n"); - - return TRUE; -} - -static void -winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf) -{ - FatalError("winShadowUpdateNativeGDI\n"); - return; -} - -static Bool -winInitVisualsNativeGDI(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set the bitsPerRGB and bit masks */ - switch (pScreenInfo->dwDepth) { - case 24: - pScreenPriv->dwBitsPerRGB = 8; - pScreenPriv->dwRedMask = 0x00FF0000; - pScreenPriv->dwGreenMask = 0x0000FF00; - pScreenPriv->dwBlueMask = 0x000000FF; - break; - - case 16: - pScreenPriv->dwBitsPerRGB = 6; - pScreenPriv->dwRedMask = 0xF800; - pScreenPriv->dwGreenMask = 0x07E0; - pScreenPriv->dwBlueMask = 0x001F; - break; - - case 15: - pScreenPriv->dwBitsPerRGB = 5; - pScreenPriv->dwRedMask = 0x7C00; - pScreenPriv->dwGreenMask = 0x03E0; - pScreenPriv->dwBlueMask = 0x001F; - break; - - case 8: - pScreenPriv->dwBitsPerRGB = 8; - pScreenPriv->dwRedMask = 0; - pScreenPriv->dwGreenMask = 0; - pScreenPriv->dwBlueMask = 0; - break; - - default: - ErrorF("winInitVisualsNativeGDI - Unknown screen depth\n"); - return FALSE; - break; - } - - /* Tell the user how many bits per RGB we are using */ - ErrorF("winInitVisualsNativeGDI - Using dwBitsPerRGB: %d\n", - (int) pScreenPriv->dwBitsPerRGB); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) { - case 24: - case 16: - case 15: - if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - TrueColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) { - ErrorF("winInitVisuals - miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - break; - - case 8: - ErrorF("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); - if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, - StaticColorMask, - pScreenPriv->dwBitsPerRGB, - StaticColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) { - ErrorF("winInitVisuals - miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - break; - - default: - ErrorF("winInitVisualsNativeGDI - Unknown screen depth\n"); - return FALSE; - } - -#if 1 - ErrorF("winInitVisualsNativeGDI - Returning\n"); -#endif - - return TRUE; -} - -/* Adjust the video mode */ -static Bool -winAdjustVideoModeNativeGDI(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = NULL; - DWORD dwBPP; - - hdc = GetDC(NULL); - - /* We're in serious trouble if we can't get a DC */ - if (hdc == NULL) { - ErrorF("winAdjustVideoModeNativeGDI - GetDC () failed\n"); - return FALSE; - } - - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps(hdc, BITSPIXEL); - pScreenInfo->dwDepth = GetDeviceCaps(hdc, PLANES); - - switch (pScreenInfo->dwDepth) { - case 24: - case 16: - case 15: - case 8: - break; - default: - if (dwBPP == 32) - pScreenInfo->dwDepth = 24; - else - pScreenInfo->dwDepth = dwBPP; - break; - } - - /* GDI cannot change the screen depth, so we'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - - /* Release our DC */ - ReleaseDC(NULL, hdc); - - return TRUE; -} - -static Bool -winActivateAppNativeGDI(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* - * Are we active? - * Are we fullscreen? - */ - if (pScreenPriv != NULL - && pScreenPriv->fActive - && pScreenPriv->pScreenInfo && pScreenPriv->pScreenInfo->fFullScreen) { - /* - * Activating, attempt to bring our window - * to the top of the display - */ - ShowWindow(pScreenPriv->hwndScreen, SW_RESTORE); - } - - /* - * Are we inactive? - * Are we fullscreen? - */ - if (pScreenPriv != NULL - && !pScreenPriv->fActive - && pScreenPriv->pScreenInfo && pScreenPriv->pScreenInfo->fFullScreen) { - /* - * Deactivating, stuff our window onto the - * task bar. - */ - ShowWindow(pScreenPriv->hwndScreen, SW_MINIMIZE); - } - - return TRUE; -} - -HBITMAP -winCreateDIBNativeGDI(int iWidth, int iHeight, int iDepth, - BYTE ** ppbBits, BITMAPINFO ** ppbmi) -{ - BITMAPINFOHEADER *pbmih = NULL; - HBITMAP hBitmap = NULL; - BITMAPINFO *pbmi = NULL; - - /* Don't create an invalid bitmap */ - if (iWidth == 0 || iHeight == 0 || iDepth == 0) { - ErrorF("\nwinCreateDIBNativeGDI - Invalid specs w %d h %d d %d\n\n", - iWidth, iHeight, iDepth); - return NULL; - } - - /* Allocate bitmap info header */ - pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - if (pbmih == NULL) { - ErrorF("winCreateDIBNativeGDI - malloc () failed\n"); - return FALSE; - } - ZeroMemory(pbmih, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - - /* Describe bitmap to be created */ - pbmih->biSize = sizeof(BITMAPINFOHEADER); - pbmih->biWidth = iWidth; - pbmih->biHeight = -iHeight; - pbmih->biPlanes = 1; - pbmih->biBitCount = iDepth; - pbmih->biCompression = BI_RGB; - pbmih->biSizeImage = 0; - pbmih->biXPelsPerMeter = 0; - pbmih->biYPelsPerMeter = 0; - pbmih->biClrUsed = 0; - pbmih->biClrImportant = 0; - - /* Setup color table for mono DIBs */ - if (iDepth == 1) { - pbmi = (BITMAPINFO *) pbmih; - pbmi->bmiColors[1].rgbBlue = 255; - pbmi->bmiColors[1].rgbGreen = 255; - pbmi->bmiColors[1].rgbRed = 255; - } - - /* Create a DIB with a bit pointer */ - hBitmap = CreateDIBSection(NULL, - (BITMAPINFO *) pbmih, - DIB_RGB_COLORS, (void **) ppbBits, NULL, 0); - if (hBitmap == NULL) { - ErrorF("winCreateDIBNativeGDI - CreateDIBSection () failed\n"); - return NULL; - } - - /* Free the bitmap info header memory */ - if (ppbmi != NULL) { - /* Store the address of the BMIH in the ppbmih parameter */ - *ppbmi = (BITMAPINFO *) pbmih; - } - else { - free(pbmih); - pbmih = NULL; - } - - return hBitmap; -} - -#if 0 -static Bool -winBltExposedRegionsNativeGDI(ScreenPtr pScreen) -{ - - return TRUE; -} -#endif - -static Bool -winRedrawScreenNativeGDI(ScreenPtr pScreen) -{ - FatalError("winRedrawScreenNativeGDI\n"); - return TRUE; -} - -static Bool -winRealizeInstalledPaletteNativeGDI(ScreenPtr pScreen) -{ - FatalError("winRealizeInstalledPaletteNativeGDI\n"); - return TRUE; -} - -static Bool -winInstallColormapNativeGDI(ColormapPtr pColormap) -{ - FatalError("winInstallColormapNativeGDI\n"); - return TRUE; -} - -static Bool -winStoreColorsNativeGDI(ColormapPtr pmap, int ndef, xColorItem * pdefs) -{ - FatalError("winStoreColorsNativeGDI\n"); - return TRUE; -} - -static Bool -winCreateColormapNativeGDI(ColormapPtr pColormap) -{ - FatalError("winCreateColormapNativeGDI\n"); - return TRUE; -} - -static Bool -winDestroyColormapNativeGDI(ColormapPtr pColormap) -{ - FatalError("winDestroyColormapNativeGDI\n"); - return TRUE; -} - -/* Set engine specific funtions */ -Bool -winSetEngineFunctionsNativeGDI(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBNativeGDI; - pScreenPriv->pwinFreeFB = winFreeFBNativeGDI; - pScreenPriv->pwinShadowUpdate = winShadowUpdateNativeGDI; - pScreenPriv->pwinInitScreen = winInitScreenNativeGDI; - pScreenPriv->pwinCloseScreen = winCloseScreenNativeGDI; - pScreenPriv->pwinInitVisuals = winInitVisualsNativeGDI; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeNativeGDI; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = - winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitNativeGDI; - /* - * WARNING: Do not set the BltExposedRegions procedure pointer to anything - * other than NULL until a working painting procedure is in place. - * Else, winWindowProc will get stuck in an infinite loop because - * Windows expects the BeginPaint and EndPaint functions to be called - * before a WM_PAINT message can be removed from the queue. We are - * using NULL here as a signal for winWindowProc that it should - * not signal that the WM_PAINT message has been processed. - */ - pScreenPriv->pwinBltExposedRegions = NULL; - pScreenPriv->pwinActivateApp = winActivateAppNativeGDI; - pScreenPriv->pwinRedrawScreen = winRedrawScreenNativeGDI; - pScreenPriv->pwinRealizeInstalledPalette = - winRealizeInstalledPaletteNativeGDI; - pScreenPriv->pwinInstallColormap = winInstallColormapNativeGDI; - pScreenPriv->pwinStoreColors = winStoreColorsNativeGDI; - pScreenPriv->pwinCreateColormap = winCreateColormapNativeGDI; - pScreenPriv->pwinDestroyColormap = winDestroyColormapNativeGDI; - pScreenPriv->pwinHotKeyAltTab = - (winHotKeyAltTabProcPtr) (void (*)(void)) NoopDDA; - - return TRUE; -} diff --git a/xserver/hw/xwin/winpfbdd.c b/xserver/hw/xwin/winpfbdd.c deleted file mode 100644 index 010616101..000000000 --- a/xserver/hw/xwin/winpfbdd.c +++ /dev/null @@ -1,620 +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 -#endif -#include "win.h" - -/* - * Local function prototypes - */ - -static Bool - winAllocateFBPrimaryDD(ScreenPtr pScreen); - -static Bool - winCloseScreenPrimaryDD(ScreenPtr pScreen); - -static Bool - winInitVisualsPrimaryDD(ScreenPtr pScreen); - -static Bool - winAdjustVideoModePrimaryDD(ScreenPtr pScreen); - -static Bool - winActivateAppPrimaryDD(ScreenPtr pScreen); - -static Bool - winHotKeyAltTabPrimaryDD(ScreenPtr pScreen); - -/* - * Create a DirectDraw primary surface - */ - -static Bool -winAllocateFBPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - DDSURFACEDESC ddsd; - DDSURFACEDESC *pddsdPrimary = NULL; - DDSURFACEDESC *pddsdOffscreen = NULL; - RECT rcClient; - - ErrorF("winAllocateFBPrimaryDD\n"); - - /* Get client area location in screen coords */ - GetClientRect(pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) &rcClient, 2); - - /* Create a DirectDraw object, store the address at lpdd */ - ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); - if (ddrval != DD_OK) - FatalError("winAllocateFBPrimaryDD - Could not start DirectDraw\n"); - - /* 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; - } - - ErrorF("winAllocateFBPrimaryDD - Created and initialized DD\n"); - - /* Are we windowed or fullscreen? */ - if (pScreenInfo->fFullScreen) { - /* Full screen mode */ - ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_FULLSCREEN - | DDSCL_EXCLUSIVE); - if (FAILED(ddrval)) - FatalError("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); - - /* Change the video mode to the mode requested */ - ddrval = IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - pScreenInfo->dwRefreshRate, 0); - if (FAILED(ddrval)) - FatalError("winAllocateFBPrimaryDD - Could not set " - "full screen display mode\n"); - } - else { - /* Windowed mode */ - ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_NORMAL); - if (FAILED(ddrval)) - FatalError("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); - } - - /* 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)) - FatalError("winAllocateFBPrimaryDD - Could not create primary " - "surface %08x\n", (unsigned int) ddrval); - - ErrorF("winAllocateFBPrimaryDD - Created primary\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdPrimary = pScreenPriv->pddsdPrimary = malloc(sizeof(DDSURFACEDESC)); - if (pddsdPrimary == NULL) - FatalError("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory(pddsdPrimary, sizeof(*pddsdPrimary)); - pddsdPrimary->dwSize = sizeof(*pddsdPrimary); - - /* Describe the offscreen 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->pddsOffscreen, NULL); - if (ddrval != DD_OK) - FatalError("winAllocateFBPrimaryDD - Could not create shadow " - "surface\n"); - - ErrorF("winAllocateFBPrimaryDD - Created offscreen\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdOffscreen = pScreenPriv->pddsdOffscreen - = malloc(sizeof(DDSURFACEDESC)); - if (pddsdOffscreen == NULL) - FatalError("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory(pddsdOffscreen, sizeof(*pddsdOffscreen)); - pddsdOffscreen->dwSize = sizeof(*pddsdOffscreen); - - ErrorF("winAllocateFBPrimaryDD - Locking primary\n"); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsPrimary, - pScreenInfo-> - fFullScreen ? NULL : &rcClient, - pddsdPrimary, DDLOCK_WAIT, NULL); - if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL) - FatalError("winAllocateFBPrimaryDD - Could not lock " - "primary surface\n"); - - ErrorF("winAllocateFBPrimaryDD - Locked primary\n"); - - /* We don't know how to deal with anything other than RGB */ - if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB)) - FatalError("winAllocateFBPrimaryDD - Color format other than RGB\n"); - - /* Grab the pitch from the surface desc */ - pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8) - / pScreenInfo->dwBPP; - - /* Save the pointer to our surface memory */ - pScreenInfo->pfb = pddsdPrimary->lpSurface; - - /* Grab the color depth and masks from the surface description */ - pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask; - pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask; - pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask; - - ErrorF("winAllocateFBPrimaryDD - Returning\n"); - - return TRUE; -} - -static void -winFreeFBPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the offscreen surface, if there is one */ - if (pScreenPriv->pddsOffscreen) { - IDirectDrawSurface2_Unlock(pScreenPriv->pddsOffscreen, NULL); - IDirectDrawSurface2_Release(pScreenPriv->pddsOffscreen); - pScreenPriv->pddsOffscreen = NULL; - } - - /* Release the primary surface, if there is one */ - if (pScreenPriv->pddsPrimary) { - IDirectDrawSurface2_Unlock(pScreenPriv->pddsPrimary, NULL); - IDirectDrawSurface2_Release(pScreenPriv->pddsPrimary); - pScreenPriv->pddsPrimary = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) { - IDirectDraw2_RestoreDisplayMode(pScreenPriv->pdd); - IDirectDraw2_Release(pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; -} - -static Bool -winInitScreenPrimaryDD(ScreenPtr pScreen) -{ - return winAllocateFBPrimaryDD(pScreen); -} - -/* - * Call the wrapped CloseScreen function. - * - * Free our resources and private structures. - */ - -static Bool -winCloseScreenPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - - ErrorF("winCloseScreenPrimaryDD - Freeing screen resources\n"); - - /* 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); - - /* Delete the window property */ - RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); - - winFreeFBPrimaryDD(pScreen); - - /* 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; - } - - /* 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 -winInitVisualsPrimaryDD(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 > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - ErrorF("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) { - case 24: - case 16: - case 15: - if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - TrueColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) { - ErrorF("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - break; - - case 8: -#if CYGDEBUG - winDebug("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); -#endif /* CYGDEBUG */ - if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, - PseudoColorMask, - pScreenPriv->dwBitsPerRGB, - PseudoColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) { - ErrorF("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } -#if CYGDEBUG - winDebug("winInitVisualsPrimaryDD - Returned from " - "miSetVisualTypesAndMasks\n"); -#endif /* CYGDEBUG */ - break; - - default: - ErrorF("winInitVisualsPrimaryDD - Unknown screen depth\n"); - return FALSE; - } - - ErrorF("winInitVisualsPrimaryDD - Returning\n"); - - return TRUE; -} - -static Bool -winAdjustVideoModePrimaryDD(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("winAdjustVideoModePrimaryDD - 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; -} - -/* - * We need to blit our offscreen fb to - * the screen when we are activated, and we need to point - * the fb code back to the primary surface memory. - */ - -static Bool -winActivateAppPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - RECT rcSrc, rcClient; - HRESULT ddrval = DD_OK; - - /* Check for errors */ - if (pScreenPriv == NULL - || pScreenPriv->pScreenInfo == NULL - || pScreenPriv->pddsPrimary == NULL - || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Check for do-nothing */ - if (!pScreenPriv->fActive) - return TRUE; - - /* We are activating */ - ddrval = IDirectDrawSurface2_IsLost(pScreenPriv->pddsOffscreen); - if (ddrval == DD_OK) { - IDirectDrawSurface2_Unlock(pScreenPriv->pddsOffscreen, NULL); - /* - * We don't check for an error from Unlock, because it - * doesn't matter if the Unlock failed. - */ - } - - /* Restore both surfaces, just cause I like it that way */ - IDirectDrawSurface2_Restore(pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary); - - /* Get client area in screen coords */ - GetClientRect(pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) &rcClient, 2); - - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenPriv->pScreenInfo->dwWidth; - rcSrc.bottom = pScreenPriv->pScreenInfo->dwHeight; - - ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsOffscreen, - &rcSrc, DDBLT_WAIT, NULL); - if (ddrval != DD_OK) - FatalError("winActivateAppPrimaryDD () - Failed blitting offscreen " - "surface to primary surface %08x\n", (unsigned int) ddrval); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsdPrimary, - DDLOCK_WAIT, NULL); - if (ddrval != DD_OK || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError("winActivateAppPrimaryDD () - Could not lock " - "primary surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer(pScreen, pScreenPriv->pddsdPrimary->lpSurface); - - /* - * Register the Alt-Tab combo as a hotkey so we can copy - * the primary framebuffer before the display mode changes - */ - RegisterHotKey(pScreenPriv->hwndScreen, 1, MOD_ALT, 9); - - return TRUE; -} - -/* - * Handle the Alt+Tab hotkey. - * - * We need to save the primary fb to an offscreen fb when - * we get deactivated, and point the fb code at the offscreen - * fb for the duration of the deactivation. - */ - -static Bool -winHotKeyAltTabPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - HRESULT ddrval = DD_OK; - - ErrorF("\nwinHotKeyAltTabPrimaryDD\n\n"); - - /* Alt+Tab was pressed, we will lose focus very soon */ - pScreenPriv->fActive = FALSE; - - /* Check for error conditions */ - if (pScreenPriv->pddsPrimary == NULL || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Did we loose the primary surface? */ - ddrval = IDirectDrawSurface2_IsLost(pScreenPriv->pddsPrimary); - if (ddrval == DD_OK) { - ddrval = IDirectDrawSurface2_Unlock(pScreenPriv->pddsPrimary, NULL); - if (FAILED(ddrval)) - FatalError("winHotKeyAltTabPrimaryDD - Failed unlocking primary " - "surface\n"); - } - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsOffscreen, NULL, /* should be rcDest */ - pScreenPriv->pddsPrimary, - NULL, DDBLT_WAIT, NULL); - if (ddrval == DDERR_SURFACELOST) { - IDirectDrawSurface2_Restore(pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary); - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsPrimary, - NULL, DDBLT_WAIT, NULL); - if (FAILED(ddrval)) - FatalError("winHotKeyAltTabPrimaryDD - Failed blitting primary " - "surface to offscreen surface: %08x\n", - (unsigned int) ddrval); - } - else { - FatalError("winHotKeyAltTabPrimaryDD - Unknown error from " - "Blt: %08dx\n", (unsigned int) ddrval); - } - - /* Lock the offscreen surface */ - ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsdOffscreen, - DDLOCK_WAIT, NULL); - if (ddrval != DD_OK || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError("winHotKeyAltTabPrimaryDD - Could not lock " - "offscreen surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer(pScreen, pScreenPriv->pddsdOffscreen->lpSurface); - - /* Unregister our hotkey */ - UnregisterHotKey(pScreenPriv->hwndScreen, 1); - - return TRUE; -} - -/* Set engine specific functions */ -Bool -winSetEngineFunctionsPrimaryDD(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD; - pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD; - pScreenPriv->pwinShadowUpdate = - (winShadowUpdateProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD; - pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD; - pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = - winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = - (winBltExposedRegionsProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; - pScreenPriv->pwinRedrawScreen = NULL; - pScreenPriv->pwinRealizeInstalledPalette = NULL; - pScreenPriv->pwinInstallColormap = NULL; - pScreenPriv->pwinStoreColors = NULL; - pScreenPriv->pwinCreateColormap = NULL; - pScreenPriv->pwinDestroyColormap = NULL; - pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD; - pScreenPriv->pwinCreatePrimarySurface = - (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; - pScreenPriv->pwinReleasePrimarySurface = - (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; -#endif - - return TRUE; -} diff --git a/xserver/hw/xwin/winpixmap.c b/xserver/hw/xwin/winpixmap.c deleted file mode 100644 index ef158c854..000000000 --- a/xserver/hw/xwin/winpixmap.c +++ /dev/null @@ -1,223 +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: drewry, september 1986 - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* - * Local prototypes - */ - -#if 0 -static void - winXRotatePixmapNativeGDI(PixmapPtr pPix, int rw); - -static void - winYRotatePixmapNativeGDI(PixmapPtr pPix, int rh); - -static void - -winCopyRotatePixmapNativeGDI(PixmapPtr psrcPix, PixmapPtr *ppdstPix, - int xrot, int yrot); -#endif - -/* See Porting Layer Definition - p. 34 */ -/* See mfb/mfbpixmap.c - mfbCreatePixmap() */ -PixmapPtr -winCreatePixmapNativeGDI(ScreenPtr pScreen, - int iWidth, int iHeight, - int iDepth, unsigned usage_hint) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - PixmapPtr pPixmap = NULL; - - /* Allocate pixmap memory */ - pPixmap = AllocatePixmap(pScreen, 0); - if (!pPixmap) { - ErrorF("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n"); - return NullPixmap; - } - -#if CYGDEBUG - winDebug("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n", - iWidth, iHeight, iDepth, usage_hint, - PixmapBytePad(iWidth, iDepth)); -#endif - - /* Setup pixmap values */ - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = iDepth; - pPixmap->drawable.bitsPerPixel = BitsPerPixel(iDepth); - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = iWidth; - pPixmap->drawable.height = iHeight; - pPixmap->devKind = 0; - pPixmap->refcnt = 1; - pPixmap->devPrivate.ptr = NULL; - pPixmap->usage_hint = usage_hint; - - /* Pixmap privates are allocated by AllocatePixmap */ - pPixmapPriv = winGetPixmapPriv(pPixmap); - - /* Initialize pixmap privates */ - pPixmapPriv->hBitmap = NULL; - pPixmapPriv->hdcSelected = NULL; - pPixmapPriv->pbBits = NULL; - pPixmapPriv->dwScanlineBytes = PixmapBytePad(iWidth, iDepth); - - /* Check for zero width or height pixmaps */ - if (iWidth == 0 || iHeight == 0) { - /* Don't allocate a real pixmap, just set fields and return */ - return pPixmap; - } - - /* Create a DIB for the pixmap */ - pPixmapPriv->hBitmap = winCreateDIBNativeGDI(iWidth, iHeight, iDepth, - &pPixmapPriv->pbBits, - (BITMAPINFO **) &pPixmapPriv-> - pbmih); - -#if CYGDEBUG - winDebug("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " - "screen: %08x\n", - pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen); -#endif - - return pPixmap; -} - -/* - * See Porting Layer Definition - p. 35 - * - * See mfb/mfbpixmap.c - mfbDestroyPixmap() - */ - -Bool -winDestroyPixmapNativeGDI(PixmapPtr pPixmap) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - -#if CYGDEBUG - winDebug("winDestroyPixmapNativeGDI ()\n"); -#endif - - /* Bail early if there is not a pixmap to destroy */ - if (pPixmap == NULL) { - ErrorF("winDestroyPixmapNativeGDI () - No pixmap to destroy\n"); - return TRUE; - } - - /* Get a handle to the pixmap privates */ - pPixmapPriv = winGetPixmapPriv(pPixmap); - -#if CYGDEBUG - winDebug("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n", - pPixmapPriv->hBitmap); -#endif - - /* Decrement reference count, return if nonzero */ - --pPixmap->refcnt; - if (pPixmap->refcnt != 0) - return TRUE; - - /* Free GDI bitmap */ - if (pPixmapPriv->hBitmap) - DeleteObject(pPixmapPriv->hBitmap); - - /* Free the bitmap info header memory */ - free(pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - - /* Free the pixmap memory */ - free(pPixmap); - pPixmap = NULL; - - return TRUE; -} - -/* - * Not used yet - */ - -Bool -winModifyPixmapHeaderNativeGDI(PixmapPtr pPixmap, - int iWidth, int iHeight, - int iDepth, - int iBitsPerPixel, int devKind, void *pPixData) -{ - FatalError("winModifyPixmapHeaderNativeGDI ()\n"); - return TRUE; -} - -#if 0 -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ - -static void -winXRotatePixmapNativeGDI(PixmapPtr pPix, int rw) -{ - ErrorF("winXRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} - -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ -static void -winYRotatePixmapNativeGDI(PixmapPtr pPix, int rh) -{ - ErrorF("winYRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} - -/* - * Not used yet. - * See cfb/cfbpixmap.c - */ - -static void -winCopyRotatePixmapNativeGDI(PixmapPtr psrcPix, PixmapPtr *ppdstPix, - int xrot, int yrot) -{ - ErrorF("winCopyRotatePixmap()\n"); - /* fill in this function, look at CFB */ -} -#endif diff --git a/xserver/hw/xwin/winpolyline.c b/xserver/hw/xwin/winpolyline.c deleted file mode 100644 index 8b7e10645..000000000 --- a/xserver/hw/xwin/winpolyline.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* See Porting Layer Definition - p. 50 */ -void -winPolyLineNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr ppt) -{ - switch (pGC->lineStyle) { - case LineSolid: - if (pGC->lineWidth == 0) - return miZeroLine(pDrawable, pGC, mode, npt, ppt); - else - miWideLine(pDrawable, pGC, mode, npt, ppt); - break; - case LineOnOffDash: - case LineDoubleDash: - miWideDash(pDrawable, pGC, mode, npt, ppt); - break; - } -} diff --git a/xserver/hw/xwin/winprefs.c b/xserver/hw/xwin/winprefs.c index f386facdd..505292714 100644 --- a/xserver/hw/xwin/winprefs.c +++ b/xserver/hw/xwin/winprefs.c @@ -44,6 +44,7 @@ #include #include "winprefs.h" +#include "windisplay.h" #include "winmultiwindowclass.h" /* Where will the custom menu commands start counting from? */ @@ -624,7 +625,7 @@ winIconIsOverride(HICON hicon) * If @path is NULL, use the built-in default. */ static int -winPrefsLoadPreferences(char *path) +winPrefsLoadPreferences(const char *path) { FILE *prefFile = NULL; @@ -712,15 +713,14 @@ LoadPreferences(void) /* Setup a DISPLAY environment variable, need to allocate on heap */ /* because putenv doesn't copy the argument... */ - snprintf(szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display); - szEnvDisplay = (char *) (malloc(strlen(szDisplay) + 1)); + winGetDisplayName(szDisplay, 0); + szEnvDisplay = (char *) (malloc(strlen(szDisplay) + strlen("DISPLAY=") + 1)); if (szEnvDisplay) { - strcpy(szEnvDisplay, szDisplay); + snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay); putenv(szEnvDisplay); } /* Replace any "%display%" in menu commands with display string */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); for (i = 0; i < pref.menuItems; i++) { for (j = 0; j < pref.menu[i].menuItems; j++) { if (pref.menu[i].menuItem[j].cmd == CMD_EXEC) { diff --git a/xserver/hw/xwin/winprefslex.l b/xserver/hw/xwin/winprefslex.l index fd13edc05..9e6f0d6d4 100644 --- a/xserver/hw/xwin/winprefslex.l +++ b/xserver/hw/xwin/winprefslex.l @@ -37,8 +37,6 @@ #include #include "winprefsyacc.h" -extern int yyparse(void); - extern void ErrorF (const char* /*f*/, ...); /* Copy the parsed string, must be free()d in yacc parser */ diff --git a/xserver/hw/xwin/winprefsyacc.y b/xserver/hw/xwin/winprefsyacc.y index 683fc44ca..9bb28ae92 100644 --- a/xserver/hw/xwin/winprefsyacc.y +++ b/xserver/hw/xwin/winprefsyacc.y @@ -64,7 +64,7 @@ static void SetDefaultSysMenu (char *menu, int pos); static void SetTrayIcon (char *fname); static void OpenMenu(char *menuname); -static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); +static void AddMenuLine(const char *name, MENUCOMMANDTYPE cmd, const char *param); static void CloseMenu(void); static void OpenIcons(void); @@ -79,9 +79,10 @@ static void OpenSysMenu(void); static void AddSysMenuLine(char *matchstr, char *menuname, int pos); static void CloseSysMenu(void); -static int yyerror (char *s); +static int yyerror (const char *s); extern char *yytext; +extern int yylineno; extern int yylex(void); %} @@ -252,10 +253,8 @@ debug: DEBUGOUTPUT STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($ * Errors in parsing abort and print log messages */ static int -yyerror (char *s) +yyerror (const char *s) { - extern int yylineno; /* Handled by flex internally */ - ErrorF("LoadPreferences: %s line %d\n", s, yylineno); return 1; } @@ -308,7 +307,7 @@ OpenMenu (char *menuname) } static void -AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) +AddMenuLine (const char *text, MENUCOMMANDTYPE cmd, const char *param) { if (menu.menuItem==NULL) menu.menuItem = malloc(sizeof(MENUITEM)); diff --git a/xserver/hw/xwin/winprocarg.c b/xserver/hw/xwin/winprocarg.c index f2bf05bad..837cdb2f4 100644 --- a/xserver/hw/xwin/winprocarg.c +++ b/xserver/hw/xwin/winprocarg.c @@ -31,19 +31,18 @@ from The Open Group. #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + #include <../xfree86/common/xorgVersion.h> #include "win.h" #include "winconfig.h" #include "winmsg.h" #include "winmonitors.h" -/* - * References to external symbols - */ - #ifdef XWIN_CLIPBOARD -extern Bool g_fUnicodeClipboard; -extern Bool g_fClipboard; +#include "winclipboard/winclipboard.h" #endif /* @@ -716,6 +715,26 @@ ddxProcessArgument(int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } + + /* + * Look for the '-primary' argument + */ + if (IS_OPTION("-primary")) { + fPrimarySelection = TRUE; + + /* Indicate that we have processed this argument */ + return 1; + } + + /* + * Look for the '-noprimary' argument + */ + if (IS_OPTION("-noprimary")) { + fPrimarySelection = FALSE; + + /* Indicate that we have processed this argument */ + return 1; + } #endif /* @@ -1166,6 +1185,16 @@ winLogVersionInfo(void) ErrorF("Vendor: %s\n", XVENDORNAME); ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); +#ifdef HAVE_SYS_UTSNAME_H + { + struct utsname name; + + if (uname(&name) >= 0) { + ErrorF("OS: %s %s %s %s %s\n", name.sysname, name.nodename, + name.release, name.version, name.machine); + } + } +#endif if (strlen(BUILDERSTRING)) ErrorF("%s\n", BUILDERSTRING); ErrorF("Contact: %s\n", BUILDERADDR); diff --git a/xserver/hw/xwin/winresource.h b/xserver/hw/xwin/winresource.h index afbf9f28d..37e92ce61 100644 --- a/xserver/hw/xwin/winresource.h +++ b/xserver/hw/xwin/winresource.h @@ -43,6 +43,7 @@ #define ID_APP_HIDE_ROOT 201 #define ID_APP_ALWAYS_ON_TOP 202 #define ID_APP_ABOUT 203 +#define ID_APP_MONITOR_PRIMARY 204 #define ID_ABOUT_WEBSITE 303 diff --git a/xserver/hw/xwin/winrop.c b/xserver/hw/xwin/winrop.c deleted file mode 100644 index 1f9ff7320..000000000 --- a/xserver/hw/xwin/winrop.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - *Copyright (C) 1994-2002 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: Alan Hourihane - */ - -/* - * Raster operations used by Windows translated to X's 16 rop codes... - */ -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -void - ROP16(HDC hdc, int rop); - -int g_copyROP[16] = { 0xFF0062, /* GXclear - 0 */ - 0x8800C6, /* GXand - S & D */ - 0x440328, /* GXandReverse - S & !D */ - 0xCC0020, /* GXcopy - S */ - 0x220326, /* GXandInverted - !S & D */ - 0xAA0029, /* GXnoop - D */ - 0x660046, /* GXxor - S ^ D */ - 0xEE0086, /* GXor - S | D */ - 0x1100A6, /* GXnor - !S & !D */ - 0x990126, /* GXequiv - !S ^ D */ - 0x550009, /* GXinvert - !D */ - 0xDD0228, /* GXorReverse - S | !D */ - 0x330008, /* GXcopyInverted - !S */ - 0xBB0226, /* GXorInverted - !S | D */ - 0x7700C6, /* GXnand - !S | !D */ - 0x000042 /* GXset - 1 */ -}; - -int g_patternROP[16] = { 0xFF0062, /* GXclear - 0 */ - 0xA000C9, /* GXand - P & D */ - 0xF50225, /* GXandReverse - P & !D */ - 0xF00021, /* GXcopy - P */ - 0x5F00E9, /* GXandInverted - !P & D */ - 0xAA0029, /* GXnoop - D */ - 0xA50065, /* GXxor - P ^ D */ - 0xA000C9, /* GXor - P | D */ - 0x5F00E9, /* GXnor - !P & !D */ - 0x5A0049, /* GXequiv - !P ^ D */ - 0x550009, /* GXinvert - !D */ - 0x500325, /* GXorReverse - P | !D */ - 0x0F0001, /* GXcopyInverted - !P */ - 0x0A0329, /* GXorInverted - !P | D */ - 0x0500A9, /* GXnand - !P | !D */ - 0x000042 /* GXset - 1 */ -}; - -void -ROP16(HDC hdc, int rop) -{ - switch (rop) { - case GXclear: - SetROP2(hdc, R2_BLACK); - break; - - case GXand: - SetROP2(hdc, R2_MASKPEN); - break; - - case GXandReverse: - SetROP2(hdc, R2_MASKPENNOT); - break; - - case GXcopy: - SetROP2(hdc, R2_COPYPEN); - break; - - case GXnoop: - SetROP2(hdc, R2_NOP); - break; - - case GXxor: - SetROP2(hdc, R2_XORPEN); - break; - - case GXor: - SetROP2(hdc, R2_MERGEPEN); - break; - - case GXnor: - SetROP2(hdc, R2_NOTMERGEPEN); - break; - - case GXequiv: - SetROP2(hdc, R2_NOTXORPEN); - break; - - case GXinvert: - SetROP2(hdc, R2_NOT); - break; - - case GXorReverse: - SetROP2(hdc, R2_MERGEPENNOT); - break; - - case GXcopyInverted: - SetROP2(hdc, R2_NOTCOPYPEN); - break; - - case GXorInverted: - SetROP2(hdc, R2_MERGENOTPEN); - break; - - case GXnand: - SetROP2(hdc, R2_NOTMASKPEN); - break; - - case GXset: - SetROP2(hdc, R2_WHITE); - break; - } -} diff --git a/xserver/hw/xwin/winscrinit.c b/xserver/hw/xwin/winscrinit.c index 23152cbd2..ce0aada31 100644 --- a/xserver/hw/xwin/winscrinit.c +++ b/xserver/hw/xwin/winscrinit.c @@ -185,7 +185,7 @@ winScreenInit(ScreenPtr pScreen, int argc, char **argv) /* Are we using multiple monitors? */ if (pScreenInfo->fMultipleMonitors) { - /* + /* * In this case, some of the defaults set in * winInitializeScreenDefaults() are not correct ... */ @@ -345,7 +345,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) pVisual->vid != pScreen->rootVisual; pVisual++); pScreenPriv->pRootVisual = pVisual; - /* + /* * Setup points to the block and wakeup handlers. Pass a pointer * to the current screen as pWakeupdata. */ @@ -570,145 +570,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) return TRUE; } -#ifdef XWIN_NATIVEGDI -/* See Porting Layer Definition - p. 20 */ - -Bool -winFinishScreenInitNativeGDI(int i, - ScreenPtr pScreen, int argc, char **argv) -{ - winScreenPriv(pScreen); - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[i]; - VisualPtr pVisuals = NULL; - DepthPtr pDepths = NULL; - VisualID rootVisual = 0; - int nVisuals = 0, nDepths = 0, nRootDepth = 0; - - /* Ignore user input (mouse, keyboard) */ - pScreenInfo->fIgnoreInput = FALSE; - - /* Get device contexts for the screen and shadow bitmap */ - pScreenPriv->hdcScreen = GetDC(pScreenPriv->hwndScreen); - if (pScreenPriv->hdcScreen == NULL) - FatalError("winFinishScreenInitNativeGDI - Couldn't get a DC\n"); - - /* Init visuals */ - if (!(*pScreenPriv->pwinInitVisuals) (pScreen)) { - ErrorF("winFinishScreenInitNativeGDI - pwinInitVisuals failed\n"); - return FALSE; - } - - /* Initialize the mi visuals */ - if (!miInitVisuals(&pVisuals, &pDepths, &nVisuals, &nDepths, &nRootDepth, - &rootVisual, - ((unsigned long) 1 << (pScreenInfo->dwDepth - 1)), 8, - TrueColor)) { - ErrorF("winFinishScreenInitNativeGDI - miInitVisuals () failed\n"); - return FALSE; - } - - /* Initialize the CloseScreen procedure pointer */ - pScreen->CloseScreen = NULL; - - /* Initialize the mi code */ - if (!miScreenInit(pScreen, NULL, /* No framebuffer */ - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - monitorResolution, monitorResolution, - pScreenInfo->dwStride, - nRootDepth, nDepths, pDepths, rootVisual, - nVisuals, pVisuals)) { - ErrorF("winFinishScreenInitNativeGDI - miScreenInit failed\n"); - return FALSE; - } - - pScreen->defColormap = FakeClientID(0); - - /* - * Register our block and wakeup handlers; these procedures - * process messages in our Windows message queue; specifically, - * they process mouse and keyboard input. - */ - pScreen->BlockHandler = winBlockHandler; - pScreen->WakeupHandler = winWakeupHandler; - - /* Place our save screen function */ - pScreen->SaveScreen = winSaveScreen; - - /* Pixmaps */ - pScreen->CreatePixmap = winCreatePixmapNativeGDI; - pScreen->DestroyPixmap = winDestroyPixmapNativeGDI; - - /* Other Screen Routines */ - pScreen->QueryBestSize = winQueryBestSizeNativeGDI; - pScreen->SaveScreen = winSaveScreen; - pScreen->GetImage = miGetImage; - pScreen->GetSpans = winGetSpansNativeGDI; - - /* Window Procedures */ - pScreen->CreateWindow = winCreateWindowNativeGDI; - pScreen->DestroyWindow = winDestroyWindowNativeGDI; - pScreen->PositionWindow = winPositionWindowNativeGDI; - /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI; */ - pScreen->RealizeWindow = winMapWindowNativeGDI; - pScreen->UnrealizeWindow = winUnmapWindowNativeGDI; - - /* Paint window */ - pScreen->CopyWindow = winCopyWindowNativeGDI; - - /* Fonts */ - pScreen->RealizeFont = winRealizeFontNativeGDI; - pScreen->UnrealizeFont = winUnrealizeFontNativeGDI; - - /* GC */ - pScreen->CreateGC = winCreateGCNativeGDI; - - /* Colormap Routines */ - pScreen->CreateColormap = miInitializeColormap; - pScreen->DestroyColormap = - (DestroyColormapProcPtr) (void (*)(void)) NoopDDA; - pScreen->InstallColormap = miInstallColormap; - pScreen->UninstallColormap = miUninstallColormap; - pScreen->ListInstalledColormaps = miListInstalledColormaps; - pScreen->StoreColors = (StoreColorsProcPtr) (void (*)(void)) NoopDDA; - pScreen->ResolveColor = miResolveColor; - - /* Bitmap */ - pScreen->BitmapToRegion = winPixmapToRegionNativeGDI; - - ErrorF("winFinishScreenInitNativeGDI - calling miDCInitialize\n"); - - /* Set the default white and black pixel positions */ - pScreen->whitePixel = pScreen->blackPixel = (Pixel) 0; - - /* Initialize the cursor */ - if (!miDCInitialize(pScreen, &g_winPointerCursorFuncs)) { - ErrorF("winFinishScreenInitNativeGDI - miDCInitialize failed\n"); - return FALSE; - } - - /* Create a default colormap */ - if (!miCreateDefColormap(pScreen)) { - ErrorF("winFinishScreenInitNativeGDI - miCreateDefColormap () " - "failed\n"); - return FALSE; - } - - ErrorF("winFinishScreenInitNativeGDI - miCreateDefColormap () " - "returned\n"); - - /* mi doesn't use a CloseScreen procedure, so no need to wrap */ - pScreen->CloseScreen = pScreenPriv->pwinCloseScreen; - - /* Tell the server that we are enabled */ - pScreenPriv->fEnabled = TRUE; - - ErrorF("winFinishScreenInitNativeGDI - Successful addition of " - "screen %p\n", pScreen); - - return TRUE; -} -#endif - /* See Porting Layer Definition - p. 33 */ static Bool winSaveScreen(ScreenPtr pScreen, int on) diff --git a/xserver/hw/xwin/winsetsp.c b/xserver/hw/xwin/winsetsp.c deleted file mode 100644 index 11108cb53..000000000 --- a/xserver/hw/xwin/winsetsp.c +++ /dev/null @@ -1,175 +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: Harold L Hunt II - * Alan Hourihane - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* See Porting Layer Definition - p. 55 */ -void -winSetSpansNativeGDI(DrawablePtr pDrawable, - GCPtr pGC, - char *pSrcs, - DDXPointPtr pPoints, - int *piWidths, int iSpans, int fSorted) -{ - winGCPriv(pGC); - PixmapPtr pPixmap = NULL; - winPrivPixmapPtr pPixmapPriv = NULL; - HBITMAP hbmpOrig = NULL; - BITMAPINFO *pbmi; - HRGN hrgn = NULL, combined = NULL; - int nbox; - BoxPtr pbox; - - nbox = RegionNumRects(pGC->pCompositeClip); - pbox = RegionRects(pGC->pCompositeClip); - - if (!nbox) - return; - - pbmi = malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD)); - - combined = CreateRectRgn(pbox->x1, pbox->y1, pbox->x2, pbox->y2); - nbox--; - pbox++; - while (nbox--) { - hrgn = CreateRectRgn(pbox->x1, pbox->y1, pbox->x2, pbox->y2); - CombineRgn(combined, combined, hrgn, RGN_OR); - DeleteObject(hrgn); - hrgn = NULL; - pbox++; - } - - /* Branch on the drawable type */ - switch (pDrawable->type) { - case DRAWABLE_PIXMAP: - - SelectClipRgn(pGCPriv->hdcMem, combined); - DeleteObject(combined); - combined = NULL; - - pPixmap = (PixmapPtr) pDrawable; - pPixmapPriv = winGetPixmapPriv(pPixmap); - - /* Select the drawable pixmap into a DC */ - hbmpOrig = SelectObject(pGCPriv->hdcMem, pPixmapPriv->hBitmap); - if (hbmpOrig == NULL) - FatalError("winSetSpans - DRAWABLE_PIXMAP - SelectObject () " - "failed on pPixmapPriv->hBitmap\n"); - - while (iSpans--) { - ZeroMemory(pbmi, sizeof(BITMAPINFO)); - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = *piWidths; - pbmi->bmiHeader.biHeight = 1; - pbmi->bmiHeader.biPlanes = 1; - pbmi->bmiHeader.biBitCount = pDrawable->depth; - pbmi->bmiHeader.biCompression = BI_RGB; - - /* Setup color table for mono DIBs */ - if (pDrawable->depth == 1) { - RGBQUAD *bmiColors = &(pbmi->bmiColors[0]); - bmiColors[1].rgbBlue = 255; - bmiColors[1].rgbGreen = 255; - bmiColors[1].rgbRed = 255; - } - - StretchDIBits(pGCPriv->hdcMem, - pPoints->x, pPoints->y, - *piWidths, 1, - 0, 0, - *piWidths, 1, - pSrcs, - (BITMAPINFO *) pbmi, - DIB_RGB_COLORS, g_copyROP[pGC->alu]); - - pSrcs += PixmapBytePad(*piWidths, pDrawable->depth); - pPoints++; - piWidths++; - } - - /* Reset the clip region */ - SelectClipRgn(pGCPriv->hdcMem, NULL); - - /* Push the drawable pixmap out of the GC HDC */ - SelectObject(pGCPriv->hdcMem, hbmpOrig); - break; - - case DRAWABLE_WINDOW: - - SelectClipRgn(pGCPriv->hdc, combined); - DeleteObject(combined); - combined = NULL; - - while (iSpans--) { - ZeroMemory(pbmi, sizeof(BITMAPINFO)); - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = *piWidths; - pbmi->bmiHeader.biHeight = 1; - pbmi->bmiHeader.biPlanes = 1; - pbmi->bmiHeader.biBitCount = pDrawable->depth; - pbmi->bmiHeader.biCompression = BI_RGB; - - /* Setup color table for mono DIBs */ - if (pDrawable->depth == 1) { - RGBQUAD *bmiColors = &(pbmi->bmiColors[0]); - bmiColors[1].rgbBlue = 255; - bmiColors[1].rgbGreen = 255; - bmiColors[1].rgbRed = 255; - } - - StretchDIBits(pGCPriv->hdc, - pPoints->x, pPoints->y, - *piWidths, 1, - 0, 0, - *piWidths, 1, - pSrcs, - (BITMAPINFO *) pbmi, - DIB_RGB_COLORS, g_copyROP[pGC->alu]); - - pSrcs += PixmapBytePad(*piWidths, pDrawable->depth); - pPoints++; - piWidths++; - } - - /* Reset the clip region */ - SelectClipRgn(pGCPriv->hdc, NULL); - break; - - default: - FatalError("\nwinSetSpansNativeGDI - Unknown drawable type\n\n"); - break; - } - - free(pbmi); -} diff --git a/xserver/hw/xwin/winshaddd.c b/xserver/hw/xwin/winshaddd.c index 5f3b658fb..4904eb440 100644 --- a/xserver/hw/xwin/winshaddd.c +++ b/xserver/hw/xwin/winshaddd.c @@ -173,7 +173,7 @@ winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen) /* * 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. */ @@ -518,7 +518,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) /* * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and + * handle large regions by creating a clipping region and * doing a single blit constrained to that clipping region. */ if (pScreenInfo->dwClipUpdatesNBoxes == 0 @@ -619,7 +619,7 @@ winInitScreenShadowDD(ScreenPtr pScreen) /* * Call the wrapped CloseScreen function. - * + * * Free our resources and private structures. */ @@ -683,7 +683,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen) /* * 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. diff --git a/xserver/hw/xwin/winshadddnl.c b/xserver/hw/xwin/winshadddnl.c index 55af5c383..48599b266 100644 --- a/xserver/hw/xwin/winshadddnl.c +++ b/xserver/hw/xwin/winshadddnl.c @@ -184,7 +184,7 @@ winReleasePrimarySurfaceShadowDDNL(ScreenPtr pScreen) /* * 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. */ @@ -216,7 +216,7 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen) } /* - * Initialize the framebuffer memory so we don't get a + * Initialize the framebuffer memory so we don't get a * strange display at startup */ ZeroMemory(lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); @@ -545,7 +545,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) /* * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and + * handle large regions by creating a clipping region and * doing a single blit constrained to that clipping region. */ if (pScreenInfo->dwClipUpdatesNBoxes == 0 @@ -986,6 +986,10 @@ winRedrawScreenShadowDDNL(ScreenPtr pScreen) RECT rcSrc, rcDest; POINT ptOrigin; + /* Return immediately if we didn't get needed surfaces */ + if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4) + return FALSE; + /* Get the origin of the window in the screen coords */ ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; diff --git a/xserver/hw/xwin/winshadgdi.c b/xserver/hw/xwin/winshadgdi.c index 5c815eb73..3d222ad4b 100644 --- a/xserver/hw/xwin/winshadgdi.c +++ b/xserver/hw/xwin/winshadgdi.c @@ -155,7 +155,7 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen) /* Color masks for 8 bpp are standardized */ if (GetDeviceCaps(pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE) { - /* + /* * RGB BPP for 8 bit palletes is always 8 * and the color masks are always 0. */ @@ -381,7 +381,7 @@ winAllocateFBShadowGDI(ScreenPtr pScreen) #if 0 return FALSE; #else - /* ago: ignore this error. The blit fails with wine, but does not + /* ago: ignore this error. The blit fails with wine, but does not * cause any problems later. */ fReturn = TRUE; @@ -474,7 +474,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) /* * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and + * handle large regions by creating a clipping region and * doing a single blit constrained to that clipping region. */ if (!pScreenInfo->fMultiWindow && @@ -634,7 +634,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen) /* * 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. @@ -815,7 +815,7 @@ winActivateAppShadowGDI(ScreenPtr pScreen) */ if (pScreenPriv->fActive && pScreenInfo->fFullScreen) { /* - * Activating, attempt to bring our window + * Activating, attempt to bring our window * to the top of the display */ ShowWindow(pScreenPriv->hwndScreen, SW_RESTORE); diff --git a/xserver/hw/xwin/wintrayicon.c b/xserver/hw/xwin/wintrayicon.c index e0aa7e5ab..6acc0d712 100644 --- a/xserver/hw/xwin/wintrayicon.c +++ b/xserver/hw/xwin/wintrayicon.c @@ -32,9 +32,13 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif + #include "win.h" #include #include "winprefs.h" +#ifdef XWIN_CLIPBOARD +#include "winclipboard/winclipboard.h" +#endif /* * Initialize the tray icon @@ -170,6 +174,21 @@ winHandleIconMessage(HWND hwnd, UINT message, RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND); } +#ifdef XWIN_CLIPBOARD + if (g_fClipboard) { + /* Set menu state to indicate if 'Monitor Primary' is enabled or not */ + MENUITEMINFO mii = { 0 }; + mii.cbSize = sizeof(MENUITEMINFO); + mii.fMask = MIIM_STATE; + mii.fState = fPrimarySelection ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo(hmenuTray, ID_APP_MONITOR_PRIMARY, FALSE, &mii); + } + else { + /* Remove 'Monitor Primary' menu item */ + RemoveMenu(hmenuTray, ID_APP_MONITOR_PRIMARY, MF_BYCOMMAND); + } +#endif + SetupRootMenu(hmenuTray); /* diff --git a/xserver/hw/xwin/winwin32rootlesswndproc.c b/xserver/hw/xwin/winwin32rootlesswndproc.c index 001d0d2fc..f65811c9a 100644 --- a/xserver/hw/xwin/winwin32rootlesswndproc.c +++ b/xserver/hw/xwin/winwin32rootlesswndproc.c @@ -147,7 +147,7 @@ ConstrainSize(WinXSizeHints hints, int *widthp, int *heightp) * * minAspectX * dheight > minAspectY * dwidth * maxAspectX * dheight < maxAspectY * dwidth - * + * */ if (hints.flags & PAspect) { diff --git a/xserver/hw/xwin/winwindow.c b/xserver/hw/xwin/winwindow.c index 8c1c28f2a..934f6d845 100644 --- a/xserver/hw/xwin/winwindow.c +++ b/xserver/hw/xwin/winwindow.c @@ -49,225 +49,6 @@ static void winReshapeRootless(WindowPtr pWin); -#ifdef XWIN_NATIVEGDI -/* See Porting Layer Definition - p. 37 */ -/* See mfb/mfbwindow.c - mfbCreateWindow() */ - -Bool -winCreateWindowNativeGDI(WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winCreateWindowNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(CreateWindow); - fResult = (*pScreen->CreateWindow) (pWin); - WIN_WRAP(CreateWindow, winCreateWindowNativeGDI); - - return fResult; -} - -/* See Porting Layer Definition - p. 37 */ -/* See mfb/mfbwindow.c - mfbDestroyWindow() */ - -Bool -winDestroyWindowNativeGDI(WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winDestroyWindowNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(DestroyWindow); - fResult = (*pScreen->DestroyWindow) (pWin); - WIN_WRAP(DestroyWindow, winDestroyWindowNativeGDI); - - return fResult; -} - -/* See Porting Layer Definition - p. 37 */ -/* See mfb/mfbwindow.c - mfbPositionWindow() */ - -Bool -winPositionWindowNativeGDI(WindowPtr pWin, int x, int y) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winPositionWindowNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(PositionWindow); - fResult = (*pScreen->PositionWindow) (pWin, x, y); - WIN_WRAP(PositionWindow, winPositionWindowNativeGDI); - - return fResult; -} - -/* See Porting Layer Definition - p. 39 */ -/* See mfb/mfbwindow.c - mfbCopyWindow() */ - -void -winCopyWindowNativeGDI(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - DDXPointPtr pptSrc; - DDXPointPtr ppt; - RegionPtr prgnDst; - BoxPtr pBox; - int dx, dy; - int i, nbox; - BoxPtr pBoxDst; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if 0 - ErrorF("winCopyWindow\n"); -#endif - - /* Create a region for the destination */ - prgnDst = RegionCreate(NULL, 1); - - /* Calculate the shift from the source to the destination */ - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - - /* Translate the region from the destination to the source? */ - RegionTranslate(prgnSrc, -dx, -dy); - RegionIntersect(prgnDst, &pWin->borderClip, prgnSrc); - - /* Get a pointer to the first box in the region to be copied */ - pBox = RegionRects(prgnDst); - - /* Get the number of boxes in the region */ - nbox = RegionNumRects(prgnDst); - - /* Allocate source points for each box */ - if (!(pptSrc = malloc(nbox * sizeof(DDXPointRec)))) - return; - - /* Set an iterator pointer */ - ppt = pptSrc; - - /* Calculate the source point of each box? */ - for (i = nbox; --i >= 0; ppt++, pBox++) { - ppt->x = pBox->x1 + dx; - ppt->y = pBox->y1 + dy; - } - - /* Setup loop pointers again */ - pBoxDst = RegionRects(prgnDst); - ppt = pptSrc; - -#if 0 - ErrorF("winCopyWindow - x1\tx2\ty1\ty2\tx\ty\n"); -#endif - - /* BitBlt each source to the destination point */ - for (i = nbox; --i >= 0; pBoxDst++, ppt++) { -#if 0 - ErrorF("winCopyWindow - %d\t%d\t%d\t%d\t%d\t%d\n", - pBoxDst->x1, pBoxDst->x2, pBoxDst->y1, pBoxDst->y2, - ppt->x, ppt->y); -#endif - - BitBlt(pScreenPriv->hdcScreen, - pBoxDst->x1, pBoxDst->y1, - pBoxDst->x2 - pBoxDst->x1, pBoxDst->y2 - pBoxDst->y1, - pScreenPriv->hdcScreen, ppt->x, ppt->y, SRCCOPY); - } - - /* Cleanup the regions, etc. */ - free(pptSrc); - RegionDestroy(prgnDst); -} - -/* See Porting Layer Definition - p. 37 */ -/* See mfb/mfbwindow.c - mfbChangeWindowAttributes() */ - -Bool -winChangeWindowAttributesNativeGDI(WindowPtr pWin, unsigned long mask) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winChangeWindowAttributesNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(ChangeWindowAttributes); - fResult = (*pScreen->ChangeWindowAttributes) (pWin, mask); - WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesNativeGDI); - - /* - * NOTE: We do not currently need to do anything here. - */ - - return fResult; -} - -/* See Porting Layer Definition - p. 37 - * Also referred to as UnrealizeWindow - */ - -Bool -winUnmapWindowNativeGDI(WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winUnmapWindowNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(UnrealizeWindow); - fResult = (*pScreen->UnrealizeWindow) (pWin); - WIN_WRAP(UnrealizeWindow, winUnmapWindowNativeGDI); - - return fResult; -} - -/* See Porting Layer Definition - p. 37 - * Also referred to as RealizeWindow - */ - -Bool -winMapWindowNativeGDI(WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - - winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace("winMapWindowNativeGDI (%p)\n", pWin); -#endif - - WIN_UNWRAP(RealizeWindow); - fResult = (*pScreen->RealizeWindow) (pWin); - WIN_WRAP(RealizeWindow, winMapWindowMultiWindow); - - return fResult; - -} -#endif - /* See Porting Layer Definition - p. 37 */ /* See mfb/mfbwindow.c - mfbCreateWindow() */ diff --git a/xserver/hw/xwin/winwindowswm.c b/xserver/hw/xwin/winwindowswm.c index 2805ff7ce..db41d6b60 100644 --- a/xserver/hw/xwin/winwindowswm.c +++ b/xserver/hw/xwin/winwindowswm.c @@ -284,7 +284,7 @@ ProcWindowsWMReenableUpdate(ClientPtr client) { REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq); - //winEnableUpdate(); + //winEnableUpdate(); return Success; } diff --git a/xserver/hw/xwin/winwndproc.c b/xserver/hw/xwin/winwndproc.c index bee223de7..1bf3f5cde 100644 --- a/xserver/hw/xwin/winwndproc.c +++ b/xserver/hw/xwin/winwndproc.c @@ -42,6 +42,9 @@ #include "winmsg.h" #include "winmonitors.h" #include "inputstr.h" +#ifdef XWIN_CLIPBOARD +#include "winclipboard/winclipboard.h" +#endif /* * Global variables @@ -160,11 +163,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) */ if (s_pScreenInfo->fFullScreen && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD - || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL -#ifdef XWIN_PRIMARYFB - || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD -#endif - )) { + || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { break; } @@ -188,11 +187,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 -#ifdef XWIN_PRIMARYFB - || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD -#endif - )) { + s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) { /* Cannot display the visual until the depth is restored */ ErrorF("winWindowProc - Disruptive change in depth\n"); @@ -408,7 +403,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetScrollInfo(hwnd, SB_VERT, &si, TRUE); /* - * NOTE: Scrollbars may have moved if they were at the + * NOTE: Scrollbars may have moved if they were at the * far right/bottom, so we query their current position. */ @@ -626,7 +621,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int iBorderHeight, iBorderWidth; #if CYGDEBUG - winDebug("winWindowProc - WM_GETMINMAXINFO - pScreenInfo: %08x\n", + winDebug("winWindowProc - WM_GETMINMAXINFO - pScreenInfo: %p\n", s_pScreenInfo); #endif @@ -1058,12 +1053,12 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (winIsFakeCtrl_L(message, wParam, lParam)) return 0; - /* + /* * Discard presses generated from Windows auto-repeat */ if (lParam & (1 << 30)) { switch (wParam) { - /* ago: Pressing LControl while RControl is pressed is + /* ago: Pressing LControl while RControl is pressed is * Indicated as repeat. Fix this! */ case VK_CONTROL: @@ -1223,6 +1218,12 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; #endif +#ifdef XWIN_CLIPBOARD + case ID_APP_MONITOR_PRIMARY: + fPrimarySelection = !fPrimarySelection; + return 0; +#endif + case ID_APP_ABOUT: /* Display the About box */ winDisplayAboutDialog(s_pScreenPriv); diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in index 5f5e9c02b..9419d225e 100644 --- a/xserver/include/Makefile.in +++ b/xserver/include/Makefile.in @@ -242,6 +242,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/include/callback.h b/xserver/include/callback.h index df638c0d4..fe7015ee7 100644 --- a/xserver/include/callback.h +++ b/xserver/include/callback.h @@ -64,16 +64,16 @@ typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *); -extern _X_EXPORT Bool AddCallback(CallbackListPtr * /*pcbl */ , - CallbackProcPtr /*callback */ , - void */*data */ ); +extern _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl, + CallbackProcPtr callback, + void *data); -extern _X_EXPORT Bool DeleteCallback(CallbackListPtr * /*pcbl */ , - CallbackProcPtr /*callback */ , - void */*data */ ); +extern _X_EXPORT Bool DeleteCallback(CallbackListPtr *pcbl, + CallbackProcPtr callback, + void *data); -extern _X_EXPORT void _CallCallbacks(CallbackListPtr * /*pcbl */ , - void */*call_data */ ); +extern _X_EXPORT void _CallCallbacks(CallbackListPtr *pcbl, + void *call_data); static inline void CallCallbacks(CallbackListPtr *pcbl, void *call_data) @@ -83,7 +83,7 @@ CallCallbacks(CallbackListPtr *pcbl, void *call_data) _CallCallbacks(pcbl, call_data); } -extern _X_EXPORT void DeleteCallbackList(CallbackListPtr * /*pcbl */ ); +extern _X_EXPORT void DeleteCallbackList(CallbackListPtr *pcbl); extern _X_EXPORT void InitCallbackManager(void); extern _X_EXPORT void DeleteCallbackManager(void); diff --git a/xserver/include/closure.h b/xserver/include/closure.h index 0a7dae6ae..0d941dfe9 100644 --- a/xserver/include/closure.h +++ b/xserver/include/closure.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/colormap.h b/xserver/include/colormap.h index 22229ca84..5f6b97fec 100644 --- a/xserver/include/colormap.h +++ b/xserver/include/colormap.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -82,14 +82,14 @@ extern _X_EXPORT int CreateColormap(Colormap /*mid */ , int /*alloc */ , int /*client */ ); -extern _X_EXPORT int FreeColormap(void */*pmap */ , - XID /*mid */ ); +extern _X_EXPORT int FreeColormap(void *pmap, + XID mid); -extern _X_EXPORT int TellLostMap(WindowPtr /*pwin */ , - void */* Colormap *pmid */ ); +extern _X_EXPORT int TellLostMap(WindowPtr pwin, + void *value); -extern _X_EXPORT int TellGainedMap(WindowPtr /*pwin */ , - void */* Colormap *pmid */ ); +extern _X_EXPORT int TellGainedMap(WindowPtr pwin, + void *value); extern _X_EXPORT int CopyColormapAndFree(Colormap /*mid */ , ColormapPtr /*pSrc */ , @@ -126,8 +126,8 @@ extern _X_EXPORT int QueryColors(ColormapPtr /*pmap */ , xrgb * /*prgbList */ , ClientPtr client); -extern _X_EXPORT int FreeClientPixels(void */*pcr */ , - XID /*fakeid */ ); +extern _X_EXPORT int FreeClientPixels(void *pcr, + XID fakeid); extern _X_EXPORT int AllocColorCells(int /*client */ , ColormapPtr /*pmap */ , diff --git a/xserver/include/colormapst.h b/xserver/include/colormapst.h index ac0c62e70..53b61cb22 100644 --- a/xserver/include/colormapst.h +++ b/xserver/include/colormapst.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/cursor.h b/xserver/include/cursor.h index 9da08affd..281d88ba0 100644 --- a/xserver/include/cursor.h +++ b/xserver/include/cursor.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -68,8 +68,8 @@ extern _X_EXPORT DevScreenPrivateKeyRec cursorScreenDevPriv; extern _X_EXPORT CursorPtr rootCursor; -extern _X_EXPORT int FreeCursor(void */*pCurs */ , - XID /*cid */ ); +extern _X_EXPORT int FreeCursor(void *pCurs, + XID cid); extern _X_EXPORT CursorPtr RefCursor(CursorPtr /* cursor */); extern _X_EXPORT CursorPtr UnrefCursor(CursorPtr /* cursor */); diff --git a/xserver/include/cursorstr.h b/xserver/include/cursorstr.h index 2157954c9..221cd7034 100644 --- a/xserver/include/cursorstr.h +++ b/xserver/include/cursorstr.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -49,7 +49,7 @@ SOFTWARE. #include "cursor.h" #include "privates.h" -/* +/* * device-independent cursor storage */ diff --git a/xserver/include/dbus-core.h b/xserver/include/dbus-core.h index b2d6d1b9e..d6260dc66 100644 --- a/xserver/include/dbus-core.h +++ b/xserver/include/dbus-core.h @@ -27,7 +27,7 @@ #define DBUS_CORE_H #ifdef NEED_DBUS -typedef struct DBusConnection DBusConnection; +#include typedef void (*dbus_core_connect_hook) (DBusConnection * connection, void *data); diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index 7a5c9ed25..bf7b76bd0 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -57,9 +57,6 @@ /* Support SHM */ #undef HAS_SHM -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_MTRR_H - /* Has backtrace support */ #undef HAVE_BACKTRACE @@ -75,6 +72,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DBM_H +/* Define to 1 if you have the declaration of `program_invocation_short_name', and + to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -103,6 +104,9 @@ /* Define to 1 if you have the `getpeerucred' function. */ #undef HAVE_GETPEERUCRED +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + /* Define to 1 if you have the `getzoneid' function. */ #undef HAVE_GETZONEID @@ -384,9 +388,15 @@ /* Vendor name */ #undef XVENDORNAME +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + /* Enable GNU and other extensions to the C environment for GLIBC */ #undef _GNU_SOURCE +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -508,4 +518,16 @@ /* Build glamor's GBM-based EGL support */ #undef GLAMOR_HAS_GBM +/* byte order */ +#undef X_BYTE_ORDER + +/* Listen on TCP socket */ +#undef LISTEN_TCP + +/* Listen on Unix socket */ +#undef LISTEN_UNIX + +/* Listen on local socket */ +#undef LISTEN_LOCAL + #endif /* _DIX_CONFIG_H_ */ diff --git a/xserver/include/dix.h b/xserver/include/dix.h index c5c86b6b8..921156b4c 100644 --- a/xserver/include/dix.h +++ b/xserver/include/dix.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -152,14 +152,14 @@ extern _X_EXPORT void UpdateCurrentTime(void); extern _X_EXPORT void UpdateCurrentTimeIf(void); -extern _X_EXPORT int dixDestroyPixmap(void */*value */ , - XID /*pid */ ); +extern _X_EXPORT int dixDestroyPixmap(void *value, + XID pid); -extern _X_EXPORT void InitClient(ClientPtr /*client */ , - int /*i */ , - void */*ospriv */ ); +extern _X_EXPORT void InitClient(ClientPtr client, + int i, + void *ospriv); -extern _X_EXPORT ClientPtr NextAvailableClient(void */*ospriv */ ); +extern _X_EXPORT ClientPtr NextAvailableClient(void *ospriv); extern _X_EXPORT void SendErrorToClient(ClientPtr /*client */ , unsigned int /*majorCode */ , @@ -208,11 +208,11 @@ extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ , extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ ); -extern _X_EXPORT void BlockHandler(void */*pTimeout */ , - void */*pReadmask */ ); +extern _X_EXPORT void BlockHandler(void *pTimeout, + void *pReadmask); -extern _X_EXPORT void WakeupHandler(int /*result */ , - void */*pReadmask */ ); +extern _X_EXPORT void WakeupHandler(int result, + void *pReadmask); void EnableLimitedSchedulingLatency(void); @@ -220,21 +220,17 @@ void void DisableLimitedSchedulingLatency(void); -typedef void (*WakeupHandlerProcPtr) (void */* blockData */ , - int /* result */ , - void */* pReadmask */ ); +typedef void (*WakeupHandlerProcPtr) (void *blockData, + int result, + void *pReadmask); -extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr - /*blockHandler */ , - WakeupHandlerProcPtr - /*wakeupHandler */ , - void */*blockData */ ); +extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, + WakeupHandlerProcPtr wakeupHandler, + void *blockData); -extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr - /*blockHandler */ , - WakeupHandlerProcPtr - /*wakeupHandler */ , - void */*blockData */ ); +extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, + WakeupHandlerProcPtr wakeupHandler, + void *blockData); extern _X_EXPORT void InitBlockAndWakeupHandlers(void); @@ -242,22 +238,17 @@ extern _X_EXPORT void ProcessWorkQueue(void); extern _X_EXPORT void ProcessWorkQueueZombies(void); -extern _X_EXPORT Bool QueueWorkProc(Bool (* /*function */ )( - ClientPtr - /*clientUnused */ - , - void * - /*closure */ ), - ClientPtr /*client */ , - void */*closure */ - ); +extern _X_EXPORT Bool QueueWorkProc(Bool (*function)(ClientPtr clientUnused, + void *closure), + ClientPtr client, + void *closure); -typedef Bool (*ClientSleepProcPtr) (ClientPtr /*client */ , - void */*closure */ ); +typedef Bool (*ClientSleepProcPtr) (ClientPtr client, + void *closure); -extern _X_EXPORT Bool ClientSleep(ClientPtr /*client */ , - ClientSleepProcPtr /* function */ , - void */*closure */ ); +extern _X_EXPORT Bool ClientSleep(ClientPtr client, + ClientSleepProcPtr function, + void *closure); #ifndef ___CLIENTSIGNAL_DEFINED___ #define ___CLIENTSIGNAL_DEFINED___ @@ -268,6 +259,12 @@ extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ ); extern _X_EXPORT Bool ClientIsAsleep(ClientPtr /*client */ ); +extern _X_EXPORT void SendGraphicsExpose(ClientPtr /*client */ , + RegionPtr /*pRgn */ , + XID /*drawable */ , + int /*major */ , + int /*minor */); + /* atom.c */ extern _X_EXPORT Atom MakeAtom(const char * /*string */ , @@ -449,8 +446,8 @@ extern void RecalculateDeliverableEvents(WindowPtr /* pWin */ ); extern _X_EXPORT int -OtherClientGone(void */* value */ , - XID /* id */ ); +OtherClientGone(void *value, + XID id); extern void DoFocusEvents(DeviceIntPtr /* dev */ , diff --git a/xserver/include/dixfont.h b/xserver/include/dixfont.h index 40d80c141..48c630539 100644 --- a/xserver/include/dixfont.h +++ b/xserver/include/dixfont.h @@ -40,9 +40,9 @@ 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 void FontWakeup(void *data, + int count, + void *LastSelectMask); extern _X_EXPORT int OpenFont(ClientPtr /*client */ , XID /*fid */ , @@ -50,8 +50,8 @@ extern _X_EXPORT int OpenFont(ClientPtr /*client */ , unsigned /*lenfname */ , const char * /*pfontname */ ); -extern _X_EXPORT int CloseFont(void */*pfont */ , - XID /*fid */ ); +extern _X_EXPORT int CloseFont(void *pfont, + XID fid); typedef struct _xQueryFontReply *xQueryFontReplyPtr; diff --git a/xserver/include/dixgrabs.h b/xserver/include/dixgrabs.h index d78d8127b..3bd80132b 100644 --- a/xserver/include/dixgrabs.h +++ b/xserver/include/dixgrabs.h @@ -47,8 +47,8 @@ extern GrabPtr CreateGrab(int /* client */ , WindowPtr /* confineTo */ , CursorPtr /* cursor */ ); -extern _X_EXPORT int DeletePassiveGrab(void */* value */ , - XID /* id */ ); +extern _X_EXPORT int DeletePassiveGrab(void *value, + XID id); extern _X_EXPORT Bool GrabMatchesSecond(GrabPtr /* pFirstGrab */ , GrabPtr /* pSecondGrab */ , diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index 489011429..e41e94666 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -129,21 +129,12 @@ /* Cygwin has /dev/windows for signaling new win32 messages */ #undef HAS_DEVWINDOWS -/* Define to 1 if NetBSD built-in MTRR support is available */ -#undef HAS_MTRR_BUILTIN - -/* MTRR support available */ -#undef HAS_MTRR_SUPPORT - /* Support SHM */ #undef HAS_SHM /* Use Windows sockets */ #undef HAS_WINSOCK -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_MTRR_H - /* Define to 1 if you have the `authdes_create' function. */ #undef HAVE_AUTHDES_CREATE @@ -168,6 +159,10 @@ /* Have D-Bus support */ #undef HAVE_DBUS +/* Define to 1 if you have the declaration of `program_invocation_short_name', + and to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -202,6 +197,9 @@ /* Define to 1 if you have the `getpeerucred' function. */ #undef HAVE_GETPEERUCRED +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + /* Define to 1 if you have the `getresuid' function. */ #undef HAVE_GETRESUID @@ -229,6 +227,9 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM +/* Define to 1 if libudev is available. */ +#undef HAVE_LIBUDEV + /* Have libunwind support */ #undef HAVE_LIBUNWIND @@ -244,9 +245,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_MTRR_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -350,9 +348,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LINKER_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MEMRANGE_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MKDEV_H @@ -394,7 +389,7 @@ /* Define to 1 if you have the `walkcontext' function. */ #undef HAVE_WALKCONTEXT -/* Have X Shared Memory Fence library */ +/* Have xshmfence support */ #undef HAVE_XSHMFENCE /* Support IPv6 for TCP connections */ @@ -545,7 +540,7 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Where to install Xorg.bin and Xorg.wrap */ +/* Where to install the Xorg binary and Xorg.wrap */ #undef SUID_WRAPPER_DIR /* Define to 1 on systems derived from System V Release 4 */ @@ -739,9 +734,6 @@ /* Support Record extension */ #undef XRECORD -/* Build registry module */ -#undef XREGISTRY - /* Build SELinux extension */ #undef XSELINUX @@ -772,6 +764,9 @@ /* Short vendor name */ #undef XVENDORNAMESHORT +/* byte order */ +#undef X_BYTE_ORDER + /* Use X server privilege separation */ #undef X_PRIVSEP diff --git a/xserver/include/extension.h b/xserver/include/extension.h index 7c09af150..a4c09dee1 100644 --- a/xserver/include/extension.h +++ b/xserver/include/extension.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/extnsionst.h b/xserver/include/extnsionst.h index fbdb73c53..636f0a891 100644 --- a/xserver/include/extnsionst.h +++ b/xserver/include/extnsionst.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -72,7 +72,7 @@ typedef struct _ExtensionEntry { PrivateRec *devPrivates; } ExtensionEntry; -/* +/* * The arguments may be different for extension event swapping functions. * Deal with this by casting when initializing the event's EventSwapVector[] * entries. diff --git a/xserver/include/gc.h b/xserver/include/gc.h index ecaa257bb..53f9c29e1 100644 --- a/xserver/include/gc.h +++ b/xserver/include/gc.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -112,8 +112,8 @@ extern _X_EXPORT int CopyGC(GCPtr /*pgcSrc */ , GCPtr /*pgcDst */ , BITS32 /*mask */ ); -extern _X_EXPORT int FreeGC(void */*pGC */ , - XID /*gid */ ); +extern _X_EXPORT int FreeGC(void *pGC, + XID gid); extern _X_EXPORT void FreeGCperDepth(int /*screenNum */ ); diff --git a/xserver/include/gcstruct.h b/xserver/include/gcstruct.h index c830ccde7..e48d61045 100644 --- a/xserver/include/gcstruct.h +++ b/xserver/include/gcstruct.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -76,10 +76,10 @@ typedef struct _GCFuncs { void (*DestroyGC) (GCPtr /*pGC */ ); - void (*ChangeClip) (GCPtr /*pGC */ , - int /*type */ , - void */*pvalue */ , - int /*nrects */ ); + void (*ChangeClip) (GCPtr pGC, + int type, + void *pvalue, + int nrects); void (*DestroyClip) (GCPtr /*pGC */ ); @@ -210,21 +210,21 @@ typedef struct _GCOps { int /*count */ , unsigned short * /*chars */ ); - void (*ImageGlyphBlt) (DrawablePtr /*pDrawable */ , - GCPtr /*pGC */ , - int /*x */ , - int /*y */ , - unsigned int /*nglyph */ , - CharInfoPtr * /*ppci */ , - void */*pglyphBase */ ); + void (*ImageGlyphBlt) (DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, + void *pglyphBase); - void (*PolyGlyphBlt) (DrawablePtr /*pDrawable */ , - GCPtr /*pGC */ , - int /*x */ , - int /*y */ , - unsigned int /*nglyph */ , - CharInfoPtr * /*ppci */ , - void */*pglyphBase */ ); + void (*PolyGlyphBlt) (DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, + void *pglyphBase); void (*PushPixels) (GCPtr /*pGC */ , PixmapPtr /*pBitMap */ , @@ -254,16 +254,15 @@ typedef struct _GC { unsigned int arcMode:1; unsigned int subWindowMode:1; unsigned int graphicsExposures:1; - unsigned int clientClipType:2; /* CT_ */ unsigned int miTranslate:1; /* should mi things translate? */ unsigned int tileIsPixel:1; /* tile is solid pixel */ unsigned int fExpose:1; /* Call exposure handling */ unsigned int freeCompClip:1; /* Free composite clip */ unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */ - unsigned int unused:13; /* see comment above */ - unsigned long planemask; - unsigned long fgPixel; - unsigned long bgPixel; + unsigned int unused:15; /* see comment above */ + unsigned int planemask; + unsigned int fgPixel; + unsigned int bgPixel; /* * alas -- both tile and stipple must be here as they * are independently specifiable @@ -271,11 +270,11 @@ typedef struct _GC { PixUnion tile; PixmapPtr stipple; DDXPointRec patOrg; /* origin for (tile, stipple) */ - struct _Font *font; DDXPointRec clipOrg; - void *clientClip; - unsigned long stateChanges; /* masked with GC_ */ - unsigned long serialNumber; + struct _Font *font; + RegionPtr clientClip; + unsigned int stateChanges; /* masked with GC_ */ + unsigned int serialNumber; const GCFuncs *funcs; const GCOps *ops; PrivateRec *devPrivates; diff --git a/xserver/include/hotplug.h b/xserver/include/hotplug.h index 4c2fa970c..6fe76c806 100644 --- a/xserver/include/hotplug.h +++ b/xserver/include/hotplug.h @@ -32,64 +32,41 @@ extern _X_EXPORT void config_pre_init(void); extern _X_EXPORT void config_init(void); extern _X_EXPORT void config_fini(void); -enum { ODEV_ATTRIB_UNKNOWN = -1, ODEV_ATTRIB_STRING = 0, ODEV_ATTRIB_INT }; - -struct OdevAttribute { - struct xorg_list member; - int attrib_id; - union { - char *attrib_name; - int attrib_value; - }; - int attrib_type; -}; +/* Bump this each time you add something to the struct + * so that drivers can easily tell what is available + */ +#define ODEV_ATTRIBUTES_VERSION 1 struct OdevAttributes { - struct xorg_list list; + /* path to kernel device node - Linux e.g. /dev/dri/card0 */ + char *path; + + /* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */ + char *syspath; + + /* DRI-style bus id */ + char *busid; + + /* Server managed FD */ + int fd; + + /* Major number of the device node pointed to by ODEV_ATTRIB_PATH */ + int major; + + /* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ + int minor; + + /* kernel driver name */ + char *driver; }; /* Note starting with xserver 1.16 this function never fails */ struct OdevAttributes * -config_odev_allocate_attribute_list(void); - -void -config_odev_free_attribute_list(struct OdevAttributes *attribs); - -/* Note starting with xserver 1.16 this function never fails */ -Bool -config_odev_add_attribute(struct OdevAttributes *attribs, int attrib, - const char *attrib_name); - -char * -config_odev_get_attribute(struct OdevAttributes *attribs, int attrib_id); - -/* Note starting with xserver 1.16 this function never fails */ -Bool -config_odev_add_int_attribute(struct OdevAttributes *attribs, int attrib, - int attrib_value); - -int -config_odev_get_int_attribute(struct OdevAttributes *attribs, int attrib, - int def); +config_odev_allocate_attributes(void); void config_odev_free_attributes(struct OdevAttributes *attribs); -/* path to kernel device node - Linux e.g. /dev/dri/card0 */ -#define ODEV_ATTRIB_PATH 1 -/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */ -#define ODEV_ATTRIB_SYSPATH 2 -/* DRI-style bus id */ -#define ODEV_ATTRIB_BUSID 3 -/* Server managed FD */ -#define ODEV_ATTRIB_FD 4 -/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */ -#define ODEV_ATTRIB_MAJOR 5 -/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ -#define ODEV_ATTRIB_MINOR 6 -/* kernel driver name */ -#define ODEV_ATTRIB_DRIVER 7 - typedef void (*config_odev_probe_proc_ptr)(struct OdevAttributes *attribs); void config_odev_probe(config_odev_probe_proc_ptr probe_callback); diff --git a/xserver/include/input.h b/xserver/include/input.h index cbf949b53..7212cc176 100644 --- a/xserver/include/input.h +++ b/xserver/include/input.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -287,9 +287,6 @@ extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ , extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ , KeyCode * /*maxCode */ ); -extern _X_EXPORT Bool SetKeySymsMap(KeySymsPtr /*dst */ , - KeySymsPtr /*src */ ); - extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ , int /*numButtons */ , Atom * /* labels */ , @@ -314,10 +311,10 @@ extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ , unsigned int /*mode */ , unsigned int /*numAxes */ ); -typedef void (*BellProcPtr) (int /*percent */ , - DeviceIntPtr /*device */ , - void */*ctrl */ , - int); +typedef void (*BellProcPtr) (int percent, + DeviceIntPtr device, + void *ctrl, + int feedbackClass); typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ , KeybdCtrl * /*ctrl */ ); @@ -508,7 +505,7 @@ extern int AttachDevice(ClientPtr client, DeviceIntPtr slave, DeviceIntPtr master); extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd); -extern DeviceIntPtr GetMaster(DeviceIntPtr dev, int type); +extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type); extern _X_EXPORT int AllocDevicePair(ClientPtr client, const char *name, diff --git a/xserver/include/inputstr.h b/xserver/include/inputstr.h index f6cfb049d..568f5f991 100644 --- a/xserver/include/inputstr.h +++ b/xserver/include/inputstr.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -159,7 +159,7 @@ typedef struct _OtherInputMasks { */ #define MasksPerDetailMask 8 /* 256 keycodes and 256 possible - modifier combinations, but only + modifier combinations, but only 3 buttons. */ typedef struct _DetailRec { /* Grab details may be bit masks */ @@ -174,9 +174,9 @@ union _GrabMask { }; /** - * Central struct for device grabs. + * Central struct for device grabs. * The same struct is used for both core grabs and device grabs, with - * different fields being set. + * different fields being set. * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask * is a combination of standard event masks (i.e. PointerMotionMask | * ButtonPressMask). diff --git a/xserver/include/list.h b/xserver/include/list.h index 455c670d3..39f198590 100644 --- a/xserver/include/list.h +++ b/xserver/include/list.h @@ -117,7 +117,7 @@ struct xorg_list { * Example: * xorg_list_init(&bar->list_of_foos); * - * @param The list to initialized. + * @param list The list to initialize */ static inline void xorg_list_init(struct xorg_list *list) diff --git a/xserver/include/misc.h b/xserver/include/misc.h index 9c2f573b9..9b1c03a67 100644 --- a/xserver/include/misc.h +++ b/xserver/include/misc.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -43,7 +43,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright 1992, 1993 Data General Corporation; -Copyright 1992, 1993 OMRON Corporation +Copyright 1992, 1993 OMRON Corporation Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the @@ -51,9 +51,9 @@ above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that neither the name OMRON or DATA GENERAL be used in advertising or publicity pertaining to distribution of the software without specific, written prior -permission of the party whose name is to be used. Neither OMRON or +permission of the party whose name is to be used. Neither OMRON or DATA GENERAL make any representation about the suitability of this software -for any purpose. It is provided "as is" without express or implied warranty. +for any purpose. It is provided "as is" without express or implied warranty. OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, @@ -67,7 +67,7 @@ OF THIS SOFTWARE. #ifndef MISC_H #define MISC_H 1 /* - * X internal definitions + * X internal definitions * */ @@ -138,7 +138,7 @@ lswapl(uint32_t x) static inline uint16_t lswaps(uint16_t x) { - return ((x & 0xff) << 8) | ((x >> 8) & 0xff); + return (uint16_t)((x & 0xff) << 8) | ((x >> 8) & 0xff); } #undef min diff --git a/xserver/include/miscstruct.h b/xserver/include/miscstruct.h index dbab10f08..589a6cbaa 100644 --- a/xserver/include/miscstruct.h +++ b/xserver/include/miscstruct.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/os.h b/xserver/include/os.h index 7bae5b67f..a910c6558 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -67,15 +67,11 @@ SOFTWARE. typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; -#ifndef xalloc +#ifndef xnfalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size)) -#define xalloc(size) Xalloc((unsigned long)(size)) -#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size)) -#define xrealloc(ptr, size) Xrealloc((void *)(ptr), (unsigned long)(size)) -#define xfree(ptr) Xfree((void *)(ptr)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif @@ -139,8 +135,8 @@ extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , unsigned int /*string_n */ , char * /*auth_string */ ); -extern _X_EXPORT Bool EstablishNewConnections(ClientPtr /*clientUnused */ , - void */*closure */ ); +extern _X_EXPORT Bool EstablishNewConnections(ClientPtr clientUnused, + void *closure); extern _X_EXPORT void CheckConnections(void); @@ -173,14 +169,14 @@ extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ ); extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); -extern _X_EXPORT void AdjustWaitForDelay(void */*waitTime */ , - unsigned long /*newdelay */ ); +extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, + unsigned long newdelay); typedef struct _OsTimerRec *OsTimerPtr; -typedef CARD32 (*OsTimerCallback) (OsTimerPtr /* timer */ , - CARD32 /* time */ , - void */* arg */ ); +typedef CARD32 (*OsTimerCallback) (OsTimerPtr timer, + CARD32 time, + void *arg); extern _X_EXPORT void TimerInit(void); @@ -189,11 +185,11 @@ extern _X_EXPORT Bool TimerForce(OsTimerPtr /* timer */ ); #define TimerAbsolute (1<<0) #define TimerForceOld (1<<1) -extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr /* timer */ , - int /* flags */ , - CARD32 /* millis */ , - OsTimerCallback /* func */ , - void */* arg */ ); +extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr timer, + int flags, + CARD32 millis, + OsTimerCallback func, + void *arg); extern _X_EXPORT void TimerCheck(void); extern _X_EXPORT void TimerCancel(OsTimerPtr /* pTimer */ ); @@ -210,40 +206,9 @@ extern _X_EXPORT void UseMsg(void); extern _X_EXPORT void ProcessCommandLine(int /*argc */ , char * /*argv */ []); -extern _X_EXPORT int set_font_authorizations(char ** /* authorizations */ , - int * /*authlen */ , - void */* client */ ); - -#ifndef _HAVE_XALLOC_DECLS -#define _HAVE_XALLOC_DECLS - -/* - * Use malloc(3) instead. - */ -extern _X_EXPORT void * -Xalloc(unsigned long /*amount */ ) _X_DEPRECATED; - -/* - * Use calloc(3) instead - */ -extern _X_EXPORT void * -Xcalloc(unsigned long /*amount */ ) _X_DEPRECATED; - -/* - * Use realloc(3) instead - */ -extern _X_EXPORT void * -Xrealloc(void * /*ptr */ , unsigned long /*amount */ ) - _X_DEPRECATED; - -/* - * Use free(3) instead - */ -extern _X_EXPORT void -Xfree(void * /*ptr */ ) - _X_DEPRECATED; - -#endif +extern _X_EXPORT int set_font_authorizations(char **authorizations, + int *authlen, + void *client); /* * This function malloc(3)s buffer, terminating the server if there is not @@ -398,18 +363,18 @@ AddHost(ClientPtr /*client */ , const void * /*pAddr */ ); extern _X_EXPORT Bool -ForEachHostInFamily(int /*family */ , - Bool (* /*func */ )( - unsigned char * /* addr */ , - short /* len */ , - void */* closure */ ), - void */*closure */ ); +ForEachHostInFamily(int family, + Bool (*func)( + unsigned char *addr, + short len, + void *closure), + void *closure); extern _X_EXPORT int -RemoveHost(ClientPtr /*client */ , - int /*family */ , - unsigned /*length */ , - void */*pAddr */ ); +RemoveHost(ClientPtr client, + int family, + unsigned length, + void *pAddr); extern _X_EXPORT int GetHosts(void ** /*data */ , @@ -422,9 +387,6 @@ typedef struct sockaddr *sockaddrPtr; extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client); -extern _X_EXPORT int -LocalClientCred(ClientPtr, int *, int *); - #define LCC_UID_SET (1 << 0) #define LCC_GID_SET (1 << 1) #define LCC_PID_SET (1 << 2) @@ -457,12 +419,29 @@ AddLocalHosts(void); extern _X_EXPORT void ResetHosts(const char *display); +extern _X_EXPORT void +EnableLocalAccess(void); + +extern _X_EXPORT void +DisableLocalAccess(void); + extern _X_EXPORT void EnableLocalHost(void); extern _X_EXPORT void DisableLocalHost(void); +#ifndef NO_LOCAL_CLIENT_CRED +extern _X_EXPORT void +EnableLocalUser(void); + +extern _X_EXPORT void +DisableLocalUser(void); + +extern _X_EXPORT void +LocalAccessScopeUser(void); +#endif + extern _X_EXPORT void AccessUsingXdmcp(void); @@ -471,7 +450,7 @@ DefineSelf(int /*fd */ ); #if XDMCP extern _X_EXPORT void -AugmentSelf(void */*from */ , int /*len */ ); +AugmentSelf(void *from, int len); extern _X_EXPORT void RegisterAuthorizations(void); diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h index 46ec3f5a2..9656c3ade 100644 --- a/xserver/include/pixmap.h +++ b/xserver/include/pixmap.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -93,13 +93,13 @@ typedef union _PixUnion { #define WindowDrawable(type) \ ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW)) -extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ , - int /*width */ , - int /*height */ , - int /*depth */ , - int /*bitsPerPixel */ , - int /*devKind */ , - void */*pPixData */ ); +extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen, + int width, + int height, + int depth, + int bitsPerPixel, + int devKind, + void *pPixData); extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ ); @@ -120,6 +120,12 @@ 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); + extern _X_EXPORT Bool PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst); diff --git a/xserver/include/pixmapstr.h b/xserver/include/pixmapstr.h index 2a1ef9b85..380e48335 100644 --- a/xserver/include/pixmapstr.h +++ b/xserver/include/pixmapstr.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -67,7 +67,7 @@ typedef struct _Drawable { } DrawableRec; /* - * PIXMAP -- device dependent + * PIXMAP -- device dependent */ typedef struct _Pixmap { @@ -90,6 +90,7 @@ typedef struct _PixmapDirtyUpdate { int x, y; DamagePtr damage; struct xorg_list ent; + int dst_x, dst_y; } PixmapDirtyUpdateRec; static inline void diff --git a/xserver/include/property.h b/xserver/include/property.h index 3b8ea8b2d..e350513a4 100644 --- a/xserver/include/property.h +++ b/xserver/include/property.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -57,24 +57,24 @@ extern _X_EXPORT int dixLookupProperty(PropertyPtr * /*result */ , ClientPtr /*pClient */ , Mask /*access_mode */ ); -extern _X_EXPORT int dixChangeWindowProperty(ClientPtr /*pClient */ , - WindowPtr /*pWin */ , - Atom /*property */ , - Atom /*type */ , - int /*format */ , - int /*mode */ , - unsigned long /*len */ , - void */*value */ , - Bool /*sendevent */ ); +extern _X_EXPORT int dixChangeWindowProperty(ClientPtr pClient, + WindowPtr pWin, + Atom property, + Atom type, + int format, + int mode, + unsigned long len, + void *value, + Bool sendevent); -extern _X_EXPORT int ChangeWindowProperty(WindowPtr /*pWin */ , - Atom /*property */ , - Atom /*type */ , - int /*format */ , - int /*mode */ , - unsigned long /*len */ , - void */*value */ , - Bool /*sendevent */ ); +extern _X_EXPORT int ChangeWindowProperty(WindowPtr pWin, + Atom property, + Atom type, + int format, + int mode, + unsigned long len, + void *value, + Bool sendevent); extern _X_EXPORT int DeleteProperty(ClientPtr /*client */ , WindowPtr /*pWin */ , diff --git a/xserver/include/propertyst.h b/xserver/include/propertyst.h index da995769c..d8ca840a0 100644 --- a/xserver/include/propertyst.h +++ b/xserver/include/propertyst.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -49,7 +49,7 @@ SOFTWARE. #include "misc.h" #include "property.h" #include "privates.h" -/* +/* * PROPERTY -- property element */ diff --git a/xserver/include/region.h b/xserver/include/region.h index 11dd59e98..14d283f88 100644 --- a/xserver/include/region.h +++ b/xserver/include/region.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/regionstr.h b/xserver/include/regionstr.h index 00343f27f..103235859 100644 --- a/xserver/include/regionstr.h +++ b/xserver/include/regionstr.h @@ -125,7 +125,7 @@ RegionEnd(RegionPtr reg) } static inline size_t -RegionSizeof(int n) +RegionSizeof(size_t n) { if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec))) return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); diff --git a/xserver/include/registry.h b/xserver/include/registry.h index 96be87aad..f50fa7622 100644 --- a/xserver/include/registry.h +++ b/xserver/include/registry.h @@ -17,18 +17,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define XREGISTRY_UNKNOWN "" -#ifdef XREGISTRY - #include "resource.h" #include "extnsionst.h" +#if defined(XSELINUX) || defined(RES) +#define X_REGISTRY_RESOURCE 1 +#endif + +#if defined(XSELINUX) || defined(XCSECURITY) || defined(XSERVER_DTRACE) +#define X_REGISTRY_REQUEST 1 +#endif + /* Internal string registry - for auditing, debugging, security, etc. */ -/* - * Registration functions. The name string is not copied, so it must - * not be a stack variable. - */ +#ifdef X_REGISTRY_RESOURCE +/* Functions used by the X-Resource extension */ extern _X_EXPORT void RegisterResourceName(RESTYPE type, const char *name); +extern _X_EXPORT const char *LookupResourceName(RESTYPE rtype); +#endif + +#ifdef X_REGISTRY_REQUEST extern _X_EXPORT void RegisterExtensionNames(ExtensionEntry * ext); /* @@ -38,29 +46,13 @@ extern _X_EXPORT const char *LookupMajorName(int major); extern _X_EXPORT const char *LookupRequestName(int major, int minor); extern _X_EXPORT const char *LookupEventName(int event); extern _X_EXPORT const char *LookupErrorName(int error); -extern _X_EXPORT const char *LookupResourceName(RESTYPE rtype); +#endif /* * Setup and teardown */ extern _X_EXPORT void dixResetRegistry(void); extern _X_EXPORT void dixFreeRegistry(void); +extern _X_EXPORT void dixCloseRegistry(void); -#else /* XREGISTRY */ - -/* Define calls away when the registry is not being built. */ - -#define RegisterResourceName(a, b) { ; } -#define RegisterExtensionNames(a) { ; } - -#define LookupMajorName(a) XREGISTRY_UNKNOWN -#define LookupRequestName(a, b) XREGISTRY_UNKNOWN -#define LookupEventName(a) XREGISTRY_UNKNOWN -#define LookupErrorName(a) XREGISTRY_UNKNOWN -#define LookupResourceName(a) XREGISTRY_UNKNOWN - -#define dixResetRegistry() { ; } -#define dixFreeRegistry() { ; } - -#endif /* XREGISTRY */ #endif /* DIX_REGISTRY_H */ diff --git a/xserver/include/resource.h b/xserver/include/resource.h index db44aefad..772f363b0 100644 --- a/xserver/include/resource.h +++ b/xserver/include/resource.h @@ -26,13 +26,13 @@ Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -50,7 +50,7 @@ SOFTWARE. #include "dixaccess.h" /***************************************************************** - * STUFF FOR RESOURCES + * STUFF FOR RESOURCES *****************************************************************/ /* classes for Resource routines */ @@ -136,21 +136,21 @@ typedef struct { void *value; } ResourceStateInfoRec; -typedef int (*DeleteType) (void */*value */ , - XID /*id */ ); +typedef int (*DeleteType) (void *value, + XID id); -typedef void (*FindResType) (void */*value */ , - XID /*id */ , - void */*cdata */ ); +typedef void (*FindResType) (void *value, + XID id, + void *cdata); -typedef void (*FindAllRes) (void */*value */ , - XID /*id */ , - RESTYPE /*type */ , - void */*cdata */ ); +typedef void (*FindAllRes) (void *value, + XID id, + RESTYPE type, + void *cdata); -typedef Bool (*FindComplexResType) (void */*value */ , - XID /*id */ , - void */*cdata */ ); +typedef Bool (*FindComplexResType) (void *value, + XID id, + void *cdata); /* Structure for estimating resource memory usage. Memory usage * consists of space allocated for the resource itself and of @@ -166,16 +166,16 @@ typedef struct { unsigned long refCnt; } ResourceSizeRec, *ResourceSizePtr; -typedef void (*SizeType)(void */*value*/, - XID /*id*/, - ResourceSizePtr /*size*/); +typedef void (*SizeType)(void *value, + XID id, + ResourceSizePtr size); -extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ , - const char * /*name */ ); +extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType deleteFunc, + const char *name); -typedef void (*FindTypeSubResources)(void */* value */, - FindAllRes /* func */, - void */* cdata */); +typedef void (*FindTypeSubResources)(void *value, + FindAllRes func, + void *cdata); extern _X_EXPORT SizeType GetResourceTypeSizeFunc( RESTYPE /*type*/); @@ -200,9 +200,9 @@ extern _X_EXPORT XID FakeClientID(int /*client */ ); #ifdef __APPLE__ #define AddResource Darwin_X_AddResource #endif -extern _X_EXPORT Bool AddResource(XID /*id */ , - RESTYPE /*type */ , - void */*value */ ); +extern _X_EXPORT Bool AddResource(XID id, + RESTYPE type, + void *value); extern _X_EXPORT void FreeResource(XID /*id */ , RESTYPE /*skipDeleteFuncType */ ); @@ -211,27 +211,27 @@ extern _X_EXPORT void FreeResourceByType(XID /*id */ , RESTYPE /*type */ , Bool /*skipFree */ ); -extern _X_EXPORT Bool ChangeResourceValue(XID /*id */ , - RESTYPE /*rtype */ , - void */*value */ ); +extern _X_EXPORT Bool ChangeResourceValue(XID id, + RESTYPE rtype, + void *value); -extern _X_EXPORT void FindClientResourcesByType(ClientPtr /*client */ , - RESTYPE /*type */ , - FindResType /*func */ , - void */*cdata */ ); +extern _X_EXPORT void FindClientResourcesByType(ClientPtr client, + RESTYPE type, + FindResType func, + void *cdata); -extern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ , - FindAllRes /*func */ , - void */*cdata */ ); +extern _X_EXPORT void FindAllClientResources(ClientPtr client, + FindAllRes func, + void *cdata); /** @brief Iterate through all subresources of a resource. @note The XID argument provided to the FindAllRes function may be 0 for subresources that don't have an XID */ -extern _X_EXPORT void FindSubResources(void */*resource*/, - RESTYPE /*type*/, - FindAllRes /*func*/, - void */*cdata*/); +extern _X_EXPORT void FindSubResources(void *resource, + RESTYPE type, + FindAllRes func, + void *cdata); extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ ); diff --git a/xserver/include/rgb.h b/xserver/include/rgb.h index ddfb1d814..449bc54f0 100644 --- a/xserver/include/rgb.h +++ b/xserver/include/rgb.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/screenint.h b/xserver/include/screenint.h index e61cd33ed..e38384873 100644 --- a/xserver/include/screenint.h +++ b/xserver/include/screenint.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h index 6acdadd7a..faf05630c 100644 --- a/xserver/include/scrnintstr.h +++ b/xserver/include/scrnintstr.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -155,8 +155,7 @@ typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ , VTKind /*kind */ ); typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ , - RegionPtr /*prgn */ , - RegionPtr /*other_exposed */ ); + RegionPtr /*prgn */); typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ , DDXPointRec /*ptOldOrg */ , @@ -253,29 +252,23 @@ typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ , typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ ); -typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ , - RegionPtr /*pRgn */ , - XID /*drawable */ , - int /*major */ , - int /*minor */ ); +typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen, + void *pTimeout, + void *pReadmask); -typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr /*pScreen*/ , - void */*pTimeout */ , - void */*pReadmask */ ); - -typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr /*pScreen*/ , - unsigned long /*result */ , - void */*pReadMask */ ); +typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen, + unsigned long result, + void *pReadMask); typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ ); -typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr /*pPixmap */ , - int /*width */ , - int /*height */ , - int /*depth */ , - int /*bitsPerPixel */ , - int /*devKind */ , - void */*pPixData */ ); +typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap, + int width, + int height, + int depth, + int bitsPerPixel, + int devKind, + void *pPixData); typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ ); @@ -358,6 +351,96 @@ typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen, typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32); +/* Wrapping Screen procedures + + There are a few modules in the X server which dynamically add and + remove themselves from various screen procedure call chains. + + For example, the BlockHandler is dynamically modified by: + + * xf86Rotate + * miSprite + * composite + * render (for animated cursors) + + Correctly manipulating this chain is complicated by the fact that + the chain is constructed through a sequence of screen private + structures, each holding the next screen->proc pointer. + + To add a module to a screen->proc chain is fairly simple; just save + the current screen->proc value in the module screen private + and store the module's function in the screen->proc location. + + Removing a screen proc is a bit trickier. It seems like all you + need to do is set the screen->proc pointer back to the value saved + in your screen private. However, if some other module has come + along and wrapped on top of you, then the right place to store the + previous screen->proc value is actually in the wrapping module's + screen private structure(!). Of course, you have no idea what + other module may have wrapped on top, nor could you poke inside + its screen private in any case. + + To make this work, we restrict the unwrapping process to happen + during the invocation of the screen proc itself, and then we + require the screen proc to take some care when manipulating the + screen proc functions pointers. + + The requirements are: + + 1) The screen proc must set the screen->proc pointer back to the + value saved in its screen private before calling outside its + module. + + 2a) If the screen proc wants to be remove itself from the chain, + it must not manipulate screen->proc pointer again before + returning. + + 2b) If the screen proc wants to remain in the chain, it must: + + 2b.1) Re-fetch the screen->proc pointer and store that in + its screen private. This ensures that any changes + to the chain will be preserved. + + 2b.2) Set screen->proc back to itself + + One key requirement here is that these steps must wrap not just + any invocation of the nested screen->proc value, but must nest + essentially any calls outside the current module. This ensures + that other modules can reliably manipulate screen->proc wrapping + using these same rules. + + For example, the animated cursor code in render has two macros, + Wrap and Unwrap. + + #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) + + Unwrap takes the screen private (as), the screen (s) and the + member name (elt), and restores screen->proc to that saved in the + screen private. + + #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) + + Wrap takes the screen private (as), the screen (s), the member + name (elt) and the wrapping function (func). It saves the + current screen->proc value in the screen private, and then sets the + screen->proc to the local wrapping function. + + Within each of these functions, there's a pretty simple pattern: + + Unwrap(as, pScreen, UnrealizeCursor); + + // Do local stuff, including possibly calling down through + // pScreen->UnrealizeCursor + + Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); + + The wrapping block handler is a bit different; it does the Unwrap, + the local operations and then only re-Wraps if the hook is still + required. Unwrap occurrs at the top of each function, just after + entry, and Wrap occurrs at the bottom of each function, just + before returning. + */ + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -451,7 +534,6 @@ typedef struct _Screen { /* Region procedures */ BitmapToRegionProcPtr BitmapToRegion; - SendGraphicsExposeProcPtr SendGraphicsExpose; /* os layer procedures */ diff --git a/xserver/include/selection.h b/xserver/include/selection.h index 37e4f5e64..7a516f14a 100644 --- a/xserver/include/selection.h +++ b/xserver/include/selection.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -51,7 +51,7 @@ SOFTWARE. #include "privates.h" /* - * Selection data structures + * Selection data structures */ typedef struct _Selection { diff --git a/xserver/include/servermd.h b/xserver/include/servermd.h index eeabaa997..087826f48 100644 --- a/xserver/include/servermd.h +++ b/xserver/include/servermd.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -47,334 +47,27 @@ SOFTWARE. #ifndef SERVERMD_H #define SERVERMD_H 1 -/* - * Note: much of this is vestigial from mfb/cfb times. This should - * really be simplified even further. - */ +#if !defined(_DIX_CONFIG_H_) && !defined(_XORG_SERVER_H_) +#error Drivers must include xorg-server.h before any other xserver headers +#error xserver code must include dix-config.h before any other headers +#endif -/* - * Machine dependent values: - * GLYPHPADBYTES should be chosen with consideration for the space-time - * trade-off. Padding to 0 bytes means that there is no wasted space - * in the font bitmaps (both on disk and in memory), but that access of - * the bitmaps will cause odd-address memory references. Padding to - * 2 bytes would ensure even address memory references and would - * be suitable for a 68010-class machine, but at the expense of wasted - * space in the font bitmaps. Padding to 4 bytes would be good - * for real 32 bit machines, etc. Be sure that you tell the font - * compiler what kind of padding you want because its defines are - * kept separate from this. See server/include/font.h for how - * GLYPHPADBYTES is used. - */ - - -#ifdef __avr32__ - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#endif /* __avr32__ */ - -#if defined(vax) || defined(__vax__) - -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */ -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 /* to make fb work */ -#define GETLEFTBITS_ALIGNMENT 1 -#define FAST_UNALIGNED_READS - -#endif /* vax */ - -#if defined(__arm32__) || defined(__arm__) && defined(__OpenBSD__) +#include /* for X_LITTLE_ENDIAN/X_BIG_ENDIAN */ +#if X_BYTE_ORDER == X_LITTLE_ENDIAN #define IMAGE_BYTE_ORDER LSBFirst #define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 - -#endif /* __arm32__ */ - -#if defined(__nds32__) - -#define IMAGE_BYTE_ORDER LSBFirst - -#if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -#define BITMAP_BIT_ORDER MSBFirst +#elif X_BYTE_ORDER == X_BIG_ENDIAN +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst #else -#define BITMAP_BIT_ORDER LSBFirst -#endif - -#if defined(XF86MONOVGA) || defined(XF86VGA16) -#define BITMAP_SCANLINE_UNIT 8 -#endif - -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 -#define LARGE_INSTRUCTION_CACHE -#define AVOID_MEMORY_READ - -#endif /* __nds32__ */ - -#if defined __hppa__ - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 /* to make fb work */ - /* byte boundries */ -#endif /* hpux || __hppa__ */ - -#if defined (__m88k__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#endif /* __m88k__ */ - -#if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) - -#if defined(__LITTLE_ENDIAN__) -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#else -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#endif -#define GLYPHPADBYTES 4 - -#endif /* PowerPC */ - -#if defined(__sh__) - -#if defined(__BIG_ENDIAN__) -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#else -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -#endif - -#endif /* SuperH */ - -#if defined(__m32r__) - -#if defined(__BIG_ENDIAN__) -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#else -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -#endif - -#endif /* __m32r__ */ - -#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \ - (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \ - defined(__sparc__) || defined(__mc68000__) - -#if defined(__sparc) || defined(__sparc__) -#if !defined(sparc) -#define sparc 1 -#endif -#endif - -#if defined(sun386) || defined(sun5) -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */ -#define BITMAP_BIT_ORDER LSBFirst -#else -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */ -#define BITMAP_BIT_ORDER MSBFirst -#endif - -#define GLYPHPADBYTES 4 - -#endif /* sun && !(i386 && SVR4) */ - -#if defined(ibm032) || defined (ibm) - -#ifdef __i386__ -#define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */ -#else -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only */ -#endif -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 1 -/* ibm pcc doesn't understand pragmas. */ - -#ifdef __i386__ -#define BITMAP_SCANLINE_UNIT 8 -#endif - -#endif /* ibm */ - -#if (defined(mips) || defined(__mips)) - -#if defined(MIPSEL) || defined(__MIPSEL__) -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */ -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -#else -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#endif - -#endif /* mips */ - -#if defined(__alpha) || defined(__alpha__) -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */ -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 - -#endif /* alpha */ - -#if defined (linux) && defined (__s390__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#define BITMAP_SCANLINE_UNIT 8 -#define FAST_UNALIGNED_READ - -#endif /* linux/s390 */ - -#if defined (linux) && defined (__s390x__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#define BITMAP_SCANLINE_UNIT 8 -#define FAST_UNALIGNED_READ - -#endif /* linux/s390x */ - -#if defined(__ia64__) || defined(ia64) - -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 - -#endif /* ia64 */ - -#if defined(__amd64__) || defined(amd64) || defined(__amd64) -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -/* ???? */ -#endif /* AMD64 */ - -#if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \ - defined(__alpha__) || defined(__alpha) || \ - defined(__i386__) || \ - defined(__s390x__) || defined(__s390__) - -#ifndef IMAGE_BYTE_ORDER -#define IMAGE_BYTE_ORDER LSBFirst -#endif - -#ifndef BITMAP_BIT_ORDER -#define BITMAP_BIT_ORDER LSBFirst +#error "Too weird to live." #endif #ifndef GLYPHPADBYTES #define GLYPHPADBYTES 4 #endif -#endif /* SVR4 / BSD / i386 */ - -#if defined (linux) && defined (__mc68000__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 - -#endif /* linux/m68k */ - -#if defined (__OpenBSD__) && defined (__mc68020__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define FAST_UNALIGNED_READS -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#endif /* OpenBSD/m68k */ - -#ifdef sgi - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 -#define AVOID_MEMORY_READ -#define FAST_CONSTANT_OFFSET_MODE -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS - -#endif - -/* linux on ARM */ -#if defined(linux) && defined(__arm__) -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -#endif - -/* linux on IBM S/390 */ -#if defined (linux) && defined (__s390__) -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#endif /* linux/s390 */ - -#ifdef __aarch64__ - -#ifdef __AARCH64EL__ -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#endif -#ifdef __AARCH64EB__ -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#endif -#define GLYPHPADBYTES 4 - -#endif /* __aarch64__ */ - -#if defined(__arc__) - -#if defined(__BIG_ENDIAN__) -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#else -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#endif -#define GLYPHPADBYTES 4 - -#endif /* ARC */ - -#ifdef __xtensa__ - -#ifdef __XTENSA_EL__ -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#endif -#ifdef __XTENSA_EB__ -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#endif -#define GLYPHPADBYTES 4 - -#endif /* __xtensa__ */ - /* size of buffer to use with GetImage, measured in bytes. There's obviously * a trade-off between the amount of heap used and the number of times the * ddx routine has to be called. @@ -395,7 +88,7 @@ SOFTWARE. #endif #include -/* +/* * This returns the number of padding units, for depth d and width w. * For bitmaps this can be calculated with the macros above. * Other depths require either grovelling over the formats field of the @@ -433,8 +126,4 @@ extern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[]; #define BitmapBytePad(w) \ (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD) -#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d) -#define PixmapBytePadProto(w, d) PixmapBytePad(w, d) -#define BitmapBytePadProto(w) BitmapBytePad(w) - #endif /* SERVERMD_H */ diff --git a/xserver/include/site.h b/xserver/include/site.h index 25caabbb3..9bd8e2f12 100644 --- a/xserver/include/site.h +++ b/xserver/include/site.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -66,8 +66,8 @@ SOFTWARE. /* * The following constants are provided solely as a last line of defense. The * normal build ALWAYS overrides them using a special rule given in - * server/dix/Imakefile. If you want to change either of these constants, - * you should set the DefaultFontPath or DefaultRGBDatabase configuration + * server/dix/Imakefile. If you want to change either of these constants, + * you should set the DefaultFontPath or DefaultRGBDatabase configuration * parameters. * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! */ @@ -76,7 +76,7 @@ SOFTWARE. #endif /* - * The following constants contain default values for all of the variables + * The following constants contain default values for all of the variables * that can be initialized on the server command line or in the environment. */ #define COMPILEDDEFAULTFONT "fixed" diff --git a/xserver/include/window.h b/xserver/include/window.h index b5a937eef..6daec8599 100644 --- a/xserver/include/window.h +++ b/xserver/include/window.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -72,16 +72,16 @@ struct _Cursor; typedef struct _BackingStore *BackingStorePtr; typedef struct _Window *WindowPtr; -typedef int (*VisitWindowProcPtr) (WindowPtr /*pWin */ , - void */*data */ ); +typedef int (*VisitWindowProcPtr) (WindowPtr pWin, + void *data); -extern _X_EXPORT int TraverseTree(WindowPtr /*pWin */ , - VisitWindowProcPtr /*func */ , - void */*data */ ); +extern _X_EXPORT int TraverseTree(WindowPtr pWin, + VisitWindowProcPtr func, + void *data); -extern _X_EXPORT int WalkTree(ScreenPtr /*pScreen */ , - VisitWindowProcPtr /*func */ , - void */*data */ ); +extern _X_EXPORT int WalkTree(ScreenPtr pScreen, + VisitWindowProcPtr func, + void *data); extern _X_EXPORT Bool CreateRootWindow(ScreenPtr /*pScreen */ ); @@ -108,8 +108,8 @@ extern _X_EXPORT WindowPtr CreateWindow(Window /*wid */ , VisualID /*visual */ , int * /*error */ ); -extern _X_EXPORT int DeleteWindow(void */*pWin */ , - XID /*wid */ ); +extern _X_EXPORT int DeleteWindow(void *pWin, + XID wid); extern _X_EXPORT int DestroySubwindows(WindowPtr /*pWin */ , ClientPtr /*client */ ); diff --git a/xserver/include/windowstr.h b/xserver/include/windowstr.h index 6b79bbd2e..53eef376e 100644 --- a/xserver/include/windowstr.h +++ b/xserver/include/windowstr.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -144,14 +144,13 @@ typedef struct _Window { Mask eventMask; /* mask from the creating client */ PixUnion background; PixUnion border; - void *backStorage; /* null when BS disabled */ WindowOptPtr optional; unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */ unsigned borderIsPixel:1; unsigned cursorIsNone:1; /* else real cursor (might inherit) */ unsigned backingStore:2; + unsigned backStorage:1; /* if bs is allocated */ unsigned saveUnder:1; - unsigned DIXsaveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; unsigned overrideRedirect:1; diff --git a/xserver/include/xkbfile.h b/xserver/include/xkbfile.h index 9f3b04c30..f93d31ab0 100644 --- a/xserver/include/xkbfile.h +++ b/xserver/include/xkbfile.h @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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. diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 229de2194..cc6307af5 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -596,15 +596,15 @@ extern _X_EXPORT void XkbSendCompatMapNotify(DeviceIntPtr /* kbd */ , xkbCompatMapNotify * /* ev */ ); -extern _X_EXPORT void XkbHandleBell(BOOL /* force */ , - BOOL /* eventOnly */ , - DeviceIntPtr /* kbd */ , - CARD8 /* percent */ , - void */* ctrl */ , - CARD8 /* class */ , - Atom /* name */ , - WindowPtr /* pWin */ , - ClientPtr /* pClient */ +extern _X_EXPORT void XkbHandleBell(BOOL force, + BOOL eventOnly, + DeviceIntPtr kbd, + CARD8 percent, + void *ctrl, + CARD8 class, + Atom name, + WindowPtr pWin, + ClientPtr pClient ); extern _X_EXPORT void XkbSendAccessXNotify(DeviceIntPtr /* kbd */ , diff --git a/xserver/include/xkbstr.h b/xserver/include/xkbstr.h index 935330c7c..8d715577a 100644 --- a/xserver/include/xkbstr.h +++ b/xserver/include/xkbstr.h @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -417,7 +417,7 @@ typedef struct _XkbKeyAliasRec { } XkbKeyAliasRec, *XkbKeyAliasPtr; /* - * Names for everything + * Names for everything */ typedef struct _XkbNamesRec { Atom keycodes; @@ -554,7 +554,7 @@ typedef struct _XkbChanges { } XkbChangesRec, *XkbChangesPtr; /* - * These data structures are used to construct a keymap from + * These data structures are used to construct a keymap from * a set of components or to list components in the server * database. */ @@ -587,8 +587,8 @@ typedef struct _XkbComponentList { } XkbComponentListRec, *XkbComponentListPtr; /* - * The following data structures describe and track changes to a - * non-keyboard extension device + * The following data structures describe and track changes to a + * non-keyboard extension device */ typedef struct _XkbDeviceLedInfo { unsigned short led_class; diff --git a/xserver/include/xorg-config.h.in b/xserver/include/xorg-config.h.in index fc50eb88b..a2198b642 100644 --- a/xserver/include/xorg-config.h.in +++ b/xserver/include/xorg-config.h.in @@ -82,12 +82,6 @@ /* Building vgahw module */ #undef WITH_VGAHW -/* Define to 1 if NetBSD built-in MTRR support is available */ -#undef HAS_MTRR_BUILTIN - -/* Define to 1 if BSD MTRR support is available */ -#undef HAS_MTRR_SUPPORT - /* NetBSD PIO alpha IO */ #undef USE_ALPHA_PIO diff --git a/xserver/include/xorg-server.h.in b/xserver/include/xorg-server.h.in index 27fdc29fd..655b4036b 100644 --- a/xserver/include/xorg-server.h.in +++ b/xserver/include/xorg-server.h.in @@ -16,6 +16,10 @@ #ifndef _XORG_SERVER_H_ #define _XORG_SERVER_H_ +#ifdef HAVE_XORG_CONFIG_H +#error Include xorg-config.h when building the X server +#endif + /* Support BigRequests extension */ #undef BIGREQS @@ -230,4 +234,7 @@ /* Ask fontsproto to make font path element names const */ #define FONT_PATH_ELEMENT_NAME_CONST 1 +/* byte order */ +#undef X_BYTE_ORDER + #endif /* _XORG_SERVER_H_ */ diff --git a/xserver/include/xsha1.h b/xserver/include/xsha1.h index aab71067a..60c6a9004 100644 --- a/xserver/include/xsha1.h +++ b/xserver/include/xsha1.h @@ -12,7 +12,7 @@ int x_sha1_update(void *ctx, void *data, int size); /* * Place the hash in result, and free ctx. - * Returns 0 on error, 1 on success. + * Returns 0 on error, 1 on success. */ int x_sha1_final(void *ctx, unsigned char result[20]); diff --git a/xserver/man/Makefile.in b/xserver/man/Makefile.in index 519f9823b..3b055975f 100644 --- a/xserver/man/Makefile.in +++ b/xserver/man/Makefile.in @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/man/Xserver.man b/xserver/man/Xserver.man index 07226d5f9..2908e52df 100644 --- a/xserver/man/Xserver.man +++ b/xserver/man/Xserver.man @@ -186,10 +186,10 @@ Prohibit creating indirect GLX contexts. Indirect GLX is of limited use, since it lacks support for many modern OpenGL features and extensions; it's slower than direct contexts; and it opens a large attack surface for protocol parsing errors. +This is the default unless +iglx is specified. .TP 8 .B +iglx Allow creating indirect GLX contexts. -This is the default unless \-iglx is specified. .TP 8 .B \-maxbigreqsize \fIsize\fP sets the maximum big request to diff --git a/xserver/mi/Makefile.am b/xserver/mi/Makefile.am index 0cef7798f..110c3f5dd 100644 --- a/xserver/mi/Makefile.am +++ b/xserver/mi/Makefile.am @@ -2,8 +2,8 @@ noinst_LTLIBRARIES = libmi.la if XORG sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ - migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ - mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h + migc.h mipointrst.h mizerarc.h micoord.h \ + mistruct.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) @@ -16,7 +16,6 @@ libmi_la_SOURCES = \ micmap.h \ micoord.h \ micopy.c \ - micursor.c \ midash.c \ midispcur.c \ mieq.c \ @@ -24,7 +23,6 @@ libmi_la_SOURCES = \ mifillarc.c \ mifillarc.h \ mifillrct.c \ - mifpolycon.c \ mifpoly.h \ migc.c \ migc.h \ @@ -37,18 +35,13 @@ libmi_la_SOURCES = \ mipointrst.h \ mipoly.c \ mipoly.h \ - mipolycon.c \ - mipolygen.c \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ - mipolyutil.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ - mispans.c \ - mispans.h \ misprite.c \ misprite.h \ mistruct.h \ diff --git a/xserver/mi/Makefile.in b/xserver/mi/Makefile.in index 2271fc1a5..0bc732114 100644 --- a/xserver/mi/Makefile.in +++ b/xserver/mi/Makefile.in @@ -76,11 +76,10 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmi_la_LIBADD = am_libmi_la_OBJECTS = miarc.lo mibitblt.lo micmap.lo micopy.lo \ - micursor.lo midash.lo midispcur.lo mieq.lo miexpose.lo \ - mifillarc.lo mifillrct.lo mifpolycon.lo migc.lo miglblt.lo \ - mioverlay.lo mipointer.lo mipoly.lo mipolycon.lo mipolygen.lo \ - mipolypnt.lo mipolyrect.lo mipolyseg.lo mipolytext.lo \ - mipolyutil.lo mipushpxl.lo miscrinit.lo mispans.lo misprite.lo \ + midash.lo midispcur.lo mieq.lo miexpose.lo mifillarc.lo \ + mifillrct.lo migc.lo miglblt.lo mioverlay.lo mipointer.lo \ + mipoly.lo mipolypnt.lo mipolyrect.lo mipolyseg.lo \ + mipolytext.lo mipushpxl.lo miscrinit.lo misprite.lo \ mivaltree.lo miwideline.lo miwindow.lo mizerarc.lo \ mizerclip.lo mizerline.lo libmi_la_OBJECTS = $(am_libmi_la_OBJECTS) @@ -130,8 +129,7 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__sdk_HEADERS_DIST = micmap.h miline.h mipointer.h mi.h migc.h \ - mipointrst.h mizerarc.h micoord.h mifillarc.h mispans.h \ - miwideline.h mistruct.h mifpoly.h mioverlay.h + mipointrst.h mizerarc.h micoord.h mistruct.h mioverlay.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -272,6 +270,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -511,8 +510,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmi.la @XORG_TRUE@sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ -@XORG_TRUE@ migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ -@XORG_TRUE@ mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h +@XORG_TRUE@ migc.h mipointrst.h mizerarc.h micoord.h \ +@XORG_TRUE@ mistruct.h mioverlay.h AM_CFLAGS = $(DIX_CFLAGS) libmi_la_SOURCES = \ @@ -523,7 +522,6 @@ libmi_la_SOURCES = \ micmap.h \ micoord.h \ micopy.c \ - micursor.c \ midash.c \ midispcur.c \ mieq.c \ @@ -531,7 +529,6 @@ libmi_la_SOURCES = \ mifillarc.c \ mifillarc.h \ mifillrct.c \ - mifpolycon.c \ mifpoly.h \ migc.c \ migc.h \ @@ -544,18 +541,13 @@ libmi_la_SOURCES = \ mipointrst.h \ mipoly.c \ mipoly.h \ - mipolycon.c \ - mipolygen.c \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ - mipolyutil.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ - mispans.c \ - mispans.h \ misprite.c \ misprite.h \ mistruct.h \ @@ -627,29 +619,23 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mibitblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micopy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/micursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midispcur.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mieq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miexpose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifillarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifillrct.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mifpolycon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miglblt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mioverlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipoly.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolycon.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolygen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolypnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolyrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolyseg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolytext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipolyutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipushpxl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscrinit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mispans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misprite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mivaltree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miwideline.Plo@am__quote@ diff --git a/xserver/mi/mi.h b/xserver/mi/mi.h index 1209a16c4..db62c9166 100644 --- a/xserver/mi/mi.h +++ b/xserver/mi/mi.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -67,6 +67,11 @@ typedef struct _miDash *miDashPtr; /* miarc.c */ +extern _X_EXPORT void miWideArc(DrawablePtr pDraw, + GCPtr pGC, + int narcs, + xArc * parcs); + extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ , GCPtr /*pGC */ , int /*narcs */ , @@ -224,15 +229,7 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , int /*width */ , int /*height */ , int /*dstx */ , - int /*dsty */ , - unsigned long /*plane */ - ); - -extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ , - RegionPtr /*pRgn */ , - XID /*drawable */ , - int /*major */ , - int /*minor */ + int /*dsty */ ); extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ , @@ -242,9 +239,7 @@ extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ , ); extern _X_EXPORT void miWindowExposures(WindowPtr /*pWin */ , - RegionPtr /*prgn */ , - RegionPtr /*other_exposed */ - ); + RegionPtr /*prgn */); extern _X_EXPORT void miPaintWindow(WindowPtr /*pWin */ , RegionPtr /*prgn */ , @@ -265,22 +260,22 @@ extern _X_EXPORT void miPolyFillRect(DrawablePtr /*pDrawable */ , /* miglblt.c */ -extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr /*pDrawable */ , - GCPtr /*pGC */ , - int /*x */ , - int /*y */ , - unsigned int /*nglyph */ , - CharInfoPtr * /*ppci */ , - void */*pglyphBase */ +extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, + void *pglyphBase ); -extern _X_EXPORT void miImageGlyphBlt(DrawablePtr /*pDrawable */ , - GCPtr /*pGC */ , - int /*x */ , - int /*y */ , - unsigned int /*nglyph */ , - CharInfoPtr * /*ppci */ , - void */*pglyphBase */ +extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable, + GCPtr pGC, + int x, + int y, + unsigned int nglyph, + CharInfoPtr *ppci, + void *pglyphBase ); /* mipoly.c */ @@ -293,22 +288,6 @@ extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ , DDXPointPtr /*pPts */ ); -/* mipolycon.c */ - -extern _X_EXPORT Bool miFillConvexPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - DDXPointPtr /*ptsIn */ - ); - -/* mipolygen.c */ - -extern _X_EXPORT Bool miFillGeneralPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - DDXPointPtr /*ptsIn */ - ); - /* mipolypnt.c */ extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ , @@ -381,36 +360,36 @@ extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ , /* miscrinit.c */ -extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr /*pPixmap */ , - int /*width */ , - int /*height */ , - int /*depth */ , - int /*bitsPerPixel */ , - int /*devKind */ , - void */*pPixData */ +extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap, + int width, + int height, + int depth, + int bitsPerPixel, + int devKind, + void *pPixData ); extern _X_EXPORT Bool miCreateScreenResources(ScreenPtr /*pScreen */ ); -extern _X_EXPORT Bool miScreenDevPrivateInit(ScreenPtr /*pScreen */ , - int /*width */ , - void */*pbits */ +extern _X_EXPORT Bool miScreenDevPrivateInit(ScreenPtr pScreen, + int width, + void *pbits ); -extern _X_EXPORT Bool miScreenInit(ScreenPtr /*pScreen */ , - void */*pbits */ , - int /*xsize */ , - int /*ysize */ , - int /*dpix */ , - int /*dpiy */ , - int /*width */ , - int /*rootDepth */ , - int /*numDepths */ , - DepthPtr /*depths */ , - VisualID /*rootVisual */ , - int /*numVisuals */ , - VisualPtr /*visuals */ +extern _X_EXPORT Bool miScreenInit(ScreenPtr pScreen, + void *pbits, + int xsize, + int ysize, + int dpix, + int dpiy, + int width, + int rootDepth, + int numDepths, + DepthPtr depths, + VisualID rootVisual, + int numVisuals, + VisualPtr visuals ); /* mivaltree.c */ @@ -422,17 +401,6 @@ extern _X_EXPORT int miShapedWindowIn(RegionPtr /*universe */ , int /*y */ ); -typedef void - (*SetRedirectBorderClipProcPtr) (WindowPtr pWindow, RegionPtr pRegion); - -typedef RegionPtr - (*GetRedirectBorderClipProcPtr) (WindowPtr pWindow); - -extern _X_EXPORT void - -miRegisterRedirectBorderClipProc(SetRedirectBorderClipProcPtr setBorderClip, - GetRedirectBorderClipProcPtr getBorderClip); - extern _X_EXPORT int miValidateTree(WindowPtr /*pParent */ , WindowPtr /*pChild */ , VTKind /*kind */ @@ -452,6 +420,12 @@ extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ , DDXPointPtr /*pPts */ ); +extern _X_EXPORT void miPolylines(DrawablePtr pDrawable, + GCPtr pGC, + int mode, + int npt, + DDXPointPtr pPts); + /* miwindow.c */ extern _X_EXPORT void miClearToBackground(WindowPtr /*pWin */ , @@ -480,12 +454,12 @@ extern _X_EXPORT void miMoveWindow(WindowPtr /*pWin */ , VTKind /*kind */ ); -extern _X_EXPORT void miSlideAndSizeWindow(WindowPtr /*pWin */ , - int /*x */ , - int /*y */ , - unsigned int /*w */ , - unsigned int /*h */ , - WindowPtr /*pSib */ +extern _X_EXPORT void miResizeWindow(WindowPtr /*pWin */ , + int /*x */ , + int /*y */ , + unsigned int /*w */ , + unsigned int /*h */ , + WindowPtr /*pSib */ ); extern _X_EXPORT WindowPtr miGetLayerWindow(WindowPtr /*pWin */ @@ -504,9 +478,6 @@ extern _X_EXPORT void miMarkUnrealizedWindow(WindowPtr /*pChild */ , Bool /*fromConfigure */ ); -extern _X_EXPORT void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, - int depth); - extern _X_EXPORT WindowPtr miSpriteTrace(SpritePtr pSprite, int x, int y); extern _X_EXPORT WindowPtr miXYToWindow(ScreenPtr pScreen, SpritePtr pSprite, int x, int y); diff --git a/xserver/mi/miarc.c b/xserver/mi/miarc.c index 0f56c7db3..e8bc87e3e 100644 --- a/xserver/mi/miarc.c +++ b/xserver/mi/miarc.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,6 +63,22 @@ SOFTWARE. #include "mifillarc.h" #include +#define EPSILON 0.000001 +#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON) +#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON) +#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) +#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */ + +/* Point with sub-pixel positioning. */ +typedef struct _SppPoint { + double x, y; +} SppPointRec, *SppPointPtr; + +typedef struct _SppArc { + double x, y, width, height; + double angle1, angle2; +} SppArcRec, *SppArcPtr; + static double miDsin(double a); static double miDcos(double a); static double miDasin(double v); @@ -82,7 +98,7 @@ cbrt(double x) /* * some interesting sematic interpretation of the protocol: * - * Self intersecting arcs (i.e. those spanning 360 degrees) + * Self intersecting arcs (i.e. those spanning 360 degrees) * never join with other arcs, and are drawn without caps * (unless on/off dashed, in which case each dash segment * is capped, except when the last segment meets the @@ -99,21 +115,6 @@ cbrt(double x) * */ -#undef max -#undef min - -_X_INLINE static int -max(const int x, const int y) -{ - return x > y ? x : y; -} - -_X_INLINE static int -min(const int x, const int y) -{ - return x < y ? x : y; -} - struct bound { double min, max; }; @@ -353,7 +354,7 @@ of the two quadratics y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0 -where +where A = +/- sqrt(8Z + b^2 - 4c) b, c, d are the cubic, quadratic, and linear coefficients of the quartic @@ -886,7 +887,7 @@ miFillWideEllipse(DrawablePtr pDraw, GCPtr pGC, xArc * parc) */ void -miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) +miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) { int i; xArc *parc; @@ -1110,6 +1111,195 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) } } +/* Find the index of the point with the smallest y.also return the + * smallest and largest y */ +static int +GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans, int *by, int *ty) +{ + SppPointPtr ptMin; + double ymin, ymax; + SppPointPtr ptsStart = pts; + + ptMin = pts; + ymin = ymax = (pts++)->y; + + while (--n > 0) { + if (pts->y < ymin) { + ptMin = pts; + ymin = pts->y; + } + if (pts->y > ymax) + ymax = pts->y; + + pts++; + } + + *by = ICEIL(ymin + yFtrans); + *ty = ICEIL(ymax + yFtrans - 1); + return ptMin - ptsStart; +} + +/* + * miFillSppPoly written by Todd Newman; April. 1987. + * + * Fill a convex polygon. If the given polygon + * is not convex, then the result is undefined. + * The algorithm is to order the edges from smallest + * y to largest by partitioning the array into a left + * edge list and a right edge list. The algorithm used + * to traverse each edge is digital differencing analyzer + * line algorithm with y as the major axis. There's some funny linear + * interpolation involved because of the subpixel postioning. + */ +static void +miFillSppPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */ + SppPointPtr ptsIn, /* the points */ + int xTrans, int yTrans, /* Translate each point by this */ + double xFtrans, double yFtrans /* translate before conversion + by this amount. This provides + a mechanism to match rounding + errors with any shape that must + meet the polygon exactly. + */ + ) +{ + double xl = 0.0, xr = 0.0, /* x vals of left and right edges */ + ml = 0.0, /* left edge slope */ + mr = 0.0, /* right edge slope */ + dy, /* delta y */ + i; /* loop counter */ + int y, /* current scanline */ + j, imin, /* index of vertex with smallest y */ + ymin, /* y-extents of polygon */ + ymax, *width, *FirstWidth, /* output buffer */ + *Marked; /* set if this vertex has been used */ + int left, right, /* indices to first endpoints */ + nextleft, nextright; /* indices to second endpoints */ + DDXPointPtr ptsOut, FirstPoint; /* output buffer */ + + if (pgc->miTranslate) { + xTrans += dst->x; + yTrans += dst->y; + } + + imin = GetFPolyYBounds(ptsIn, count, yFtrans, &ymin, &ymax); + + 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); + + if (!ptsOut || !width || !Marked) { + free(Marked); + free(width); + free(ptsOut); + return; + } + + for (j = 0; j < count; j++) + Marked[j] = 0; + nextleft = nextright = imin; + Marked[imin] = -1; + y = ICEIL(ptsIn[nextleft].y + yFtrans); + + /* + * loop through all edges of the polygon + */ + do { + /* add a left edge if we need to */ + if ((y > (ptsIn[nextleft].y + yFtrans) || + ISEQUAL(y, ptsIn[nextleft].y + yFtrans)) && + Marked[nextleft] != 1) { + Marked[nextleft]++; + left = nextleft++; + + /* find the next edge, considering the end conditions */ + if (nextleft >= count) + nextleft = 0; + + /* now compute the starting point and slope */ + dy = ptsIn[nextleft].y - ptsIn[left].y; + if (dy != 0.0) { + ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy; + dy = y - (ptsIn[left].y + yFtrans); + xl = (ptsIn[left].x + xFtrans) + ml * max(dy, 0); + } + } + + /* add a right edge if we need to */ + if ((y > ptsIn[nextright].y + yFtrans) || + (ISEQUAL(y, ptsIn[nextright].y + yFtrans) + && Marked[nextright] != 1)) { + Marked[nextright]++; + right = nextright--; + + /* find the next edge, considering the end conditions */ + if (nextright < 0) + nextright = count - 1; + + /* now compute the starting point and slope */ + dy = ptsIn[nextright].y - ptsIn[right].y; + if (dy != 0.0) { + mr = (ptsIn[nextright].x - ptsIn[right].x) / dy; + dy = y - (ptsIn[right].y + yFtrans); + xr = (ptsIn[right].x + xFtrans) + mr * max(dy, 0); + } + } + + /* + * generate scans to fill while we still have + * a right edge as well as a left edge. + */ + i = (min(ptsIn[nextleft].y, ptsIn[nextright].y) + yFtrans) - y; + + if (i < EPSILON) { + if (Marked[nextleft] && Marked[nextright]) { + /* Arrgh, we're trapped! (no more points) + * Out, we've got to get out of here before this decadence saps + * our will completely! */ + break; + } + continue; + } + else { + j = (int) i; + if (!j) + j++; + } + while (j > 0) { + int cxl, cxr; + + ptsOut->y = (y) + yTrans; + + cxl = ICEIL(xl); + cxr = ICEIL(xr); + /* reverse the edges if necessary */ + if (xl < xr) { + *(width++) = cxr - cxl; + (ptsOut++)->x = cxl + xTrans; + } + else { + *(width++) = cxl - cxr; + (ptsOut++)->x = cxr + xTrans; + } + y++; + + /* increment down the edges */ + xl += ml; + xr += mr; + j--; + } + } while (y <= ymax); + + /* Finally, fill the spans we've collected */ + (*pgc->ops->FillSpans) (dst, pgc, + ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); + free(Marked); + free(FirstWidth); + free(FirstPoint); +} static double angleBetween(SppPointRec center, SppPointRec point1, SppPointRec point2) { @@ -1291,7 +1481,7 @@ miArcCap(DrawablePtr pDraw, /* MIROUNDCAP -- a private helper function * Put Rounded cap on end. pCenter is the center of this end of the line * pEnd is the center of the other end of the line. pCorner is one of the - * two corners at this end of the line. + * two corners at this end of the line. * NOTE: pOtherCorner must be counter-clockwise from pCorner. */ /*ARGSUSED*/ static void @@ -1443,7 +1633,7 @@ miDatan2(double dy, double dx) * array. (For example, if we want to leave a spare point to make sectors * instead of segments.) So we pass in the malloc()ed chunk that contains the * array and an index saying where we should start stashing the points. - * If there isn't an array already, we just pass in a null pointer and + * If there isn't an array already, we just pass in a null pointer and * count on realloc() to handle the null pointer correctly. */ static int @@ -1462,7 +1652,7 @@ miGetArcPts(SppArcPtr parc, /* points to an arc */ SppPointPtr poly; /* The spec says that positive angles indicate counterclockwise motion. - * Given our coordinate system (with 0,0 in the upper left corner), + * Given our coordinate system (with 0,0 in the upper left corner), * the screen appears flipped in Y. The easiest fix is to negate the * angles given */ @@ -2548,7 +2738,7 @@ computeBound(struct arc_def *def, } /* - * this section computes the x value of the span at y + * this section computes the x value of the span at y * intersected with the specified face of the ellipse. * * this is the min/max X value over the set of normal @@ -2561,7 +2751,7 @@ computeBound(struct arc_def *def, * * compute the derivative with-respect-to ellipse_y and solve * for zero: - * + * * (w^2 - h^2) ellipse_y^3 + h^4 y * 0 = - ---------------------------------- * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2) @@ -2588,7 +2778,7 @@ computeBound(struct arc_def *def, * * or (to use accelerators), * - * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2) + * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2) * */ @@ -3396,3 +3586,12 @@ drawQuadrant(struct arc_def *def, y--; } } + +void +miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) +{ + if (pGC->lineWidth == 0) + miZeroPolyArc(pDraw, pGC, narcs, parcs); + else + miWideArc(pDraw, pGC, narcs, parcs); +} diff --git a/xserver/mi/mibitblt.c b/xserver/mi/mibitblt.c index 3ed4ed1cc..724396333 100644 --- a/xserver/mi/mibitblt.c +++ b/xserver/mi/mibitblt.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -66,13 +66,13 @@ SOFTWARE. extern int ffs(int); #endif -/* MICOPYAREA -- public entry for the CopyArea request +/* MICOPYAREA -- public entry for the CopyArea request * For each rectangle in the source region * get the pixels with GetSpans * set them in the destination with SetSpans * We let SetSpans worry about clipping to the destination. */ -RegionPtr +_X_COLD RegionPtr miCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, @@ -242,8 +242,7 @@ miCopyArea(DrawablePtr pSrcDrawable, } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, - widthSrc, heightSrc, xOut, yOut, - (unsigned long) 0); + widthSrc, heightSrc, xOut, yOut); if (realSrcClip) RegionDestroy(prgnSrcClip); @@ -254,7 +253,7 @@ miCopyArea(DrawablePtr pSrcDrawable, } /* MIGETPLANE -- gets a bitmap representing one plane of pDraw - * A helper used for CopyPlane and XY format GetImage + * A helper used for CopyPlane and XY format GetImage * No clever strategy here, we grab a scanline at a time, pull out the * bits and then stuff them in a 1 bit deep map. */ @@ -262,8 +261,7 @@ miCopyArea(DrawablePtr pSrcDrawable, * This should be replaced with something more general. mi shouldn't have to * care about such things as scanline padding et alia. */ -static -MiBits * +_X_COLD static MiBits * miGetPlane(DrawablePtr pDraw, int planeNum, /* number of the bitPlane */ int sx, int sy, int w, int h, MiBits * result) { @@ -360,16 +358,16 @@ miGetPlane(DrawablePtr pDraw, int planeNum, /* number of the bitPlane */ } /* MIOPQSTIPDRAWABLE -- use pbits as an opaque stipple for pDraw. - * Drawing through the clip mask we SetSpans() the bits into a + * Drawing through the clip mask we SetSpans() the bits into a * bitmap and stipple those bits onto the destination drawable by doing a - * PolyFillRect over the whole drawable, + * PolyFillRect over the whole drawable, * then we invert the bitmap by copying it onto itself with an alu of * GXinvert, invert the foreground/background colors of the gc, and draw * the background bits. * Note how the clipped out bits of the bitmap are always the background * color so that the stipple never causes FillRect to draw them. */ -static void +_X_COLD static void miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, MiBits * pbits, int srcx, int w, int h, int dstx, int dsty) { @@ -506,12 +504,12 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, } /* MICOPYPLANE -- public entry for the CopyPlane request. - * strategy: - * First build up a bitmap out of the bits requested + * strategy: + * First build up a bitmap out of the bits requested * build a source clip - * Use the bitmap we've built up as a Stipple for the destination + * Use the bitmap we've built up as a Stipple for the destination */ -RegionPtr +_X_COLD RegionPtr miCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, @@ -579,7 +577,7 @@ miCopyPlane(DrawablePtr pSrcDrawable, } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane); + width, height, dstx, dsty); RegionDestroy(prgnSrc); return prgnExposed; } @@ -600,7 +598,7 @@ miCopyPlane(DrawablePtr pSrcDrawable, * XY format: * get the single plane specified in planemask */ -void +_X_COLD void miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pDst) { @@ -672,16 +670,16 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, /* MIPUTIMAGE -- public entry for the PutImage request * Here we benefit from knowing the format of the bits pointed to by pImage, - * even if we don't know how pDraw represents them. - * Three different strategies are used depending on the format + * even if we don't know how pDraw represents them. + * Three different strategies are used depending on the format * XYBitmap Format: * we just use the Opaque Stipple helper function to cover the destination - * Note that this covers all the planes of the drawable with the + * Note that this covers all the planes of the drawable with the * foreground color (masked with the GC planemask) where there are 1 bits * and the background color (masked with the GC planemask) where there are * 0 bits * XYPixmap format: - * what we're called with is a series of XYBitmaps, but we only want + * what we're called with is a series of XYBitmaps, but we only want * each XYPixmap to update 1 plane, instead of updating all of them. * we set the foreground color to be all 1s and the background to all 0s * then for each plane, we set the plane mask to only effect that one @@ -690,7 +688,7 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, * ZPixmap format: * This part is simple, just call SetSpans */ -void +_X_COLD void miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { diff --git a/xserver/mi/micmap.c b/xserver/mi/micmap.c index 4648b9a70..1aeb359ba 100644 --- a/xserver/mi/micmap.c +++ b/xserver/mi/micmap.c @@ -235,42 +235,7 @@ miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem * indefs, Bool miCreateDefColormap(ScreenPtr pScreen) { -/* - * In the following sources PC X server vendors may want to delete - * "_not_tog" from "#ifdef WIN32_not_tog" - */ -#ifdef WIN32_not_tog - /* - * these are the MS-Windows desktop colors, adjusted for X's 16-bit - * color specifications. - */ - static xColorItem citems[] = { - {0, 0, 0, 0, 0, 0}, - {1, 0x8000, 0, 0, 0, 0}, - {2, 0, 0x8000, 0, 0, 0}, - {3, 0x8000, 0x8000, 0, 0, 0}, - {4, 0, 0, 0x8000, 0, 0}, - {5, 0x8000, 0, 0x8000, 0, 0}, - {6, 0, 0x8000, 0x8000, 0, 0}, - {7, 0xc000, 0xc000, 0xc000, 0, 0}, - {8, 0xc000, 0xdc00, 0xc000, 0, 0}, - {9, 0xa600, 0xca00, 0xf000, 0, 0}, - {246, 0xff00, 0xfb00, 0xf000, 0, 0}, - {247, 0xa000, 0xa000, 0xa400, 0, 0}, - {248, 0x8000, 0x8000, 0x8000, 0, 0}, - {249, 0xff00, 0, 0, 0, 0}, - {250, 0, 0xff00, 0, 0, 0}, - {251, 0xff00, 0xff00, 0, 0, 0}, - {252, 0, 0, 0xff00, 0, 0}, - {253, 0xff00, 0, 0xff00, 0, 0}, - {254, 0, 0xff00, 0xff00, 0, 0}, - {255, 0xff00, 0xff00, 0xff00, 0, 0} - }; -#define NUM_DESKTOP_COLORS sizeof citems / sizeof citems[0] - int i; -#else unsigned short zero = 0, ones = 0xFFFF; -#endif Pixel wp, bp; VisualPtr pVisual; ColormapPtr cmap; @@ -294,21 +259,12 @@ miCreateDefColormap(ScreenPtr pScreen) if (pScreen->rootDepth > 1) { wp = pScreen->whitePixel; bp = pScreen->blackPixel; -#ifdef WIN32_not_tog - for (i = 0; i < NUM_DESKTOP_COLORS; i++) { - if (AllocColor(cmap, - &citems[i].red, &citems[i].green, &citems[i].blue, - &citems[i].pixel, 0) != Success) - return FALSE; - } -#else if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) != Success) || (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) != Success)) return FALSE; pScreen->whitePixel = wp; pScreen->blackPixel = bp; -#endif } (*pScreen->InstallColormap) (cmap); diff --git a/xserver/mi/micoord.h b/xserver/mi/micoord.h index 481e418c5..c83bffd90 100644 --- a/xserver/mi/micoord.h +++ b/xserver/mi/micoord.h @@ -32,27 +32,7 @@ /* Macros which handle a coordinate in a single register */ -/* - * Most compilers will convert divisions by 65536 into shifts, if signed - * shifts exist. If your machine does arithmetic shifts and your compiler - * can't get it right, add to this line. - */ - -/* - * mips compiler - what a joke - it CSEs the 65536 constant into a reg - * forcing as to use div instead of shift. Let's be explicit. - */ - -#if defined(mips) || \ - defined(sparc) || defined(__sparc64__) || \ - defined(__alpha) || defined(__alpha__) || \ - defined(__i386__) || defined(__i386) || defined(__ia64__) || \ - defined(__s390x__) || defined(__s390__) || \ - defined(__amd64__) || defined(amd64) || defined(__amd64) #define GetHighWord(x) (((int) (x)) >> 16) -#else -#define GetHighWord(x) (((int) (x)) / 65536) -#endif #if IMAGE_BYTE_ORDER == MSBFirst #define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i)))) diff --git a/xserver/mi/micopy.c b/xserver/mi/micopy.c index 30795114d..2409c7880 100644 --- a/xserver/mi/micopy.c +++ b/xserver/mi/micopy.c @@ -167,7 +167,7 @@ miDoCopy(DrawablePtr pSrcDrawable, /* Compute source clip region */ if (pSrcDrawable->type == DRAWABLE_PIXMAP) { - if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE)) + if ((pSrcDrawable == pDstDrawable) && (!pGC->clientClip)) prgnSrcClip = miGetCompositeClip(pGC); else fastSrc = TRUE; @@ -186,8 +186,7 @@ miDoCopy(DrawablePtr pSrcDrawable, */ fastSrc = TRUE; } - else if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) { + else if ((pSrcDrawable == pDstDrawable) && (!pGC->clientClip)) { prgnSrcClip = miGetCompositeClip(pGC); } else { @@ -304,8 +303,7 @@ miDoCopy(DrawablePtr pSrcDrawable, yIn - pSrcDrawable->y, widthSrc, heightSrc, xOut - pDstDrawable->x, - yOut - pDstDrawable->y, - (unsigned long) bitPlane); + yOut - pDstDrawable->y); RegionUninit(&rgnDst); if (freeSrcClip) RegionDestroy(prgnSrcClip); diff --git a/xserver/mi/micursor.c b/xserver/mi/micursor.c deleted file mode 100644 index 13ce776db..000000000 --- a/xserver/mi/micursor.c +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "cursor.h" -#include "misc.h" -#include "mi.h" -#include "inputstr.h" - -void -miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr, - CursorPtr pCurs, Bool displayed) -{ - /* - * This is guaranteed to correct any color-dependent state which may have - * been bound up in private state created by RealizeCursor - */ - pScr->UnrealizeCursor(pDev, pScr, pCurs); - pScr->RealizeCursor(pDev, pScr, pCurs); - if (displayed) - pScr->DisplayCursor(pDev, pScr, pCurs); -} diff --git a/xserver/mi/midash.c b/xserver/mi/midash.c index 78cbaf25e..08f11aa38 100644 --- a/xserver/mi/midash.c +++ b/xserver/mi/midash.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -49,7 +49,6 @@ SOFTWARE. #include "regionstr.h" #include "mistruct.h" -#include "mifpoly.h" void miStepDash(int dist, /* distance to step */ diff --git a/xserver/mi/midispcur.c b/xserver/mi/midispcur.c index 8cca5fe6e..50f0dd212 100644 --- a/xserver/mi/midispcur.c +++ b/xserver/mi/midispcur.c @@ -78,9 +78,9 @@ typedef struct { (miDCBufferPtr)dixLookupScreenPrivate(&dev->devPrivates, miDCDeviceKey, screen) : \ (miDCBufferPtr)dixLookupScreenPrivate(&GetMaster(dev, MASTER_POINTER)->devPrivates, miDCDeviceKey, screen)) -/* +/* * The core pointer buffer will point to the index of the virtual pointer - * in the pCursorBuffers array. + * in the pCursorBuffers array. */ typedef struct { CloseScreenProcPtr CloseScreen; diff --git a/xserver/mi/miexpose.c b/xserver/mi/miexpose.c index 198c4332f..fc4dbc071 100644 --- a/xserver/mi/miexpose.c +++ b/xserver/mi/miexpose.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -107,7 +107,7 @@ the region package can call this. #define RECTLIMIT 25 /* pick a number, any number > 8 */ #endif -/* miHandleExposures +/* miHandleExposures generate a region for exposures for areas that were copied from obscured or non-existent areas to non-obscured areas of the destination. Paint the background for the region, if the destination is a window. @@ -116,18 +116,12 @@ NOTE: this should generally be called, even if graphicsExposures is false, because this is where bits get recovered from backing store. -NOTE: - added argument 'plane' is used to indicate how exposures from backing -store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea -should be used, else a CopyPlane of the indicated plane will be used. The -exposing is done by the backing store's GraphicsExpose function, of course. - */ RegionPtr miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, - int dstx, int dsty, unsigned long plane) + int dstx, int dsty) { RegionPtr prgnSrcClip; /* drawable-relative source clip */ RegionRec rgnSrcRec; @@ -137,8 +131,8 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionRec rgnExposed; /* exposed region, calculated source- relative, made dst relative to intersect with visible parts of - dest and send events to client, - and then screen relative to paint + dest and send events to client, + and then screen relative to paint the window background */ WindowPtr pSrcWin; @@ -149,7 +143,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, if (!pGC->graphicsExposures && (pDstDrawable->type == DRAWABLE_PIXMAP) && ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr) pSrcDrawable)->backStorage == NULL))) + (((WindowPtr) pSrcDrawable)->backStorage == 0))) return NULL; srcBox.x1 = srcx; @@ -236,7 +230,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionIntersect(&rgnExposed, &rgnExposed, prgnDstClip); /* intersect with client clip region. */ - if (pGC->clientClipType == CT_REGION) + if (pGC->clientClip) RegionIntersect(&rgnExposed, &rgnExposed, pGC->clientClip); /* @@ -312,53 +306,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } } -/* send GraphicsExpose events, or a NoExpose event, based on the region */ - -void -miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, - int major, int minor) -{ - if (pRgn && !RegionNil(pRgn)) { - xEvent *pEvent; - xEvent *pe; - BoxPtr pBox; - int i; - int numRects; - - numRects = RegionNumRects(pRgn); - pBox = RegionRects(pRgn); - if (!(pEvent = calloc(numRects, sizeof(xEvent)))) - return; - pe = pEvent; - - for (i = 1; i <= numRects; i++, pe++, pBox++) { - pe->u.u.type = GraphicsExpose; - pe->u.graphicsExposure.drawable = drawable; - pe->u.graphicsExposure.x = pBox->x1; - pe->u.graphicsExposure.y = pBox->y1; - pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; - pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; - pe->u.graphicsExposure.count = numRects - i; - pe->u.graphicsExposure.majorEvent = major; - pe->u.graphicsExposure.minorEvent = minor; - } - /* GraphicsExpose is a "critical event", which TryClientEvents - * handles specially. */ - TryClientEvents(client, NULL, pEvent, numRects, - (Mask) 0, NoEventMask, NullGrab); - free(pEvent); - } - else { - xEvent event = { - .u.noExposure.drawable = drawable, - .u.noExposure.majorEvent = major, - .u.noExposure.minorEvent = minor - }; - event.u.u.type = NoExpose; - WriteEventsToClient(client, 1, &event); - } -} - void miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy) { @@ -421,30 +368,15 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy) } void -miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) +miWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; - if ((prgn && !RegionNil(prgn)) || - (exposures && !RegionNil(exposures)) || other_exposed) { + if (prgn && !RegionNil(prgn)) { RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = + int clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask; - if (other_exposed) { - if (exposures) { - RegionUnion(other_exposed, exposures, other_exposed); - if (exposures != prgn) - RegionDestroy(exposures); - } - exposures = other_exposed; - } - if (clientInterested && exposures && - (RegionNumRects(exposures) > RECTLIMIT)) { + if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) { /* * If we have LOTS of rectangles, we decide to take the extents * and force an exposure on that. This should require much less @@ -453,34 +385,21 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) */ BoxRec box; - box = *RegionExtents(exposures); - if (exposures == prgn) { - exposures = &expRec; - RegionInit(exposures, &box, 1); - RegionReset(prgn, &box); - } - else { - RegionReset(exposures, &box); - RegionUnion(prgn, prgn, exposures); - } + 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); } - if (prgn && !RegionNil(prgn)) - miPaintWindow(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !RegionNil(exposures)) + miPaintWindow(pWin, prgn, PW_BACKGROUND); + if (clientInterested) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) { + if (exposures == &expRec) RegionUninit(exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - RegionDestroy(exposures); - if (prgn) - RegionEmpty(prgn); + RegionEmpty(prgn); } - else if (exposures && exposures != prgn) - RegionDestroy(exposures); } #ifdef ROOTLESS @@ -645,7 +564,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) } /* MICLEARDRAWABLE -- sets the entire drawable to the background color of - * the GC. Useful when we have a scratch drawable and need to initialize + * the GC. Useful when we have a scratch drawable and need to initialize * it. */ void miClearDrawable(DrawablePtr pDraw, GCPtr pGC) diff --git a/xserver/mi/mifillarc.c b/xserver/mi/mifillarc.c index 337343dd1..888519edf 100644 --- a/xserver/mi/mifillarc.c +++ b/xserver/mi/mifillarc.c @@ -36,7 +36,6 @@ Author: Bob Scheifler, MIT X Consortium #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" -#include "mifpoly.h" #include "mi.h" #include "mifillarc.h" @@ -51,7 +50,7 @@ Author: Bob Scheifler, MIT X Consortium #define Dsin(d) sin((double)d*(M_PI/11520.0)) #define Dcos(d) cos((double)d*(M_PI/11520.0)) -void +static void miFillArcSetup(xArc * arc, miFillArcRec * info) { info->y = arc->height >> 1; @@ -277,7 +276,7 @@ miGetPieEdge(xArc * arc, int angle, miSliceEdgePtr edge, Bool top, Bool left) miGetArcEdge(arc, edge, k, top, left); } -void +static void miFillArcSliceSetup(xArc * arc, miArcSliceRec * slice, GCPtr pGC) { int angle1, angle2; @@ -476,26 +475,16 @@ miFillArcSliceSetup(xArc * arc, miArcSliceRec * slice, GCPtr pGC) *wids++ = slw; \ } -static void -miFillEllipseI(DrawablePtr pDraw, GCPtr pGC, xArc * arc) +static int +miFillEllipseI(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; int slw; miFillArcRec info; - DDXPointPtr points; DDXPointPtr pts; - int *widths; int *wids; - points = malloc(sizeof(DDXPointRec) * arc->height); - if (!points) - return; - widths = malloc(sizeof(int) * arc->height); - if (!widths) { - free(points); - return; - } miFillArcSetup(arc, &info); MIFILLARCSETUP(); if (pGC->miTranslate) { @@ -508,31 +497,19 @@ miFillEllipseI(DrawablePtr pDraw, GCPtr pGC, xArc * arc) MIFILLARCSTEP(slw); ADDSPANS(); } - (*pGC->ops->FillSpans) (pDraw, pGC, pts - points, points, widths, FALSE); - free(widths); - free(points); + return pts - points; } -static void -miFillEllipseD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) +static int +miFillEllipseD(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y; int xorg, yorg, dx, dy, slw; double e, yk, xk, ym, xm; miFillArcDRec info; - DDXPointPtr points; DDXPointPtr pts; - int *widths; int *wids; - points = malloc(sizeof(DDXPointRec) * arc->height); - if (!points) - return; - widths = malloc(sizeof(int) * arc->height); - if (!widths) { - free(points); - return; - } miFillArcDSetup(arc, &info); MIFILLARCSETUP(); if (pGC->miTranslate) { @@ -545,9 +522,7 @@ miFillEllipseD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) MIFILLARCSTEP(slw); ADDSPANS(); } - (*pGC->ops->FillSpans) (pDraw, pGC, pts - points, points, widths, FALSE); - free(widths); - free(points); + return pts - points; } #define ADDSPAN(l,r) \ @@ -572,17 +547,15 @@ miFillEllipseD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) ADDSPAN(xl, xc); \ } -static void -miFillArcSliceI(DrawablePtr pDraw, GCPtr pGC, xArc * arc) +static int +miFillArcSliceI(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; int x, y, e; miFillArcRec info; miArcSliceRec slice; int ya, xl, xr, xc; - DDXPointPtr points; DDXPointPtr pts; - int *widths; int *wids; miFillArcSetup(arc, &info); @@ -591,14 +564,6 @@ miFillArcSliceI(DrawablePtr pDraw, GCPtr pGC, xArc * arc) slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = malloc(sizeof(DDXPointRec) * slw); - if (!points) - return; - widths = malloc(sizeof(int) * slw); - if (!widths) { - free(points); - return; - } if (pGC->miTranslate) { xorg += pDraw->x; yorg += pDraw->y; @@ -622,13 +587,11 @@ miFillArcSliceI(DrawablePtr pDraw, GCPtr pGC, xArc * arc) ADDSLICESPANS(slice.flip_bot); } } - (*pGC->ops->FillSpans) (pDraw, pGC, pts - points, points, widths, FALSE); - free(widths); - free(points); + return pts - points; } -static void -miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) +static int +miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc, DDXPointPtr points, int *widths) { int x, y; int dx, dy, xorg, yorg, slw; @@ -636,9 +599,7 @@ miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) miFillArcDRec info; miArcSliceRec slice; int ya, xl, xr, xc; - DDXPointPtr points; DDXPointPtr pts; - int *widths; int *wids; miFillArcDSetup(arc, &info); @@ -647,14 +608,6 @@ miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = malloc(sizeof(DDXPointRec) * slw); - if (!points) - return; - widths = malloc(sizeof(int) * slw); - if (!widths) { - free(points); - return; - } if (pGC->miTranslate) { xorg += pDraw->x; yorg += pDraw->y; @@ -678,35 +631,74 @@ miFillArcSliceD(DrawablePtr pDraw, GCPtr pGC, xArc * arc) ADDSLICESPANS(slice.flip_bot); } } - (*pGC->ops->FillSpans) (pDraw, pGC, pts - points, points, widths, FALSE); - free(widths); - free(points); + return pts - points; } /* MIPOLYFILLARC -- The public entry for the PolyFillArc request. * Since we don't have to worry about overlapping segments, we can just * fill each arc as it comes. */ -void -miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - int i; - xArc *arc; - for (i = narcs, arc = parcs; --i >= 0; arc++) { - if (miFillArcEmpty(arc)) - continue; - if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) { - if (miCanFillArc(arc)) - miFillEllipseI(pDraw, pGC, arc); - else - miFillEllipseD(pDraw, pGC, arc); +/* Limit the number of spans in a single draw request to avoid integer + * overflow in the computation of the span buffer size. + */ +#define MAX_SPANS_PER_LOOP (4 * 1024 * 1024) + +void +miPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs_all, xArc * parcs) +{ + while (narcs_all > 0) { + int narcs; + int i; + xArc *arc; + int nspans = 0; + DDXPointPtr pts, points; + int *wids, *widths; + int n; + + for (narcs = 0, arc = parcs; narcs < narcs_all; narcs++, arc++) { + if (narcs && nspans + arc->height > MAX_SPANS_PER_LOOP) + break; + nspans += arc->height; + + /* A pie-slice arc may add another pile of spans */ + if (pGC->arcMode == ArcPieSlice && + (-FULLCIRCLE < arc->angle2 && arc->angle2 < FULLCIRCLE)) + nspans += (arc->height + 1) >> 1; } - else { - if (miCanFillArc(arc)) - miFillArcSliceI(pDraw, pGC, arc); - else - miFillArcSliceD(pDraw, pGC, arc); + + pts = points = malloc (sizeof (DDXPointRec) * nspans + + sizeof(int) * nspans); + if (points) { + wids = widths = (int *) (points + nspans); + + for (i = 0, arc = parcs; i < narcs; arc++, i++) { + if (miFillArcEmpty(arc)) + continue; + if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) + { + if (miCanFillArc(arc)) + n = miFillEllipseI(pDraw, pGC, arc, pts, wids); + else + n = miFillEllipseD(pDraw, pGC, arc, pts, wids); + } + else + { + if (miCanFillArc(arc)) + n = miFillArcSliceI(pDraw, pGC, arc, pts, wids); + else + n = miFillArcSliceD(pDraw, pGC, arc, pts, wids); + } + pts += n; + wids += n; + } + nspans = pts - points; + if (nspans) + (*pGC->ops->FillSpans) (pDraw, pGC, nspans, points, + widths, FALSE); + free (points); } + parcs += narcs; + narcs_all -= narcs; } } diff --git a/xserver/mi/mifillarc.h b/xserver/mi/mifillarc.h index 1478d1850..61ab2538d 100644 --- a/xserver/mi/mifillarc.h +++ b/xserver/mi/mifillarc.h @@ -175,13 +175,4 @@ typedef struct _miArcSlice { #define miFillInArcLower(slw) (((iny + dy) != 0) && \ ((slw > 1) || (ine != inxk))) -extern _X_EXPORT void miFillArcSetup(xArc * /*arc */ , - miFillArcRec * /*info */ - ); - -extern _X_EXPORT void miFillArcSliceSetup(xArc * /*arc */ , - miArcSliceRec * /*slice */ , - GCPtr /*pGC */ - ); - #endif /* __MIFILLARC_H__ */ diff --git a/xserver/mi/mifillrct.c b/xserver/mi/mifillrct.c index 79c4057d7..28f2322e6 100644 --- a/xserver/mi/mifillrct.c +++ b/xserver/mi/mifillrct.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -65,7 +65,7 @@ SOFTWARE. * then call FillSpans to fill each rectangle. We let FillSpans worry about * clipping to the destination */ -void +_X_COLD void miPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /* number of rectangles to fill */ xRectangle *prectInit /* Pointer to first rectangle to fill */ ) diff --git a/xserver/mi/mifpoly.h b/xserver/mi/mifpoly.h index f853fb46b..3202476b2 100644 --- a/xserver/mi/mifpoly.h +++ b/xserver/mi/mifpoly.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -49,24 +49,6 @@ SOFTWARE. #include -#define EPSILON 0.000001 -#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON) -#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON) -#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \ - (b) - (a) <= 0.5) -#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5))) -#define ISZERO(x) (fabs((x)) <= EPSILON) -#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) -#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y)) -#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y)) - -#define NotEnd 0 -#define FirstEnd 1 -#define SecondEnd 2 - -#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */ -#define D2SECANT 5.21671526231167 /* 1/2*sin(11/2) - max extension per width */ - static _X_INLINE int ICEIL(double x) { @@ -75,28 +57,4 @@ ICEIL(double x) return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp + 1; } -/* Point with sub-pixel positioning. In this case we use doubles, but - * see mifpolycon.c for other suggestions - */ -typedef struct _SppPoint { - double x, y; -} SppPointRec, *SppPointPtr; - -typedef struct _SppArc { - double x, y, width, height; - double angle1, angle2; -} SppArcRec, *SppArcPtr; - -/* mifpolycon.c */ - -extern _X_EXPORT void miFillSppPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - SppPointPtr /*ptsIn */ , - int /*xTrans */ , - int /*yTrans */ , - double /*xFtrans */ , - double /*yFtrans */ - ); - #endif /* __MIFPOLY_H__ */ diff --git a/xserver/mi/mifpolycon.c b/xserver/mi/mifpolycon.c deleted file mode 100644 index b1337315b..000000000 --- a/xserver/mi/mifpolycon.c +++ /dev/null @@ -1,249 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "mifpoly.h" - -static int GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans, - int *by, int *ty); - -/* - * Written by Todd Newman; April. 1987. - * - * Fill a convex polygon. If the given polygon - * is not convex, then the result is undefined. - * The algorithm is to order the edges from smallest - * y to largest by partitioning the array into a left - * edge list and a right edge list. The algorithm used - * to traverse each edge is digital differencing analyzer - * line algorithm with y as the major axis. There's some funny linear - * interpolation involved because of the subpixel postioning. - */ -void -miFillSppPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */ - SppPointPtr ptsIn, /* the points */ - int xTrans, int yTrans, /* Translate each point by this */ - double xFtrans, double yFtrans /* translate before conversion - by this amount. This provides - a mechanism to match rounding - errors with any shape that must - meet the polygon exactly. - */ - ) -{ - double xl = 0.0, xr = 0.0, /* x vals of left and right edges */ - ml = 0.0, /* left edge slope */ - mr = 0.0, /* right edge slope */ - dy, /* delta y */ - i; /* loop counter */ - int y, /* current scanline */ - j, imin, /* index of vertex with smallest y */ - ymin, /* y-extents of polygon */ - ymax, *width, *FirstWidth, /* output buffer */ - *Marked; /* set if this vertex has been used */ - int left, right, /* indices to first endpoints */ - nextleft, nextright; /* indices to second endpoints */ - DDXPointPtr ptsOut, FirstPoint; /* output buffer */ - - if (pgc->miTranslate) { - xTrans += dst->x; - yTrans += dst->y; - } - - imin = GetFPolyYBounds(ptsIn, count, yFtrans, &ymin, &ymax); - - 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); - - if (!ptsOut || !width || !Marked) { - free(Marked); - free(width); - free(ptsOut); - return; - } - - for (j = 0; j < count; j++) - Marked[j] = 0; - nextleft = nextright = imin; - Marked[imin] = -1; - y = ICEIL(ptsIn[nextleft].y + yFtrans); - - /* - * loop through all edges of the polygon - */ - do { - /* add a left edge if we need to */ - if ((y > (ptsIn[nextleft].y + yFtrans) || - ISEQUAL(y, ptsIn[nextleft].y + yFtrans)) && - Marked[nextleft] != 1) { - Marked[nextleft]++; - left = nextleft++; - - /* find the next edge, considering the end conditions */ - if (nextleft >= count) - nextleft = 0; - - /* now compute the starting point and slope */ - dy = ptsIn[nextleft].y - ptsIn[left].y; - if (dy != 0.0) { - ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy; - dy = y - (ptsIn[left].y + yFtrans); - xl = (ptsIn[left].x + xFtrans) + ml * max(dy, 0); - } - } - - /* add a right edge if we need to */ - if ((y > ptsIn[nextright].y + yFtrans) || - (ISEQUAL(y, ptsIn[nextright].y + yFtrans) - && Marked[nextright] != 1)) { - Marked[nextright]++; - right = nextright--; - - /* find the next edge, considering the end conditions */ - if (nextright < 0) - nextright = count - 1; - - /* now compute the starting point and slope */ - dy = ptsIn[nextright].y - ptsIn[right].y; - if (dy != 0.0) { - mr = (ptsIn[nextright].x - ptsIn[right].x) / dy; - dy = y - (ptsIn[right].y + yFtrans); - xr = (ptsIn[right].x + xFtrans) + mr * max(dy, 0); - } - } - - /* - * generate scans to fill while we still have - * a right edge as well as a left edge. - */ - i = (min(ptsIn[nextleft].y, ptsIn[nextright].y) + yFtrans) - y; - - if (i < EPSILON) { - if (Marked[nextleft] && Marked[nextright]) { - /* Arrgh, we're trapped! (no more points) - * Out, we've got to get out of here before this decadence saps - * our will completely! */ - break; - } - continue; - } - else { - j = (int) i; - if (!j) - j++; - } - while (j > 0) { - int cxl, cxr; - - ptsOut->y = (y) + yTrans; - - cxl = ICEIL(xl); - cxr = ICEIL(xr); - /* reverse the edges if necessary */ - if (xl < xr) { - *(width++) = cxr - cxl; - (ptsOut++)->x = cxl + xTrans; - } - else { - *(width++) = cxl - cxr; - (ptsOut++)->x = cxr + xTrans; - } - y++; - - /* increment down the edges */ - xl += ml; - xr += mr; - j--; - } - } while (y <= ymax); - - /* Finally, fill the spans we've collected */ - (*pgc->ops->FillSpans) (dst, pgc, - ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); - free(Marked); - free(FirstWidth); - free(FirstPoint); -} - -/* Find the index of the point with the smallest y.also return the - * smallest and largest y */ -static - int -GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans, int *by, int *ty) -{ - SppPointPtr ptMin; - double ymin, ymax; - SppPointPtr ptsStart = pts; - - ptMin = pts; - ymin = ymax = (pts++)->y; - - while (--n > 0) { - if (pts->y < ymin) { - ptMin = pts; - ymin = pts->y; - } - if (pts->y > ymax) - ymax = pts->y; - - pts++; - } - - *by = ICEIL(ymin + yFtrans); - *ty = ICEIL(ymax + yFtrans - 1); - return ptMin - ptsStart; -} diff --git a/xserver/mi/migc.c b/xserver/mi/migc.c index 9bbe8846e..8fdd4810c 100644 --- a/xserver/mi/migc.c +++ b/xserver/mi/migc.c @@ -55,20 +55,9 @@ miDestroyGC(GCPtr pGC) void miDestroyClip(GCPtr pGC) { - if (pGC->clientClipType == CT_NONE) - return; - else if (pGC->clientClipType == CT_PIXMAP) { - (*pGC->pScreen->DestroyPixmap) ((PixmapPtr) (pGC->clientClip)); - } - else { - /* - * we know we'll never have a list of rectangles, since ChangeClip - * immediately turns them into a region - */ + if (pGC->clientClip) RegionDestroy(pGC->clientClip); - } pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; } void @@ -77,8 +66,7 @@ miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) (*pGC->funcs->DestroyClip) (pGC); if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (void *) BitmapToRegion(pGC->pScreen, - (PixmapPtr) pvalue); + pGC->clientClip = BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } else if (type == CT_REGION) { @@ -86,34 +74,21 @@ miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) pGC->clientClip = pvalue; } else if (type != CT_NONE) { - pGC->clientClip = (void *) RegionFromRects(nrects, - (xRectangle *) pvalue, - type); + pGC->clientClip = RegionFromRects(nrects, (xRectangle *) pvalue, type); free(pvalue); } - pGC->clientClipType = (type != CT_NONE && - pGC->clientClip) ? CT_REGION : CT_NONE; pGC->stateChanges |= GCClipMask; } void miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) { - RegionPtr prgnNew; - - switch (pgcSrc->clientClipType) { - case CT_PIXMAP: - ((PixmapPtr) pgcSrc->clientClip)->refcnt++; - /* Fall through !! */ - case CT_NONE: - (*pgcDst->funcs->ChangeClip) (pgcDst, (int) pgcSrc->clientClipType, - pgcSrc->clientClip, 0); - break; - case CT_REGION: - prgnNew = RegionCreate(NULL, 1); + if (pgcSrc->clientClip) { + RegionPtr prgnNew = RegionCreate(NULL, 1); RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); - (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (void *) prgnNew, 0); - break; + (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, prgnNew, 0); + } else { + (*pgcDst->funcs->ChangeClip) (pgcDst, CT_NONE, NULL, 0); } } @@ -149,7 +124,7 @@ miComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable) * regions. (this wins especially if many clients clip by children * and have no client clip.) */ - if (pGC->clientClipType == CT_NONE) { + if (!pGC->clientClip) { if (freeCompClip) RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; @@ -206,7 +181,7 @@ miComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable) pGC->pCompositeClip = RegionCreate(&pixbounds, 1); } - if (pGC->clientClipType == CT_REGION) { + if (pGC->clientClip) { if (pDrawable->x || pDrawable->y) { RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, diff --git a/xserver/mi/miglblt.c b/xserver/mi/miglblt.c index b53ab9c0e..0183e998b 100644 --- a/xserver/mi/miglblt.c +++ b/xserver/mi/miglblt.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/miinitext.c b/xserver/mi/miinitext.c index 1d905167e..5872bf534 100644 --- a/xserver/mi/miinitext.c +++ b/xserver/mi/miinitext.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mioverlay.c b/xserver/mi/mioverlay.c index 7f502fa37..2b20fd72f 100644 --- a/xserver/mi/mioverlay.c +++ b/xserver/mi/mioverlay.c @@ -79,7 +79,7 @@ static void miOverlayMarkUnrealizedWindow(WindowPtr, WindowPtr, Bool); static int miOverlayValidateTree(WindowPtr, WindowPtr, VTKind); static void miOverlayHandleExposures(WindowPtr); static void miOverlayMoveWindow(WindowPtr, int, int, WindowPtr, VTKind); -static void miOverlayWindowExposures(WindowPtr, RegionPtr, RegionPtr); +static void miOverlayWindowExposures(WindowPtr, RegionPtr); static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int, unsigned int, WindowPtr); static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool); @@ -827,7 +827,7 @@ miOverlayHandleExposures(WindowPtr pWin) miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); WindowPtr pChild; ValidatePtr val; - void (*WindowExposures) (WindowPtr, RegionPtr, RegionPtr); + WindowExposuresProcPtr WindowExposures; WindowExposures = pWin->drawable.pScreen->WindowExposures; if (pPriv->underlayMarked) { @@ -849,8 +849,7 @@ miOverlayHandleExposures(WindowPtr pWin) } RegionUninit(&mival->borderExposed); - (*WindowExposures) (pTree->pWin, &mival->exposed, - NullRegion); + (*WindowExposures) (pTree->pWin, &mival->exposed); RegionUninit(&mival->exposed); } free(mival); @@ -886,7 +885,7 @@ miOverlayHandleExposures(WindowPtr pWin) if (RegionNotEmpty(&val->after.borderExposed)) { miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); } - (*WindowExposures) (pChild, &val->after.exposed, NullRegion); + (*WindowExposures) (pChild, &val->after.exposed); } RegionUninit(&val->after.borderExposed); RegionUninit(&val->after.exposed); @@ -980,42 +979,23 @@ miOverlayMoveWindow(WindowPtr pWin, #endif static void -miOverlayWindowExposures(WindowPtr pWin, - RegionPtr prgn, RegionPtr other_exposed) +miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; - if ((prgn && !RegionNil(prgn)) || - (exposures && !RegionNil(exposures)) || other_exposed) { + if (prgn && !RegionNil(prgn)) { RegionRec expRec; - int clientInterested; - - clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & - ExposureMask; - if (other_exposed) { - if (exposures) { - RegionUnion(other_exposed, exposures, other_exposed); - if (exposures != prgn) - RegionDestroy(exposures); - } - exposures = other_exposed; - } - if (clientInterested && exposures && - (RegionNumRects(exposures) > RECTLIMIT)) { + 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; - box = *RegionExtents(exposures); - if (exposures == prgn) { - exposures = &expRec; - RegionInit(exposures, &box, 1); - RegionReset(prgn, &box); - } - else { - RegionReset(exposures, &box); - RegionUnion(prgn, prgn, exposures); - } + box = *RegionExtents(prgn); + exposures = &expRec; + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); /* This is the only reason why we are replacing mi's version of this file */ @@ -1027,21 +1007,14 @@ miOverlayWindowExposures(WindowPtr pWin, else RegionIntersect(prgn, prgn, &pWin->clipList); } - if (prgn && !RegionNil(prgn)) - miPaintWindow(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !RegionNil(exposures)) + miPaintWindow(pWin, prgn, PW_BACKGROUND); + if (clientInterested) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) { + if (exposures == &expRec) RegionUninit(exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - RegionDestroy(exposures); - if (prgn) - RegionEmpty(prgn); + RegionEmpty(prgn); } - else if (exposures && exposures != prgn) - RegionDestroy(exposures); } typedef struct { @@ -1491,11 +1464,7 @@ miOverlaySetShape(WindowPtr pWin, int kind) if (WasViewable) { (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); - (*pScreen->ValidateTree) (pWin->parent, NullWindow, VTOther); - } - - if (WasViewable) { (*pScreen->HandleExposures) (pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree) (pWin->parent, NullWindow, @@ -1592,7 +1561,6 @@ miOverlayClearToBackground(WindowPtr pWin, miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); BoxRec box; RegionRec reg; - RegionPtr pBSReg = NullRegion; ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); RegionPtr clipList; @@ -1636,12 +1604,10 @@ miOverlayClearToBackground(WindowPtr pWin, RegionIntersect(®, ®, clipList); if (generateExposures) - (*pScreen->WindowExposures) (pWin, ®, pBSReg); + (*pScreen->WindowExposures) (pWin, ®); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); RegionUninit(®); - if (pBSReg) - RegionDestroy(pBSReg); } /****************************************************************/ @@ -1701,7 +1667,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) freeTmpClip = FALSE; } freeCompClip = pGC->freeCompClip; - if (pGC->clientClipType == CT_NONE) { + if (!pGC->clientClip) { if (freeCompClip) RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; diff --git a/xserver/mi/mipointer.c b/xserver/mi/mipointer.c index 6fa416d9d..ada1ab570 100644 --- a/xserver/mi/mipointer.c +++ b/xserver/mi/mipointer.c @@ -273,6 +273,20 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, return TRUE; } +void +miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr, + CursorPtr pCurs, Bool displayed) +{ + /* + * This is guaranteed to correct any color-dependent state which may have + * been bound up in private state created by RealizeCursor + */ + pScr->UnrealizeCursor(pDev, pScr, pCurs); + pScr->RealizeCursor(pDev, pScr, pCurs); + if (displayed) + pScr->DisplayCursor(pDev, pScr, pCurs); +} + /** * Set up sprite information for the device. * This function will be called once for each device after it is initialized @@ -539,10 +553,15 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) * The coordinates provided are always absolute. The parameter mode whether * it was relative or absolute movement that landed us at those coordinates. * + * If the cursor was constrained by a barrier, ET_Barrier* events may be + * generated and appended to the InternalEvent list provided. + * * @param pDev The device to move * @param mode Movement mode (Absolute or Relative) * @param[in,out] screenx The x coordinate in desktop coordinates * @param[in,out] screeny The y coordinate in desktop coordinates + * @param[in,out] nevents The number of events in events (before/after) + * @param[in,out] events The list of events before/after being constrained */ ScreenPtr miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, @@ -579,8 +598,8 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, int constrained_x, constrained_y; int current_x, current_y; /* current position in per-screen coord */ - current_x = MIPOINTER(pDev)->x - pScreen->y; - current_y = MIPOINTER(pDev)->y - pScreen->x; + current_x = MIPOINTER(pDev)->x - pScreen->x; + current_y = MIPOINTER(pDev)->y - pScreen->y; input_constrain_cursor(pDev, pScreen, current_x, current_y, x, y, diff --git a/xserver/mi/mipoly.c b/xserver/mi/mipoly.c index 07d981845..a332376d1 100644 --- a/xserver/mi/mipoly.c +++ b/xserver/mi/mipoly.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -47,11 +47,6 @@ SOFTWARE. * mipoly.c * * Written by Brian Kelleher; June 1986 - * - * Draw polygons. This routine translates the point by the - * origin if pGC->miTranslate is non-zero, and calls - * to the appropriate routine to actually scan convert the - * polygon. */ #ifdef HAVE_DIX_CONFIG_H #include @@ -62,8 +57,622 @@ SOFTWARE. #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" +#include "miscanfill.h" +#include "mipoly.h" #include "regionstr.h" +/* + * Insert the given edge into the edge table. First we must find the correct + * bucket in the Edge table, then find the right slot in the bucket. Finally, + * we can insert it. + */ +static Bool +miInsertEdgeInET(EdgeTable * ET, EdgeTableEntry * ETE, int scanline, + ScanLineListBlock ** SLLBlock, int *iSLLBlock) +{ + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; + ScanLineListBlock *tmpSLLBlock; + + /* + * find the right bucket to put the edge into + */ + pPrevSLL = &ET->scanlines; + pSLL = pPrevSLL->next; + while (pSLL && (pSLL->scanline < scanline)) { + pPrevSLL = pSLL; + pSLL = pSLL->next; + } + + /* + * reassign pSLL (pointer to ScanLineList) if necessary + */ + if ((!pSLL) || (pSLL->scanline > scanline)) { + if (*iSLLBlock > SLLSPERBLOCK - 1) { + tmpSLLBlock = malloc(sizeof(ScanLineListBlock)); + if (!tmpSLLBlock) + return FALSE; + (*SLLBlock)->next = tmpSLLBlock; + tmpSLLBlock->next = NULL; + *SLLBlock = tmpSLLBlock; + *iSLLBlock = 0; + } + pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); + + pSLL->next = pPrevSLL->next; + pSLL->edgelist = NULL; + pPrevSLL->next = pSLL; + } + pSLL->scanline = scanline; + + /* + * now insert the edge in the right bucket + */ + prev = NULL; + start = pSLL->edgelist; + while (start && (start->bres.minor < ETE->bres.minor)) { + prev = start; + start = start->next; + } + ETE->next = start; + + if (prev) + prev->next = ETE; + else + pSLL->edgelist = ETE; + return TRUE; +} + +static void +miFreeStorage(ScanLineListBlock * pSLLBlock) +{ + ScanLineListBlock *tmpSLLBlock; + + while (pSLLBlock) { + tmpSLLBlock = pSLLBlock->next; + free(pSLLBlock); + pSLLBlock = tmpSLLBlock; + } +} + +/* + * CreateEdgeTable + * + * This routine creates the edge table for scan converting polygons. + * The Edge Table (ET) looks like: + * + * EdgeTable + * -------- + * | ymax | ScanLineLists + * |scanline|-->------------>-------------->... + * -------- |scanline| |scanline| + * |edgelist| |edgelist| + * --------- --------- + * | | + * | | + * V V + * list of ETEs list of ETEs + * + * where ETE is an EdgeTableEntry data structure, and there is one ScanLineList + * per scanline at which an edge is initially entered. + */ + +static Bool +miCreateETandAET(int count, DDXPointPtr pts, EdgeTable * ET, + EdgeTableEntry * AET, EdgeTableEntry * pETEs, + ScanLineListBlock * pSLLBlock) +{ + DDXPointPtr top, bottom; + DDXPointPtr PrevPt, CurrPt; + int iSLLBlock = 0; + + int dy; + + if (count < 2) + return TRUE; + + /* + * initialize the Active Edge Table + */ + AET->next = NULL; + AET->back = NULL; + AET->nextWETE = NULL; + AET->bres.minor = MININT; + + /* + * initialize the Edge Table. + */ + ET->scanlines.next = NULL; + ET->ymax = MININT; + ET->ymin = MAXINT; + pSLLBlock->next = NULL; + + PrevPt = &pts[count - 1]; + + /* + * for each vertex in the array of points. + * In this loop we are dealing with two vertices at + * a time -- these make up one edge of the polygon. + */ + while (count--) { + CurrPt = pts++; + + /* + * find out which point is above and which is below. + */ + if (PrevPt->y > CurrPt->y) { + bottom = PrevPt, top = CurrPt; + pETEs->ClockWise = 0; + } + else { + bottom = CurrPt, top = PrevPt; + pETEs->ClockWise = 1; + } + + /* + * don't add horizontal edges to the Edge table. + */ + if (bottom->y != top->y) { + pETEs->ymax = bottom->y - 1; /* -1 so we don't get last scanline */ + + /* + * initialize integer edge algorithm + */ + dy = bottom->y - top->y; + BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); + + if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock)) { + miFreeStorage(pSLLBlock->next); + return FALSE; + } + + ET->ymax = max(ET->ymax, PrevPt->y); + ET->ymin = min(ET->ymin, PrevPt->y); + pETEs++; + } + + PrevPt = CurrPt; + } + return TRUE; +} + +/* + * This routine moves EdgeTableEntries from the EdgeTable into the Active Edge + * Table, leaving them sorted by smaller x coordinate. + */ + +static void +miloadAET(EdgeTableEntry * AET, EdgeTableEntry * ETEs) +{ + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; + + pPrevAET = AET; + AET = AET->next; + while (ETEs) { + while (AET && (AET->bres.minor < ETEs->bres.minor)) { + pPrevAET = AET; + AET = AET->next; + } + tmp = ETEs->next; + ETEs->next = AET; + if (AET) + AET->back = ETEs; + ETEs->back = pPrevAET; + pPrevAET->next = ETEs; + pPrevAET = ETEs; + + ETEs = tmp; + } +} + +/* + * computeWAET + * + * This routine links the AET by the nextWETE (winding EdgeTableEntry) link for + * use by the winding number rule. The final Active Edge Table (AET) might + * look something like: + * + * AET + * ---------- --------- --------- + * |ymax | |ymax | |ymax | + * | ... | |... | |... | + * |next |->|next |->|next |->... + * |nextWETE| |nextWETE| |nextWETE| + * --------- --------- ^-------- + * | | | + * V-------------------> V---> ... + * + */ +static void +micomputeWAET(EdgeTableEntry * AET) +{ + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; + + AET->nextWETE = NULL; + pWETE = AET; + AET = AET->next; + while (AET) { + if (AET->ClockWise) + isInside++; + else + isInside--; + + if ((!inside && !isInside) || (inside && isInside)) { + pWETE->nextWETE = AET; + pWETE = AET; + inside = !inside; + } + AET = AET->next; + } + pWETE->nextWETE = NULL; +} + +/* + * Just a simple insertion sort using pointers and back pointers to sort the + * Active Edge Table. + */ + +static int +miInsertionSort(EdgeTableEntry * AET) +{ + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; + + AET = AET->next; + while (AET) { + pETEinsert = AET; + pETEchase = AET; + while (pETEchase->back->bres.minor > AET->bres.minor) + pETEchase = pETEchase->back; + + AET = AET->next; + if (pETEchase != pETEinsert) { + pETEchaseBackTMP = pETEchase->back; + pETEinsert->back->next = AET; + if (AET) + AET->back = pETEinsert->back; + pETEinsert->next = pETEchase; + pETEchase->back->next = pETEinsert; + pETEchase->back = pETEinsert; + pETEinsert->back = pETEchaseBackTMP; + changed = 1; + } + } + return changed; +} + +/* Find the index of the point with the smallest y */ +static int +getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty) +{ + DDXPointPtr ptMin; + int ymin, ymax; + DDXPointPtr ptsStart = pts; + + ptMin = pts; + ymin = ymax = (pts++)->y; + + while (--n > 0) { + if (pts->y < ymin) { + ptMin = pts; + ymin = pts->y; + } + if (pts->y > ymax) + ymax = pts->y; + + pts++; + } + + *by = ymin; + *ty = ymax; + return ptMin - ptsStart; +} + +/* + * Written by Brian Kelleher; Dec. 1985. + * + * Fill a convex polygon. If the given polygon is not convex, then the result + * is undefined. The algorithm is to order the edges from smallest y to + * largest by partitioning the array into a left edge list and a right edge + * list. The algorithm used to traverse each edge is an extension of + * Bresenham's line algorithm with y as the major axis. For a derivation of + * the algorithm, see the author of this code. + */ +static Bool +miFillConvexPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn) +{ + int xl = 0, xr = 0; /* x vals of left and right edges */ + int dl = 0, dr = 0; /* decision variables */ + int ml = 0, m1l = 0; /* left edge slope and slope+1 */ + int mr = 0, m1r = 0; /* right edge slope and slope+1 */ + int incr1l = 0, incr2l = 0; /* left edge error increments */ + int incr1r = 0, incr2r = 0; /* right edge error increments */ + int dy; /* delta y */ + int y; /* current scanline */ + int left, right; /* indices to first endpoints */ + int i; /* loop counter */ + int nextleft, nextright; /* indices to second endpoints */ + DDXPointPtr ptsOut, FirstPoint; /* output buffer */ + int *width, *FirstWidth; /* output buffer */ + int imin; /* index of smallest vertex (in y) */ + int ymin; /* y-extents of polygon */ + int ymax; + + /* + * find leftx, bottomy, rightx, topy, and the index + * of bottomy. Also translate the points. + */ + imin = getPolyYBounds(ptsIn, count, &ymin, &ymax); + + dy = ymax - ymin + 1; + if ((count < 3) || (dy < 0)) + return TRUE; + ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * dy); + width = FirstWidth = malloc(sizeof(int) * dy); + if (!FirstPoint || !FirstWidth) { + free(FirstWidth); + free(FirstPoint); + return FALSE; + } + + nextleft = nextright = imin; + y = ptsIn[nextleft].y; + + /* + * loop through all edges of the polygon + */ + do { + /* + * add a left edge if we need to + */ + if (ptsIn[nextleft].y == y) { + left = nextleft; + + /* + * find the next edge, considering the end + * conditions of the array. + */ + nextleft++; + if (nextleft >= count) + nextleft = 0; + + /* + * now compute all of the random information + * needed to run the iterative algorithm. + */ + BRESINITPGON(ptsIn[nextleft].y - ptsIn[left].y, + ptsIn[left].x, ptsIn[nextleft].x, + xl, dl, ml, m1l, incr1l, incr2l); + } + + /* + * add a right edge if we need to + */ + if (ptsIn[nextright].y == y) { + right = nextright; + + /* + * find the next edge, considering the end + * conditions of the array. + */ + nextright--; + if (nextright < 0) + nextright = count - 1; + + /* + * now compute all of the random information + * needed to run the iterative algorithm. + */ + BRESINITPGON(ptsIn[nextright].y - ptsIn[right].y, + ptsIn[right].x, ptsIn[nextright].x, + xr, dr, mr, m1r, incr1r, incr2r); + } + + /* + * generate scans to fill while we still have + * a right edge as well as a left edge. + */ + i = min(ptsIn[nextleft].y, ptsIn[nextright].y) - y; + /* in case we're called with non-convex polygon */ + if (i < 0) { + free(FirstWidth); + free(FirstPoint); + return TRUE; + } + while (i-- > 0) { + ptsOut->y = y; + + /* + * reverse the edges if necessary + */ + if (xl < xr) { + *(width++) = xr - xl; + (ptsOut++)->x = xl; + } + else { + *(width++) = xl - xr; + (ptsOut++)->x = xr; + } + y++; + + /* increment down the edges */ + BRESINCRPGON(dl, xl, ml, m1l, incr1l, incr2l); + BRESINCRPGON(dr, xr, mr, m1r, incr1r, incr2r); + } + } while (y != ymax); + + /* + * Finally, fill the spans + */ + (*pgc->ops->FillSpans) (dst, pgc, + ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); + free(FirstWidth); + free(FirstPoint); + return TRUE; +} + +/* + * Written by Brian Kelleher; Oct. 1985 + * + * Routine to fill a polygon. Two fill rules are supported: frWINDING and + * frEVENODD. + */ +static Bool +miFillGeneralPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn) +{ + EdgeTableEntry *pAET; /* the Active Edge Table */ + int y; /* the current scanline */ + int nPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table */ + ScanLineList *pSLL; /* Current ScanLineList */ + DDXPointPtr ptsOut; /* ptr to output buffers */ + int *width; + DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ + int FirstWidth[NUMPTSTOBUFFER]; + EdgeTableEntry *pPrevAET; /* previous AET entry */ + EdgeTable ET; /* Edge Table header node */ + EdgeTableEntry AET; /* Active ET header node */ + EdgeTableEntry *pETEs; /* Edge Table Entries buff */ + ScanLineListBlock SLLBlock; /* header for ScanLineList */ + int fixWAET = 0; + + if (count < 3) + return TRUE; + + if (!(pETEs = malloc(sizeof(EdgeTableEntry) * count))) + return FALSE; + ptsOut = FirstPoint; + width = FirstWidth; + if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock)) { + free(pETEs); + return FALSE; + } + pSLL = ET.scanlines.next; + + if (pgc->fillRule == EvenOddRule) { + /* + * for each scanline + */ + for (y = ET.ymin; y < ET.ymax; y++) { + /* + * Add a new edge to the active edge table when we + * get to the next edge. + */ + if (pSLL && y == pSLL->scanline) { + miloadAET(&AET, pSLL->edgelist); + pSLL = pSLL->next; + } + pPrevAET = &AET; + pAET = AET.next; + + /* + * for each active edge + */ + while (pAET) { + ptsOut->x = pAET->bres.minor; + ptsOut++->y = y; + *width++ = pAET->next->bres.minor - pAET->bres.minor; + nPts++; + + /* + * send out the buffer when its full + */ + if (nPts == NUMPTSTOBUFFER) { + (*pgc->ops->FillSpans) (dst, pgc, + nPts, FirstPoint, FirstWidth, 1); + ptsOut = FirstPoint; + width = FirstWidth; + nPts = 0; + } + EVALUATEEDGEEVENODD(pAET, pPrevAET, y); + EVALUATEEDGEEVENODD(pAET, pPrevAET, y); + } + miInsertionSort(&AET); + } + } + else { /* default to WindingNumber */ + + /* + * for each scanline + */ + for (y = ET.ymin; y < ET.ymax; y++) { + /* + * Add a new edge to the active edge table when we + * get to the next edge. + */ + if (pSLL && y == pSLL->scanline) { + miloadAET(&AET, pSLL->edgelist); + micomputeWAET(&AET); + pSLL = pSLL->next; + } + pPrevAET = &AET; + pAET = AET.next; + pWETE = pAET; + + /* + * for each active edge + */ + while (pAET) { + /* + * if the next edge in the active edge table is + * also the next edge in the winding active edge + * table. + */ + if (pWETE == pAET) { + ptsOut->x = pAET->bres.minor; + ptsOut++->y = y; + *width++ = pAET->nextWETE->bres.minor - pAET->bres.minor; + nPts++; + + /* + * send out the buffer + */ + if (nPts == NUMPTSTOBUFFER) { + (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, + FirstWidth, 1); + ptsOut = FirstPoint; + width = FirstWidth; + nPts = 0; + } + + pWETE = pWETE->nextWETE; + while (pWETE != pAET) + EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); + pWETE = pWETE->nextWETE; + } + EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); + } + + /* + * reevaluate the Winding active edge table if we + * just had to resort it or if we just exited an edge. + */ + if (miInsertionSort(&AET) || fixWAET) { + micomputeWAET(&AET); + fixWAET = 0; + } + } + } + + /* + * Get any spans that we missed by buffering + */ + (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, FirstWidth, 1); + free(pETEs); + miFreeStorage(SLLBlock.next); + return TRUE; +} + +/* + * Draw polygons. This routine translates the point by the origin if + * pGC->miTranslate is non-zero, and calls to the appropriate routine to + * actually scan convert the polygon. + */ void miFillPolygon(DrawablePtr dst, GCPtr pgc, int shape, int mode, int count, DDXPointPtr pPts) diff --git a/xserver/mi/mipoly.h b/xserver/mi/mipoly.h index e37fb48a2..d67a5249e 100644 --- a/xserver/mi/mipoly.h +++ b/xserver/mi/mipoly.h @@ -55,7 +55,7 @@ from The Open Group. * the polygon by incrementing the y coordinate. We * keep a list of edges which the current scanline crosses, * sorted by x. This list is called the Active Edge Table (AET) - * As we change the y-coordinate, we update each entry in + * As we change the y-coordinate, we update each entry in * in the active edge table to reflect the edges new xcoord. * This list must be sorted at each scanline in case * two edges intersect. @@ -171,23 +171,3 @@ typedef struct _ScanLineListBlock { pAET = pAET->next; \ } \ } - -/* mipolyutil.c */ - -extern _X_EXPORT Bool miCreateETandAET(int /*count */ , - DDXPointPtr /*pts */ , - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs */ , - ScanLineListBlock * /*pSLLBlock */ - ); - -extern _X_EXPORT void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */ - ); - -extern _X_EXPORT void micomputeWAET(EdgeTableEntry * /*AET*/); - -extern _X_EXPORT int miInsertionSort(EdgeTableEntry * /*AET*/); - -extern _X_EXPORT void miFreeStorage(ScanLineListBlock * /*pSLLBlock */ - ); diff --git a/xserver/mi/mipolycon.c b/xserver/mi/mipolycon.c deleted file mode 100644 index e831633fe..000000000 --- a/xserver/mi/mipolycon.c +++ /dev/null @@ -1,235 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "gcstruct.h" -#include "pixmap.h" -#include "mi.h" -#include "miscanfill.h" - -static int getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty); - -/* - * convexpoly.c - * - * Written by Brian Kelleher; Dec. 1985. - * - * Fill a convex polygon. If the given polygon - * is not convex, then the result is undefined. - * The algorithm is to order the edges from smallest - * y to largest by partitioning the array into a left - * edge list and a right edge list. The algorithm used - * to traverse each edge is an extension of Bresenham's - * line algorithm with y as the major axis. - * For a derivation of the algorithm, see the author of - * this code. - */ -Bool -miFillConvexPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */ - DDXPointPtr ptsIn /* the points */ - ) -{ - int xl = 0, xr = 0; /* x vals of left and right edges */ - int dl = 0, dr = 0; /* decision variables */ - int ml = 0, m1l = 0; /* left edge slope and slope+1 */ - int mr = 0, m1r = 0; /* right edge slope and slope+1 */ - int incr1l = 0, incr2l = 0; /* left edge error increments */ - int incr1r = 0, incr2r = 0; /* right edge error increments */ - int dy; /* delta y */ - int y; /* current scanline */ - int left, right; /* indices to first endpoints */ - int i; /* loop counter */ - int nextleft, nextright; /* indices to second endpoints */ - DDXPointPtr ptsOut, FirstPoint; /* output buffer */ - int *width, *FirstWidth; /* output buffer */ - int imin; /* index of smallest vertex (in y) */ - int ymin; /* y-extents of polygon */ - int ymax; - - /* - * find leftx, bottomy, rightx, topy, and the index - * of bottomy. Also translate the points. - */ - imin = getPolyYBounds(ptsIn, count, &ymin, &ymax); - - dy = ymax - ymin + 1; - if ((count < 3) || (dy < 0)) - return TRUE; - ptsOut = FirstPoint = malloc(sizeof(DDXPointRec) * dy); - width = FirstWidth = malloc(sizeof(int) * dy); - if (!FirstPoint || !FirstWidth) { - free(FirstWidth); - free(FirstPoint); - return FALSE; - } - - nextleft = nextright = imin; - y = ptsIn[nextleft].y; - - /* - * loop through all edges of the polygon - */ - do { - /* - * add a left edge if we need to - */ - if (ptsIn[nextleft].y == y) { - left = nextleft; - - /* - * find the next edge, considering the end - * conditions of the array. - */ - nextleft++; - if (nextleft >= count) - nextleft = 0; - - /* - * now compute all of the random information - * needed to run the iterative algorithm. - */ - BRESINITPGON(ptsIn[nextleft].y - ptsIn[left].y, - ptsIn[left].x, ptsIn[nextleft].x, - xl, dl, ml, m1l, incr1l, incr2l); - } - - /* - * add a right edge if we need to - */ - if (ptsIn[nextright].y == y) { - right = nextright; - - /* - * find the next edge, considering the end - * conditions of the array. - */ - nextright--; - if (nextright < 0) - nextright = count - 1; - - /* - * now compute all of the random information - * needed to run the iterative algorithm. - */ - BRESINITPGON(ptsIn[nextright].y - ptsIn[right].y, - ptsIn[right].x, ptsIn[nextright].x, - xr, dr, mr, m1r, incr1r, incr2r); - } - - /* - * generate scans to fill while we still have - * a right edge as well as a left edge. - */ - i = min(ptsIn[nextleft].y, ptsIn[nextright].y) - y; - /* in case we're called with non-convex polygon */ - if (i < 0) { - free(FirstWidth); - free(FirstPoint); - return TRUE; - } - while (i-- > 0) { - ptsOut->y = y; - - /* - * reverse the edges if necessary - */ - if (xl < xr) { - *(width++) = xr - xl; - (ptsOut++)->x = xl; - } - else { - *(width++) = xl - xr; - (ptsOut++)->x = xr; - } - y++; - - /* increment down the edges */ - BRESINCRPGON(dl, xl, ml, m1l, incr1l, incr2l); - BRESINCRPGON(dr, xr, mr, m1r, incr1r, incr2r); - } - } while (y != ymax); - - /* - * Finally, fill the spans - */ - (*pgc->ops->FillSpans) (dst, pgc, - ptsOut - FirstPoint, FirstPoint, FirstWidth, 1); - free(FirstWidth); - free(FirstPoint); - return TRUE; -} - -/* - * Find the index of the point with the smallest y. - */ -static int -getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty) -{ - DDXPointPtr ptMin; - int ymin, ymax; - DDXPointPtr ptsStart = pts; - - ptMin = pts; - ymin = ymax = (pts++)->y; - - while (--n > 0) { - if (pts->y < ymin) { - ptMin = pts; - ymin = pts->y; - } - if (pts->y > ymax) - ymax = pts->y; - - pts++; - } - - *by = ymin; - *ty = ymax; - return ptMin - ptsStart; -} diff --git a/xserver/mi/mipolygen.c b/xserver/mi/mipolygen.c deleted file mode 100644 index 2031b42b7..000000000 --- a/xserver/mi/mipolygen.c +++ /dev/null @@ -1,213 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "gcstruct.h" -#include "miscanfill.h" -#include "mipoly.h" -#include "pixmap.h" -#include "mi.h" - -/* - * - * Written by Brian Kelleher; Oct. 1985 - * - * Routine to fill a polygon. Two fill rules are - * supported: frWINDING and frEVENODD. - * - * See fillpoly.h for a complete description of the algorithm. - */ - -Bool -miFillGeneralPoly(DrawablePtr dst, GCPtr pgc, int count, /* number of points */ - DDXPointPtr ptsIn /* the points */ - ) -{ - EdgeTableEntry *pAET; /* the Active Edge Table */ - int y; /* the current scanline */ - int nPts = 0; /* number of pts in buffer */ - EdgeTableEntry *pWETE; /* Winding Edge Table */ - ScanLineList *pSLL; /* Current ScanLineList */ - DDXPointPtr ptsOut; /* ptr to output buffers */ - int *width; - DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ - int FirstWidth[NUMPTSTOBUFFER]; - EdgeTableEntry *pPrevAET; /* previous AET entry */ - EdgeTable ET; /* Edge Table header node */ - EdgeTableEntry AET; /* Active ET header node */ - EdgeTableEntry *pETEs; /* Edge Table Entries buff */ - ScanLineListBlock SLLBlock; /* header for ScanLineList */ - int fixWAET = 0; - - if (count < 3) - return TRUE; - - if (!(pETEs = malloc(sizeof(EdgeTableEntry) * count))) - return FALSE; - ptsOut = FirstPoint; - width = FirstWidth; - if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock)) { - free(pETEs); - return FALSE; - } - pSLL = ET.scanlines.next; - - if (pgc->fillRule == EvenOddRule) { - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; y++) { - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL && y == pSLL->scanline) { - miloadAET(&AET, pSLL->edgelist); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - - /* - * for each active edge - */ - while (pAET) { - ptsOut->x = pAET->bres.minor; - ptsOut++->y = y; - *width++ = pAET->next->bres.minor - pAET->bres.minor; - nPts++; - - /* - * send out the buffer when its full - */ - if (nPts == NUMPTSTOBUFFER) { - (*pgc->ops->FillSpans) (dst, pgc, - nPts, FirstPoint, FirstWidth, 1); - ptsOut = FirstPoint; - width = FirstWidth; - nPts = 0; - } - EVALUATEEDGEEVENODD(pAET, pPrevAET, y) - EVALUATEEDGEEVENODD(pAET, pPrevAET, y); - } - miInsertionSort(&AET); - } - } - else { /* default to WindingNumber */ - - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; y++) { - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL && y == pSLL->scanline) { - miloadAET(&AET, pSLL->edgelist); - micomputeWAET(&AET); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - pWETE = pAET; - - /* - * for each active edge - */ - while (pAET) { - /* - * if the next edge in the active edge table is - * also the next edge in the winding active edge - * table. - */ - if (pWETE == pAET) { - ptsOut->x = pAET->bres.minor; - ptsOut++->y = y; - *width++ = pAET->nextWETE->bres.minor - pAET->bres.minor; - nPts++; - - /* - * send out the buffer - */ - if (nPts == NUMPTSTOBUFFER) { - (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, - FirstWidth, 1); - ptsOut = FirstPoint; - width = FirstWidth; - nPts = 0; - } - - pWETE = pWETE->nextWETE; - while (pWETE != pAET) - EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); - pWETE = pWETE->nextWETE; - } - EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); - } - - /* - * reevaluate the Winding active edge table if we - * just had to resort it or if we just exited an edge. - */ - if (miInsertionSort(&AET) || fixWAET) { - micomputeWAET(&AET); - fixWAET = 0; - } - } - } - - /* - * Get any spans that we missed by buffering - */ - (*pgc->ops->FillSpans) (dst, pgc, nPts, FirstPoint, FirstWidth, 1); - free(pETEs); - miFreeStorage(SLLBlock.next); - return TRUE; -} diff --git a/xserver/mi/mipolypnt.c b/xserver/mi/mipolypnt.c index 086502b26..4fa521d07 100644 --- a/xserver/mi/mipolypnt.c +++ b/xserver/mi/mipolypnt.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mipolyrect.c b/xserver/mi/mipolyrect.c index e316ae053..830822513 100644 --- a/xserver/mi/mipolyrect.c +++ b/xserver/mi/mipolyrect.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mipolyseg.c b/xserver/mi/mipolyseg.c index d6f18076c..7909b398b 100644 --- a/xserver/mi/mipolyseg.c +++ b/xserver/mi/mipolyseg.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,7 +61,7 @@ SOFTWARE. * lines are drawn in the order listed. * * Walks the segments, compressing them into format for PolyLines. - * + * *****************************************************************/ void diff --git a/xserver/mi/mipolytext.c b/xserver/mi/mipolytext.c index 02c45882f..f1e5ed867 100644 --- a/xserver/mi/mipolytext.c +++ b/xserver/mi/mipolytext.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mipolyutil.c b/xserver/mi/mipolyutil.c deleted file mode 100644 index 5e6301d43..000000000 --- a/xserver/mi/mipolyutil.c +++ /dev/null @@ -1,369 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "regionstr.h" -#include "gc.h" -#include "miscanfill.h" -#include "mipoly.h" -#include "misc.h" /* MAXINT */ - -/* - * fillUtils.c - * - * Written by Brian Kelleher; Oct. 1985 - * - * This module contains all of the utility functions - * needed to scan convert a polygon. - * - */ - -/* - * InsertEdgeInET - * - * Insert the given edge into the edge table. - * First we must find the correct bucket in the - * Edge table, then find the right slot in the - * bucket. Finally, we can insert it. - * - */ -static Bool -miInsertEdgeInET(EdgeTable * ET, EdgeTableEntry * ETE, int scanline, - ScanLineListBlock ** SLLBlock, int *iSLLBlock) -{ - EdgeTableEntry *start, *prev; - ScanLineList *pSLL, *pPrevSLL; - ScanLineListBlock *tmpSLLBlock; - - /* - * find the right bucket to put the edge into - */ - pPrevSLL = &ET->scanlines; - pSLL = pPrevSLL->next; - while (pSLL && (pSLL->scanline < scanline)) { - pPrevSLL = pSLL; - pSLL = pSLL->next; - } - - /* - * reassign pSLL (pointer to ScanLineList) if necessary - */ - if ((!pSLL) || (pSLL->scanline > scanline)) { - if (*iSLLBlock > SLLSPERBLOCK - 1) { - tmpSLLBlock = malloc(sizeof(ScanLineListBlock)); - if (!tmpSLLBlock) - return FALSE; - (*SLLBlock)->next = tmpSLLBlock; - tmpSLLBlock->next = NULL; - *SLLBlock = tmpSLLBlock; - *iSLLBlock = 0; - } - pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); - - pSLL->next = pPrevSLL->next; - pSLL->edgelist = NULL; - pPrevSLL->next = pSLL; - } - pSLL->scanline = scanline; - - /* - * now insert the edge in the right bucket - */ - prev = NULL; - start = pSLL->edgelist; - while (start && (start->bres.minor < ETE->bres.minor)) { - prev = start; - start = start->next; - } - ETE->next = start; - - if (prev) - prev->next = ETE; - else - pSLL->edgelist = ETE; - return TRUE; -} - -/* - * CreateEdgeTable - * - * This routine creates the edge table for - * scan converting polygons. - * The Edge Table (ET) looks like: - * - * EdgeTable - * -------- - * | ymax | ScanLineLists - * |scanline|-->------------>-------------->... - * -------- |scanline| |scanline| - * |edgelist| |edgelist| - * --------- --------- - * | | - * | | - * V V - * list of ETEs list of ETEs - * - * where ETE is an EdgeTableEntry data structure, - * and there is one ScanLineList per scanline at - * which an edge is initially entered. - * - */ - -Bool -miCreateETandAET(int count, DDXPointPtr pts, EdgeTable * ET, - EdgeTableEntry * AET, EdgeTableEntry * pETEs, - ScanLineListBlock * pSLLBlock) -{ - DDXPointPtr top, bottom; - DDXPointPtr PrevPt, CurrPt; - int iSLLBlock = 0; - - int dy; - - if (count < 2) - return TRUE; - - /* - * initialize the Active Edge Table - */ - AET->next = NULL; - AET->back = NULL; - AET->nextWETE = NULL; - AET->bres.minor = MININT; - - /* - * initialize the Edge Table. - */ - ET->scanlines.next = NULL; - ET->ymax = MININT; - ET->ymin = MAXINT; - pSLLBlock->next = NULL; - - PrevPt = &pts[count - 1]; - - /* - * for each vertex in the array of points. - * In this loop we are dealing with two vertices at - * a time -- these make up one edge of the polygon. - */ - while (count--) { - CurrPt = pts++; - - /* - * find out which point is above and which is below. - */ - if (PrevPt->y > CurrPt->y) { - bottom = PrevPt, top = CurrPt; - pETEs->ClockWise = 0; - } - else { - bottom = CurrPt, top = PrevPt; - pETEs->ClockWise = 1; - } - - /* - * don't add horizontal edges to the Edge table. - */ - if (bottom->y != top->y) { - pETEs->ymax = bottom->y - 1; /* -1 so we don't get last scanline */ - - /* - * initialize integer edge algorithm - */ - dy = bottom->y - top->y; - BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); - - if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock)) { - miFreeStorage(pSLLBlock->next); - return FALSE; - } - - ET->ymax = max(ET->ymax, PrevPt->y); - ET->ymin = min(ET->ymin, PrevPt->y); - pETEs++; - } - - PrevPt = CurrPt; - } - return TRUE; -} - -/* - * loadAET - * - * This routine moves EdgeTableEntries from the - * EdgeTable into the Active Edge Table, - * leaving them sorted by smaller x coordinate. - * - */ - -void -miloadAET(EdgeTableEntry * AET, EdgeTableEntry * ETEs) -{ - EdgeTableEntry *pPrevAET; - EdgeTableEntry *tmp; - - pPrevAET = AET; - AET = AET->next; - while (ETEs) { - while (AET && (AET->bres.minor < ETEs->bres.minor)) { - pPrevAET = AET; - AET = AET->next; - } - tmp = ETEs->next; - ETEs->next = AET; - if (AET) - AET->back = ETEs; - ETEs->back = pPrevAET; - pPrevAET->next = ETEs; - pPrevAET = ETEs; - - ETEs = tmp; - } -} - -/* - * computeWAET - * - * This routine links the AET by the - * nextWETE (winding EdgeTableEntry) link for - * use by the winding number rule. The final - * Active Edge Table (AET) might look something - * like: - * - * AET - * ---------- --------- --------- - * |ymax | |ymax | |ymax | - * | ... | |... | |... | - * |next |->|next |->|next |->... - * |nextWETE| |nextWETE| |nextWETE| - * --------- --------- ^-------- - * | | | - * V-------------------> V---> ... - * - */ -void -micomputeWAET(EdgeTableEntry * AET) -{ - EdgeTableEntry *pWETE; - int inside = 1; - int isInside = 0; - - AET->nextWETE = NULL; - pWETE = AET; - AET = AET->next; - while (AET) { - if (AET->ClockWise) - isInside++; - else - isInside--; - - if ((!inside && !isInside) || (inside && isInside)) { - pWETE->nextWETE = AET; - pWETE = AET; - inside = !inside; - } - AET = AET->next; - } - pWETE->nextWETE = NULL; -} - -/* - * InsertionSort - * - * Just a simple insertion sort using - * pointers and back pointers to sort the Active - * Edge Table. - * - */ - -int -miInsertionSort(EdgeTableEntry * AET) -{ - EdgeTableEntry *pETEchase; - EdgeTableEntry *pETEinsert; - EdgeTableEntry *pETEchaseBackTMP; - int changed = 0; - - AET = AET->next; - while (AET) { - pETEinsert = AET; - pETEchase = AET; - while (pETEchase->back->bres.minor > AET->bres.minor) - pETEchase = pETEchase->back; - - AET = AET->next; - if (pETEchase != pETEinsert) { - pETEchaseBackTMP = pETEchase->back; - pETEinsert->back->next = AET; - if (AET) - AET->back = pETEinsert->back; - pETEinsert->next = pETEchase; - pETEchase->back->next = pETEinsert; - pETEchase->back = pETEinsert; - pETEinsert->back = pETEchaseBackTMP; - changed = 1; - } - } - return changed; -} - -/* - * Clean up our act. - */ -void -miFreeStorage(ScanLineListBlock * pSLLBlock) -{ - ScanLineListBlock *tmpSLLBlock; - - while (pSLLBlock) { - tmpSLLBlock = pSLLBlock->next; - free(pSLLBlock); - pSLLBlock = tmpSLLBlock; - } -} diff --git a/xserver/mi/mipushpxl.c b/xserver/mi/mipushpxl.c index 9a78f4050..f6a1b5259 100644 --- a/xserver/mi/mipushpxl.c +++ b/xserver/mi/mipushpxl.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/miscrinit.c b/xserver/mi/miscrinit.c index 00c15f713..b53c7e41a 100644 --- a/xserver/mi/miscrinit.c +++ b/xserver/mi/miscrinit.c @@ -45,7 +45,7 @@ from The Open Group. /* We use this structure to propogate some information from miScreenInit to * miCreateScreenResources. miScreenInit allocates the structure, fills it - * in, and puts it into pScreen->devPrivate. miCreateScreenResources + * in, and puts it into pScreen->devPrivate. miCreateScreenResources * extracts the info and frees the structure. We could've accomplished the * same thing by adding fields to the screen structure, but they would have * ended up being redundant, and would have exposed this mi implementation @@ -259,13 +259,12 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */ /* CreateColormap, DestroyColormap, InstallColormap, UninstallColormap */ /* ListInstalledColormaps, StoreColors, ResolveColor */ /* BitmapToRegion */ - pScreen->SendGraphicsExpose = miSendGraphicsExpose; pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->MoveWindow = miMoveWindow; - pScreen->ResizeWindow = miSlideAndSizeWindow; + pScreen->ResizeWindow = miResizeWindow; pScreen->GetLayerWindow = miGetLayerWindow; pScreen->HandleExposures = miHandleValidateExposures; pScreen->ReparentWindow = (ReparentWindowProcPtr) 0; diff --git a/xserver/mi/mispans.c b/xserver/mi/mispans.c deleted file mode 100644 index 11c8a43d0..000000000 --- a/xserver/mi/mispans.c +++ /dev/null @@ -1,526 +0,0 @@ -/*********************************************************** - -Copyright 1989, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "mispans.h" - -/* - -These routines maintain lists of Spans, in order to implement the -``touch-each-pixel-once'' rules of wide lines and arcs. - -Written by Joel McCormack, Summer 1989. - -*/ - -void -miInitSpanGroup(SpanGroup * spanGroup) -{ - spanGroup->size = 0; - spanGroup->count = 0; - spanGroup->group = NULL; - spanGroup->ymin = MAXSHORT; - spanGroup->ymax = MINSHORT; -} /* InitSpanGroup */ - -#define YMIN(spans) (spans->points[0].y) -#define YMAX(spans) (spans->points[spans->count-1].y) - -static void -miSubtractSpans(SpanGroup * spanGroup, Spans * sub) -{ - int i, subCount, spansCount; - int ymin, ymax, xmin, xmax; - Spans *spans; - DDXPointPtr subPt, spansPt; - int *subWid, *spansWid; - int extra; - - ymin = YMIN(sub); - ymax = YMAX(sub); - spans = spanGroup->group; - for (i = spanGroup->count; i; i--, spans++) { - if (YMIN(spans) <= ymax && ymin <= YMAX(spans)) { - subCount = sub->count; - subPt = sub->points; - subWid = sub->widths; - spansCount = spans->count; - spansPt = spans->points; - spansWid = spans->widths; - extra = 0; - for (;;) { - while (spansCount && spansPt->y < subPt->y) { - spansPt++; - spansWid++; - spansCount--; - } - if (!spansCount) - break; - while (subCount && subPt->y < spansPt->y) { - subPt++; - subWid++; - subCount--; - } - if (!subCount) - break; - if (subPt->y == spansPt->y) { - xmin = subPt->x; - xmax = xmin + *subWid; - if (xmin >= spansPt->x + *spansWid || spansPt->x >= xmax) { - ; - } - else if (xmin <= spansPt->x) { - if (xmax >= spansPt->x + *spansWid) { - memmove(spansPt, spansPt + 1, - sizeof *spansPt * (spansCount - 1)); - memmove(spansWid, spansWid + 1, - sizeof *spansWid * (spansCount - 1)); - spansPt--; - spansWid--; - spans->count--; - extra++; - } - else { - *spansWid = *spansWid - (xmax - spansPt->x); - spansPt->x = xmax; - } - } - else { - if (xmax >= spansPt->x + *spansWid) { - *spansWid = xmin - spansPt->x; - } - else { - if (!extra) { - DDXPointPtr newPt; - int *newwid; - -#define EXTRA 8 - newPt = - (DDXPointPtr) realloc(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)); - if (!newwid) - break; - spansWid = newwid + (spansWid - spans->widths); - spans->widths = newwid; - extra = EXTRA; - } - memmove(spansPt + 1, spansPt, - sizeof *spansPt * (spansCount)); - memmove(spansWid + 1, spansWid, - sizeof *spansWid * (spansCount)); - spans->count++; - extra--; - *spansWid = xmin - spansPt->x; - spansWid++; - spansPt++; - *spansWid = *spansWid - (xmax - spansPt->x); - spansPt->x = xmax; - } - } - } - spansPt++; - spansWid++; - spansCount--; - } - } - } -} - -void -miAppendSpans(SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans) -{ - int ymin, ymax; - int spansCount; - - spansCount = spans->count; - 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[spanGroup->count] = *spans; - (spanGroup->count)++; - ymin = spans->points[0].y; - if (ymin < spanGroup->ymin) - spanGroup->ymin = ymin; - ymax = spans->points[spansCount - 1].y; - if (ymax > spanGroup->ymax) - spanGroup->ymax = ymax; - if (otherGroup && otherGroup->ymin < ymax && ymin < otherGroup->ymax) { - miSubtractSpans(otherGroup, spans); - } - } - else { - free(spans->points); - free(spans->widths); - } -} /* AppendSpans */ - -void -miFreeSpanGroup(SpanGroup * spanGroup) -{ - free(spanGroup->group); -} - -static void -QuickSortSpansX(DDXPointRec points[], int widths[], int numSpans) -{ - int x; - int i, j, m; - DDXPointPtr r; - -/* Always called with numSpans > 1 */ -/* Sorts only by x, as all y should be the same */ - -#define ExchangeSpans(a, b) \ -{ \ - DDXPointRec tpt; \ - int tw; \ - \ - tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ - tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ -} - - do { - if (numSpans < 9) { - /* Do insertion sort */ - int xprev; - - xprev = points[0].x; - i = 1; - do { /* while i != numSpans */ - x = points[i].x; - if (xprev > x) { - /* points[i] is out of order. Move into proper location. */ - DDXPointRec tpt; - int tw, k; - - for (j = 0; x >= points[j].x; j++) { - } - tpt = points[i]; - tw = widths[i]; - for (k = i; k != j; k--) { - points[k] = points[k - 1]; - widths[k] = widths[k - 1]; - } - points[j] = tpt; - widths[j] = tw; - x = points[i].x; - } /* if out of order */ - xprev = x; - i++; - } while (i != numSpans); - return; - } - - /* Choose partition element, stick in location 0 */ - m = numSpans / 2; - if (points[m].x > points[0].x) - ExchangeSpans(m, 0); - if (points[m].x > points[numSpans - 1].x) - ExchangeSpans(m, numSpans - 1); - if (points[m].x > points[0].x) - ExchangeSpans(m, 0); - x = points[0].x; - - /* Partition array */ - i = 0; - j = numSpans; - do { - r = &(points[i]); - do { - r++; - i++; - } while (i != numSpans && r->x < x); - r = &(points[j]); - do { - r--; - j--; - } while (x < r->x); - if (i < j) - ExchangeSpans(i, j); - } while (i < j); - - /* Move partition element back to middle */ - ExchangeSpans(0, j); - - /* Recurse */ - if (numSpans - j - 1 > 1) - QuickSortSpansX(&points[j + 1], &widths[j + 1], numSpans - j - 1); - numSpans = j; - } while (numSpans > 1); -} /* QuickSortSpans */ - -static int -UniquifySpansX(Spans * spans, DDXPointRec * newPoints, int *newWidths) -{ - int newx1, newx2, oldpt, i, y; - DDXPointRec *oldPoints; - int *oldWidths; - int *startNewWidths; - -/* Always called with numSpans > 1 */ -/* Uniquify the spans, and stash them into newPoints and newWidths. Return the - number of unique spans. */ - - startNewWidths = newWidths; - - oldPoints = spans->points; - oldWidths = spans->widths; - - y = oldPoints->y; - newx1 = oldPoints->x; - newx2 = newx1 + *oldWidths; - - for (i = spans->count - 1; i != 0; i--) { - oldPoints++; - oldWidths++; - oldpt = oldPoints->x; - if (oldpt > newx2) { - /* Write current span, start a new one */ - newPoints->x = newx1; - newPoints->y = y; - *newWidths = newx2 - newx1; - newPoints++; - newWidths++; - newx1 = oldpt; - newx2 = oldpt + *oldWidths; - } - else { - /* extend current span, if old extends beyond new */ - oldpt = oldpt + *oldWidths; - if (oldpt > newx2) - newx2 = oldpt; - } - } /* for */ - - /* Write final span */ - newPoints->x = newx1; - *newWidths = newx2 - newx1; - newPoints->y = y; - - return (newWidths - startNewWidths) + 1; -} /* UniquifySpansX */ - -static void -miDisposeSpanGroup(SpanGroup * spanGroup) -{ - int i; - Spans *spans; - - for (i = 0; i < spanGroup->count; i++) { - spans = spanGroup->group + i; - free(spans->points); - free(spans->widths); - } -} - -void -miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup) -{ - int i; - Spans *spans; - Spans *yspans; - int *ysizes; - int ymin, ylength; - - /* Outgoing spans for one big call to FillSpans */ - DDXPointPtr points; - int *widths; - int count; - - if (spanGroup->count == 0) - return; - - if (spanGroup->count == 1) { - /* Already should be sorted, unique */ - spans = spanGroup->group; - (*pGC->ops->FillSpans) - (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE); - free(spans->points); - free(spans->widths); - } - else { - /* Yuck. Gross. Radix sort into y buckets, then sort x and uniquify */ - /* This seems to be the fastest thing to do. I've tried sorting on - both x and y at the same time rather than creating into all those - y buckets, but it was somewhat slower. */ - - ymin = spanGroup->ymin; - ylength = spanGroup->ymax - ymin + 1; - - /* Allocate Spans for y buckets */ - yspans = malloc(ylength * sizeof(Spans)); - ysizes = malloc(ylength * sizeof(int)); - - if (!yspans || !ysizes) { - free(yspans); - free(ysizes); - miDisposeSpanGroup(spanGroup); - return; - } - - for (i = 0; i != ylength; i++) { - ysizes[i] = 0; - yspans[i].count = 0; - yspans[i].points = NULL; - yspans[i].widths = NULL; - } - - /* Go through every single span and put it into the correct bucket */ - count = 0; - for (i = 0, spans = spanGroup->group; - i != spanGroup->count; i++, spans++) { - int index; - int j; - - for (j = 0, points = spans->points, widths = spans->widths; - j != spans->count; j++, points++, widths++) { - index = points->y - ymin; - if (index >= 0 && index < ylength) { - Spans *newspans = &(yspans[index]); - - if (newspans->count == ysizes[index]) { - DDXPointPtr newpoints; - 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)); - if (!newpoints || !newwidths) { - for (i = 0; i < ylength; i++) { - free(yspans[i].points); - free(yspans[i].widths); - } - free(yspans); - free(ysizes); - free(newpoints); - free(newwidths); - miDisposeSpanGroup(spanGroup); - return; - } - newspans->points = newpoints; - newspans->widths = newwidths; - } - newspans->points[newspans->count] = *points; - newspans->widths[newspans->count] = *widths; - (newspans->count)++; - } /* if y value of span in range */ - } /* for j through spans */ - count += spans->count; - free(spans->points); - spans->points = NULL; - free(spans->widths); - spans->widths = NULL; - } /* 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)); - if (!points || !widths) { - for (i = 0; i < ylength; i++) { - free(yspans[i].points); - free(yspans[i].widths); - } - free(yspans); - free(ysizes); - free(points); - free(widths); - return; - } - count = 0; - for (i = 0; i != ylength; i++) { - int ycount = yspans[i].count; - - if (ycount > 0) { - if (ycount > 1) { - QuickSortSpansX(yspans[i].points, yspans[i].widths, ycount); - count += UniquifySpansX - (&(yspans[i]), &(points[count]), &(widths[count])); - } - else { - points[count] = yspans[i].points[0]; - widths[count] = yspans[i].widths[0]; - count++; - } - free(yspans[i].points); - free(yspans[i].widths); - } - } - - (*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE); - free(points); - free(widths); - free(yspans); - free(ysizes); /* use (DE)xalloc for these? */ - } - - spanGroup->count = 0; - spanGroup->ymin = MAXSHORT; - spanGroup->ymax = MINSHORT; -} diff --git a/xserver/mi/mispans.h b/xserver/mi/mispans.h deleted file mode 100644 index f3148ff19..000000000 --- a/xserver/mi/mispans.h +++ /dev/null @@ -1,87 +0,0 @@ -/*********************************************************** - -Copyright 1989, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - -Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef MISPANS_H -#define MISPANS_H - -typedef struct { - int count; /* number of spans */ - DDXPointPtr points; /* pointer to list of start points */ - int *widths; /* pointer to list of widths */ -} Spans; - -typedef struct { - int size; /* Total number of *Spans allocated */ - int count; /* Number of *Spans actually in group */ - Spans *group; /* List of Spans */ - int ymin, ymax; /* Min, max y values encountered */ -} SpanGroup; - -/* Initialize SpanGroup. MUST BE DONE before use. */ -extern _X_EXPORT void miInitSpanGroup(SpanGroup * /*spanGroup */ - ); - -/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */ -extern _X_EXPORT void miAppendSpans(SpanGroup * /*spanGroup */ , - SpanGroup * /*otherGroup */ , - Spans * /*spans */ - ); - -/* Paint a span group, insuring that each pixel is painted at most once */ -extern _X_EXPORT void miFillUniqueSpanGroup(DrawablePtr /*pDraw */ , - GCPtr /*pGC */ , - SpanGroup * /*spanGroup */ - ); - -/* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */ -extern _X_EXPORT void miFreeSpanGroup(SpanGroup * /*spanGroup */ - ); - -/* Rops which must use span groups */ -#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) -#define miSpansEasyRop(rop) (!miSpansCarefulRop(rop)) - -#endif /* MISPANS_H */ diff --git a/xserver/mi/misprite.c b/xserver/mi/misprite.c index eea731a15..68a49be1e 100644 --- a/xserver/mi/misprite.c +++ b/xserver/mi/misprite.c @@ -520,6 +520,8 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, miCursorInfoPtr pCursorInfo; Bool WorkToDo = FALSE; + SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); + for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); @@ -543,8 +545,6 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, } } - SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); - (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (WorkToDo) diff --git a/xserver/mi/mistruct.h b/xserver/mi/mistruct.h index 17f7d8329..00856f191 100644 --- a/xserver/mi/mistruct.h +++ b/xserver/mi/mistruct.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mivaltree.c b/xserver/mi/mivaltree.c index c1cc43122..ea6889fdc 100644 --- a/xserver/mi/mivaltree.c +++ b/xserver/mi/mivaltree.c @@ -27,19 +27,19 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * - * Copyright 1987, 1988, 1989 by + * Copyright 1987, 1988, 1989 by * Digital Equipment Corporation, Maynard, Massachusetts, - * + * * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in + * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital not be * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * + * software without specific, written prior permission. + * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR @@ -47,7 +47,7 @@ in this Software without prior written authorization from The Open Group. * 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. - * + * ******************************************************************/ /* The panoramix components contained the following notice */ @@ -79,7 +79,7 @@ Equipment Corporation. ******************************************************************/ - /* + /* * Aug '86: Susan Angebranndt -- original code * July '87: Adam de Boor -- substantially modified and commented * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible. @@ -99,8 +99,10 @@ Equipment Corporation. #include "mi.h" #include "regionstr.h" #include "mivalidate.h" - #include "globals.h" +#ifdef COMPOSITE +#include "compint.h" +#endif /* * Compute the visibility of a shaped window @@ -160,17 +162,6 @@ miShapedWindowIn(RegionPtr universe, RegionPtr bounding, return rgnOUT; } -static GetRedirectBorderClipProcPtr miGetRedirectBorderClipProc; -static SetRedirectBorderClipProcPtr miSetRedirectBorderClipProc; - -void -miRegisterRedirectBorderClipProc(SetRedirectBorderClipProcPtr setBorderClip, - GetRedirectBorderClipProcPtr getBorderClip) -{ - miSetRedirectBorderClipProc = setBorderClip; - miGetRedirectBorderClipProc = getBorderClip; -} - /* * Manual redirected windows are treated as transparent; they do not obscure * siblings or parent windows @@ -242,11 +233,9 @@ miComputeClips(WindowPtr pParent, * In redirected drawing case, reset universe to borderSize */ if (pParent->redirectDraw != RedirectDrawNone) { - if (miSetRedirectBorderClipProc) { - if (TreatAsTransparent(pParent)) - RegionEmpty(universe); - (*miSetRedirectBorderClipProc) (pParent, universe); - } + if (TreatAsTransparent(pParent)) + RegionEmpty(universe); + compSetRedirectBorderClip (pParent, universe); RegionCopy(universe, &pParent->borderSize); } #endif @@ -516,6 +505,17 @@ miTreeObscured(WindowPtr pParent) } } +static RegionPtr +getBorderClip(WindowPtr pWin) +{ +#ifdef COMPOSITE + if (pWin->redirectDraw != RedirectDrawNone) + return compGetRedirectBorderClip(pWin); + else +#endif + return &pWin->borderClip; +} + /* *----------------------------------------------------------------------- * miValidateTree -- @@ -609,14 +609,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ forward = TRUE; for (pWin = pChild; pWin; pWin = pWin->nextSib) { if (pWin->valdata) { - RegionPtr pBorderClip = &pWin->borderClip; - -#ifdef COMPOSITE - if (pWin->redirectDraw != RedirectDrawNone && - miGetRedirectBorderClipProc) - pBorderClip = (*miGetRedirectBorderClipProc) (pWin); -#endif - RegionAppend(&totalClip, pBorderClip); + RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } @@ -627,14 +620,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ pWin = pParent->lastChild; while (1) { if (pWin->valdata) { - RegionPtr pBorderClip = &pWin->borderClip; - -#ifdef COMPOSITE - if (pWin->redirectDraw != RedirectDrawNone && - miGetRedirectBorderClipProc) - pBorderClip = (*miGetRedirectBorderClipProc) (pWin); -#endif - RegionAppend(&totalClip, pBorderClip); + RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } diff --git a/xserver/mi/miwideline.c b/xserver/mi/miwideline.c index b76e7a818..452d74fc1 100644 --- a/xserver/mi/miwideline.c +++ b/xserver/mi/miwideline.c @@ -24,6 +24,25 @@ not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. +Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +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 Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL 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: Keith Packard, MIT X Consortium */ @@ -52,6 +71,505 @@ from The Open Group. #include "miwideline.h" #include "mi.h" +#if 0 +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "misc.h" +#include "pixmapstr.h" +#include "gcstruct.h" +#endif + +typedef struct { + int count; /* number of spans */ + DDXPointPtr points; /* pointer to list of start points */ + int *widths; /* pointer to list of widths */ +} Spans; + +typedef struct { + int size; /* Total number of *Spans allocated */ + int count; /* Number of *Spans actually in group */ + Spans *group; /* List of Spans */ + int ymin, ymax; /* Min, max y values encountered */ +} SpanGroup; + +/* Rops which must use span groups */ +#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) +#define miSpansEasyRop(rop) (!miSpansCarefulRop(rop)) + +/* + +These routines maintain lists of Spans, in order to implement the +``touch-each-pixel-once'' rules of wide lines and arcs. + +Written by Joel McCormack, Summer 1989. + +*/ + +static void +miInitSpanGroup(SpanGroup * spanGroup) +{ + spanGroup->size = 0; + spanGroup->count = 0; + spanGroup->group = NULL; + spanGroup->ymin = MAXSHORT; + spanGroup->ymax = MINSHORT; +} /* InitSpanGroup */ + +#define YMIN(spans) (spans->points[0].y) +#define YMAX(spans) (spans->points[spans->count-1].y) + +static void +miSubtractSpans(SpanGroup * spanGroup, Spans * sub) +{ + int i, subCount, spansCount; + int ymin, ymax, xmin, xmax; + Spans *spans; + DDXPointPtr subPt, spansPt; + int *subWid, *spansWid; + int extra; + + ymin = YMIN(sub); + ymax = YMAX(sub); + spans = spanGroup->group; + for (i = spanGroup->count; i; i--, spans++) { + if (YMIN(spans) <= ymax && ymin <= YMAX(spans)) { + subCount = sub->count; + subPt = sub->points; + subWid = sub->widths; + spansCount = spans->count; + spansPt = spans->points; + spansWid = spans->widths; + extra = 0; + for (;;) { + while (spansCount && spansPt->y < subPt->y) { + spansPt++; + spansWid++; + spansCount--; + } + if (!spansCount) + break; + while (subCount && subPt->y < spansPt->y) { + subPt++; + subWid++; + subCount--; + } + if (!subCount) + break; + if (subPt->y == spansPt->y) { + xmin = subPt->x; + xmax = xmin + *subWid; + if (xmin >= spansPt->x + *spansWid || spansPt->x >= xmax) { + ; + } + else if (xmin <= spansPt->x) { + if (xmax >= spansPt->x + *spansWid) { + memmove(spansPt, spansPt + 1, + sizeof *spansPt * (spansCount - 1)); + memmove(spansWid, spansWid + 1, + sizeof *spansWid * (spansCount - 1)); + spansPt--; + spansWid--; + spans->count--; + extra++; + } + else { + *spansWid = *spansWid - (xmax - spansPt->x); + spansPt->x = xmax; + } + } + else { + if (xmax >= spansPt->x + *spansWid) { + *spansWid = xmin - spansPt->x; + } + else { + if (!extra) { + DDXPointPtr newPt; + int *newwid; + +#define EXTRA 8 + newPt = + (DDXPointPtr) realloc(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)); + if (!newwid) + break; + spansWid = newwid + (spansWid - spans->widths); + spans->widths = newwid; + extra = EXTRA; + } + memmove(spansPt + 1, spansPt, + sizeof *spansPt * (spansCount)); + memmove(spansWid + 1, spansWid, + sizeof *spansWid * (spansCount)); + spans->count++; + extra--; + *spansWid = xmin - spansPt->x; + spansWid++; + spansPt++; + *spansWid = *spansWid - (xmax - spansPt->x); + spansPt->x = xmax; + } + } + } + spansPt++; + spansWid++; + spansCount--; + } + } + } +} + +static void +miAppendSpans(SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans) +{ + int ymin, ymax; + int spansCount; + + spansCount = spans->count; + 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[spanGroup->count] = *spans; + (spanGroup->count)++; + ymin = spans->points[0].y; + if (ymin < spanGroup->ymin) + spanGroup->ymin = ymin; + ymax = spans->points[spansCount - 1].y; + if (ymax > spanGroup->ymax) + spanGroup->ymax = ymax; + if (otherGroup && otherGroup->ymin < ymax && ymin < otherGroup->ymax) { + miSubtractSpans(otherGroup, spans); + } + } + else { + free(spans->points); + free(spans->widths); + } +} /* AppendSpans */ + +static void +miFreeSpanGroup(SpanGroup * spanGroup) +{ + free(spanGroup->group); +} + +static void +QuickSortSpansX(DDXPointRec points[], int widths[], int numSpans) +{ + int x; + int i, j, m; + DDXPointPtr r; + +/* Always called with numSpans > 1 */ +/* Sorts only by x, as all y should be the same */ + +#define ExchangeSpans(a, b) \ +{ \ + DDXPointRec tpt; \ + int tw; \ + \ + tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ + tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ +} + + do { + if (numSpans < 9) { + /* Do insertion sort */ + int xprev; + + xprev = points[0].x; + i = 1; + do { /* while i != numSpans */ + x = points[i].x; + if (xprev > x) { + /* points[i] is out of order. Move into proper location. */ + DDXPointRec tpt; + int tw, k; + + for (j = 0; x >= points[j].x; j++) { + } + tpt = points[i]; + tw = widths[i]; + for (k = i; k != j; k--) { + points[k] = points[k - 1]; + widths[k] = widths[k - 1]; + } + points[j] = tpt; + widths[j] = tw; + x = points[i].x; + } /* if out of order */ + xprev = x; + i++; + } while (i != numSpans); + return; + } + + /* Choose partition element, stick in location 0 */ + m = numSpans / 2; + if (points[m].x > points[0].x) + ExchangeSpans(m, 0); + if (points[m].x > points[numSpans - 1].x) + ExchangeSpans(m, numSpans - 1); + if (points[m].x > points[0].x) + ExchangeSpans(m, 0); + x = points[0].x; + + /* Partition array */ + i = 0; + j = numSpans; + do { + r = &(points[i]); + do { + r++; + i++; + } while (i != numSpans && r->x < x); + r = &(points[j]); + do { + r--; + j--; + } while (x < r->x); + if (i < j) + ExchangeSpans(i, j); + } while (i < j); + + /* Move partition element back to middle */ + ExchangeSpans(0, j); + + /* Recurse */ + if (numSpans - j - 1 > 1) + QuickSortSpansX(&points[j + 1], &widths[j + 1], numSpans - j - 1); + numSpans = j; + } while (numSpans > 1); +} /* QuickSortSpans */ + +static int +UniquifySpansX(Spans * spans, DDXPointRec * newPoints, int *newWidths) +{ + int newx1, newx2, oldpt, i, y; + DDXPointRec *oldPoints; + int *oldWidths; + int *startNewWidths; + +/* Always called with numSpans > 1 */ +/* Uniquify the spans, and stash them into newPoints and newWidths. Return the + number of unique spans. */ + + startNewWidths = newWidths; + + oldPoints = spans->points; + oldWidths = spans->widths; + + y = oldPoints->y; + newx1 = oldPoints->x; + newx2 = newx1 + *oldWidths; + + for (i = spans->count - 1; i != 0; i--) { + oldPoints++; + oldWidths++; + oldpt = oldPoints->x; + if (oldpt > newx2) { + /* Write current span, start a new one */ + newPoints->x = newx1; + newPoints->y = y; + *newWidths = newx2 - newx1; + newPoints++; + newWidths++; + newx1 = oldpt; + newx2 = oldpt + *oldWidths; + } + else { + /* extend current span, if old extends beyond new */ + oldpt = oldpt + *oldWidths; + if (oldpt > newx2) + newx2 = oldpt; + } + } /* for */ + + /* Write final span */ + newPoints->x = newx1; + *newWidths = newx2 - newx1; + newPoints->y = y; + + return (newWidths - startNewWidths) + 1; +} /* UniquifySpansX */ + +static void +miDisposeSpanGroup(SpanGroup * spanGroup) +{ + int i; + Spans *spans; + + for (i = 0; i < spanGroup->count; i++) { + spans = spanGroup->group + i; + free(spans->points); + free(spans->widths); + } +} + +static void +miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup) +{ + int i; + Spans *spans; + Spans *yspans; + int *ysizes; + int ymin, ylength; + + /* Outgoing spans for one big call to FillSpans */ + DDXPointPtr points; + int *widths; + int count; + + if (spanGroup->count == 0) + return; + + if (spanGroup->count == 1) { + /* Already should be sorted, unique */ + spans = spanGroup->group; + (*pGC->ops->FillSpans) + (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE); + free(spans->points); + free(spans->widths); + } + else { + /* Yuck. Gross. Radix sort into y buckets, then sort x and uniquify */ + /* This seems to be the fastest thing to do. I've tried sorting on + both x and y at the same time rather than creating into all those + y buckets, but it was somewhat slower. */ + + ymin = spanGroup->ymin; + ylength = spanGroup->ymax - ymin + 1; + + /* Allocate Spans for y buckets */ + yspans = malloc(ylength * sizeof(Spans)); + ysizes = malloc(ylength * sizeof(int)); + + if (!yspans || !ysizes) { + free(yspans); + free(ysizes); + miDisposeSpanGroup(spanGroup); + return; + } + + for (i = 0; i != ylength; i++) { + ysizes[i] = 0; + yspans[i].count = 0; + yspans[i].points = NULL; + yspans[i].widths = NULL; + } + + /* Go through every single span and put it into the correct bucket */ + count = 0; + for (i = 0, spans = spanGroup->group; + i != spanGroup->count; i++, spans++) { + int index; + int j; + + for (j = 0, points = spans->points, widths = spans->widths; + j != spans->count; j++, points++, widths++) { + index = points->y - ymin; + if (index >= 0 && index < ylength) { + Spans *newspans = &(yspans[index]); + + if (newspans->count == ysizes[index]) { + DDXPointPtr newpoints; + 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)); + if (!newpoints || !newwidths) { + for (i = 0; i < ylength; i++) { + free(yspans[i].points); + free(yspans[i].widths); + } + free(yspans); + free(ysizes); + free(newpoints); + free(newwidths); + miDisposeSpanGroup(spanGroup); + return; + } + newspans->points = newpoints; + newspans->widths = newwidths; + } + newspans->points[newspans->count] = *points; + newspans->widths[newspans->count] = *widths; + (newspans->count)++; + } /* if y value of span in range */ + } /* for j through spans */ + count += spans->count; + free(spans->points); + spans->points = NULL; + free(spans->widths); + spans->widths = NULL; + } /* 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)); + if (!points || !widths) { + for (i = 0; i < ylength; i++) { + free(yspans[i].points); + free(yspans[i].widths); + } + free(yspans); + free(ysizes); + free(points); + free(widths); + return; + } + count = 0; + for (i = 0; i != ylength; i++) { + int ycount = yspans[i].count; + + if (ycount > 0) { + if (ycount > 1) { + QuickSortSpansX(yspans[i].points, yspans[i].widths, ycount); + count += UniquifySpansX + (&(yspans[i]), &(points[count]), &(widths[count])); + } + else { + points[count] = yspans[i].points[0]; + widths[count] = yspans[i].widths[0]; + count++; + } + free(yspans[i].points); + free(yspans[i].widths); + } + } + + (*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE); + free(points); + free(widths); + free(yspans); + free(ysizes); /* use (DE)xalloc for these? */ + } + + spanGroup->count = 0; + spanGroup->ymin = MAXSHORT; + spanGroup->ymax = MINSHORT; +} + static Bool InitSpans(Spans * spans, size_t nspans) { @@ -273,7 +791,7 @@ miFillRectPolyHelper(DrawablePtr pDrawable, } } -/* static */ int +static int miPolyBuildEdge(double x0, double y0, double k, /* x0 * dy - y0 * dx */ int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge) { @@ -325,7 +843,7 @@ miPolyBuildEdge(double x0, double y0, double k, /* x0 * dy - y0 * dx */ #define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr))) -/* static */ int +static int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes, int count, @@ -865,7 +1383,7 @@ miRoundJoinFace(LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge) return y; } -void +static void miRoundJoinClip(LineFacePtr pLeft, LineFacePtr pRight, PolyEdgePtr edge1, PolyEdgePtr edge2, int *y1, int *y2, Bool *left1, Bool *left2) @@ -886,7 +1404,7 @@ miRoundJoinClip(LineFacePtr pLeft, LineFacePtr pRight, *y2 = miRoundJoinFace(pRight, edge2, left2); } -int +static int miRoundCapClip(LineFacePtr face, Bool isInt, PolyEdgePtr edge, Bool *leftEdge) { int y; @@ -1979,3 +2497,23 @@ miWideDash(DrawablePtr pDrawable, GCPtr pGC, if (spanData) miCleanupSpanData(pDrawable, pGC, spanData); } + +void +miPolylines(DrawablePtr drawable, + GCPtr gc, + int mode, + int n, + DDXPointPtr points) +{ + if (gc->lineWidth == 0) { + if (gc->lineStyle == LineSolid) + miZeroLine(drawable, gc, mode, n, points); + else + miZeroDashLine(drawable, gc, mode, n, points); + } else { + if (gc->lineStyle == LineSolid) + miWideLine(drawable, gc, mode, n, points); + else + miWideDash(drawable, gc, mode, n, points); + } +} diff --git a/xserver/mi/miwideline.h b/xserver/mi/miwideline.h index 110541120..88bc3d6c8 100644 --- a/xserver/mi/miwideline.h +++ b/xserver/mi/miwideline.h @@ -28,7 +28,6 @@ from The Open Group. /* Author: Keith Packard, MIT X Consortium */ -#include "mispans.h" #include "mifpoly.h" /* for ICEIL */ /* @@ -92,28 +91,3 @@ typedef struct _LineFace { ValidateGC (pDrawable, pGC); \ } \ } - -extern _X_EXPORT void miRoundJoinClip(LineFacePtr /*pLeft */ , - LineFacePtr /*pRight */ , - PolyEdgePtr /*edge1 */ , - PolyEdgePtr /*edge2 */ , - int * /*y1 */ , - int * /*y2 */ , - Bool * /*left1 */ , - Bool * /*left2 */ - ); - -extern _X_EXPORT int miRoundCapClip(LineFacePtr /*face */ , - Bool /*isInt */ , - PolyEdgePtr /*edge */ , - Bool * /*leftEdge */ - ); - -extern _X_EXPORT int miPolyBuildEdge(double x0, double y0, double k, int dx, - int dy, int xi, int yi, int left, - PolyEdgePtr edge); -extern _X_EXPORT int miPolyBuildPoly(PolyVertexPtr vertices, - PolySlopePtr slopes, int count, int xi, - int yi, PolyEdgePtr left, - PolyEdgePtr right, int *pnleft, - int *pnright, int *h); diff --git a/xserver/mi/miwindow.c b/xserver/mi/miwindow.c index 57de91bab..a1af3a770 100644 --- a/xserver/mi/miwindow.c +++ b/xserver/mi/miwindow.c @@ -27,13 +27,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -111,7 +111,7 @@ miClearToBackground(WindowPtr pWin, RegionIntersect(®, ®, &pWin->clipList); if (generateExposures) - (*pWin->drawable.pScreen->WindowExposures) (pWin, ®, NULL); + (*pWin->drawable.pScreen->WindowExposures) (pWin, ®); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); RegionUninit(®); @@ -221,7 +221,7 @@ miHandleValidateExposures(WindowPtr pWin) if (RegionNotEmpty(&val->after.borderExposed)) miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); RegionUninit(&val->after.borderExposed); - (*WindowExposures) (pChild, &val->after.exposed, NullRegion); + (*WindowExposures) (pChild, &val->after.exposed); RegionUninit(&val->after.exposed); free(val); pChild->valdata = NULL; @@ -292,9 +292,9 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) RegionDestroy(oldRegion); /* XXX need to retile border if ParentRelative origin */ (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, NULL, kind); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, NullWindow, kind); } if (pWin->realized) WindowsRestructured(); @@ -337,9 +337,8 @@ miRecomputeExposures(WindowPtr pWin, void *value) } void -miSlideAndSizeWindow(WindowPtr pWin, - int x, int y, - unsigned int w, unsigned int h, WindowPtr pSib) +miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, + WindowPtr pSib) { WindowPtr pParent; Bool WasViewable = (Bool) (pWin->viewable); @@ -608,11 +607,12 @@ miSlideAndSizeWindow(WindowPtr pWin, RegionDestroy(pRegion); if (destClip) RegionDestroy(destClip); - if (anyMarked) + if (anyMarked) { (*pScreen->HandleExposures) (pLayerWin->parent); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, - VTOther); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, + VTOther); + } } if (pWin->realized) WindowsRestructured(); @@ -664,17 +664,14 @@ miSetShape(WindowPtr pWin, int kind) if (WasViewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); - if (anyMarked) + if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, NullWindow, VTOther); - } - - if (WasViewable) { - if (anyMarked) (*pScreen->HandleExposures) (pLayerWin->parent); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, NullWindow, - VTOther); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, NULL, + VTOther); + } } } if (pWin->realized) @@ -726,10 +723,10 @@ miChangeBorderWidth(WindowPtr pWin, unsigned int width) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTOther); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, + VTOther); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, - VTOther); } if (pWin->realized) WindowsRestructured(); @@ -746,20 +743,6 @@ miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure) } } -void -miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) -{ - WindowPtr pChild; - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { - if (pChild->drawable.depth == depth) - RegionUnion(pReg, pReg, &pChild->borderClip); - - if (pChild->firstChild) - miSegregateChildren(pChild, pReg, depth); - } -} - WindowPtr miSpriteTrace(SpritePtr pSprite, int x, int y) { diff --git a/xserver/mi/mizerarc.c b/xserver/mi/mizerarc.c index 9dac180d1..b216cf43d 100644 --- a/xserver/mi/mizerarc.c +++ b/xserver/mi/mizerarc.c @@ -656,7 +656,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) for (arc = parcs, i = narcs; --i >= 0; arc++) { if (!miCanZeroArc(arc)) - miPolyArc(pDraw, pGC, 1, arc); + miWideArc(pDraw, pGC, 1, arc); else { if (arc->width > arc->height) n = arc->width + (arc->height >> 1); diff --git a/xserver/mi/mizerclip.c b/xserver/mi/mizerclip.c index d05bf6788..0ae964190 100644 --- a/xserver/mi/mizerclip.c +++ b/xserver/mi/mizerclip.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/mi/mizerline.c b/xserver/mi/mizerline.c index 90798dbdf..5a2447014 100644 --- a/xserver/mi/mizerline.c +++ b/xserver/mi/mizerline.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -179,14 +179,6 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */ MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom); while (--npt > 0) { - if (Nspans > 0) - (*pGC->ops->FillSpans) (pDraw, pGC, Nspans, pspanInit, - pwidthInit, FALSE); - Nspans = 0; - new_span = TRUE; - spans = pspanInit - 1; - widths = pwidthInit - 1; - x1 = x2; y1 = y2; oc1 = oc2; @@ -208,6 +200,14 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */ CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant); + if (ady + 1 > (list_len - Nspans)) { + (*pGC->ops->FillSpans) (pDraw, pGC, Nspans, pspanInit, + pwidthInit, FALSE); + Nspans = 0; + spans = pspanInit - 1; + widths = pwidthInit - 1; + } + new_span = TRUE; if (adx > ady) { e1 = ady << 1; e2 = e1 - (adx << 1); @@ -235,7 +235,7 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */ length = abs(new_x2 - new_x1); /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter + * of the segment, because then the capstyle doesn't matter */ if (pt2_clipped) length++; @@ -295,7 +295,7 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode, /* Origin or Previous */ length = abs(new_y2 - new_y1); /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter + * of the segment, because then the capstyle doesn't matter */ if (pt2_clipped) length++; diff --git a/xserver/miext/Makefile.in b/xserver/miext/Makefile.in index d0042637c..d30f855ba 100644 --- a/xserver/miext/Makefile.in +++ b/xserver/miext/Makefile.in @@ -239,6 +239,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/miext/damage/Makefile.in b/xserver/miext/damage/Makefile.in index 0b4fc0d24..504b9102b 100644 --- a/xserver/miext/damage/Makefile.in +++ b/xserver/miext/damage/Makefile.in @@ -263,6 +263,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/miext/damage/damage.c b/xserver/miext/damage/damage.c index 9bd9c84e7..6ef7f9dfc 100644 --- a/xserver/miext/damage/damage.c +++ b/xserver/miext/damage/damage.c @@ -1591,7 +1591,7 @@ miDamageCreate(DamagePtr pDamage) * Since we can't know if a GC has been validated against one of the affected * children, just bump them all to be safe. */ -static int +static int damageRegisterVisit(WindowPtr pWin, void *data) { pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; diff --git a/xserver/miext/rootless/Makefile.in b/xserver/miext/rootless/Makefile.in index 70a3893ea..ba943de82 100644 --- a/xserver/miext/rootless/Makefile.in +++ b/xserver/miext/rootless/Makefile.in @@ -233,6 +233,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/miext/rootless/rootless.h b/xserver/miext/rootless/rootless.h index a3f38b633..1be61cdf3 100644 --- a/xserver/miext/rootless/rootless.h +++ b/xserver/miext/rootless/rootless.h @@ -319,7 +319,7 @@ typedef struct _RootlessFrameProcs { Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs); /* - * Return the frame ID for the physical window displaying the given window. + * Return the frame ID for the physical window displaying the given window. * * create If true and the window has no frame, attempt to create one */ diff --git a/xserver/miext/rootless/rootlessGC.c b/xserver/miext/rootless/rootlessGC.c index 23ff3934e..4fba26c8d 100644 --- a/xserver/miext/rootless/rootlessGC.c +++ b/xserver/miext/rootless/rootlessGC.c @@ -297,7 +297,7 @@ RootlessCreateGC(GCPtr pGC) * All the others just unwrap and call. */ -// GCFUNC_UNRAP assumes funcs have been wrapped and +// GCFUNC_UNRAP assumes funcs have been wrapped and // does not assume ops have been wrapped #define GCFUNC_UNWRAP(pGC) \ RootlessGCRec *gcrec = (RootlessGCRec *) \ diff --git a/xserver/miext/rootless/rootlessValTree.c b/xserver/miext/rootless/rootlessValTree.c index 730d2917e..0f7b76cb6 100644 --- a/xserver/miext/rootless/rootlessValTree.c +++ b/xserver/miext/rootless/rootlessValTree.c @@ -29,19 +29,19 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * - * Copyright 1987, 1988, 1989 by + * Copyright 1987, 1988, 1989 by * Digital Equipment Corporation, Maynard, Massachusetts, - * + * * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in + * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital not be * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * + * software without specific, written prior permission. + * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR @@ -49,7 +49,7 @@ in this Software without prior written authorization from The Open Group. * 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. - * + * ******************************************************************/ /* The panoramix components contained the following notice */ @@ -80,7 +80,7 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ - /* + /* * Aug '86: Susan Angebranndt -- original code * July '87: Adam de Boor -- substantially modified and commented * Summer '89: Joel McCormack -- so fast you wouldn't believe it possible. @@ -106,64 +106,6 @@ Equipment Corporation. int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild, VTKind kind); -/* - * Compute the visibility of a shaped window - */ -static int -RootlessShapedWindowIn(RegionPtr universe, - RegionPtr bounding, BoxPtr rect, int x, int y) -{ - BoxRec box; - register BoxPtr boundBox; - int nbox; - Bool someIn, someOut; - register int t, x1, y1, x2, y2; - - nbox = RegionNumRects(bounding); - boundBox = RegionRects(bounding); - someIn = someOut = FALSE; - x1 = rect->x1; - y1 = rect->y1; - x2 = rect->x2; - y2 = rect->y2; - while (nbox--) { - if ((t = boundBox->x1 + x) < x1) - t = x1; - box.x1 = t; - if ((t = boundBox->y1 + y) < y1) - t = y1; - box.y1 = t; - if ((t = boundBox->x2 + x) > x2) - t = x2; - box.x2 = t; - if ((t = boundBox->y2 + y) > y2) - t = y2; - box.y2 = t; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - switch (RegionContainsRect(universe, &box)) { - case rgnIN: - if (someOut) - return rgnPART; - someIn = TRUE; - break; - case rgnOUT: - if (someIn) - return rgnPART; - someOut = TRUE; - break; - default: - return rgnPART; - } - boundBox++; - } - if (someIn) - return rgnIN; - return rgnOUT; -} - #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ HasBorder(w) && \ (w)->backgroundState == ParentRelative) @@ -229,10 +171,9 @@ RootlessComputeClips(WindowPtr pParent, ScreenPtr pScreen, RegionPtr pBounding; if ((pBounding = wBoundingShape(pParent))) { - switch (RootlessShapedWindowIn(universe, - pBounding, &borderSize, - pParent->drawable.x, - pParent->drawable.y)) { + switch (miShapedWindowIn(universe, pBounding, &borderSize, + pParent->drawable.x, + pParent->drawable.y)) { case rgnIN: newVis = VisibilityUnobscured; break; @@ -515,9 +456,9 @@ RootlessTreeObscured(WindowPtr pParent) * *----------------------------------------------------------------------- */ -/* +/* Quartz version: used for validate from root in rootless mode. - We need to make sure top-level windows don't clip each other, + We need to make sure top-level windows don't clip each other, and that top-level windows aren't clipped to the root window. */ /*ARGSUSED*/ @@ -550,9 +491,9 @@ RootlessMiValidateTree(WindowPtr pRoot, /* Parent to validate */ ErrorF("ValidateTree: BUSTED!\n"); } - /* - * Recursively compute the clips for all children of the root. - * They don't clip against each other or the root itself, so + /* + * Recursively compute the clips for all children of the root. + * They don't clip against each other or the root itself, so * childClip is always reset to that child's size. */ @@ -579,7 +520,7 @@ RootlessMiValidateTree(WindowPtr pRoot, /* Parent to validate */ RegionUninit(&childClip); - /* The root is never clipped by its children, so nothing on the root + /* The root is never clipped by its children, so nothing on the root is ever exposed by moving or mapping its children. */ RegionNull(&pRoot->valdata->after.exposed); RegionNull(&pRoot->valdata->after.borderExposed); diff --git a/xserver/miext/rootless/rootlessWindow.c b/xserver/miext/rootless/rootlessWindow.c index 3dbd5886a..a8f296a39 100644 --- a/xserver/miext/rootless/rootlessWindow.c +++ b/xserver/miext/rootless/rootlessWindow.c @@ -128,7 +128,7 @@ RootlessNativeWindowMoved(WindowPtr pWin) return; } - /* Don't want to do anything to the physical window (avoids + /* Don't want to do anything to the physical window (avoids notification-response feedback loops) */ no_configure_window = TRUE; @@ -477,7 +477,7 @@ RootlessRealizeWindow(WindowPtr pWin) /* * RootlessFrameForWindow - * Returns the frame ID for the physical window displaying the given window. + * Returns the frame ID for the physical window displaying the given window. * If CREATE is true and the window has no frame, attempt to create one. */ RootlessFrameID @@ -559,7 +559,7 @@ RootlessReorderWindow(WindowPtr pWin) RootlessStopDrawing(pWin, FALSE); - /* Find the next window above this one that has a mapped frame. + /* Find the next window above this one that has a mapped frame. * Only include cases where the windows are in the same category of * hittability to ensure offscreen windows dont get restacked * relative to onscreen ones (but that the offscreen ones maintain diff --git a/xserver/miext/shadow/Makefile.in b/xserver/miext/shadow/Makefile.in index 7ef4d8b95..8fb172bad 100644 --- a/xserver/miext/shadow/Makefile.in +++ b/xserver/miext/shadow/Makefile.in @@ -269,6 +269,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/miext/shadow/shadow.c b/xserver/miext/shadow/shadow.c index 522e21bd0..0dd3604a7 100644 --- a/xserver/miext/shadow/shadow.c +++ b/xserver/miext/shadow/shadow.c @@ -93,8 +93,6 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, wrap(pBuf, pScreen, GetImage); } -#define BACKWARDS_COMPATIBILITY - static Bool shadowCloseScreen(ScreenPtr pScreen) { @@ -104,35 +102,12 @@ shadowCloseScreen(ScreenPtr pScreen) unwrap(pBuf, pScreen, CloseScreen); shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); -#ifdef BACKWARDS_COMPATIBILITY - RegionUninit(&pBuf->damage); /* bc */ -#endif if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); free(pBuf); return pScreen->CloseScreen(pScreen); } -#ifdef BACKWARDS_COMPATIBILITY -static void -shadowReportFunc(DamagePtr pDamage, RegionPtr pRegion, void *closure) -{ - ScreenPtr pScreen = closure; - shadowBufPtr pBuf = (shadowBufPtr) - dixLookupPrivate(&pScreen->devPrivates, shadowScrPrivateKey); - - /* Register the damaged region, use DamageReportNone below when we - * want to break BC below... */ - RegionUnion(&pDamage->damage, &pDamage->damage, pRegion); - - /* - * BC hack. In 7.0 and earlier several drivers would inspect the - * 'damage' member directly, so we have to keep it existing. - */ - RegionCopy(&pBuf->damage, pRegion); -} -#endif - Bool shadowSetup(ScreenPtr pScreen) { @@ -147,15 +122,9 @@ shadowSetup(ScreenPtr pScreen) pBuf = malloc(sizeof(shadowBufRec)); if (!pBuf) return FALSE; -#ifdef BACKWARDS_COMPATIBILITY - pBuf->pDamage = DamageCreate((DamageReportFunc) shadowReportFunc, - (DamageDestroyFunc) NULL, - DamageReportRawRegion, TRUE, pScreen, pScreen); -#else pBuf->pDamage = DamageCreate((DamageReportFunc) NULL, (DamageDestroyFunc) NULL, DamageReportNone, TRUE, pScreen, pScreen); -#endif if (!pBuf->pDamage) { free(pBuf); return FALSE; @@ -168,9 +137,6 @@ shadowSetup(ScreenPtr pScreen) pBuf->pPixmap = 0; pBuf->closure = 0; pBuf->randr = 0; -#ifdef BACKWARDS_COMPATIBILITY - RegionNull(&pBuf->damage); /* bc */ -#endif dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf); return TRUE; @@ -230,23 +196,3 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, (void *) pScreen); } - -Bool -shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window) -{ - PixmapPtr pPixmap; - - pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, - pScreen->rootDepth, 0); - if (!pPixmap) - return FALSE; - - if (!shadowSetup(pScreen)) { - pScreen->DestroyPixmap(pPixmap); - return FALSE; - } - - shadowAdd(pScreen, pPixmap, update, window, SHADOW_ROTATE_0, 0); - - return TRUE; -} diff --git a/xserver/miext/shadow/shadow.h b/xserver/miext/shadow/shadow.h index 421ae96a6..86fa94479 100644 --- a/xserver/miext/shadow/shadow.h +++ b/xserver/miext/shadow/shadow.h @@ -43,12 +43,10 @@ typedef void *(*ShadowWindowProc) (ScreenPtr pScreen, CARD32 offset, int mode, CARD32 *size, void *closure); -/* BC hack: do not move the damage member. see shadow.c for explanation. */ typedef struct _shadowBuf { DamagePtr pDamage; ShadowUpdateProc update; ShadowWindowProc window; - RegionRec damage; PixmapPtr pPixmap; void *closure; int randr; @@ -89,10 +87,6 @@ shadowAdd(ScreenPtr pScreen, extern _X_EXPORT void shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap); -extern _X_EXPORT Bool - -shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window); - extern _X_EXPORT void *shadowAlloc(int width, int height, int bpp); extern _X_EXPORT void diff --git a/xserver/miext/shadow/shrotate.c b/xserver/miext/shadow/shrotate.c index 779a905d2..a0fc4ec4e 100644 --- a/xserver/miext/shadow/shrotate.c +++ b/xserver/miext/shadow/shrotate.c @@ -259,7 +259,7 @@ shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) p = pixelsPerBits; /* * Build one word of output from multiple inputs - * + * * Note that for 90/270 rotations, this will walk * down the shadow hitting each scanline once. * This is probably not very efficient. diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in index 09822d2c8..b41a813ac 100644 --- a/xserver/miext/sync/Makefile.in +++ b/xserver/miext/sync/Makefile.in @@ -268,6 +268,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/miext/sync/misyncfd.c b/xserver/miext/sync/misyncfd.c index 93ff85fa8..92f3b2294 100644 --- a/xserver/miext/sync/misyncfd.c +++ b/xserver/miext/sync/misyncfd.c @@ -77,7 +77,7 @@ _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen, if (!miSyncSetup(pScreen)) return FALSE; - + if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) { if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, 0)) return FALSE; @@ -94,6 +94,6 @@ _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen, priv->funcs = *funcs; dixSetPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey, priv); - + return TRUE; } diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in index fcdb81bd2..17e0fded7 100644 --- a/xserver/os/Makefile.in +++ b/xserver/os/Makefile.in @@ -265,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/os/WaitFor.c b/xserver/os/WaitFor.c index 343de0c50..431f1a6b6 100644 --- a/xserver/os/WaitFor.c +++ b/xserver/os/WaitFor.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -82,7 +82,7 @@ SOFTWARE. #define EINVAL WSAEINVAL #undef EBADF #define EBADF WSAENOTSOCK -/* Windows select does not set errno. Use GetErrno as wrapper for +/* Windows select does not set errno. Use GetErrno as wrapper for WSAGetLastError */ #define GetErrno WSAGetLastError #else @@ -167,7 +167,7 @@ WaitForSomething(int *pClientsReady) busfault_check(); #endif - /* We need a while loop here to handle + /* We need a while loop here to handle crashed connections and the screen saver timeout */ while (1) { /* deal with any blocked jobs */ @@ -349,14 +349,14 @@ WaitForSomething(int *pClientsReady) * ready, they are all returned. This means that an * aggressive client could take over the server. * This was not considered a big problem because - * aggressive clients can hose the server in so many + * aggressive clients can hose the server in so many * other ways :) */ client_priority = clients[client_index]->priority; if (nready == 0 || client_priority > highest_priority) { /* Either we found the first client, or we found * a client whose priority is greater than all others - * that have been found so far. Either way, we want + * that have been found so far. Either way, we want * to initialize the list of clients to contain just * this client. */ @@ -364,7 +364,7 @@ WaitForSomething(int *pClientsReady) highest_priority = client_priority; nready = 1; } - /* the following if makes sure that multiple same-priority + /* the following if makes sure that multiple same-priority * clients get batched together */ else if (client_priority == highest_priority) { diff --git a/xserver/os/access.c b/xserver/os/access.c index 61624fdf7..75e7a6983 100644 --- a/xserver/os/access.c +++ b/xserver/os/access.c @@ -35,13 +35,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -102,6 +102,10 @@ SOFTWARE. #include #include +#ifndef NO_LOCAL_CLIENT_CRED +#include +#endif + #if defined(TCPCONN) || defined(STREAMSCONN) #include #endif /* TCPCONN || STREAMSCONN */ @@ -201,7 +205,7 @@ static Bool NewHost(int /*family */ , /etc/X.hosts, we've added a requested field to the HOST struct, and a LocalHostRequested variable. These default to FALSE, but are set to TRUE in ResetHosts when reading in /etc/X.hosts. They are - checked in DisableLocalHost(), which is called to disable the default + checked in DisableLocalHost(), which is called to disable the default local host entries when stronger authentication is turned on. */ typedef struct _host { @@ -225,6 +229,13 @@ static int LocalHostEnabled = FALSE; static int LocalHostRequested = FALSE; static int UsingXdmcp = FALSE; +static enum { + LOCAL_ACCESS_SCOPE_HOST = 0, +#ifndef NO_LOCAL_CLIENT_CRED + LOCAL_ACCESS_SCOPE_USER, +#endif +} LocalAccessScope; + /* FamilyServerInterpreted implementation */ static Bool siAddrMatch(int family, void *addr, int len, HOST * host, ClientPtr client); @@ -236,6 +247,21 @@ static void siTypesInitialize(void); * local host to the access list */ +void +EnableLocalAccess(void) +{ + switch (LocalAccessScope) { + case LOCAL_ACCESS_SCOPE_HOST: + EnableLocalHost(); + break; +#ifndef NO_LOCAL_CLIENT_CRED + case LOCAL_ACCESS_SCOPE_USER: + EnableLocalUser(); + break; +#endif + } +} + void EnableLocalHost(void) { @@ -248,6 +274,21 @@ EnableLocalHost(void) /* * called when authorization is enabled to keep us secure */ +void +DisableLocalAccess(void) +{ + switch (LocalAccessScope) { + case LOCAL_ACCESS_SCOPE_HOST: + DisableLocalHost(); + break; +#ifndef NO_LOCAL_CLIENT_CRED + case LOCAL_ACCESS_SCOPE_USER: + DisableLocalUser(); + break; +#endif + } +} + void DisableLocalHost(void) { @@ -262,6 +303,74 @@ DisableLocalHost(void) } } +#ifndef NO_LOCAL_CLIENT_CRED +static int GetLocalUserAddr(char **addr) +{ + static const char *type = "localuser"; + static const char delimiter = '\0'; + static const char *value; + struct passwd *pw; + int length = -1; + + pw = getpwuid(getuid()); + + if (pw == NULL || pw->pw_name == NULL) + goto out; + + value = pw->pw_name; + + length = asprintf(addr, "%s%c%s", type, delimiter, value); + + if (length == -1) { + goto out; + } + + /* Trailing NUL */ + length++; + +out: + return length; +} + +void +EnableLocalUser(void) +{ + char *addr = NULL; + int length = -1; + + length = GetLocalUserAddr(&addr); + + if (length == -1) + return; + + NewHost(FamilyServerInterpreted, addr, length, TRUE); + + free(addr); +} + +void +DisableLocalUser(void) +{ + char *addr = NULL; + int length = -1; + + length = GetLocalUserAddr(&addr); + + if (length == -1) + return; + + RemoveHost(NULL, FamilyServerInterpreted, length, addr); + + free(addr); +} + +void +LocalAccessScopeUser(void) +{ + LocalAccessScope = LOCAL_ACCESS_SCOPE_USER; +} +#endif + /* * called at init time when XDMCP will be used; xdmcp always * adds local hosts manually when needed @@ -309,7 +418,7 @@ ifioctl(int fd, int cmd, char *arg) /* * DefineSelf (fd): * - * Define this host for access control. Find all the hosts the OS knows about + * Define this host for access control. Find all the hosts the OS knows about * for this fd and add them to the selfhosts list. */ @@ -712,7 +821,7 @@ DefineSelf(int fd) ) continue; - /* + /* * ignore 'localhost' entries as they're not useful * on the other end of the wire */ @@ -835,7 +944,7 @@ ResetHosts(const char *display) } saddr; #endif int family = 0; - void *addr; + void *addr = NULL; int len; siTypesInitialize(); @@ -928,8 +1037,8 @@ ResetHosts(const char *display) len = a->ai_addrlen; f = ConvertAddr(a->ai_addr, &len, (void **) &addr); - if ((family == f) || - ((family == FamilyWild) && (f != -1))) { + if (addr && ((family == f) || + ((family == FamilyWild) && (f != -1)))) { NewHost(f, addr, len, FALSE); } } @@ -1007,37 +1116,10 @@ ComputeLocalClient(ClientPtr client) return FALSE; } -/* - * Return the uid and gid of a connected local client - * - * Used by XShm to test access rights to shared memory segments - */ -int -LocalClientCred(ClientPtr client, int *pUid, int *pGid) -{ - LocalClientCredRec *lcc; - int ret = GetLocalClientCreds(client, &lcc); - - if (ret == 0) { -#ifdef HAVE_GETZONEID /* only local if in the same zone */ - if ((lcc->fieldsSet & LCC_ZID_SET) && (lcc->zoneid != getzoneid())) { - FreeLocalClientCreds(lcc); - return -1; - } -#endif - if ((lcc->fieldsSet & LCC_UID_SET) && (pUid != NULL)) - *pUid = lcc->euid; - if ((lcc->fieldsSet & LCC_GID_SET) && (pGid != NULL)) - *pGid = lcc->egid; - FreeLocalClientCreds(lcc); - } - return ret; -} - /* * Return the uid and all gids of a connected local client * Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds - * + * * Used by localuser & localgroup ServerInterpreted access control forms below * Used by AuthAudit to log who local connections came from */ @@ -1064,8 +1146,8 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp) return -1; ci = ((OsCommPtr) client->osPrivate)->trans_conn; #if !(defined(sun) && defined(HAVE_GETPEERUCRED)) - /* Most implementations can only determine peer credentials for Unix - * domain sockets - Solaris getpeerucred can work with a bit more, so + /* Most implementations can only determine peer credentials for Unix + * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not */ if (!_XSERVTransIsLocal(ci)) { @@ -1217,9 +1299,9 @@ AddHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ } Bool -ForEachHostInFamily(int family, Bool (*func) (unsigned char * /* addr */ , - short /* len */ , - void */* closure */ ), +ForEachHostInFamily(int family, Bool (*func) (unsigned char *addr, + short len, + void *closure), void *closure) { HOST *host; @@ -1230,7 +1312,7 @@ ForEachHostInFamily(int family, Bool (*func) (unsigned char * /* addr */ , return FALSE; } -/* Add a host to the access control list. This is the internal interface +/* Add a host to the access control list. This is the internal interface * called when starting or resetting the server */ static Bool NewHost(int family, const void *addr, int len, int addingLocalHosts) @@ -1385,14 +1467,14 @@ CheckAddr(int family, const void *pAddr, unsigned length) return len; } -/* Check if a host is not in the access control list. +/* Check if a host is not in the access control list. * Returns 1 if host is invalid, 0 if we've found it. */ int InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) { int family; - void *addr; + void *addr = NULL; register HOST *selfhost, *host; if (!AccessEnabled) /* just let them in */ @@ -1403,7 +1485,7 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) if (family == FamilyLocal) { if (!LocalHostEnabled) { /* - * check to see if any local address is enabled. This + * check to see if any local address is enabled. This * implicitly enables local connections. */ for (selfhost = selfhosts; selfhost; selfhost = selfhost->next) { @@ -1424,7 +1506,7 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) } } else { - if (addrEqual(family, addr, len, host)) + if (addr && addrEqual(family, addr, len, host)) return 0; } @@ -1507,7 +1589,7 @@ GetAccessControl(void) * See xc/doc/specs/SIAddresses for formal definitions of each type. */ -/* These definitions and the siTypeAdd function could be exported in the +/* These definitions and the siTypeAdd function could be exported in the * future to enable loading additional host types, but that was not done for * the initial implementation. */ @@ -1604,7 +1686,7 @@ siCheckAddr(const char *addrString, int length) valueString = (const char *) memchr(addrString, '\0', length); if (valueString != NULL) { /* Make sure the first string is a recognized address type, - * and the second string is a valid address of that type. + * and the second string is a valid address of that type. */ typelen = strlen(addrString) + 1; addrlen = length - typelen; @@ -1671,8 +1753,8 @@ siHostnameAddrMatch(int family, void *addr, int len, { Bool res = FALSE; -/* Currently only supports checking against IPv4 & IPv6 connections, but - * support for other address families, such as DECnet, could be added if +/* Currently only supports checking against IPv4 & IPv6 connections, but + * support for other address families, such as DECnet, could be added if * desired. */ #if defined(IPv6) && defined(AF_INET6) @@ -1681,7 +1763,7 @@ siHostnameAddrMatch(int family, void *addr, int len, struct addrinfo *addresses; struct addrinfo *a; int f, hostaddrlen; - void *hostaddr; + void *hostaddr = NULL; if (siAddrLen >= sizeof(hostname)) return FALSE; @@ -1692,7 +1774,7 @@ siHostnameAddrMatch(int family, void *addr, int len, for (a = addresses; a != NULL; a = a->ai_next) { hostaddrlen = a->ai_addrlen; f = ConvertAddr(a->ai_addr, &hostaddrlen, &hostaddr); - if ((f == family) && (len == hostaddrlen) && + if ((f == family) && (len == hostaddrlen) && hostaddr && (memcmp(addr, hostaddr, len) == 0)) { res = TRUE; break; @@ -1750,7 +1832,7 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv) { /* Check conformance of hostname to RFC 2396 sec. 3.2.2 definition. * We do not use ctype functions here to avoid locale-specific - * character sets. Hostnames must be pure ASCII. + * character sets. Hostnames must be pure ASCII. */ int len = length; int i; @@ -1804,12 +1886,12 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv) * * Currently supports only IPv6 literal address as specified in IETF RFC 3513 * - * Once draft-ietf-ipv6-scoping-arch-00.txt becomes an RFC, support will be + * Once draft-ietf-ipv6-scoping-arch-00.txt becomes an RFC, support will be * added for the scoped address format it specifies. */ -/* Maximum length of an IPv6 address string - increase when adding support - * for scoped address qualifiers. Includes room for trailing NUL byte. +/* Maximum length of an IPv6 address string - increase when adding support + * for scoped address qualifiers. Includes room for trailing NUL byte. */ #define SI_IPv6_MAXLEN INET6_ADDRSTRLEN diff --git a/xserver/os/auth.c b/xserver/os/auth.c index 5fcb538c4..7da6fc6ed 100644 --- a/xserver/os/auth.c +++ b/xserver/os/auth.c @@ -181,11 +181,11 @@ CheckAuthorization(unsigned int name_length, /* * If the authorization file has at least one entry for this server, - * disable local host access. (loadauth > 0) + * disable local access. (loadauth > 0) * * If there are zero entries (either initially or when the * authorization file is later reloaded), or if a valid - * authorization file was never loaded, enable local host access. + * authorization file was never loaded, enable local access. * (loadauth == 0 || !loaded) * * If the authorization file was loaded initially (with valid @@ -194,11 +194,11 @@ CheckAuthorization(unsigned int name_length, */ if (loadauth > 0) { - DisableLocalHost(); /* got at least one */ + DisableLocalAccess(); /* got at least one */ loaded = TRUE; } else if (loadauth == 0 || !loaded) - EnableLocalHost(); + EnableLocalAccess(); } if (name_length) { for (i = 0; i < NUM_AUTHORIZATION; i++) { diff --git a/xserver/os/backtrace.c b/xserver/os/backtrace.c index 3d1195b86..fd129ef21 100644 --- a/xserver/os/backtrace.c +++ b/xserver/os/backtrace.c @@ -87,7 +87,7 @@ xorg_backtrace(void) procname[1] = 0; } - if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && + if (dladdr((void *)(uintptr_t)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && *dlinfo.dli_fname) filename = dlinfo.dli_fname; else @@ -95,7 +95,7 @@ xorg_backtrace(void) ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, ret == -UNW_ENOMEM ? "..." : "", (int)off, - (void *)(pip.start_ip + off)); + (void *)(uintptr_t)(pip.start_ip + off)); ret = unw_step(&cursor); if (ret < 0) diff --git a/xserver/os/busfault.c b/xserver/os/busfault.c index ac0268fd5..d4afa6df3 100644 --- a/xserver/os/busfault.c +++ b/xserver/os/busfault.c @@ -47,7 +47,7 @@ struct busfault { void *context; }; -static Bool busfaulted; +static Bool busfaulted; static struct xorg_list busfaults; struct busfault * diff --git a/xserver/os/connection.c b/xserver/os/connection.c index ad5cf34e4..aaec1939c 100644 --- a/xserver/os/connection.c +++ b/xserver/os/connection.c @@ -26,13 +26,13 @@ Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -428,7 +428,7 @@ CreateWellKnownSockets(void) } else { /* -displayfd and no explicit display number */ Bool found = 0; - for (i = 0; i < 65535 - X_TCP_PORT; i++) { + for (i = 0; i < 65536 - X_TCP_PORT; i++) { if (TryCreateSocket(i, &partial) && !partial) { found = 1; break; @@ -526,8 +526,13 @@ CloseWellKnownConnections(void) { int i; - for (i = 0; i < ListenTransCount; i++) - _XSERVTransClose(ListenTransConns[i]); + for (i = 0; i < ListenTransCount; i++) { + if (ListenTransConns[i] != NULL) { + _XSERVTransClose(ListenTransConns[i]); + ListenTransConns[i] = NULL; + } + } + ListenTransCount = 0; } static void @@ -655,8 +660,8 @@ AuthorizationIDOfClient(ClientPtr client) * CARD8 byteOrder; * BYTE pad; * CARD16 majorVersion, minorVersion; - * CARD16 nbytesAuthProto; - * CARD16 nbytesAuthString; + * CARD16 nbytesAuthProto; + * CARD16 nbytesAuthString; * } xConnClientPrefix; * * It is hoped that eventually one protocol will be agreed upon. In the @@ -981,7 +986,7 @@ CloseDownFileDescriptor(OsCommPtr oc) /***************** * CheckConnections - * Some connection has died, go find which one and shut it down + * Some connection has died, go find which one and shut it down * The file descriptor has been closed, but is still in AllClients. * If would truly be wonderful if select() would put the bogus * file descriptors in the exception mask, but nooooo. So we have @@ -1042,7 +1047,7 @@ CheckConnections(void) /***************** * CloseDownConnection - * Delete client from AllClients and free resources + * Delete client from AllClients and free resources *****************/ void diff --git a/xserver/os/io.c b/xserver/os/io.c index 8181a8639..96a243d8c 100644 --- a/xserver/os/io.c +++ b/xserver/os/io.c @@ -26,13 +26,13 @@ Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -448,7 +448,7 @@ ReadRequestFromClient(ClientPtr client) * buffer beyond the request we're returning to the caller. * If there is only a partial request, treat like buffer * is empty so that select() will be called again and other clients - * can get into the queue. + * can get into the queue. */ gotnow -= needed; @@ -971,10 +971,11 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) } if (notWritten > oco->size) { - unsigned char *obuf; + unsigned char *obuf = NULL; - obuf = (unsigned char *) realloc(oco->buf, - notWritten + BUFSIZE); + if (notWritten + BUFSIZE <= INT_MAX) { + obuf = realloc(oco->buf, notWritten + BUFSIZE); + } if (!obuf) { _XSERVTransDisconnect(oc->trans_conn); _XSERVTransClose(oc->trans_conn); diff --git a/xserver/os/log.c b/xserver/os/log.c index 2a721b948..3db5c5333 100644 --- a/xserver/os/log.c +++ b/xserver/os/log.c @@ -127,7 +127,7 @@ static char __crashreporter_info_buff__[4096] = { 0 }; static const char *__crashreporter_info__ __attribute__ ((__used__)) = &__crashreporter_info_buff__[0]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -// This is actually a toolchain requirement, but I'm not sure the correct check, +// This is actually a toolchain requirement, but I'm not sure the correct check, // but it should be fine to just only include it for Leopard and later. This line // just tells the linker to never strip this symbol (such as for space optimization) asm(".desc ___crashreporter_info__, 0x10"); @@ -189,15 +189,15 @@ strlen_sigsafe(const char *s) * string. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + const char * LogInit(const char *fname, const char *backup) { char *logFileName = NULL; if (fname && *fname) { -#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2 -#pragma GCC diagnostic ignored "-Wformat-nonliteral" -#endif if (asprintf(&logFileName, fname, display) == -1) FatalError("Cannot allocate space for the log file name\n"); @@ -208,9 +208,6 @@ LogInit(const char *fname, const char *backup) char *suffix; char *oldLog; -#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2 -#pragma GCC diagnostic ignored "-Wformat-nonliteral" -#endif if ((asprintf(&suffix, backup, display) == -1) || (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1)) FatalError("Cannot allocate space for the log file name\n"); @@ -254,13 +251,17 @@ LogInit(const char *fname, const char *backup) return logFileName; } +#pragma GCC diagnostic pop void LogClose(enum ExitCode error) { if (logFile) { - ErrorFSigSafe("Server terminated %s (%d). Closing log file.\n", - (error == EXIT_NO_ERROR) ? "successfully" : "with error", error); + int msgtype = (error == EXIT_NO_ERROR) ? X_INFO : X_ERROR; + LogMessageVerbSigSafe(msgtype, -1, + "Server terminated %s (%d). Closing log file.\n", + (error == EXIT_NO_ERROR) ? "successfully" : "with error", + error); fclose(logFile); logFile = NULL; logFileFd = -1; @@ -354,6 +355,7 @@ vpnprintf(char *string, int size_in, const char *f, va_list args) uint64_t ui; int64_t si; size_t size = size_in; + int precision; for (; f_idx < f_len && s_idx < size - 1; f_idx++) { int length_modifier = 0; @@ -364,9 +366,29 @@ vpnprintf(char *string, int size_in, const char *f, va_list args) f_idx++; - /* silently swallow digit length modifiers */ - while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.')) + /* silently swallow minimum field width */ + if (f[f_idx] == '*') { f_idx++; + va_arg(args, int); + } else { + while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9'))) + f_idx++; + } + + /* is there a precision? */ + precision = size; + if (f[f_idx] == '.') { + f_idx++; + if (f[f_idx] == '*') { + f_idx++; + /* precision is supplied in an int argument */ + precision = va_arg(args, int); + } else { + /* silently swallow precision digits */ + while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9'))) + f_idx++; + } + } /* non-digit length modifiers */ if (f_idx < f_len) { @@ -382,9 +404,8 @@ vpnprintf(char *string, int size_in, const char *f, va_list args) switch (f[f_idx]) { case 's': string_arg = va_arg(args, char*); - p_len = strlen_sigsafe(string_arg); - for (i = 0; i < p_len && s_idx < size - 1; i++) + for (i = 0; string_arg[i] != 0 && s_idx < size - 1 && s_idx < precision; i++) string[s_idx++] = string_arg[i]; break; diff --git a/xserver/os/oscolor.c b/xserver/os/oscolor.c index a7573d28b..017aab1f2 100644 --- a/xserver/os/oscolor.c +++ b/xserver/os/oscolor.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -67,6 +67,7 @@ static const char BuiltinColorNames[] = { "AntiqueWhite2\0" "AntiqueWhite3\0" "AntiqueWhite4\0" + "aqua\0" "aquamarine\0" "aquamarine1\0" "aquamarine2\0" @@ -131,6 +132,7 @@ static const char BuiltinColorNames[] = { "cornsilk2\0" "cornsilk3\0" "cornsilk4\0" + "crimson\0" "cyan\0" "cyan1\0" "cyan2\0" @@ -229,6 +231,7 @@ static const char BuiltinColorNames[] = { "FloralWhite\0" "forest green\0" "ForestGreen\0" + "fuchsia\0" "gainsboro\0" "ghost white\0" "GhostWhite\0" @@ -470,6 +473,7 @@ static const char BuiltinColorNames[] = { "IndianRed2\0" "IndianRed3\0" "IndianRed4\0" + "indigo\0" "ivory\0" "ivory1\0" "ivory2\0" @@ -561,6 +565,7 @@ static const char BuiltinColorNames[] = { "LightYellow2\0" "LightYellow3\0" "LightYellow4\0" + "lime\0" "lime green\0" "LimeGreen\0" "linen\0" @@ -622,6 +627,7 @@ static const char BuiltinColorNames[] = { "NavyBlue\0" "old lace\0" "OldLace\0" + "olive\0" "olive drab\0" "OliveDrab\0" "OliveDrab1\0" @@ -690,6 +696,8 @@ static const char BuiltinColorNames[] = { "purple2\0" "purple3\0" "purple4\0" + "rebecca purple\0" + "RebeccaPurple\0" "red\0" "red1\0" "red2\0" @@ -732,6 +740,7 @@ static const char BuiltinColorNames[] = { "sienna2\0" "sienna3\0" "sienna4\0" + "silver\0" "sky blue\0" "SkyBlue\0" "SkyBlue1\0" @@ -774,6 +783,7 @@ static const char BuiltinColorNames[] = { "tan2\0" "tan3\0" "tan4\0" + "teal\0" "thistle\0" "thistle1\0" "thistle2\0" @@ -796,6 +806,16 @@ static const char BuiltinColorNames[] = { "VioletRed2\0" "VioletRed3\0" "VioletRed4\0" + "web gray\0" + "web green\0" + "web grey\0" + "web maroon\0" + "web purple\0" + "WebGray\0" + "WebGreen\0" + "WebGrey\0" + "WebMaroon\0" + "WebPurple\0" "wheat\0" "wheat1\0" "wheat2\0" @@ -804,9 +824,23 @@ static const char BuiltinColorNames[] = { "white\0" "white smoke\0" "WhiteSmoke\0" + "x11 gray\0" + "x11 green\0" + "x11 grey\0" + "x11 maroon\0" + "x11 purple\0" + "X11Gray\0" + "X11Green\0" + "X11Grey\0" + "X11Maroon\0" + "X11Purple\0" "yellow\0" "yellow green\0" - "yellow1\0" "yellow2\0" "yellow3\0" "yellow4\0" "YellowGreen\0" + "yellow1\0" + "yellow2\0" + "yellow3\0" + "yellow4\0" + "YellowGreen\0" }; static const BuiltinColor BuiltinColors[] = { @@ -818,750 +852,780 @@ static const BuiltinColor BuiltinColors[] = { {238, 223, 204, 62}, /* AntiqueWhite2 */ {205, 192, 176, 76}, /* AntiqueWhite3 */ {139, 131, 120, 90}, /* AntiqueWhite4 */ - {127, 255, 212, 104}, /* aquamarine */ - {127, 255, 212, 115}, /* aquamarine1 */ - {118, 238, 198, 127}, /* aquamarine2 */ - {102, 205, 170, 139}, /* aquamarine3 */ - {69, 139, 116, 151}, /* aquamarine4 */ - {240, 255, 255, 163}, /* azure */ - {240, 255, 255, 169}, /* azure1 */ - {224, 238, 238, 176}, /* azure2 */ - {193, 205, 205, 183}, /* azure3 */ - {131, 139, 139, 190}, /* azure4 */ - {245, 245, 220, 197}, /* beige */ - {255, 228, 196, 203}, /* bisque */ - {255, 228, 196, 210}, /* bisque1 */ - {238, 213, 183, 218}, /* bisque2 */ - {205, 183, 158, 226}, /* bisque3 */ - {139, 125, 107, 234}, /* bisque4 */ - {0, 0, 0, 242}, /* black */ - {255, 235, 205, 248}, /* blanched almond */ - {255, 235, 205, 264}, /* BlanchedAlmond */ - {0, 0, 255, 279}, /* blue */ - {138, 43, 226, 284}, /* blue violet */ - {0, 0, 255, 296}, /* blue1 */ - {0, 0, 238, 302}, /* blue2 */ - {0, 0, 205, 308}, /* blue3 */ - {0, 0, 139, 314}, /* blue4 */ - {138, 43, 226, 320}, /* BlueViolet */ - {165, 42, 42, 331}, /* brown */ - {255, 64, 64, 337}, /* brown1 */ - {238, 59, 59, 344}, /* brown2 */ - {205, 51, 51, 351}, /* brown3 */ - {139, 35, 35, 358}, /* brown4 */ - {222, 184, 135, 365}, /* burlywood */ - {255, 211, 155, 375}, /* burlywood1 */ - {238, 197, 145, 386}, /* burlywood2 */ - {205, 170, 125, 397}, /* burlywood3 */ - {139, 115, 85, 408}, /* burlywood4 */ - {95, 158, 160, 419}, /* cadet blue */ - {95, 158, 160, 430}, /* CadetBlue */ - {152, 245, 255, 440}, /* CadetBlue1 */ - {142, 229, 238, 451}, /* CadetBlue2 */ - {122, 197, 205, 462}, /* CadetBlue3 */ - {83, 134, 139, 473}, /* CadetBlue4 */ - {127, 255, 0, 484}, /* chartreuse */ - {127, 255, 0, 495}, /* chartreuse1 */ - {118, 238, 0, 507}, /* chartreuse2 */ - {102, 205, 0, 519}, /* chartreuse3 */ - {69, 139, 0, 531}, /* chartreuse4 */ - {210, 105, 30, 543}, /* chocolate */ - {255, 127, 36, 553}, /* chocolate1 */ - {238, 118, 33, 564}, /* chocolate2 */ - {205, 102, 29, 575}, /* chocolate3 */ - {139, 69, 19, 586}, /* chocolate4 */ - {255, 127, 80, 597}, /* coral */ - {255, 114, 86, 603}, /* coral1 */ - {238, 106, 80, 610}, /* coral2 */ - {205, 91, 69, 617}, /* coral3 */ - {139, 62, 47, 624}, /* coral4 */ - {100, 149, 237, 631}, /* cornflower blue */ - {100, 149, 237, 647}, /* CornflowerBlue */ - {255, 248, 220, 662}, /* cornsilk */ - {255, 248, 220, 671}, /* cornsilk1 */ - {238, 232, 205, 681}, /* cornsilk2 */ - {205, 200, 177, 691}, /* cornsilk3 */ - {139, 136, 120, 701}, /* cornsilk4 */ - {0, 255, 255, 711}, /* cyan */ - {0, 255, 255, 716}, /* cyan1 */ - {0, 238, 238, 722}, /* cyan2 */ - {0, 205, 205, 728}, /* cyan3 */ - {0, 139, 139, 734}, /* cyan4 */ - {0, 0, 139, 740}, /* dark blue */ - {0, 139, 139, 750}, /* dark cyan */ - {184, 134, 11, 760}, /* dark goldenrod */ - {169, 169, 169, 775}, /* dark gray */ - {0, 100, 0, 785}, /* dark green */ - {169, 169, 169, 796}, /* dark grey */ - {189, 183, 107, 806}, /* dark khaki */ - {139, 0, 139, 817}, /* dark magenta */ - {85, 107, 47, 830}, /* dark olive green */ - {255, 140, 0, 847}, /* dark orange */ - {153, 50, 204, 859}, /* dark orchid */ - {139, 0, 0, 871}, /* dark red */ - {233, 150, 122, 880}, /* dark salmon */ - {143, 188, 143, 892}, /* dark sea green */ - {72, 61, 139, 907}, /* dark slate blue */ - {47, 79, 79, 923}, /* dark slate gray */ - {47, 79, 79, 939}, /* dark slate grey */ - {0, 206, 209, 955}, /* dark turquoise */ - {148, 0, 211, 970}, /* dark violet */ - {0, 0, 139, 982}, /* DarkBlue */ - {0, 139, 139, 991}, /* DarkCyan */ - {184, 134, 11, 1000}, /* DarkGoldenrod */ - {255, 185, 15, 1014}, /* DarkGoldenrod1 */ - {238, 173, 14, 1029}, /* DarkGoldenrod2 */ - {205, 149, 12, 1044}, /* DarkGoldenrod3 */ - {139, 101, 8, 1059}, /* DarkGoldenrod4 */ - {169, 169, 169, 1074}, /* DarkGray */ - {0, 100, 0, 1083}, /* DarkGreen */ - {169, 169, 169, 1093}, /* DarkGrey */ - {189, 183, 107, 1102}, /* DarkKhaki */ - {139, 0, 139, 1112}, /* DarkMagenta */ - {85, 107, 47, 1124}, /* DarkOliveGreen */ - {202, 255, 112, 1139}, /* DarkOliveGreen1 */ - {188, 238, 104, 1155}, /* DarkOliveGreen2 */ - {162, 205, 90, 1171}, /* DarkOliveGreen3 */ - {110, 139, 61, 1187}, /* DarkOliveGreen4 */ - {255, 140, 0, 1203}, /* DarkOrange */ - {255, 127, 0, 1214}, /* DarkOrange1 */ - {238, 118, 0, 1226}, /* DarkOrange2 */ - {205, 102, 0, 1238}, /* DarkOrange3 */ - {139, 69, 0, 1250}, /* DarkOrange4 */ - {153, 50, 204, 1262}, /* DarkOrchid */ - {191, 62, 255, 1273}, /* DarkOrchid1 */ - {178, 58, 238, 1285}, /* DarkOrchid2 */ - {154, 50, 205, 1297}, /* DarkOrchid3 */ - {104, 34, 139, 1309}, /* DarkOrchid4 */ - {139, 0, 0, 1321}, /* DarkRed */ - {233, 150, 122, 1329}, /* DarkSalmon */ - {143, 188, 143, 1340}, /* DarkSeaGreen */ - {193, 255, 193, 1353}, /* DarkSeaGreen1 */ - {180, 238, 180, 1367}, /* DarkSeaGreen2 */ - {155, 205, 155, 1381}, /* DarkSeaGreen3 */ - {105, 139, 105, 1395}, /* DarkSeaGreen4 */ - {72, 61, 139, 1409}, /* DarkSlateBlue */ - {47, 79, 79, 1423}, /* DarkSlateGray */ - {151, 255, 255, 1437}, /* DarkSlateGray1 */ - {141, 238, 238, 1452}, /* DarkSlateGray2 */ - {121, 205, 205, 1467}, /* DarkSlateGray3 */ - {82, 139, 139, 1482}, /* DarkSlateGray4 */ - {47, 79, 79, 1497}, /* DarkSlateGrey */ - {0, 206, 209, 1511}, /* DarkTurquoise */ - {148, 0, 211, 1525}, /* DarkViolet */ - {255, 20, 147, 1536}, /* deep pink */ - {0, 191, 255, 1546}, /* deep sky blue */ - {255, 20, 147, 1560}, /* DeepPink */ - {255, 20, 147, 1569}, /* DeepPink1 */ - {238, 18, 137, 1579}, /* DeepPink2 */ - {205, 16, 118, 1589}, /* DeepPink3 */ - {139, 10, 80, 1599}, /* DeepPink4 */ - {0, 191, 255, 1609}, /* DeepSkyBlue */ - {0, 191, 255, 1621}, /* DeepSkyBlue1 */ - {0, 178, 238, 1634}, /* DeepSkyBlue2 */ - {0, 154, 205, 1647}, /* DeepSkyBlue3 */ - {0, 104, 139, 1660}, /* DeepSkyBlue4 */ - {105, 105, 105, 1673}, /* dim gray */ - {105, 105, 105, 1682}, /* dim grey */ - {105, 105, 105, 1691}, /* DimGray */ - {105, 105, 105, 1699}, /* DimGrey */ - {30, 144, 255, 1707}, /* dodger blue */ - {30, 144, 255, 1719}, /* DodgerBlue */ - {30, 144, 255, 1730}, /* DodgerBlue1 */ - {28, 134, 238, 1742}, /* DodgerBlue2 */ - {24, 116, 205, 1754}, /* DodgerBlue3 */ - {16, 78, 139, 1766}, /* DodgerBlue4 */ - {178, 34, 34, 1778}, /* firebrick */ - {255, 48, 48, 1788}, /* firebrick1 */ - {238, 44, 44, 1799}, /* firebrick2 */ - {205, 38, 38, 1810}, /* firebrick3 */ - {139, 26, 26, 1821}, /* firebrick4 */ - {255, 250, 240, 1832}, /* floral white */ - {255, 250, 240, 1845}, /* FloralWhite */ - {34, 139, 34, 1857}, /* forest green */ - {34, 139, 34, 1870}, /* ForestGreen */ - {220, 220, 220, 1882}, /* gainsboro */ - {248, 248, 255, 1892}, /* ghost white */ - {248, 248, 255, 1904}, /* GhostWhite */ - {255, 215, 0, 1915}, /* gold */ - {255, 215, 0, 1920}, /* gold1 */ - {238, 201, 0, 1926}, /* gold2 */ - {205, 173, 0, 1932}, /* gold3 */ - {139, 117, 0, 1938}, /* gold4 */ - {218, 165, 32, 1944}, /* goldenrod */ - {255, 193, 37, 1954}, /* goldenrod1 */ - {238, 180, 34, 1965}, /* goldenrod2 */ - {205, 155, 29, 1976}, /* goldenrod3 */ - {139, 105, 20, 1987}, /* goldenrod4 */ - {190, 190, 190, 1998}, /* gray */ - {0, 0, 0, 2003}, /* gray0 */ - {3, 3, 3, 2009}, /* gray1 */ - {26, 26, 26, 2015}, /* gray10 */ - {255, 255, 255, 2022}, /* gray100 */ - {28, 28, 28, 2030}, /* gray11 */ - {31, 31, 31, 2037}, /* gray12 */ - {33, 33, 33, 2044}, /* gray13 */ - {36, 36, 36, 2051}, /* gray14 */ - {38, 38, 38, 2058}, /* gray15 */ - {41, 41, 41, 2065}, /* gray16 */ - {43, 43, 43, 2072}, /* gray17 */ - {46, 46, 46, 2079}, /* gray18 */ - {48, 48, 48, 2086}, /* gray19 */ - {5, 5, 5, 2093}, /* gray2 */ - {51, 51, 51, 2099}, /* gray20 */ - {54, 54, 54, 2106}, /* gray21 */ - {56, 56, 56, 2113}, /* gray22 */ - {59, 59, 59, 2120}, /* gray23 */ - {61, 61, 61, 2127}, /* gray24 */ - {64, 64, 64, 2134}, /* gray25 */ - {66, 66, 66, 2141}, /* gray26 */ - {69, 69, 69, 2148}, /* gray27 */ - {71, 71, 71, 2155}, /* gray28 */ - {74, 74, 74, 2162}, /* gray29 */ - {8, 8, 8, 2169}, /* gray3 */ - {77, 77, 77, 2175}, /* gray30 */ - {79, 79, 79, 2182}, /* gray31 */ - {82, 82, 82, 2189}, /* gray32 */ - {84, 84, 84, 2196}, /* gray33 */ - {87, 87, 87, 2203}, /* gray34 */ - {89, 89, 89, 2210}, /* gray35 */ - {92, 92, 92, 2217}, /* gray36 */ - {94, 94, 94, 2224}, /* gray37 */ - {97, 97, 97, 2231}, /* gray38 */ - {99, 99, 99, 2238}, /* gray39 */ - {10, 10, 10, 2245}, /* gray4 */ - {102, 102, 102, 2251}, /* gray40 */ - {105, 105, 105, 2258}, /* gray41 */ - {107, 107, 107, 2265}, /* gray42 */ - {110, 110, 110, 2272}, /* gray43 */ - {112, 112, 112, 2279}, /* gray44 */ - {115, 115, 115, 2286}, /* gray45 */ - {117, 117, 117, 2293}, /* gray46 */ - {120, 120, 120, 2300}, /* gray47 */ - {122, 122, 122, 2307}, /* gray48 */ - {125, 125, 125, 2314}, /* gray49 */ - {13, 13, 13, 2321}, /* gray5 */ - {127, 127, 127, 2327}, /* gray50 */ - {130, 130, 130, 2334}, /* gray51 */ - {133, 133, 133, 2341}, /* gray52 */ - {135, 135, 135, 2348}, /* gray53 */ - {138, 138, 138, 2355}, /* gray54 */ - {140, 140, 140, 2362}, /* gray55 */ - {143, 143, 143, 2369}, /* gray56 */ - {145, 145, 145, 2376}, /* gray57 */ - {148, 148, 148, 2383}, /* gray58 */ - {150, 150, 150, 2390}, /* gray59 */ - {15, 15, 15, 2397}, /* gray6 */ - {153, 153, 153, 2403}, /* gray60 */ - {156, 156, 156, 2410}, /* gray61 */ - {158, 158, 158, 2417}, /* gray62 */ - {161, 161, 161, 2424}, /* gray63 */ - {163, 163, 163, 2431}, /* gray64 */ - {166, 166, 166, 2438}, /* gray65 */ - {168, 168, 168, 2445}, /* gray66 */ - {171, 171, 171, 2452}, /* gray67 */ - {173, 173, 173, 2459}, /* gray68 */ - {176, 176, 176, 2466}, /* gray69 */ - {18, 18, 18, 2473}, /* gray7 */ - {179, 179, 179, 2479}, /* gray70 */ - {181, 181, 181, 2486}, /* gray71 */ - {184, 184, 184, 2493}, /* gray72 */ - {186, 186, 186, 2500}, /* gray73 */ - {189, 189, 189, 2507}, /* gray74 */ - {191, 191, 191, 2514}, /* gray75 */ - {194, 194, 194, 2521}, /* gray76 */ - {196, 196, 196, 2528}, /* gray77 */ - {199, 199, 199, 2535}, /* gray78 */ - {201, 201, 201, 2542}, /* gray79 */ - {20, 20, 20, 2549}, /* gray8 */ - {204, 204, 204, 2555}, /* gray80 */ - {207, 207, 207, 2562}, /* gray81 */ - {209, 209, 209, 2569}, /* gray82 */ - {212, 212, 212, 2576}, /* gray83 */ - {214, 214, 214, 2583}, /* gray84 */ - {217, 217, 217, 2590}, /* gray85 */ - {219, 219, 219, 2597}, /* gray86 */ - {222, 222, 222, 2604}, /* gray87 */ - {224, 224, 224, 2611}, /* gray88 */ - {227, 227, 227, 2618}, /* gray89 */ - {23, 23, 23, 2625}, /* gray9 */ - {229, 229, 229, 2631}, /* gray90 */ - {232, 232, 232, 2638}, /* gray91 */ - {235, 235, 235, 2645}, /* gray92 */ - {237, 237, 237, 2652}, /* gray93 */ - {240, 240, 240, 2659}, /* gray94 */ - {242, 242, 242, 2666}, /* gray95 */ - {245, 245, 245, 2673}, /* gray96 */ - {247, 247, 247, 2680}, /* gray97 */ - {250, 250, 250, 2687}, /* gray98 */ - {252, 252, 252, 2694}, /* gray99 */ - {0, 255, 0, 2701}, /* green */ - {173, 255, 47, 2707}, /* green yellow */ - {0, 255, 0, 2720}, /* green1 */ - {0, 238, 0, 2727}, /* green2 */ - {0, 205, 0, 2734}, /* green3 */ - {0, 139, 0, 2741}, /* green4 */ - {173, 255, 47, 2748}, /* GreenYellow */ - {190, 190, 190, 2760}, /* grey */ - {0, 0, 0, 2765}, /* grey0 */ - {3, 3, 3, 2771}, /* grey1 */ - {26, 26, 26, 2777}, /* grey10 */ - {255, 255, 255, 2784}, /* grey100 */ - {28, 28, 28, 2792}, /* grey11 */ - {31, 31, 31, 2799}, /* grey12 */ - {33, 33, 33, 2806}, /* grey13 */ - {36, 36, 36, 2813}, /* grey14 */ - {38, 38, 38, 2820}, /* grey15 */ - {41, 41, 41, 2827}, /* grey16 */ - {43, 43, 43, 2834}, /* grey17 */ - {46, 46, 46, 2841}, /* grey18 */ - {48, 48, 48, 2848}, /* grey19 */ - {5, 5, 5, 2855}, /* grey2 */ - {51, 51, 51, 2861}, /* grey20 */ - {54, 54, 54, 2868}, /* grey21 */ - {56, 56, 56, 2875}, /* grey22 */ - {59, 59, 59, 2882}, /* grey23 */ - {61, 61, 61, 2889}, /* grey24 */ - {64, 64, 64, 2896}, /* grey25 */ - {66, 66, 66, 2903}, /* grey26 */ - {69, 69, 69, 2910}, /* grey27 */ - {71, 71, 71, 2917}, /* grey28 */ - {74, 74, 74, 2924}, /* grey29 */ - {8, 8, 8, 2931}, /* grey3 */ - {77, 77, 77, 2937}, /* grey30 */ - {79, 79, 79, 2944}, /* grey31 */ - {82, 82, 82, 2951}, /* grey32 */ - {84, 84, 84, 2958}, /* grey33 */ - {87, 87, 87, 2965}, /* grey34 */ - {89, 89, 89, 2972}, /* grey35 */ - {92, 92, 92, 2979}, /* grey36 */ - {94, 94, 94, 2986}, /* grey37 */ - {97, 97, 97, 2993}, /* grey38 */ - {99, 99, 99, 3000}, /* grey39 */ - {10, 10, 10, 3007}, /* grey4 */ - {102, 102, 102, 3013}, /* grey40 */ - {105, 105, 105, 3020}, /* grey41 */ - {107, 107, 107, 3027}, /* grey42 */ - {110, 110, 110, 3034}, /* grey43 */ - {112, 112, 112, 3041}, /* grey44 */ - {115, 115, 115, 3048}, /* grey45 */ - {117, 117, 117, 3055}, /* grey46 */ - {120, 120, 120, 3062}, /* grey47 */ - {122, 122, 122, 3069}, /* grey48 */ - {125, 125, 125, 3076}, /* grey49 */ - {13, 13, 13, 3083}, /* grey5 */ - {127, 127, 127, 3089}, /* grey50 */ - {130, 130, 130, 3096}, /* grey51 */ - {133, 133, 133, 3103}, /* grey52 */ - {135, 135, 135, 3110}, /* grey53 */ - {138, 138, 138, 3117}, /* grey54 */ - {140, 140, 140, 3124}, /* grey55 */ - {143, 143, 143, 3131}, /* grey56 */ - {145, 145, 145, 3138}, /* grey57 */ - {148, 148, 148, 3145}, /* grey58 */ - {150, 150, 150, 3152}, /* grey59 */ - {15, 15, 15, 3159}, /* grey6 */ - {153, 153, 153, 3165}, /* grey60 */ - {156, 156, 156, 3172}, /* grey61 */ - {158, 158, 158, 3179}, /* grey62 */ - {161, 161, 161, 3186}, /* grey63 */ - {163, 163, 163, 3193}, /* grey64 */ - {166, 166, 166, 3200}, /* grey65 */ - {168, 168, 168, 3207}, /* grey66 */ - {171, 171, 171, 3214}, /* grey67 */ - {173, 173, 173, 3221}, /* grey68 */ - {176, 176, 176, 3228}, /* grey69 */ - {18, 18, 18, 3235}, /* grey7 */ - {179, 179, 179, 3241}, /* grey70 */ - {181, 181, 181, 3248}, /* grey71 */ - {184, 184, 184, 3255}, /* grey72 */ - {186, 186, 186, 3262}, /* grey73 */ - {189, 189, 189, 3269}, /* grey74 */ - {191, 191, 191, 3276}, /* grey75 */ - {194, 194, 194, 3283}, /* grey76 */ - {196, 196, 196, 3290}, /* grey77 */ - {199, 199, 199, 3297}, /* grey78 */ - {201, 201, 201, 3304}, /* grey79 */ - {20, 20, 20, 3311}, /* grey8 */ - {204, 204, 204, 3317}, /* grey80 */ - {207, 207, 207, 3324}, /* grey81 */ - {209, 209, 209, 3331}, /* grey82 */ - {212, 212, 212, 3338}, /* grey83 */ - {214, 214, 214, 3345}, /* grey84 */ - {217, 217, 217, 3352}, /* grey85 */ - {219, 219, 219, 3359}, /* grey86 */ - {222, 222, 222, 3366}, /* grey87 */ - {224, 224, 224, 3373}, /* grey88 */ - {227, 227, 227, 3380}, /* grey89 */ - {23, 23, 23, 3387}, /* grey9 */ - {229, 229, 229, 3393}, /* grey90 */ - {232, 232, 232, 3400}, /* grey91 */ - {235, 235, 235, 3407}, /* grey92 */ - {237, 237, 237, 3414}, /* grey93 */ - {240, 240, 240, 3421}, /* grey94 */ - {242, 242, 242, 3428}, /* grey95 */ - {245, 245, 245, 3435}, /* grey96 */ - {247, 247, 247, 3442}, /* grey97 */ - {250, 250, 250, 3449}, /* grey98 */ - {252, 252, 252, 3456}, /* grey99 */ - {240, 255, 240, 3463}, /* honeydew */ - {240, 255, 240, 3472}, /* honeydew1 */ - {224, 238, 224, 3482}, /* honeydew2 */ - {193, 205, 193, 3492}, /* honeydew3 */ - {131, 139, 131, 3502}, /* honeydew4 */ - {255, 105, 180, 3512}, /* hot pink */ - {255, 105, 180, 3521}, /* HotPink */ - {255, 110, 180, 3529}, /* HotPink1 */ - {238, 106, 167, 3538}, /* HotPink2 */ - {205, 96, 144, 3547}, /* HotPink3 */ - {139, 58, 98, 3556}, /* HotPink4 */ - {205, 92, 92, 3565}, /* indian red */ - {205, 92, 92, 3576}, /* IndianRed */ - {255, 106, 106, 3586}, /* IndianRed1 */ - {238, 99, 99, 3597}, /* IndianRed2 */ - {205, 85, 85, 3608}, /* IndianRed3 */ - {139, 58, 58, 3619}, /* IndianRed4 */ - {255, 255, 240, 3630}, /* ivory */ - {255, 255, 240, 3636}, /* ivory1 */ - {238, 238, 224, 3643}, /* ivory2 */ - {205, 205, 193, 3650}, /* ivory3 */ - {139, 139, 131, 3657}, /* ivory4 */ - {240, 230, 140, 3664}, /* khaki */ - {255, 246, 143, 3670}, /* khaki1 */ - {238, 230, 133, 3677}, /* khaki2 */ - {205, 198, 115, 3684}, /* khaki3 */ - {139, 134, 78, 3691}, /* khaki4 */ - {230, 230, 250, 3698}, /* lavender */ - {255, 240, 245, 3707}, /* lavender blush */ - {255, 240, 245, 3722}, /* LavenderBlush */ - {255, 240, 245, 3736}, /* LavenderBlush1 */ - {238, 224, 229, 3751}, /* LavenderBlush2 */ - {205, 193, 197, 3766}, /* LavenderBlush3 */ - {139, 131, 134, 3781}, /* LavenderBlush4 */ - {124, 252, 0, 3796}, /* lawn green */ - {124, 252, 0, 3807}, /* LawnGreen */ - {255, 250, 205, 3817}, /* lemon chiffon */ - {255, 250, 205, 3831}, /* LemonChiffon */ - {255, 250, 205, 3844}, /* LemonChiffon1 */ - {238, 233, 191, 3858}, /* LemonChiffon2 */ - {205, 201, 165, 3872}, /* LemonChiffon3 */ - {139, 137, 112, 3886}, /* LemonChiffon4 */ - {173, 216, 230, 3900}, /* light blue */ - {240, 128, 128, 3911}, /* light coral */ - {224, 255, 255, 3923}, /* light cyan */ - {238, 221, 130, 3934}, /* light goldenrod */ - {250, 250, 210, 3950}, /* light goldenrod yellow */ - {211, 211, 211, 3973}, /* light gray */ - {144, 238, 144, 3984}, /* light green */ - {211, 211, 211, 3996}, /* light grey */ - {255, 182, 193, 4007}, /* light pink */ - {255, 160, 122, 4018}, /* light salmon */ - {32, 178, 170, 4031}, /* light sea green */ - {135, 206, 250, 4047}, /* light sky blue */ - {132, 112, 255, 4062}, /* light slate blue */ - {119, 136, 153, 4079}, /* light slate gray */ - {119, 136, 153, 4096}, /* light slate grey */ - {176, 196, 222, 4113}, /* light steel blue */ - {255, 255, 224, 4130}, /* light yellow */ - {173, 216, 230, 4143}, /* LightBlue */ - {191, 239, 255, 4153}, /* LightBlue1 */ - {178, 223, 238, 4164}, /* LightBlue2 */ - {154, 192, 205, 4175}, /* LightBlue3 */ - {104, 131, 139, 4186}, /* LightBlue4 */ - {240, 128, 128, 4197}, /* LightCoral */ - {224, 255, 255, 4208}, /* LightCyan */ - {224, 255, 255, 4218}, /* LightCyan1 */ - {209, 238, 238, 4229}, /* LightCyan2 */ - {180, 205, 205, 4240}, /* LightCyan3 */ - {122, 139, 139, 4251}, /* LightCyan4 */ - {238, 221, 130, 4262}, /* LightGoldenrod */ - {255, 236, 139, 4277}, /* LightGoldenrod1 */ - {238, 220, 130, 4293}, /* LightGoldenrod2 */ - {205, 190, 112, 4309}, /* LightGoldenrod3 */ - {139, 129, 76, 4325}, /* LightGoldenrod4 */ - {250, 250, 210, 4341}, /* LightGoldenrodYellow */ - {211, 211, 211, 4362}, /* LightGray */ - {144, 238, 144, 4372}, /* LightGreen */ - {211, 211, 211, 4383}, /* LightGrey */ - {255, 182, 193, 4393}, /* LightPink */ - {255, 174, 185, 4403}, /* LightPink1 */ - {238, 162, 173, 4414}, /* LightPink2 */ - {205, 140, 149, 4425}, /* LightPink3 */ - {139, 95, 101, 4436}, /* LightPink4 */ - {255, 160, 122, 4447}, /* LightSalmon */ - {255, 160, 122, 4459}, /* LightSalmon1 */ - {238, 149, 114, 4472}, /* LightSalmon2 */ - {205, 129, 98, 4485}, /* LightSalmon3 */ - {139, 87, 66, 4498}, /* LightSalmon4 */ - {32, 178, 170, 4511}, /* LightSeaGreen */ - {135, 206, 250, 4525}, /* LightSkyBlue */ - {176, 226, 255, 4538}, /* LightSkyBlue1 */ - {164, 211, 238, 4552}, /* LightSkyBlue2 */ - {141, 182, 205, 4566}, /* LightSkyBlue3 */ - {96, 123, 139, 4580}, /* LightSkyBlue4 */ - {132, 112, 255, 4594}, /* LightSlateBlue */ - {119, 136, 153, 4609}, /* LightSlateGray */ - {119, 136, 153, 4624}, /* LightSlateGrey */ - {176, 196, 222, 4639}, /* LightSteelBlue */ - {202, 225, 255, 4654}, /* LightSteelBlue1 */ - {188, 210, 238, 4670}, /* LightSteelBlue2 */ - {162, 181, 205, 4686}, /* LightSteelBlue3 */ - {110, 123, 139, 4702}, /* LightSteelBlue4 */ - {255, 255, 224, 4718}, /* LightYellow */ - {255, 255, 224, 4730}, /* LightYellow1 */ - {238, 238, 209, 4743}, /* LightYellow2 */ - {205, 205, 180, 4756}, /* LightYellow3 */ - {139, 139, 122, 4769}, /* LightYellow4 */ - {50, 205, 50, 4782}, /* lime green */ - {50, 205, 50, 4793}, /* LimeGreen */ - {250, 240, 230, 4803}, /* linen */ - {255, 0, 255, 4809}, /* magenta */ - {255, 0, 255, 4817}, /* magenta1 */ - {238, 0, 238, 4826}, /* magenta2 */ - {205, 0, 205, 4835}, /* magenta3 */ - {139, 0, 139, 4844}, /* magenta4 */ - {176, 48, 96, 4853}, /* maroon */ - {255, 52, 179, 4860}, /* maroon1 */ - {238, 48, 167, 4868}, /* maroon2 */ - {205, 41, 144, 4876}, /* maroon3 */ - {139, 28, 98, 4884}, /* maroon4 */ - {102, 205, 170, 4892}, /* medium aquamarine */ - {0, 0, 205, 4910}, /* medium blue */ - {186, 85, 211, 4922}, /* medium orchid */ - {147, 112, 219, 4936}, /* medium purple */ - {60, 179, 113, 4950}, /* medium sea green */ - {123, 104, 238, 4967}, /* medium slate blue */ - {0, 250, 154, 4985}, /* medium spring green */ - {72, 209, 204, 5005}, /* medium turquoise */ - {199, 21, 133, 5022}, /* medium violet red */ - {102, 205, 170, 5040}, /* MediumAquamarine */ - {0, 0, 205, 5057}, /* MediumBlue */ - {186, 85, 211, 5068}, /* MediumOrchid */ - {224, 102, 255, 5081}, /* MediumOrchid1 */ - {209, 95, 238, 5095}, /* MediumOrchid2 */ - {180, 82, 205, 5109}, /* MediumOrchid3 */ - {122, 55, 139, 5123}, /* MediumOrchid4 */ - {147, 112, 219, 5137}, /* MediumPurple */ - {171, 130, 255, 5150}, /* MediumPurple1 */ - {159, 121, 238, 5164}, /* MediumPurple2 */ - {137, 104, 205, 5178}, /* MediumPurple3 */ - {93, 71, 139, 5192}, /* MediumPurple4 */ - {60, 179, 113, 5206}, /* MediumSeaGreen */ - {123, 104, 238, 5221}, /* MediumSlateBlue */ - {0, 250, 154, 5237}, /* MediumSpringGreen */ - {72, 209, 204, 5255}, /* MediumTurquoise */ - {199, 21, 133, 5271}, /* MediumVioletRed */ - {25, 25, 112, 5287}, /* midnight blue */ - {25, 25, 112, 5301}, /* MidnightBlue */ - {245, 255, 250, 5314}, /* mint cream */ - {245, 255, 250, 5325}, /* MintCream */ - {255, 228, 225, 5335}, /* misty rose */ - {255, 228, 225, 5346}, /* MistyRose */ - {255, 228, 225, 5356}, /* MistyRose1 */ - {238, 213, 210, 5367}, /* MistyRose2 */ - {205, 183, 181, 5378}, /* MistyRose3 */ - {139, 125, 123, 5389}, /* MistyRose4 */ - {255, 228, 181, 5400}, /* moccasin */ - {255, 222, 173, 5409}, /* navajo white */ - {255, 222, 173, 5422}, /* NavajoWhite */ - {255, 222, 173, 5434}, /* NavajoWhite1 */ - {238, 207, 161, 5447}, /* NavajoWhite2 */ - {205, 179, 139, 5460}, /* NavajoWhite3 */ - {139, 121, 94, 5473}, /* NavajoWhite4 */ - {0, 0, 128, 5486}, /* navy */ - {0, 0, 128, 5491}, /* navy blue */ - {0, 0, 128, 5501}, /* NavyBlue */ - {253, 245, 230, 5510}, /* old lace */ - {253, 245, 230, 5519}, /* OldLace */ - {107, 142, 35, 5527}, /* olive drab */ - {107, 142, 35, 5538}, /* OliveDrab */ - {192, 255, 62, 5548}, /* OliveDrab1 */ - {179, 238, 58, 5559}, /* OliveDrab2 */ - {154, 205, 50, 5570}, /* OliveDrab3 */ - {105, 139, 34, 5581}, /* OliveDrab4 */ - {255, 165, 0, 5592}, /* orange */ - {255, 69, 0, 5599}, /* orange red */ - {255, 165, 0, 5610}, /* orange1 */ - {238, 154, 0, 5618}, /* orange2 */ - {205, 133, 0, 5626}, /* orange3 */ - {139, 90, 0, 5634}, /* orange4 */ - {255, 69, 0, 5642}, /* OrangeRed */ - {255, 69, 0, 5652}, /* OrangeRed1 */ - {238, 64, 0, 5663}, /* OrangeRed2 */ - {205, 55, 0, 5674}, /* OrangeRed3 */ - {139, 37, 0, 5685}, /* OrangeRed4 */ - {218, 112, 214, 5696}, /* orchid */ - {255, 131, 250, 5703}, /* orchid1 */ - {238, 122, 233, 5711}, /* orchid2 */ - {205, 105, 201, 5719}, /* orchid3 */ - {139, 71, 137, 5727}, /* orchid4 */ - {238, 232, 170, 5735}, /* pale goldenrod */ - {152, 251, 152, 5750}, /* pale green */ - {175, 238, 238, 5761}, /* pale turquoise */ - {219, 112, 147, 5776}, /* pale violet red */ - {238, 232, 170, 5792}, /* PaleGoldenrod */ - {152, 251, 152, 5806}, /* PaleGreen */ - {154, 255, 154, 5816}, /* PaleGreen1 */ - {144, 238, 144, 5827}, /* PaleGreen2 */ - {124, 205, 124, 5838}, /* PaleGreen3 */ - {84, 139, 84, 5849}, /* PaleGreen4 */ - {175, 238, 238, 5860}, /* PaleTurquoise */ - {187, 255, 255, 5874}, /* PaleTurquoise1 */ - {174, 238, 238, 5889}, /* PaleTurquoise2 */ - {150, 205, 205, 5904}, /* PaleTurquoise3 */ - {102, 139, 139, 5919}, /* PaleTurquoise4 */ - {219, 112, 147, 5934}, /* PaleVioletRed */ - {255, 130, 171, 5948}, /* PaleVioletRed1 */ - {238, 121, 159, 5963}, /* PaleVioletRed2 */ - {205, 104, 137, 5978}, /* PaleVioletRed3 */ - {139, 71, 93, 5993}, /* PaleVioletRed4 */ - {255, 239, 213, 6008}, /* papaya whip */ - {255, 239, 213, 6020}, /* PapayaWhip */ - {255, 218, 185, 6031}, /* peach puff */ - {255, 218, 185, 6042}, /* PeachPuff */ - {255, 218, 185, 6052}, /* PeachPuff1 */ - {238, 203, 173, 6063}, /* PeachPuff2 */ - {205, 175, 149, 6074}, /* PeachPuff3 */ - {139, 119, 101, 6085}, /* PeachPuff4 */ - {205, 133, 63, 6096}, /* peru */ - {255, 192, 203, 6101}, /* pink */ - {255, 181, 197, 6106}, /* pink1 */ - {238, 169, 184, 6112}, /* pink2 */ - {205, 145, 158, 6118}, /* pink3 */ - {139, 99, 108, 6124}, /* pink4 */ - {221, 160, 221, 6130}, /* plum */ - {255, 187, 255, 6135}, /* plum1 */ - {238, 174, 238, 6141}, /* plum2 */ - {205, 150, 205, 6147}, /* plum3 */ - {139, 102, 139, 6153}, /* plum4 */ - {176, 224, 230, 6159}, /* powder blue */ - {176, 224, 230, 6171}, /* PowderBlue */ - {160, 32, 240, 6182}, /* purple */ - {155, 48, 255, 6189}, /* purple1 */ - {145, 44, 238, 6197}, /* purple2 */ - {125, 38, 205, 6205}, /* purple3 */ - {85, 26, 139, 6213}, /* purple4 */ - {255, 0, 0, 6221}, /* red */ - {255, 0, 0, 6225}, /* red1 */ - {238, 0, 0, 6230}, /* red2 */ - {205, 0, 0, 6235}, /* red3 */ - {139, 0, 0, 6240}, /* red4 */ - {188, 143, 143, 6245}, /* rosy brown */ - {188, 143, 143, 6256}, /* RosyBrown */ - {255, 193, 193, 6266}, /* RosyBrown1 */ - {238, 180, 180, 6277}, /* RosyBrown2 */ - {205, 155, 155, 6288}, /* RosyBrown3 */ - {139, 105, 105, 6299}, /* RosyBrown4 */ - {65, 105, 225, 6310}, /* royal blue */ - {65, 105, 225, 6321}, /* RoyalBlue */ - {72, 118, 255, 6331}, /* RoyalBlue1 */ - {67, 110, 238, 6342}, /* RoyalBlue2 */ - {58, 95, 205, 6353}, /* RoyalBlue3 */ - {39, 64, 139, 6364}, /* RoyalBlue4 */ - {139, 69, 19, 6375}, /* saddle brown */ - {139, 69, 19, 6388}, /* SaddleBrown */ - {250, 128, 114, 6400}, /* salmon */ - {255, 140, 105, 6407}, /* salmon1 */ - {238, 130, 98, 6415}, /* salmon2 */ - {205, 112, 84, 6423}, /* salmon3 */ - {139, 76, 57, 6431}, /* salmon4 */ - {244, 164, 96, 6439}, /* sandy brown */ - {244, 164, 96, 6451}, /* SandyBrown */ - {46, 139, 87, 6462}, /* sea green */ - {46, 139, 87, 6472}, /* SeaGreen */ - {84, 255, 159, 6481}, /* SeaGreen1 */ - {78, 238, 148, 6491}, /* SeaGreen2 */ - {67, 205, 128, 6501}, /* SeaGreen3 */ - {46, 139, 87, 6511}, /* SeaGreen4 */ - {255, 245, 238, 6521}, /* seashell */ - {255, 245, 238, 6530}, /* seashell1 */ - {238, 229, 222, 6540}, /* seashell2 */ - {205, 197, 191, 6550}, /* seashell3 */ - {139, 134, 130, 6560}, /* seashell4 */ - {160, 82, 45, 6570}, /* sienna */ - {255, 130, 71, 6577}, /* sienna1 */ - {238, 121, 66, 6585}, /* sienna2 */ - {205, 104, 57, 6593}, /* sienna3 */ - {139, 71, 38, 6601}, /* sienna4 */ - {135, 206, 235, 6609}, /* sky blue */ - {135, 206, 235, 6618}, /* SkyBlue */ - {135, 206, 255, 6626}, /* SkyBlue1 */ - {126, 192, 238, 6635}, /* SkyBlue2 */ - {108, 166, 205, 6644}, /* SkyBlue3 */ - {74, 112, 139, 6653}, /* SkyBlue4 */ - {106, 90, 205, 6662}, /* slate blue */ - {112, 128, 144, 6673}, /* slate gray */ - {112, 128, 144, 6684}, /* slate grey */ - {106, 90, 205, 6695}, /* SlateBlue */ - {131, 111, 255, 6705}, /* SlateBlue1 */ - {122, 103, 238, 6716}, /* SlateBlue2 */ - {105, 89, 205, 6727}, /* SlateBlue3 */ - {71, 60, 139, 6738}, /* SlateBlue4 */ - {112, 128, 144, 6749}, /* SlateGray */ - {198, 226, 255, 6759}, /* SlateGray1 */ - {185, 211, 238, 6770}, /* SlateGray2 */ - {159, 182, 205, 6781}, /* SlateGray3 */ - {108, 123, 139, 6792}, /* SlateGray4 */ - {112, 128, 144, 6803}, /* SlateGrey */ - {255, 250, 250, 6813}, /* snow */ - {255, 250, 250, 6818}, /* snow1 */ - {238, 233, 233, 6824}, /* snow2 */ - {205, 201, 201, 6830}, /* snow3 */ - {139, 137, 137, 6836}, /* snow4 */ - {0, 255, 127, 6842}, /* spring green */ - {0, 255, 127, 6855}, /* SpringGreen */ - {0, 255, 127, 6867}, /* SpringGreen1 */ - {0, 238, 118, 6880}, /* SpringGreen2 */ - {0, 205, 102, 6893}, /* SpringGreen3 */ - {0, 139, 69, 6906}, /* SpringGreen4 */ - {70, 130, 180, 6919}, /* steel blue */ - {70, 130, 180, 6930}, /* SteelBlue */ - {99, 184, 255, 6940}, /* SteelBlue1 */ - {92, 172, 238, 6951}, /* SteelBlue2 */ - {79, 148, 205, 6962}, /* SteelBlue3 */ - {54, 100, 139, 6973}, /* SteelBlue4 */ - {210, 180, 140, 6984}, /* tan */ - {255, 165, 79, 6988}, /* tan1 */ - {238, 154, 73, 6993}, /* tan2 */ - {205, 133, 63, 6998}, /* tan3 */ - {139, 90, 43, 7003}, /* tan4 */ - {216, 191, 216, 7008}, /* thistle */ - {255, 225, 255, 7016}, /* thistle1 */ - {238, 210, 238, 7025}, /* thistle2 */ - {205, 181, 205, 7034}, /* thistle3 */ - {139, 123, 139, 7043}, /* thistle4 */ - {255, 99, 71, 7052}, /* tomato */ - {255, 99, 71, 7059}, /* tomato1 */ - {238, 92, 66, 7067}, /* tomato2 */ - {205, 79, 57, 7075}, /* tomato3 */ - {139, 54, 38, 7083}, /* tomato4 */ - {64, 224, 208, 7091}, /* turquoise */ - {0, 245, 255, 7101}, /* turquoise1 */ - {0, 229, 238, 7112}, /* turquoise2 */ - {0, 197, 205, 7123}, /* turquoise3 */ - {0, 134, 139, 7134}, /* turquoise4 */ - {238, 130, 238, 7145}, /* violet */ - {208, 32, 144, 7152}, /* violet red */ - {208, 32, 144, 7163}, /* VioletRed */ - {255, 62, 150, 7173}, /* VioletRed1 */ - {238, 58, 140, 7184}, /* VioletRed2 */ - {205, 50, 120, 7195}, /* VioletRed3 */ - {139, 34, 82, 7206}, /* VioletRed4 */ - {245, 222, 179, 7217}, /* wheat */ - {255, 231, 186, 7223}, /* wheat1 */ - {238, 216, 174, 7230}, /* wheat2 */ - {205, 186, 150, 7237}, /* wheat3 */ - {139, 126, 102, 7244}, /* wheat4 */ - {255, 255, 255, 7251}, /* white */ - {245, 245, 245, 7257}, /* white smoke */ - {245, 245, 245, 7269}, /* WhiteSmoke */ - {255, 255, 0, 7280}, /* yellow */ - {154, 205, 50, 7287}, /* yellow green */ - {255, 255, 0, 7300}, /* yellow1 */ - {238, 238, 0, 7308}, /* yellow2 */ - {205, 205, 0, 7316}, /* yellow3 */ - {139, 139, 0, 7324}, /* yellow4 */ - {154, 205, 50, 7332}, /* YellowGreen */ + {0, 255, 255, 104}, /* aqua */ + {127, 255, 212, 109}, /* aquamarine */ + {127, 255, 212, 120}, /* aquamarine1 */ + {118, 238, 198, 132}, /* aquamarine2 */ + {102, 205, 170, 144}, /* aquamarine3 */ + {69, 139, 116, 156}, /* aquamarine4 */ + {240, 255, 255, 168}, /* azure */ + {240, 255, 255, 174}, /* azure1 */ + {224, 238, 238, 181}, /* azure2 */ + {193, 205, 205, 188}, /* azure3 */ + {131, 139, 139, 195}, /* azure4 */ + {245, 245, 220, 202}, /* beige */ + {255, 228, 196, 208}, /* bisque */ + {255, 228, 196, 215}, /* bisque1 */ + {238, 213, 183, 223}, /* bisque2 */ + {205, 183, 158, 231}, /* bisque3 */ + {139, 125, 107, 239}, /* bisque4 */ + {0, 0, 0, 247}, /* black */ + {255, 235, 205, 253}, /* blanched almond */ + {255, 235, 205, 269}, /* BlanchedAlmond */ + {0, 0, 255, 284}, /* blue */ + {138, 43, 226, 289}, /* blue violet */ + {0, 0, 255, 301}, /* blue1 */ + {0, 0, 238, 307}, /* blue2 */ + {0, 0, 205, 313}, /* blue3 */ + {0, 0, 139, 319}, /* blue4 */ + {138, 43, 226, 325}, /* BlueViolet */ + {165, 42, 42, 336}, /* brown */ + {255, 64, 64, 342}, /* brown1 */ + {238, 59, 59, 349}, /* brown2 */ + {205, 51, 51, 356}, /* brown3 */ + {139, 35, 35, 363}, /* brown4 */ + {222, 184, 135, 370}, /* burlywood */ + {255, 211, 155, 380}, /* burlywood1 */ + {238, 197, 145, 391}, /* burlywood2 */ + {205, 170, 125, 402}, /* burlywood3 */ + {139, 115, 85, 413}, /* burlywood4 */ + {95, 158, 160, 424}, /* cadet blue */ + {95, 158, 160, 435}, /* CadetBlue */ + {152, 245, 255, 445}, /* CadetBlue1 */ + {142, 229, 238, 456}, /* CadetBlue2 */ + {122, 197, 205, 467}, /* CadetBlue3 */ + {83, 134, 139, 478}, /* CadetBlue4 */ + {127, 255, 0, 489}, /* chartreuse */ + {127, 255, 0, 500}, /* chartreuse1 */ + {118, 238, 0, 512}, /* chartreuse2 */ + {102, 205, 0, 524}, /* chartreuse3 */ + {69, 139, 0, 536}, /* chartreuse4 */ + {210, 105, 30, 548}, /* chocolate */ + {255, 127, 36, 558}, /* chocolate1 */ + {238, 118, 33, 569}, /* chocolate2 */ + {205, 102, 29, 580}, /* chocolate3 */ + {139, 69, 19, 591}, /* chocolate4 */ + {255, 127, 80, 602}, /* coral */ + {255, 114, 86, 608}, /* coral1 */ + {238, 106, 80, 615}, /* coral2 */ + {205, 91, 69, 622}, /* coral3 */ + {139, 62, 47, 629}, /* coral4 */ + {100, 149, 237, 636}, /* cornflower blue */ + {100, 149, 237, 652}, /* CornflowerBlue */ + {255, 248, 220, 667}, /* cornsilk */ + {255, 248, 220, 676}, /* cornsilk1 */ + {238, 232, 205, 686}, /* cornsilk2 */ + {205, 200, 177, 696}, /* cornsilk3 */ + {139, 136, 120, 706}, /* cornsilk4 */ + {220, 20, 60, 716}, /* crimson */ + {0, 255, 255, 724}, /* cyan */ + {0, 255, 255, 729}, /* cyan1 */ + {0, 238, 238, 735}, /* cyan2 */ + {0, 205, 205, 741}, /* cyan3 */ + {0, 139, 139, 747}, /* cyan4 */ + {0, 0, 139, 753}, /* dark blue */ + {0, 139, 139, 763}, /* dark cyan */ + {184, 134, 11, 773}, /* dark goldenrod */ + {169, 169, 169, 788}, /* dark gray */ + {0, 100, 0, 798}, /* dark green */ + {169, 169, 169, 809}, /* dark grey */ + {189, 183, 107, 819}, /* dark khaki */ + {139, 0, 139, 830}, /* dark magenta */ + {85, 107, 47, 843}, /* dark olive green */ + {255, 140, 0, 860}, /* dark orange */ + {153, 50, 204, 872}, /* dark orchid */ + {139, 0, 0, 884}, /* dark red */ + {233, 150, 122, 893}, /* dark salmon */ + {143, 188, 143, 905}, /* dark sea green */ + {72, 61, 139, 920}, /* dark slate blue */ + {47, 79, 79, 936}, /* dark slate gray */ + {47, 79, 79, 952}, /* dark slate grey */ + {0, 206, 209, 968}, /* dark turquoise */ + {148, 0, 211, 983}, /* dark violet */ + {0, 0, 139, 995}, /* DarkBlue */ + {0, 139, 139, 1004}, /* DarkCyan */ + {184, 134, 11, 1013}, /* DarkGoldenrod */ + {255, 185, 15, 1027}, /* DarkGoldenrod1 */ + {238, 173, 14, 1042}, /* DarkGoldenrod2 */ + {205, 149, 12, 1057}, /* DarkGoldenrod3 */ + {139, 101, 8, 1072}, /* DarkGoldenrod4 */ + {169, 169, 169, 1087}, /* DarkGray */ + {0, 100, 0, 1096}, /* DarkGreen */ + {169, 169, 169, 1106}, /* DarkGrey */ + {189, 183, 107, 1115}, /* DarkKhaki */ + {139, 0, 139, 1125}, /* DarkMagenta */ + {85, 107, 47, 1137}, /* DarkOliveGreen */ + {202, 255, 112, 1152}, /* DarkOliveGreen1 */ + {188, 238, 104, 1168}, /* DarkOliveGreen2 */ + {162, 205, 90, 1184}, /* DarkOliveGreen3 */ + {110, 139, 61, 1200}, /* DarkOliveGreen4 */ + {255, 140, 0, 1216}, /* DarkOrange */ + {255, 127, 0, 1227}, /* DarkOrange1 */ + {238, 118, 0, 1239}, /* DarkOrange2 */ + {205, 102, 0, 1251}, /* DarkOrange3 */ + {139, 69, 0, 1263}, /* DarkOrange4 */ + {153, 50, 204, 1275}, /* DarkOrchid */ + {191, 62, 255, 1286}, /* DarkOrchid1 */ + {178, 58, 238, 1298}, /* DarkOrchid2 */ + {154, 50, 205, 1310}, /* DarkOrchid3 */ + {104, 34, 139, 1322}, /* DarkOrchid4 */ + {139, 0, 0, 1334}, /* DarkRed */ + {233, 150, 122, 1342}, /* DarkSalmon */ + {143, 188, 143, 1353}, /* DarkSeaGreen */ + {193, 255, 193, 1366}, /* DarkSeaGreen1 */ + {180, 238, 180, 1380}, /* DarkSeaGreen2 */ + {155, 205, 155, 1394}, /* DarkSeaGreen3 */ + {105, 139, 105, 1408}, /* DarkSeaGreen4 */ + {72, 61, 139, 1422}, /* DarkSlateBlue */ + {47, 79, 79, 1436}, /* DarkSlateGray */ + {151, 255, 255, 1450}, /* DarkSlateGray1 */ + {141, 238, 238, 1465}, /* DarkSlateGray2 */ + {121, 205, 205, 1480}, /* DarkSlateGray3 */ + {82, 139, 139, 1495}, /* DarkSlateGray4 */ + {47, 79, 79, 1510}, /* DarkSlateGrey */ + {0, 206, 209, 1524}, /* DarkTurquoise */ + {148, 0, 211, 1538}, /* DarkViolet */ + {255, 20, 147, 1549}, /* deep pink */ + {0, 191, 255, 1559}, /* deep sky blue */ + {255, 20, 147, 1573}, /* DeepPink */ + {255, 20, 147, 1582}, /* DeepPink1 */ + {238, 18, 137, 1592}, /* DeepPink2 */ + {205, 16, 118, 1602}, /* DeepPink3 */ + {139, 10, 80, 1612}, /* DeepPink4 */ + {0, 191, 255, 1622}, /* DeepSkyBlue */ + {0, 191, 255, 1634}, /* DeepSkyBlue1 */ + {0, 178, 238, 1647}, /* DeepSkyBlue2 */ + {0, 154, 205, 1660}, /* DeepSkyBlue3 */ + {0, 104, 139, 1673}, /* DeepSkyBlue4 */ + {105, 105, 105, 1686}, /* dim gray */ + {105, 105, 105, 1695}, /* dim grey */ + {105, 105, 105, 1704}, /* DimGray */ + {105, 105, 105, 1712}, /* DimGrey */ + {30, 144, 255, 1720}, /* dodger blue */ + {30, 144, 255, 1732}, /* DodgerBlue */ + {30, 144, 255, 1743}, /* DodgerBlue1 */ + {28, 134, 238, 1755}, /* DodgerBlue2 */ + {24, 116, 205, 1767}, /* DodgerBlue3 */ + {16, 78, 139, 1779}, /* DodgerBlue4 */ + {178, 34, 34, 1791}, /* firebrick */ + {255, 48, 48, 1801}, /* firebrick1 */ + {238, 44, 44, 1812}, /* firebrick2 */ + {205, 38, 38, 1823}, /* firebrick3 */ + {139, 26, 26, 1834}, /* firebrick4 */ + {255, 250, 240, 1845}, /* floral white */ + {255, 250, 240, 1858}, /* FloralWhite */ + {34, 139, 34, 1870}, /* forest green */ + {34, 139, 34, 1883}, /* ForestGreen */ + {255, 0, 255, 1895}, /* fuchsia */ + {220, 220, 220, 1903}, /* gainsboro */ + {248, 248, 255, 1913}, /* ghost white */ + {248, 248, 255, 1925}, /* GhostWhite */ + {255, 215, 0, 1936}, /* gold */ + {255, 215, 0, 1941}, /* gold1 */ + {238, 201, 0, 1947}, /* gold2 */ + {205, 173, 0, 1953}, /* gold3 */ + {139, 117, 0, 1959}, /* gold4 */ + {218, 165, 32, 1965}, /* goldenrod */ + {255, 193, 37, 1975}, /* goldenrod1 */ + {238, 180, 34, 1986}, /* goldenrod2 */ + {205, 155, 29, 1997}, /* goldenrod3 */ + {139, 105, 20, 2008}, /* goldenrod4 */ + {190, 190, 190, 2019}, /* gray */ + {0, 0, 0, 2024}, /* gray0 */ + {3, 3, 3, 2030}, /* gray1 */ + {26, 26, 26, 2036}, /* gray10 */ + {255, 255, 255, 2043}, /* gray100 */ + {28, 28, 28, 2051}, /* gray11 */ + {31, 31, 31, 2058}, /* gray12 */ + {33, 33, 33, 2065}, /* gray13 */ + {36, 36, 36, 2072}, /* gray14 */ + {38, 38, 38, 2079}, /* gray15 */ + {41, 41, 41, 2086}, /* gray16 */ + {43, 43, 43, 2093}, /* gray17 */ + {46, 46, 46, 2100}, /* gray18 */ + {48, 48, 48, 2107}, /* gray19 */ + {5, 5, 5, 2114}, /* gray2 */ + {51, 51, 51, 2120}, /* gray20 */ + {54, 54, 54, 2127}, /* gray21 */ + {56, 56, 56, 2134}, /* gray22 */ + {59, 59, 59, 2141}, /* gray23 */ + {61, 61, 61, 2148}, /* gray24 */ + {64, 64, 64, 2155}, /* gray25 */ + {66, 66, 66, 2162}, /* gray26 */ + {69, 69, 69, 2169}, /* gray27 */ + {71, 71, 71, 2176}, /* gray28 */ + {74, 74, 74, 2183}, /* gray29 */ + {8, 8, 8, 2190}, /* gray3 */ + {77, 77, 77, 2196}, /* gray30 */ + {79, 79, 79, 2203}, /* gray31 */ + {82, 82, 82, 2210}, /* gray32 */ + {84, 84, 84, 2217}, /* gray33 */ + {87, 87, 87, 2224}, /* gray34 */ + {89, 89, 89, 2231}, /* gray35 */ + {92, 92, 92, 2238}, /* gray36 */ + {94, 94, 94, 2245}, /* gray37 */ + {97, 97, 97, 2252}, /* gray38 */ + {99, 99, 99, 2259}, /* gray39 */ + {10, 10, 10, 2266}, /* gray4 */ + {102, 102, 102, 2272}, /* gray40 */ + {105, 105, 105, 2279}, /* gray41 */ + {107, 107, 107, 2286}, /* gray42 */ + {110, 110, 110, 2293}, /* gray43 */ + {112, 112, 112, 2300}, /* gray44 */ + {115, 115, 115, 2307}, /* gray45 */ + {117, 117, 117, 2314}, /* gray46 */ + {120, 120, 120, 2321}, /* gray47 */ + {122, 122, 122, 2328}, /* gray48 */ + {125, 125, 125, 2335}, /* gray49 */ + {13, 13, 13, 2342}, /* gray5 */ + {127, 127, 127, 2348}, /* gray50 */ + {130, 130, 130, 2355}, /* gray51 */ + {133, 133, 133, 2362}, /* gray52 */ + {135, 135, 135, 2369}, /* gray53 */ + {138, 138, 138, 2376}, /* gray54 */ + {140, 140, 140, 2383}, /* gray55 */ + {143, 143, 143, 2390}, /* gray56 */ + {145, 145, 145, 2397}, /* gray57 */ + {148, 148, 148, 2404}, /* gray58 */ + {150, 150, 150, 2411}, /* gray59 */ + {15, 15, 15, 2418}, /* gray6 */ + {153, 153, 153, 2424}, /* gray60 */ + {156, 156, 156, 2431}, /* gray61 */ + {158, 158, 158, 2438}, /* gray62 */ + {161, 161, 161, 2445}, /* gray63 */ + {163, 163, 163, 2452}, /* gray64 */ + {166, 166, 166, 2459}, /* gray65 */ + {168, 168, 168, 2466}, /* gray66 */ + {171, 171, 171, 2473}, /* gray67 */ + {173, 173, 173, 2480}, /* gray68 */ + {176, 176, 176, 2487}, /* gray69 */ + {18, 18, 18, 2494}, /* gray7 */ + {179, 179, 179, 2500}, /* gray70 */ + {181, 181, 181, 2507}, /* gray71 */ + {184, 184, 184, 2514}, /* gray72 */ + {186, 186, 186, 2521}, /* gray73 */ + {189, 189, 189, 2528}, /* gray74 */ + {191, 191, 191, 2535}, /* gray75 */ + {194, 194, 194, 2542}, /* gray76 */ + {196, 196, 196, 2549}, /* gray77 */ + {199, 199, 199, 2556}, /* gray78 */ + {201, 201, 201, 2563}, /* gray79 */ + {20, 20, 20, 2570}, /* gray8 */ + {204, 204, 204, 2576}, /* gray80 */ + {207, 207, 207, 2583}, /* gray81 */ + {209, 209, 209, 2590}, /* gray82 */ + {212, 212, 212, 2597}, /* gray83 */ + {214, 214, 214, 2604}, /* gray84 */ + {217, 217, 217, 2611}, /* gray85 */ + {219, 219, 219, 2618}, /* gray86 */ + {222, 222, 222, 2625}, /* gray87 */ + {224, 224, 224, 2632}, /* gray88 */ + {227, 227, 227, 2639}, /* gray89 */ + {23, 23, 23, 2646}, /* gray9 */ + {229, 229, 229, 2652}, /* gray90 */ + {232, 232, 232, 2659}, /* gray91 */ + {235, 235, 235, 2666}, /* gray92 */ + {237, 237, 237, 2673}, /* gray93 */ + {240, 240, 240, 2680}, /* gray94 */ + {242, 242, 242, 2687}, /* gray95 */ + {245, 245, 245, 2694}, /* gray96 */ + {247, 247, 247, 2701}, /* gray97 */ + {250, 250, 250, 2708}, /* gray98 */ + {252, 252, 252, 2715}, /* gray99 */ + {0, 255, 0, 2722}, /* green */ + {173, 255, 47, 2728}, /* green yellow */ + {0, 255, 0, 2741}, /* green1 */ + {0, 238, 0, 2748}, /* green2 */ + {0, 205, 0, 2755}, /* green3 */ + {0, 139, 0, 2762}, /* green4 */ + {173, 255, 47, 2769}, /* GreenYellow */ + {190, 190, 190, 2781}, /* grey */ + {0, 0, 0, 2786}, /* grey0 */ + {3, 3, 3, 2792}, /* grey1 */ + {26, 26, 26, 2798}, /* grey10 */ + {255, 255, 255, 2805}, /* grey100 */ + {28, 28, 28, 2813}, /* grey11 */ + {31, 31, 31, 2820}, /* grey12 */ + {33, 33, 33, 2827}, /* grey13 */ + {36, 36, 36, 2834}, /* grey14 */ + {38, 38, 38, 2841}, /* grey15 */ + {41, 41, 41, 2848}, /* grey16 */ + {43, 43, 43, 2855}, /* grey17 */ + {46, 46, 46, 2862}, /* grey18 */ + {48, 48, 48, 2869}, /* grey19 */ + {5, 5, 5, 2876}, /* grey2 */ + {51, 51, 51, 2882}, /* grey20 */ + {54, 54, 54, 2889}, /* grey21 */ + {56, 56, 56, 2896}, /* grey22 */ + {59, 59, 59, 2903}, /* grey23 */ + {61, 61, 61, 2910}, /* grey24 */ + {64, 64, 64, 2917}, /* grey25 */ + {66, 66, 66, 2924}, /* grey26 */ + {69, 69, 69, 2931}, /* grey27 */ + {71, 71, 71, 2938}, /* grey28 */ + {74, 74, 74, 2945}, /* grey29 */ + {8, 8, 8, 2952}, /* grey3 */ + {77, 77, 77, 2958}, /* grey30 */ + {79, 79, 79, 2965}, /* grey31 */ + {82, 82, 82, 2972}, /* grey32 */ + {84, 84, 84, 2979}, /* grey33 */ + {87, 87, 87, 2986}, /* grey34 */ + {89, 89, 89, 2993}, /* grey35 */ + {92, 92, 92, 3000}, /* grey36 */ + {94, 94, 94, 3007}, /* grey37 */ + {97, 97, 97, 3014}, /* grey38 */ + {99, 99, 99, 3021}, /* grey39 */ + {10, 10, 10, 3028}, /* grey4 */ + {102, 102, 102, 3034}, /* grey40 */ + {105, 105, 105, 3041}, /* grey41 */ + {107, 107, 107, 3048}, /* grey42 */ + {110, 110, 110, 3055}, /* grey43 */ + {112, 112, 112, 3062}, /* grey44 */ + {115, 115, 115, 3069}, /* grey45 */ + {117, 117, 117, 3076}, /* grey46 */ + {120, 120, 120, 3083}, /* grey47 */ + {122, 122, 122, 3090}, /* grey48 */ + {125, 125, 125, 3097}, /* grey49 */ + {13, 13, 13, 3104}, /* grey5 */ + {127, 127, 127, 3110}, /* grey50 */ + {130, 130, 130, 3117}, /* grey51 */ + {133, 133, 133, 3124}, /* grey52 */ + {135, 135, 135, 3131}, /* grey53 */ + {138, 138, 138, 3138}, /* grey54 */ + {140, 140, 140, 3145}, /* grey55 */ + {143, 143, 143, 3152}, /* grey56 */ + {145, 145, 145, 3159}, /* grey57 */ + {148, 148, 148, 3166}, /* grey58 */ + {150, 150, 150, 3173}, /* grey59 */ + {15, 15, 15, 3180}, /* grey6 */ + {153, 153, 153, 3186}, /* grey60 */ + {156, 156, 156, 3193}, /* grey61 */ + {158, 158, 158, 3200}, /* grey62 */ + {161, 161, 161, 3207}, /* grey63 */ + {163, 163, 163, 3214}, /* grey64 */ + {166, 166, 166, 3221}, /* grey65 */ + {168, 168, 168, 3228}, /* grey66 */ + {171, 171, 171, 3235}, /* grey67 */ + {173, 173, 173, 3242}, /* grey68 */ + {176, 176, 176, 3249}, /* grey69 */ + {18, 18, 18, 3256}, /* grey7 */ + {179, 179, 179, 3262}, /* grey70 */ + {181, 181, 181, 3269}, /* grey71 */ + {184, 184, 184, 3276}, /* grey72 */ + {186, 186, 186, 3283}, /* grey73 */ + {189, 189, 189, 3290}, /* grey74 */ + {191, 191, 191, 3297}, /* grey75 */ + {194, 194, 194, 3304}, /* grey76 */ + {196, 196, 196, 3311}, /* grey77 */ + {199, 199, 199, 3318}, /* grey78 */ + {201, 201, 201, 3325}, /* grey79 */ + {20, 20, 20, 3332}, /* grey8 */ + {204, 204, 204, 3338}, /* grey80 */ + {207, 207, 207, 3345}, /* grey81 */ + {209, 209, 209, 3352}, /* grey82 */ + {212, 212, 212, 3359}, /* grey83 */ + {214, 214, 214, 3366}, /* grey84 */ + {217, 217, 217, 3373}, /* grey85 */ + {219, 219, 219, 3380}, /* grey86 */ + {222, 222, 222, 3387}, /* grey87 */ + {224, 224, 224, 3394}, /* grey88 */ + {227, 227, 227, 3401}, /* grey89 */ + {23, 23, 23, 3408}, /* grey9 */ + {229, 229, 229, 3414}, /* grey90 */ + {232, 232, 232, 3421}, /* grey91 */ + {235, 235, 235, 3428}, /* grey92 */ + {237, 237, 237, 3435}, /* grey93 */ + {240, 240, 240, 3442}, /* grey94 */ + {242, 242, 242, 3449}, /* grey95 */ + {245, 245, 245, 3456}, /* grey96 */ + {247, 247, 247, 3463}, /* grey97 */ + {250, 250, 250, 3470}, /* grey98 */ + {252, 252, 252, 3477}, /* grey99 */ + {240, 255, 240, 3484}, /* honeydew */ + {240, 255, 240, 3493}, /* honeydew1 */ + {224, 238, 224, 3503}, /* honeydew2 */ + {193, 205, 193, 3513}, /* honeydew3 */ + {131, 139, 131, 3523}, /* honeydew4 */ + {255, 105, 180, 3533}, /* hot pink */ + {255, 105, 180, 3542}, /* HotPink */ + {255, 110, 180, 3550}, /* HotPink1 */ + {238, 106, 167, 3559}, /* HotPink2 */ + {205, 96, 144, 3568}, /* HotPink3 */ + {139, 58, 98, 3577}, /* HotPink4 */ + {205, 92, 92, 3586}, /* indian red */ + {205, 92, 92, 3597}, /* IndianRed */ + {255, 106, 106, 3607}, /* IndianRed1 */ + {238, 99, 99, 3618}, /* IndianRed2 */ + {205, 85, 85, 3629}, /* IndianRed3 */ + {139, 58, 58, 3640}, /* IndianRed4 */ + {75, 0, 130, 3651}, /* indigo */ + {255, 255, 240, 3658}, /* ivory */ + {255, 255, 240, 3664}, /* ivory1 */ + {238, 238, 224, 3671}, /* ivory2 */ + {205, 205, 193, 3678}, /* ivory3 */ + {139, 139, 131, 3685}, /* ivory4 */ + {240, 230, 140, 3692}, /* khaki */ + {255, 246, 143, 3698}, /* khaki1 */ + {238, 230, 133, 3705}, /* khaki2 */ + {205, 198, 115, 3712}, /* khaki3 */ + {139, 134, 78, 3719}, /* khaki4 */ + {230, 230, 250, 3726}, /* lavender */ + {255, 240, 245, 3735}, /* lavender blush */ + {255, 240, 245, 3750}, /* LavenderBlush */ + {255, 240, 245, 3764}, /* LavenderBlush1 */ + {238, 224, 229, 3779}, /* LavenderBlush2 */ + {205, 193, 197, 3794}, /* LavenderBlush3 */ + {139, 131, 134, 3809}, /* LavenderBlush4 */ + {124, 252, 0, 3824}, /* lawn green */ + {124, 252, 0, 3835}, /* LawnGreen */ + {255, 250, 205, 3845}, /* lemon chiffon */ + {255, 250, 205, 3859}, /* LemonChiffon */ + {255, 250, 205, 3872}, /* LemonChiffon1 */ + {238, 233, 191, 3886}, /* LemonChiffon2 */ + {205, 201, 165, 3900}, /* LemonChiffon3 */ + {139, 137, 112, 3914}, /* LemonChiffon4 */ + {173, 216, 230, 3928}, /* light blue */ + {240, 128, 128, 3939}, /* light coral */ + {224, 255, 255, 3951}, /* light cyan */ + {238, 221, 130, 3962}, /* light goldenrod */ + {250, 250, 210, 3978}, /* light goldenrod yellow */ + {211, 211, 211, 4001}, /* light gray */ + {144, 238, 144, 4012}, /* light green */ + {211, 211, 211, 4024}, /* light grey */ + {255, 182, 193, 4035}, /* light pink */ + {255, 160, 122, 4046}, /* light salmon */ + {32, 178, 170, 4059}, /* light sea green */ + {135, 206, 250, 4075}, /* light sky blue */ + {132, 112, 255, 4090}, /* light slate blue */ + {119, 136, 153, 4107}, /* light slate gray */ + {119, 136, 153, 4124}, /* light slate grey */ + {176, 196, 222, 4141}, /* light steel blue */ + {255, 255, 224, 4158}, /* light yellow */ + {173, 216, 230, 4171}, /* LightBlue */ + {191, 239, 255, 4181}, /* LightBlue1 */ + {178, 223, 238, 4192}, /* LightBlue2 */ + {154, 192, 205, 4203}, /* LightBlue3 */ + {104, 131, 139, 4214}, /* LightBlue4 */ + {240, 128, 128, 4225}, /* LightCoral */ + {224, 255, 255, 4236}, /* LightCyan */ + {224, 255, 255, 4246}, /* LightCyan1 */ + {209, 238, 238, 4257}, /* LightCyan2 */ + {180, 205, 205, 4268}, /* LightCyan3 */ + {122, 139, 139, 4279}, /* LightCyan4 */ + {238, 221, 130, 4290}, /* LightGoldenrod */ + {255, 236, 139, 4305}, /* LightGoldenrod1 */ + {238, 220, 130, 4321}, /* LightGoldenrod2 */ + {205, 190, 112, 4337}, /* LightGoldenrod3 */ + {139, 129, 76, 4353}, /* LightGoldenrod4 */ + {250, 250, 210, 4369}, /* LightGoldenrodYellow */ + {211, 211, 211, 4390}, /* LightGray */ + {144, 238, 144, 4400}, /* LightGreen */ + {211, 211, 211, 4411}, /* LightGrey */ + {255, 182, 193, 4421}, /* LightPink */ + {255, 174, 185, 4431}, /* LightPink1 */ + {238, 162, 173, 4442}, /* LightPink2 */ + {205, 140, 149, 4453}, /* LightPink3 */ + {139, 95, 101, 4464}, /* LightPink4 */ + {255, 160, 122, 4475}, /* LightSalmon */ + {255, 160, 122, 4487}, /* LightSalmon1 */ + {238, 149, 114, 4500}, /* LightSalmon2 */ + {205, 129, 98, 4513}, /* LightSalmon3 */ + {139, 87, 66, 4526}, /* LightSalmon4 */ + {32, 178, 170, 4539}, /* LightSeaGreen */ + {135, 206, 250, 4553}, /* LightSkyBlue */ + {176, 226, 255, 4566}, /* LightSkyBlue1 */ + {164, 211, 238, 4580}, /* LightSkyBlue2 */ + {141, 182, 205, 4594}, /* LightSkyBlue3 */ + {96, 123, 139, 4608}, /* LightSkyBlue4 */ + {132, 112, 255, 4622}, /* LightSlateBlue */ + {119, 136, 153, 4637}, /* LightSlateGray */ + {119, 136, 153, 4652}, /* LightSlateGrey */ + {176, 196, 222, 4667}, /* LightSteelBlue */ + {202, 225, 255, 4682}, /* LightSteelBlue1 */ + {188, 210, 238, 4698}, /* LightSteelBlue2 */ + {162, 181, 205, 4714}, /* LightSteelBlue3 */ + {110, 123, 139, 4730}, /* LightSteelBlue4 */ + {255, 255, 224, 4746}, /* LightYellow */ + {255, 255, 224, 4758}, /* LightYellow1 */ + {238, 238, 209, 4771}, /* LightYellow2 */ + {205, 205, 180, 4784}, /* LightYellow3 */ + {139, 139, 122, 4797}, /* LightYellow4 */ + {0, 255, 0, 4810}, /* lime */ + {50, 205, 50, 4815}, /* lime green */ + {50, 205, 50, 4826}, /* LimeGreen */ + {250, 240, 230, 4836}, /* linen */ + {255, 0, 255, 4842}, /* magenta */ + {255, 0, 255, 4850}, /* magenta1 */ + {238, 0, 238, 4859}, /* magenta2 */ + {205, 0, 205, 4868}, /* magenta3 */ + {139, 0, 139, 4877}, /* magenta4 */ + {176, 48, 96, 4886}, /* maroon */ + {255, 52, 179, 4893}, /* maroon1 */ + {238, 48, 167, 4901}, /* maroon2 */ + {205, 41, 144, 4909}, /* maroon3 */ + {139, 28, 98, 4917}, /* maroon4 */ + {102, 205, 170, 4925}, /* medium aquamarine */ + {0, 0, 205, 4943}, /* medium blue */ + {186, 85, 211, 4955}, /* medium orchid */ + {147, 112, 219, 4969}, /* medium purple */ + {60, 179, 113, 4983}, /* medium sea green */ + {123, 104, 238, 5000}, /* medium slate blue */ + {0, 250, 154, 5018}, /* medium spring green */ + {72, 209, 204, 5038}, /* medium turquoise */ + {199, 21, 133, 5055}, /* medium violet red */ + {102, 205, 170, 5073}, /* MediumAquamarine */ + {0, 0, 205, 5090}, /* MediumBlue */ + {186, 85, 211, 5101}, /* MediumOrchid */ + {224, 102, 255, 5114}, /* MediumOrchid1 */ + {209, 95, 238, 5128}, /* MediumOrchid2 */ + {180, 82, 205, 5142}, /* MediumOrchid3 */ + {122, 55, 139, 5156}, /* MediumOrchid4 */ + {147, 112, 219, 5170}, /* MediumPurple */ + {171, 130, 255, 5183}, /* MediumPurple1 */ + {159, 121, 238, 5197}, /* MediumPurple2 */ + {137, 104, 205, 5211}, /* MediumPurple3 */ + {93, 71, 139, 5225}, /* MediumPurple4 */ + {60, 179, 113, 5239}, /* MediumSeaGreen */ + {123, 104, 238, 5254}, /* MediumSlateBlue */ + {0, 250, 154, 5270}, /* MediumSpringGreen */ + {72, 209, 204, 5288}, /* MediumTurquoise */ + {199, 21, 133, 5304}, /* MediumVioletRed */ + {25, 25, 112, 5320}, /* midnight blue */ + {25, 25, 112, 5334}, /* MidnightBlue */ + {245, 255, 250, 5347}, /* mint cream */ + {245, 255, 250, 5358}, /* MintCream */ + {255, 228, 225, 5368}, /* misty rose */ + {255, 228, 225, 5379}, /* MistyRose */ + {255, 228, 225, 5389}, /* MistyRose1 */ + {238, 213, 210, 5400}, /* MistyRose2 */ + {205, 183, 181, 5411}, /* MistyRose3 */ + {139, 125, 123, 5422}, /* MistyRose4 */ + {255, 228, 181, 5433}, /* moccasin */ + {255, 222, 173, 5442}, /* navajo white */ + {255, 222, 173, 5455}, /* NavajoWhite */ + {255, 222, 173, 5467}, /* NavajoWhite1 */ + {238, 207, 161, 5480}, /* NavajoWhite2 */ + {205, 179, 139, 5493}, /* NavajoWhite3 */ + {139, 121, 94, 5506}, /* NavajoWhite4 */ + {0, 0, 128, 5519}, /* navy */ + {0, 0, 128, 5524}, /* navy blue */ + {0, 0, 128, 5534}, /* NavyBlue */ + {253, 245, 230, 5543}, /* old lace */ + {253, 245, 230, 5552}, /* OldLace */ + {128, 128, 0, 5560}, /* olive */ + {107, 142, 35, 5566}, /* olive drab */ + {107, 142, 35, 5577}, /* OliveDrab */ + {192, 255, 62, 5587}, /* OliveDrab1 */ + {179, 238, 58, 5598}, /* OliveDrab2 */ + {154, 205, 50, 5609}, /* OliveDrab3 */ + {105, 139, 34, 5620}, /* OliveDrab4 */ + {255, 165, 0, 5631}, /* orange */ + {255, 69, 0, 5638}, /* orange red */ + {255, 165, 0, 5649}, /* orange1 */ + {238, 154, 0, 5657}, /* orange2 */ + {205, 133, 0, 5665}, /* orange3 */ + {139, 90, 0, 5673}, /* orange4 */ + {255, 69, 0, 5681}, /* OrangeRed */ + {255, 69, 0, 5691}, /* OrangeRed1 */ + {238, 64, 0, 5702}, /* OrangeRed2 */ + {205, 55, 0, 5713}, /* OrangeRed3 */ + {139, 37, 0, 5724}, /* OrangeRed4 */ + {218, 112, 214, 5735}, /* orchid */ + {255, 131, 250, 5742}, /* orchid1 */ + {238, 122, 233, 5750}, /* orchid2 */ + {205, 105, 201, 5758}, /* orchid3 */ + {139, 71, 137, 5766}, /* orchid4 */ + {238, 232, 170, 5774}, /* pale goldenrod */ + {152, 251, 152, 5789}, /* pale green */ + {175, 238, 238, 5800}, /* pale turquoise */ + {219, 112, 147, 5815}, /* pale violet red */ + {238, 232, 170, 5831}, /* PaleGoldenrod */ + {152, 251, 152, 5845}, /* PaleGreen */ + {154, 255, 154, 5855}, /* PaleGreen1 */ + {144, 238, 144, 5866}, /* PaleGreen2 */ + {124, 205, 124, 5877}, /* PaleGreen3 */ + {84, 139, 84, 5888}, /* PaleGreen4 */ + {175, 238, 238, 5899}, /* PaleTurquoise */ + {187, 255, 255, 5913}, /* PaleTurquoise1 */ + {174, 238, 238, 5928}, /* PaleTurquoise2 */ + {150, 205, 205, 5943}, /* PaleTurquoise3 */ + {102, 139, 139, 5958}, /* PaleTurquoise4 */ + {219, 112, 147, 5973}, /* PaleVioletRed */ + {255, 130, 171, 5987}, /* PaleVioletRed1 */ + {238, 121, 159, 6002}, /* PaleVioletRed2 */ + {205, 104, 137, 6017}, /* PaleVioletRed3 */ + {139, 71, 93, 6032}, /* PaleVioletRed4 */ + {255, 239, 213, 6047}, /* papaya whip */ + {255, 239, 213, 6059}, /* PapayaWhip */ + {255, 218, 185, 6070}, /* peach puff */ + {255, 218, 185, 6081}, /* PeachPuff */ + {255, 218, 185, 6091}, /* PeachPuff1 */ + {238, 203, 173, 6102}, /* PeachPuff2 */ + {205, 175, 149, 6113}, /* PeachPuff3 */ + {139, 119, 101, 6124}, /* PeachPuff4 */ + {205, 133, 63, 6135}, /* peru */ + {255, 192, 203, 6140}, /* pink */ + {255, 181, 197, 6145}, /* pink1 */ + {238, 169, 184, 6151}, /* pink2 */ + {205, 145, 158, 6157}, /* pink3 */ + {139, 99, 108, 6163}, /* pink4 */ + {221, 160, 221, 6169}, /* plum */ + {255, 187, 255, 6174}, /* plum1 */ + {238, 174, 238, 6180}, /* plum2 */ + {205, 150, 205, 6186}, /* plum3 */ + {139, 102, 139, 6192}, /* plum4 */ + {176, 224, 230, 6198}, /* powder blue */ + {176, 224, 230, 6210}, /* PowderBlue */ + {160, 32, 240, 6221}, /* purple */ + {155, 48, 255, 6228}, /* purple1 */ + {145, 44, 238, 6236}, /* purple2 */ + {125, 38, 205, 6244}, /* purple3 */ + {85, 26, 139, 6252}, /* purple4 */ + {102, 51, 153, 6260}, /* rebecca purple */ + {102, 51, 153, 6275}, /* RebeccaPurple */ + {255, 0, 0, 6289}, /* red */ + {255, 0, 0, 6293}, /* red1 */ + {238, 0, 0, 6298}, /* red2 */ + {205, 0, 0, 6303}, /* red3 */ + {139, 0, 0, 6308}, /* red4 */ + {188, 143, 143, 6313}, /* rosy brown */ + {188, 143, 143, 6324}, /* RosyBrown */ + {255, 193, 193, 6334}, /* RosyBrown1 */ + {238, 180, 180, 6345}, /* RosyBrown2 */ + {205, 155, 155, 6356}, /* RosyBrown3 */ + {139, 105, 105, 6367}, /* RosyBrown4 */ + {65, 105, 225, 6378}, /* royal blue */ + {65, 105, 225, 6389}, /* RoyalBlue */ + {72, 118, 255, 6399}, /* RoyalBlue1 */ + {67, 110, 238, 6410}, /* RoyalBlue2 */ + {58, 95, 205, 6421}, /* RoyalBlue3 */ + {39, 64, 139, 6432}, /* RoyalBlue4 */ + {139, 69, 19, 6443}, /* saddle brown */ + {139, 69, 19, 6456}, /* SaddleBrown */ + {250, 128, 114, 6468}, /* salmon */ + {255, 140, 105, 6475}, /* salmon1 */ + {238, 130, 98, 6483}, /* salmon2 */ + {205, 112, 84, 6491}, /* salmon3 */ + {139, 76, 57, 6499}, /* salmon4 */ + {244, 164, 96, 6507}, /* sandy brown */ + {244, 164, 96, 6519}, /* SandyBrown */ + {46, 139, 87, 6530}, /* sea green */ + {46, 139, 87, 6540}, /* SeaGreen */ + {84, 255, 159, 6549}, /* SeaGreen1 */ + {78, 238, 148, 6559}, /* SeaGreen2 */ + {67, 205, 128, 6569}, /* SeaGreen3 */ + {46, 139, 87, 6579}, /* SeaGreen4 */ + {255, 245, 238, 6589}, /* seashell */ + {255, 245, 238, 6598}, /* seashell1 */ + {238, 229, 222, 6608}, /* seashell2 */ + {205, 197, 191, 6618}, /* seashell3 */ + {139, 134, 130, 6628}, /* seashell4 */ + {160, 82, 45, 6638}, /* sienna */ + {255, 130, 71, 6645}, /* sienna1 */ + {238, 121, 66, 6653}, /* sienna2 */ + {205, 104, 57, 6661}, /* sienna3 */ + {139, 71, 38, 6669}, /* sienna4 */ + {192, 192, 192, 6677}, /* silver */ + {135, 206, 235, 6684}, /* sky blue */ + {135, 206, 235, 6693}, /* SkyBlue */ + {135, 206, 255, 6701}, /* SkyBlue1 */ + {126, 192, 238, 6710}, /* SkyBlue2 */ + {108, 166, 205, 6719}, /* SkyBlue3 */ + {74, 112, 139, 6728}, /* SkyBlue4 */ + {106, 90, 205, 6737}, /* slate blue */ + {112, 128, 144, 6748}, /* slate gray */ + {112, 128, 144, 6759}, /* slate grey */ + {106, 90, 205, 6770}, /* SlateBlue */ + {131, 111, 255, 6780}, /* SlateBlue1 */ + {122, 103, 238, 6791}, /* SlateBlue2 */ + {105, 89, 205, 6802}, /* SlateBlue3 */ + {71, 60, 139, 6813}, /* SlateBlue4 */ + {112, 128, 144, 6824}, /* SlateGray */ + {198, 226, 255, 6834}, /* SlateGray1 */ + {185, 211, 238, 6845}, /* SlateGray2 */ + {159, 182, 205, 6856}, /* SlateGray3 */ + {108, 123, 139, 6867}, /* SlateGray4 */ + {112, 128, 144, 6878}, /* SlateGrey */ + {255, 250, 250, 6888}, /* snow */ + {255, 250, 250, 6893}, /* snow1 */ + {238, 233, 233, 6899}, /* snow2 */ + {205, 201, 201, 6905}, /* snow3 */ + {139, 137, 137, 6911}, /* snow4 */ + {0, 255, 127, 6917}, /* spring green */ + {0, 255, 127, 6930}, /* SpringGreen */ + {0, 255, 127, 6942}, /* SpringGreen1 */ + {0, 238, 118, 6955}, /* SpringGreen2 */ + {0, 205, 102, 6968}, /* SpringGreen3 */ + {0, 139, 69, 6981}, /* SpringGreen4 */ + {70, 130, 180, 6994}, /* steel blue */ + {70, 130, 180, 7005}, /* SteelBlue */ + {99, 184, 255, 7015}, /* SteelBlue1 */ + {92, 172, 238, 7026}, /* SteelBlue2 */ + {79, 148, 205, 7037}, /* SteelBlue3 */ + {54, 100, 139, 7048}, /* SteelBlue4 */ + {210, 180, 140, 7059}, /* tan */ + {255, 165, 79, 7063}, /* tan1 */ + {238, 154, 73, 7068}, /* tan2 */ + {205, 133, 63, 7073}, /* tan3 */ + {139, 90, 43, 7078}, /* tan4 */ + {0, 128, 128, 7083}, /* teal */ + {216, 191, 216, 7088}, /* thistle */ + {255, 225, 255, 7096}, /* thistle1 */ + {238, 210, 238, 7105}, /* thistle2 */ + {205, 181, 205, 7114}, /* thistle3 */ + {139, 123, 139, 7123}, /* thistle4 */ + {255, 99, 71, 7132}, /* tomato */ + {255, 99, 71, 7139}, /* tomato1 */ + {238, 92, 66, 7147}, /* tomato2 */ + {205, 79, 57, 7155}, /* tomato3 */ + {139, 54, 38, 7163}, /* tomato4 */ + {64, 224, 208, 7171}, /* turquoise */ + {0, 245, 255, 7181}, /* turquoise1 */ + {0, 229, 238, 7192}, /* turquoise2 */ + {0, 197, 205, 7203}, /* turquoise3 */ + {0, 134, 139, 7214}, /* turquoise4 */ + {238, 130, 238, 7225}, /* violet */ + {208, 32, 144, 7232}, /* violet red */ + {208, 32, 144, 7243}, /* VioletRed */ + {255, 62, 150, 7253}, /* VioletRed1 */ + {238, 58, 140, 7264}, /* VioletRed2 */ + {205, 50, 120, 7275}, /* VioletRed3 */ + {139, 34, 82, 7286}, /* VioletRed4 */ + {128, 128, 128, 7297}, /* web gray */ + {0, 128, 0, 7306}, /* web green */ + {128, 128, 128, 7316}, /* web grey */ + {128, 0, 0, 7325}, /* web maroon */ + {128, 0, 128, 7336}, /* web purple */ + {128, 128, 128, 7347}, /* WebGray */ + {0, 128, 0, 7355}, /* WebGreen */ + {128, 128, 128, 7364}, /* WebGrey */ + {128, 0, 0, 7372}, /* WebMaroon */ + {128, 0, 128, 7382}, /* WebPurple */ + {245, 222, 179, 7392}, /* wheat */ + {255, 231, 186, 7398}, /* wheat1 */ + {238, 216, 174, 7405}, /* wheat2 */ + {205, 186, 150, 7412}, /* wheat3 */ + {139, 126, 102, 7419}, /* wheat4 */ + {255, 255, 255, 7426}, /* white */ + {245, 245, 245, 7432}, /* white smoke */ + {245, 245, 245, 7444}, /* WhiteSmoke */ + {190, 190, 190, 7455}, /* x11 gray */ + {0, 255, 0, 7464}, /* x11 green */ + {190, 190, 190, 7474}, /* x11 grey */ + {176, 48, 96, 7483}, /* x11 maroon */ + {160, 32, 240, 7494}, /* x11 purple */ + {190, 190, 190, 7505}, /* X11Gray */ + {0, 255, 0, 7513}, /* X11Green */ + {190, 190, 190, 7522}, /* X11Grey */ + {176, 48, 96, 7530}, /* X11Maroon */ + {160, 32, 240, 7540}, /* X11Purple */ + {255, 255, 0, 7550}, /* yellow */ + {154, 205, 50, 7557}, /* yellow green */ + {255, 255, 0, 7570}, /* yellow1 */ + {238, 238, 0, 7578}, /* yellow2 */ + {205, 205, 0, 7586}, /* yellow3 */ + {139, 139, 0, 7594}, /* yellow4 */ + {154, 205, 50, 7602}, /* YellowGreen */ }; #define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) diff --git a/xserver/os/osdep.h b/xserver/os/osdep.h index 5e979dfc3..851136f01 100644 --- a/xserver/os/osdep.h +++ b/xserver/os/osdep.h @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/xserver/os/osinit.c b/xserver/os/osinit.c index dccf45a7e..9e7797bd3 100644 --- a/xserver/os/osinit.c +++ b/xserver/os/osinit.c @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -208,9 +208,11 @@ OsInit(void) * for failures to load libraries/modules at runtime so we can clean up * after ourselves. */ - int failure_signal = SIGQUIT; + { + int failure_signal = SIGQUIT; - dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); + dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); + } #endif #if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */ @@ -225,9 +227,9 @@ OsInit(void) fclose(stdin); fclose(stdout); # endif - /* - * If a write of zero bytes to stderr returns non-zero, i.e. -1, - * then writing to stderr failed, and we'll write somewhere else + /* + * If a write of zero bytes to stderr returns non-zero, i.e. -1, + * then writing to stderr failed, and we'll write somewhere else * instead. (Apparently this never happens in the Real World.) */ if (write(2, fname, 0) == -1) { diff --git a/xserver/os/utils.c b/xserver/os/utils.c index c1b13d10c..df3924a0b 100644 --- a/xserver/os/utils.c +++ b/xserver/os/utils.c @@ -194,7 +194,7 @@ Bool noGEExtension = FALSE; Bool CoreDump; -Bool enableIndirectGLX = TRUE; +Bool enableIndirectGLX = FALSE; #ifdef PANORAMIX Bool PanoramiXExtensionDisabledHack = FALSE; @@ -553,8 +553,8 @@ UseMsg(void) ErrorF("-fn string default font name\n"); ErrorF("-fp string default font path\n"); ErrorF("-help prints message with these options\n"); - ErrorF("+iglx Allow creating indirect GLX contexts (default)\n"); - ErrorF("-iglx Prohibit creating indirect GLX contexts\n"); + ErrorF("+iglx Allow creating indirect GLX contexts\n"); + ErrorF("-iglx Prohibit creating indirect GLX contexts (default)\n"); ErrorF("-I ignore all remaining arguments\n"); #ifdef RLIMIT_DATA ErrorF("-ld int limit data space to N Kb\n"); @@ -1139,24 +1139,6 @@ set_font_authorizations(char **authorizations, int *authlen, void *client) #endif /* TCPCONN */ } -void * -Xalloc(unsigned long amount) -{ - /* - * Xalloc used to return NULL when large amount of memory is requested. In - * order to catch the buggy callers this warning has been added, slated to - * removal by anyone who touches this code (or just looks at it) in 2011. - * - * -- Mikhail Gusarov - */ - if ((long) amount <= 0) - ErrorF("Warning: Xalloc: " - "requesting unpleasantly large amount of memory: %lu bytes.\n", - amount); - - return malloc(amount); -} - void * XNFalloc(unsigned long amount) { @@ -1167,12 +1149,6 @@ XNFalloc(unsigned long amount) return ptr; } -void * -Xcalloc(unsigned long amount) -{ - return calloc(1, amount); -} - void * XNFcalloc(unsigned long amount) { @@ -1183,24 +1159,6 @@ XNFcalloc(unsigned long amount) return ret; } -void * -Xrealloc(void *ptr, unsigned long amount) -{ - /* - * Xrealloc used to return NULL when large amount of memory is requested. In - * order to catch the buggy callers this warning has been added, slated to - * removal by anyone who touches this code (or just looks at it) in 2011. - * - * -- Mikhail Gusarov - */ - if ((long) amount <= 0) - ErrorF("Warning: Xrealloc: " - "requesting unpleasantly large amount of memory: %lu bytes.\n", - amount); - - return realloc(ptr, amount); -} - void * XNFrealloc(void *ptr, unsigned long amount) { @@ -1211,12 +1169,6 @@ XNFrealloc(void *ptr, unsigned long amount) return ret; } -void -Xfree(void *ptr) -{ - free(ptr); -} - char * Xstrdup(const char *s) { @@ -1442,6 +1394,7 @@ System(const char *command) switch (pid = fork()) { case -1: /* error */ p = -1; + break; case 0: /* child */ if (setgid(getgid()) == -1) _exit(127); @@ -2159,6 +2112,7 @@ FormatUInt64Hex(uint64_t num, char *string) string[len] = '\0'; } +#if !defined(WIN32) || defined(__CYGWIN__) /* Move a file descriptor out of the way of our select mask; this * is useful for file descriptors which will never appear in the * select mask to avoid reducing the number of clients that can @@ -2182,3 +2136,4 @@ os_move_fd(int fd) close(fd); return newfd; } +#endif diff --git a/xserver/os/xdmcp.c b/xserver/os/xdmcp.c index 99616d94b..b265db338 100644 --- a/xserver/os/xdmcp.c +++ b/xserver/os/xdmcp.c @@ -19,6 +19,10 @@ #ifdef WIN32 #include +#define XSERV_t +#define TRANS_SERVER +#define TRANS_REOPEN +#include #endif #include @@ -48,6 +52,11 @@ #include #endif +#define XSERV_t +#define TRANS_SERVER +#define TRANS_REOPEN +#include + #ifdef XDMCP #undef REQUEST @@ -242,6 +251,14 @@ XdmcpUseMsg(void) ErrorF("-displayID display-id manufacturer display ID for request\n"); } +static void +XdmcpDefaultListen(void) +{ + /* Even when configured --disable-listen-tcp, we should listen on tcp in + XDMCP modes */ + _XSERVTransListen("tcp"); +} + int XdmcpOptions(int argc, char **argv, int i) { @@ -249,11 +266,13 @@ XdmcpOptions(int argc, char **argv, int i) get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_QUERY; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } if (strcmp(argv[i], "-broadcast") == 0) { XDM_INIT_STATE = XDM_BROADCAST; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } #if defined(IPv6) && defined(AF_INET6) @@ -261,6 +280,7 @@ XdmcpOptions(int argc, char **argv, int i) i = get_mcast_options(argc, argv, ++i); XDM_INIT_STATE = XDM_MULTICAST; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } #endif @@ -268,6 +288,7 @@ XdmcpOptions(int argc, char **argv, int i) get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_INDIRECT; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } if (strcmp(argv[i], "-port") == 0) { @@ -562,7 +583,7 @@ XdmcpRegisterDisplayClass(const char *name, int length) DisplayClass.data[i] = (CARD8) name[i]; } -/* +/* * initialize XDMCP; create the socket, compute the display * number, set up the state machine */ diff --git a/xserver/os/xsha1.c b/xserver/os/xsha1.c index 24c0aa284..c54e68c83 100644 --- a/xserver/os/xsha1.c +++ b/xserver/os/xsha1.c @@ -1,3 +1,28 @@ +/* Copyright © 2007 Carl Worth + * Copyright © 2009 Jeremy Huddleston, Julien Cristau, and Matthieu Herrb + * Copyright © 2009-2010 Mikhail Gusarov + * Copyright © 2012 Yaakov Selkowitz and Keith Packard + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/xserver/present/Makefile.in b/xserver/present/Makefile.in index 9e3a880b2..6422e7552 100644 --- a/xserver/present/Makefile.in +++ b/xserver/present/Makefile.in @@ -264,6 +264,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/present/present.c b/xserver/present/present.c index 8e4829e76..a6346015e 100644 --- a/xserver/present/present.c +++ b/xserver/present/present.c @@ -91,7 +91,7 @@ present_flip_pending_pixmap(ScreenPtr screen) if (!screen_priv->flip_pending) return NULL; - + return screen_priv->flip_pending->pixmap; } @@ -291,14 +291,18 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc if (crtc != window_priv->crtc) { uint64_t old_ust, old_msc; - /* The old CRTC may have been turned off, in which case - * we'll just use whatever previous MSC we'd seen from this CRTC - */ + if (window_priv->crtc == PresentCrtcNeverSet) { + window_priv->msc_offset = 0; + } else { + /* The old CRTC may have been turned off, in which case + * we'll just use whatever previous MSC we'd seen from this CRTC + */ - if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success) - old_msc = window_priv->msc; + if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success) + old_msc = window_priv->msc; - window_priv->msc_offset += new_msc - old_msc; + window_priv->msc_offset += new_msc - old_msc; + } window_priv->crtc = crtc; } @@ -368,7 +372,7 @@ present_set_tree_pixmap_visit(WindowPtr window, void *data) (*screen->SetWindowPixmap)(window, visit->new); return WT_WALKCHILDREN; } - + static void present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap) { @@ -395,7 +399,8 @@ present_set_abort_flip(ScreenPtr screen) present_set_tree_pixmap(screen_priv->flip_window, (*screen->GetScreenPixmap)(screen)); - present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); + if (screen->root) + present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); screen_priv->flip_pending->abort_flip = TRUE; } @@ -404,20 +409,20 @@ 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, - (*screen->GetScreenPixmap)(screen)); + present_set_tree_pixmap(screen_priv->flip_window, pixmap); - present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); + present_set_tree_pixmap(screen->root, pixmap); /* Update the screen pixmap with the current flip pixmap contents */ if (screen_priv->flip_pixmap && screen_priv->flip_window) { - present_copy_region(&screen_priv->flip_window->drawable, + present_copy_region(&pixmap->drawable, screen_priv->flip_pixmap, NULL, 0, 0); } @@ -725,7 +730,7 @@ present_pixmap(WindowPtr window, if (!pixmap) target_crtc = window_priv->crtc; - if (!target_crtc) + if (!target_crtc || target_crtc == PresentCrtcNeverSet) target_crtc = present_get_crtc(window); } @@ -866,19 +871,18 @@ present_pixmap(WindowPtr window, vblank->queued = TRUE; if ((pixmap && target_msc >= crtc_msc) || (!pixmap && target_msc > crtc_msc)) { ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc); - if (ret != Success) { - xorg_list_del(&vblank->event_queue); - vblank->queued = FALSE; - goto failure; - } - } else - present_execute(vblank, ust, crtc_msc); + if (ret == Success) + return Success; + + DebugPresent(("present_queue_vblank failed\n")); + } + + present_execute(vblank, ust, crtc_msc); return Success; no_mem: ret = BadAlloc; -failure: vblank->notifies = NULL; present_vblank_destroy(vblank); return ret; @@ -936,11 +940,12 @@ present_flip_destroy(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); - /* XXX this needs to be synchronous for server reset */ - - /* Do the actual cleanup once the flip has been performed by the hardware */ + /* Reset window pixmaps back to the screen pixmap */ if (screen_priv->flip_pending) present_set_abort_flip(screen); + + /* Drop reference to any pending flip or unflip pixmaps. */ + present_flip_idle(screen); } void diff --git a/xserver/present/present.h b/xserver/present/present.h index 0e3bdc08e..aab2e168a 100644 --- a/xserver/present/present.h +++ b/xserver/present/present.h @@ -116,6 +116,7 @@ extern _X_EXPORT Bool present_screen_init(ScreenPtr screen, present_screen_info_ptr info); typedef void (*present_complete_notify_proc)(WindowPtr window, + CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, diff --git a/xserver/present/present_event.c b/xserver/present/present_event.c index e9b827651..d3a59ea25 100644 --- a/xserver/present/present_event.c +++ b/xserver/present/present_event.c @@ -173,8 +173,8 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se } } } - if (complete_notify && kind == PresentCompleteKindPixmap) - (*complete_notify)(window, mode, serial, ust, msc); + if (complete_notify) + (*complete_notify)(window, kind, mode, serial, ust, msc); } void diff --git a/xserver/present/present_priv.h b/xserver/present/present_priv.h index d8569a2b6..f5c1652d1 100644 --- a/xserver/present/present_priv.h +++ b/xserver/present/present_priv.h @@ -134,6 +134,8 @@ typedef struct present_window_priv { struct xorg_list notifies; } present_window_priv_rec, *present_window_priv_ptr; +#define PresentCrtcNeverSet ((RRCrtcPtr) 1) + extern DevPrivateKeyRec present_window_private_key; static inline present_window_priv_ptr diff --git a/xserver/present/present_screen.c b/xserver/present/present_screen.c index 25ef6818d..2f91ac7dc 100644 --- a/xserver/present/present_screen.c +++ b/xserver/present/present_screen.c @@ -45,6 +45,7 @@ present_get_window_priv(WindowPtr window, Bool create) return NULL; xorg_list_init(&window_priv->vblank); xorg_list_init(&window_priv->notifies); + window_priv->crtc = PresentCrtcNeverSet; dixSetPrivate(&window->devPrivates, &present_window_private_key, window_priv); return window_priv; } diff --git a/xserver/pseudoramiX/Makefile.in b/xserver/pseudoramiX/Makefile.in index bc831c228..3e2d90ade 100644 --- a/xserver/pseudoramiX/Makefile.in +++ b/xserver/pseudoramiX/Makefile.in @@ -234,6 +234,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in index 6019676e1..6526f10e3 100644 --- a/xserver/randr/Makefile.in +++ b/xserver/randr/Makefile.in @@ -273,6 +273,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h index e14223201..13e6a8596 100644 --- a/xserver/randr/randrstr.h +++ b/xserver/randr/randrstr.h @@ -984,17 +984,17 @@ extern _X_EXPORT void #endif /* _RANDRSTR_H_ */ /* - + randr extension implementation structure Query state: ProcRRGetScreenInfo/ProcRRGetScreenResources RRGetInfo - + • Request configuration from driver, either 1.0 or 1.2 style • These functions only record state changes, all other actions are pended until RRTellChanged is called - + ->rrGetInfo 1.0: RRRegisterSize @@ -1009,15 +1009,15 @@ Query state: RROutputSetSubpixelOrder RROutputSetClones RRCrtcNotify - + • Must delay scanning configuration until after ->rrGetInfo returns because some drivers will call SetCurrentConfig in the middle of the ->rrGetInfo operation. - + 1.0: • Scan old configuration, mirror to new structures - + RRScanOldConfig RRCrtcCreate RROutputCreate @@ -1027,16 +1027,16 @@ Query state: RROldModeAdd • This adds modes one-at-a-time RRModeGet RRCrtcNotify - + • send events, reset pointer if necessary - + RRTellChanged WalkTree (sending events) - + • when layout has changed: RRPointerScreenConfigured RRSendConfigNotify - + Asynchronous state setting (1.2 only) When setting state asynchronously, the driver invokes the ->rrGetInfo function and then calls RRTellChanged to flush diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c index 69b3ecf0f..dca0691ac 100644 --- a/xserver/randr/rrcrtc.c +++ b/xserver/randr/rrcrtc.c @@ -428,7 +428,7 @@ rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height, ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix); if (ret == FALSE) { - ErrorF("failed to set shadow slave pixmap\n"); + ErrorF("randr: failed to set shadow slave pixmap\n"); return FALSE; } @@ -502,7 +502,6 @@ rrCheckPixmapBounding(ScreenPtr pScreen, if (new_width == screen_pixmap->drawable.width && new_height == screen_pixmap->drawable.height) { - ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2); } else { pScrPriv->rrScreenSetSize(pScreen, new_width, new_height, 0, 0); } @@ -557,7 +556,6 @@ RRCrtcSet(RRCrtcPtr crtc, width = mode->mode.width; height = mode->mode.height; } - ErrorF("have a master to look out for\n"); ret = rrCheckPixmapBounding(master, crtc, x, y, width, height); if (!ret) @@ -565,8 +563,6 @@ RRCrtcSet(RRCrtcPtr crtc, if (pScreen->current_master) { ret = rrCreateSharedPixmap(crtc, width, height, x, y); - ErrorF("need to create shared pixmap %d", ret); - } } #if RANDR_12_INTERFACE diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c index 1649309dc..548e07d1d 100644 --- a/xserver/randr/rroutput.c +++ b/xserver/randr/rroutput.c @@ -487,6 +487,7 @@ ProcRRGetOutputInfo(ClientPtr client) swapl(&rep.mmHeight); swaps(&rep.nCrtcs); swaps(&rep.nModes); + swaps(&rep.nPreferred); swaps(&rep.nClones); swaps(&rep.nameLength); } diff --git a/xserver/randr/rrpointer.c b/xserver/randr/rrpointer.c index eb6b6770c..b301d050d 100644 --- a/xserver/randr/rrpointer.c +++ b/xserver/randr/rrpointer.c @@ -77,21 +77,22 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, if (x < crtc->x) dx = crtc->x - x; - else if (x > crtc->x + scan_width) - dx = x - (crtc->x + scan_width); + else if (x > crtc->x + scan_width - 1) + dx = crtc->x + (scan_width - 1) - x; else dx = 0; if (y < crtc->y) dy = crtc->y - y; - else if (y > crtc->y + scan_height) - dy = y - (crtc->y + scan_height); + else if (y > crtc->y + scan_height - 1) + dy = crtc->y + (scan_height - 1) - y; else dy = 0; - dist = dx + dy; + dist = dx * dx + dy * dy; if (!nearest || dist < best) { nearest = crtc; best_dx = dx; best_dy = dy; + best = dist; } } if (best_dx || best_dy) diff --git a/xserver/randr/rrprovider.c b/xserver/randr/rrprovider.c index 4507ba894..bbb8e51b3 100644 --- a/xserver/randr/rrprovider.c +++ b/xserver/randr/rrprovider.c @@ -159,7 +159,7 @@ ProcRRGetProviderInfo (ClientPtr client) ScreenPtr provscreen; RRProvider *providers; uint32_t *prov_cap; - + REQUEST_SIZE_MATCH(xRRGetProviderInfoReq); VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c index e7ea49ddf..c2a7798e1 100644 --- a/xserver/randr/rrscreen.c +++ b/xserver/randr/rrscreen.c @@ -400,8 +400,6 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) update_totals(iter, pScrPriv); } - ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len); - pScrPriv = rrGetScrPriv(pScreen); rep = (xRRGetScreenResourcesReply) { .type = X_Reply, diff --git a/xserver/randr/rrtransform.c b/xserver/randr/rrtransform.c index f93181d2e..c8a27498f 100644 --- a/xserver/randr/rrtransform.c +++ b/xserver/randr/rrtransform.c @@ -131,7 +131,7 @@ RRTransformRescale(struct pixman_f_transform *f_transform, double limit) /* * Compute the complete transformation matrix including - * client-specified transform, rotation/reflection values and the crtc + * client-specified transform, rotation/reflection values and the crtc * offset. * * Return TRUE if the resulting transform is not a simple translation. diff --git a/xserver/randr/rrtransform.h b/xserver/randr/rrtransform.h index 2269b4cb7..f811d2b3d 100644 --- a/xserver/randr/rrtransform.h +++ b/xserver/randr/rrtransform.h @@ -59,7 +59,7 @@ extern _X_EXPORT Bool /* * Compute the complete transformation matrix including - * client-specified transform, rotation/reflection values and the crtc + * client-specified transform, rotation/reflection values and the crtc * offset. * * Return TRUE if the resulting transform is not a simple translation. diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c index 363ceadd2..b336bd7cd 100644 --- a/xserver/randr/rrxinerama.c +++ b/xserver/randr/rrxinerama.c @@ -23,7 +23,7 @@ * This Xinerama implementation comes from the SiS driver which has * the following notice: */ -/* +/* * SiS driver main code * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. diff --git a/xserver/record/Makefile.in b/xserver/record/Makefile.in index f98d029f4..1e83894c0 100644 --- a/xserver/record/Makefile.in +++ b/xserver/record/Makefile.in @@ -232,6 +232,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/record/record.c b/xserver/record/record.c index c9002196f..0a466e279 100644 --- a/xserver/record/record.c +++ b/xserver/record/record.c @@ -93,7 +93,7 @@ typedef union { } major; } RecordMinorOpRec, *RecordMinorOpPtr; -/* RecordClientsAndProtocolRec, nicknamed RCAP - holds all the client and +/* RecordClientsAndProtocolRec, nicknamed RCAP - holds all the client and * protocol selections passed in a single CreateContext or RegisterClients. * Generally, a context will have one of these from the create and an * additional one for each RegisterClients. RCAPs are freed when all their @@ -260,7 +260,7 @@ RecordFlushReplyBuffer(RecordContextPtr pContext, * is its length in bytes. * padlen is the number of pad bytes from a zeroed array. * futurelen is the number of bytes that will be sent in subsequent - * calls to this function to complete this protocol element. + * calls to this function to complete this protocol element. * In those subsequent calls, futurelen will be -1 to indicate * that the current data is a continuation of the same protocol * element. @@ -1020,8 +1020,8 @@ RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient) * * Side Effects: * Recording hooks needed by client will be uninstalled if the context - * is enabled. The designated client will be removed from the - * pRCAP->pClientIDs array. If it was the only client on the RCAP, + * is enabled. The designated client will be removed from the + * pRCAP->pClientIDs array. If it was the only client on the RCAP, * the RCAP is removed from the context and freed. (Invariant: RCAPs * have at least one client.) */ @@ -1064,7 +1064,7 @@ RecordDeleteClientFromRCAP(RecordClientsAndProtocolPtr pRCAP, int position) * * Side Effects: * Recording hooks needed by client will be installed if the context - * is enabled. The designated client will be added to the + * is enabled. The designated client will be added to the * pRCAP->pClientIDs array, which may be realloced. * pRCAP->clientIDsSeparatelyAllocated may be set to 1 if there * is no more room to hold clients internal to the RCAP. @@ -1173,8 +1173,8 @@ RecordSanityCheckClientSpecifiers(ClientPtr client, XID *clientspecs, * pClientspecs is an array of CLIENTSPECs that have been sanity * checked. * pNumClientspecs is a pointer to the number of elements in pClientspecs. - * excludespec, if non-zero, is the resource id base of a client that - * should not be included in the expansion of XRecordAllClients or + * excludespec, if non-zero, is the resource id base of a client that + * should not be included in the expansion of XRecordAllClients or * XRecordCurrentClients. * * Returns: @@ -1379,7 +1379,7 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client, } /* end RecordSanityCheckRegisterClients */ /* This is a tactical structure used to gather information about all the sets - * (RecordSetPtr) that need to be created for an RCAP in the process of + * (RecordSetPtr) that need to be created for an RCAP in the process of * digesting a list of RECORDRANGEs (converting it to the internal * representation). */ @@ -1447,7 +1447,7 @@ RecordAllocIntervals(SetInfoPtr psi, int nIntervals) * Returns: BadAlloc if a memory allocation error occurred, else Success. * * Side Effects: - * The slice of pRanges indicated by byteoffset is stored in psi. + * The slice of pRanges indicated by byteoffset is stored in psi. * If pExtSetInfo is non-NULL, minor opcode intervals are stored * in an existing SetInfoRec if the major opcode interval matches, else * they are stored in a new SetInfoRec, and *pnExtSetInfo is @@ -2639,7 +2639,7 @@ SProcRecordDispatch(ClientPtr client) /* RecordConnectionSetupInfo * * Arguments: - * pContext is an enabled context that specifies recording of + * pContext is an enabled context that specifies recording of * connection setup info. * pci holds the connection setup info. * diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in index aafe4285a..5d95cc5aa 100644 --- a/xserver/render/Makefile.in +++ b/xserver/render/Makefile.in @@ -265,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/render/animcur.c b/xserver/render/animcur.c index 69f9f887c..825ae1fe7 100644 --- a/xserver/render/animcur.c +++ b/xserver/render/animcur.c @@ -159,7 +159,7 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen, /* * Not a simple Unwrap/Wrap as this - * isn't called along the DisplayCursor + * isn't called along the DisplayCursor * wrapper chain. */ DisplayCursor = pScreen->DisplayCursor; diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c index ae3812171..f3310db12 100644 --- a/xserver/render/glyph.c +++ b/xserver/render/glyph.c @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. diff --git a/xserver/render/glyphstr.h b/xserver/render/glyphstr.h index 835c1a74e..2df055dfd 100644 --- a/xserver/render/glyphstr.h +++ b/xserver/render/glyphstr.h @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. diff --git a/xserver/render/mipict.c b/xserver/render/mipict.c index 3959fc415..a72510480 100644 --- a/xserver/render/mipict.c +++ b/xserver/render/mipict.c @@ -49,23 +49,9 @@ miDestroyPicture(PicturePtr pPicture) void miDestroyPictureClip(PicturePtr pPicture) { - switch (pPicture->clientClipType) { - case CT_NONE: - return; - case CT_PIXMAP: - (*pPicture->pDrawable->pScreen-> - DestroyPixmap) ((PixmapPtr) (pPicture->clientClip)); - break; - default: - /* - * we know we'll never have a list of rectangles, since ChangeClip - * immediately turns them into a region - */ + if (pPicture->clientClip) RegionDestroy(pPicture->clientClip); - break; - } pPicture->clientClip = NULL; - pPicture->clientClipType = CT_NONE; } int @@ -73,37 +59,31 @@ miChangePictureClip(PicturePtr pPicture, int type, void *value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); - void *clientClip; - int clientClipType; + RegionPtr clientClip; switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (void *) BitmapToRegion(pScreen, (PixmapPtr) value); + clientClip = BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; - clientClipType = CT_REGION; (*pScreen->DestroyPixmap) ((PixmapPtr) value); break; case CT_REGION: clientClip = value; - clientClipType = CT_REGION; break; case CT_NONE: clientClip = 0; - clientClipType = CT_NONE; break; default: - clientClip = (void *) RegionFromRects(n, (xRectangle *) value, type); + clientClip = RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) return BadAlloc; - clientClipType = CT_REGION; free(value); break; } (*ps->DestroyPictureClip) (pPicture); pPicture->clientClip = clientClip; - pPicture->clientClipType = clientClipType; pPicture->stateChanges |= CPClipMask; return Success; } @@ -144,7 +124,7 @@ miValidatePicture(PicturePtr pPicture, Mask mask) * copying of regions. (this wins especially if many clients clip * by children and have no client clip.) */ - if (pPicture->clientClipType == CT_NONE) { + if (!pPicture->clientClip) { if (freeCompClip) RegionDestroy(pPicture->pCompositeClip); pPicture->pCompositeClip = pregWin; @@ -203,7 +183,7 @@ miValidatePicture(PicturePtr pPicture, Mask mask) pPicture->pCompositeClip = RegionCreate(&pixbounds, 1); } - if (pPicture->clientClipType == CT_REGION) { + if (pPicture->clientClip) { if (pDrawable->x || pDrawable->y) { RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, @@ -284,7 +264,7 @@ miClipPictureReg(pixman_region16_t * pRegion, static inline Bool miClipPictureSrc(RegionPtr pRegion, PicturePtr pPicture, int dx, int dy) { - if (pPicture->clientClipType != CT_NONE) { + if (pPicture->clientClip) { Bool result; pixman_region_translate(pPicture->clientClip, diff --git a/xserver/render/mipict.h b/xserver/render/mipict.h index a16dd3112..23ce9e8f6 100644 --- a/xserver/render/mipict.h +++ b/xserver/render/mipict.h @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. diff --git a/xserver/render/mirect.c b/xserver/render/mirect.c index 4e76972d1..a36d1d6e3 100644 --- a/xserver/render/mirect.c +++ b/xserver/render/mirect.c @@ -54,7 +54,7 @@ miColorRects(PicturePtr pDst, tmpval[1].val = pixel; tmpval[2].val = pDst->subWindowMode; mask = GCFunction | GCForeground | GCSubwindowMode; - if (pClipPict->clientClipType == CT_REGION) { + if (pClipPict->clientClip) { tmpval[3].val = pDst->clipOrigin.x - xoff; tmpval[4].val = pDst->clipOrigin.y - yoff; mask |= GCClipXOrigin | GCClipYOrigin; diff --git a/xserver/render/picture.c b/xserver/render/picture.c index 7da93102b..6ff31ba02 100644 --- a/xserver/render/picture.c +++ b/xserver/render/picture.c @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -41,6 +41,9 @@ #include "servermd.h" #include "picturestr.h" #include "xace.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif DevPrivateKeyRec PictureScreenPrivateKeyRec; DevPrivateKeyRec PictureWindowPrivateKeyRec; @@ -731,7 +734,6 @@ SetPictureToDefaults(PicturePtr pPicture) pPicture->polyEdge = PolyEdgeSharp; pPicture->polyMode = PolyModePrecise; pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; pPicture->componentAlpha = FALSE; pPicture->repeatType = RepeatNone; @@ -1008,6 +1010,38 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, return pPicture; } +static int +cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + PanoramiXRes *res; + int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE, + client, mode); + if (err != Success) + return err; + id = res->info[screen->myNum].id; + } +#endif + return dixLookupResourceByType(result, id, PictureType, client, mode); +} + +static int +cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + PanoramiXRes *res; + int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP, + client, mode); + if (err != Success) + return err; + id = res->info[screen->myNum].id; + } +#endif + return dixLookupResourceByType(result, id, RT_PIXMAP, client, mode); +} + #define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) #define NEXT_PTR(_type) ((_type) ulist++->ptr) @@ -1054,9 +1088,8 @@ ChangePicture(PicturePtr pPicture, if (pid == None) pAlpha = 0; else { - error = dixLookupResourceByType((void **) &pAlpha, pid, - PictureType, client, - DixReadAccess); + error = cpAlphaMap((void **) &pAlpha, pid, pScreen, + client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; @@ -1113,9 +1146,8 @@ ChangePicture(PicturePtr pPicture, } else { clipType = CT_PIXMAP; - error = dixLookupResourceByType((void **) &pPixmap, pid, - RT_PIXMAP, client, - DixReadAccess); + error = cpClipMask((void **) &pPixmap, pid, pScreen, + client, DixReadAccess); if (error != Success) { client->errorValue = pid; break; @@ -1332,87 +1364,6 @@ SetPictureTransform(PicturePtr pPicture, PictTransform * transform) return Success; } -void -CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst) -{ - PictureScreenPtr ps = GetPictureScreen(pSrc->pDrawable->pScreen); - Mask origMask = mask; - - pDst->serialNumber |= GC_CHANGE_SERIAL_BIT; - pDst->stateChanges |= mask; - - while (mask) { - Mask bit = lowbit(mask); - - switch (bit) { - case CPRepeat: - pDst->repeat = pSrc->repeat; - pDst->repeatType = pSrc->repeatType; - break; - case CPAlphaMap: - if (pSrc->alphaMap && - pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) - pSrc->alphaMap->refcnt++; - if (pDst->alphaMap) - FreePicture((void *) pDst->alphaMap, (XID) 0); - pDst->alphaMap = pSrc->alphaMap; - break; - case CPAlphaXOrigin: - pDst->alphaOrigin.x = pSrc->alphaOrigin.x; - break; - case CPAlphaYOrigin: - pDst->alphaOrigin.y = pSrc->alphaOrigin.y; - break; - case CPClipXOrigin: - pDst->clipOrigin.x = pSrc->clipOrigin.x; - break; - case CPClipYOrigin: - pDst->clipOrigin.y = pSrc->clipOrigin.y; - break; - case CPClipMask: - switch (pSrc->clientClipType) { - case CT_NONE: - (*ps->ChangePictureClip) (pDst, CT_NONE, NULL, 0); - break; - case CT_REGION: - if (!pSrc->clientClip) { - (*ps->ChangePictureClip) (pDst, CT_NONE, NULL, 0); - } - else { - RegionPtr clientClip; - RegionPtr srcClientClip = (RegionPtr) pSrc->clientClip; - - clientClip = RegionCreate(RegionExtents(srcClientClip), - RegionNumRects(srcClientClip)); - (*ps->ChangePictureClip) (pDst, CT_REGION, clientClip, 0); - } - break; - default: - /* XXX: CT_PIXMAP unimplemented */ - break; - } - break; - case CPGraphicsExposure: - pDst->graphicsExposures = pSrc->graphicsExposures; - break; - case CPPolyEdge: - pDst->polyEdge = pSrc->polyEdge; - break; - case CPPolyMode: - pDst->polyMode = pSrc->polyMode; - break; - case CPDither: - break; - case CPComponentAlpha: - pDst->componentAlpha = pSrc->componentAlpha; - break; - } - mask &= ~bit; - } - - (*ps->ChangePicture) (pDst, origMask); -} - static void ValidateOnePicture(PicturePtr pPicture) { diff --git a/xserver/render/picture.h b/xserver/render/picture.h index c85353a44..66c85c56f 100644 --- a/xserver/render/picture.h +++ b/xserver/render/picture.h @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -129,7 +129,7 @@ typedef enum _PictFormatShort { } PictFormatShort; /* - * For dynamic indexed visuals (GrayScale and PseudoColor), these control the + * For dynamic indexed visuals (GrayScale and PseudoColor), these control the * selection of colors allocated for drawing to Pictures. The default * policy depends on the size of the colormap: * @@ -189,8 +189,8 @@ typedef pixman_fixed_1_16_t xFixed_1_16; typedef pixman_fixed_16_16_t xFixed_16_16; /* - * An unadorned "xFixed" is the same as xFixed_16_16, - * (since it's quite common in the code) + * An unadorned "xFixed" is the same as xFixed_16_16, + * (since it's quite common in the code) */ typedef pixman_fixed_t xFixed; diff --git a/xserver/render/picturestr.h b/xserver/render/picturestr.h index 8c8100d81..177f87b80 100644 --- a/xserver/render/picturestr.h +++ b/xserver/render/picturestr.h @@ -132,7 +132,6 @@ typedef struct _Picture { unsigned int polyEdge:1; unsigned int polyMode:1; unsigned int freeCompClip:1; - unsigned int clientClipType:2; unsigned int componentAlpha:1; unsigned int repeatType:2; unsigned int filter:3; @@ -145,7 +144,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - void *clientClip; + RegionPtr clientClip; unsigned long serialNumber; @@ -475,9 +474,6 @@ SetPictureClipRegion(PicturePtr pPicture, extern _X_EXPORT int SetPictureTransform(PicturePtr pPicture, PictTransform * transform); -extern _X_EXPORT void - CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst); - extern _X_EXPORT void ValidatePicture(PicturePtr pPicture); diff --git a/xserver/render/render.c b/xserver/render/render.c index 60834477b..723f380c2 100644 --- a/xserver/render/render.c +++ b/xserver/render/render.c @@ -16,7 +16,7 @@ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -1548,7 +1548,7 @@ ProcRenderCreateCursor(ClientPtr client) FreePicture(pPicture, 0); } /* - * Check whether the cursor can be directly supported by + * Check whether the cursor can be directly supported by * the core cursor code */ ncolor = 0; diff --git a/xserver/test-driver b/xserver/test-driver index d30605660..8e575b017 100644 --- a/xserver/test-driver +++ b/xserver/test-driver @@ -3,7 +3,7 @@ scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -119,6 +122,12 @@ case $estatus:$expect_failure in *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" diff --git a/xserver/test/Makefile.am b/xserver/test/Makefile.am index 5849fbc03..82578d977 100644 --- a/xserver/test/Makefile.am +++ b/xserver/test/Makefile.am @@ -5,7 +5,10 @@ if XORG # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another SUBDIRS += xi1 xi2 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch +noinst_PROGRAMS += xkb input xtest misc fixes xfree86 os signal-logging touch +if RES +noinst_PROGRAMS += hashtabletest +endif endif check_LTLIBRARIES = libxservertest.la diff --git a/xserver/test/Makefile.in b/xserver/test/Makefile.in index c8a3d3872..859725c8a 100644 --- a/xserver/test/Makefile.in +++ b/xserver/test/Makefile.in @@ -51,19 +51,21 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@noinst_PROGRAMS = list$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@ string$(EXEEXT) $(am__EXEEXT_1) +@ENABLE_UNIT_TESTS_TRUE@ string$(EXEEXT) $(am__EXEEXT_1) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_2) # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_1 = xi1 xi2 -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_3 = -I$(top_srcdir)/hw/xfree86/parser \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 os signal-logging touch +@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__append_3 = hashtabletest +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_4 = -I$(top_srcdir)/hw/xfree86/parser \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ddc \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_4 = $(OS_LIB) $(DIX_LIB) -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_5 = \ +@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_5 = $(OS_LIB) $(DIX_LIB) +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_6 = \ @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 \ @@ -76,10 +78,10 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@ -@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_6 = $(top_builddir)/hw/xfree86/dri/libdri.la -@DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri2/libdri2.la -@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_8 = $(top_builddir)/dri3/libdri3.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_9 = \ +@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri/libdri.la +@DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_8 = $(top_builddir)/hw/xfree86/dri2/libdri2.la +@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_9 = $(top_builddir)/dri3/libdri3.la +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_10 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/damageext/libdamageext.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libfb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libwfb.la \ @@ -95,26 +97,26 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkbstubs.la -@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_10 = \ +@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_11 = \ @COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/composite/libcomposite.la -@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_11 = \ +@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_12 = \ @DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dbe/libdbe.la -@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_12 = \ +@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_13 = \ @ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@ $(top_builddir)/glx/libglx.la -@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_13 = \ +@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_14 = \ @ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@ $(top_builddir)/record/librecord.la -@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_14 = \ +@DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_15 = \ @DRI3_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dri3/libdri3.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_15 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_16 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@ $(top_builddir)/miext/rootless/librootless.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_16 = -lXplugin -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_17 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_17 = -lXplugin +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_18 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@ $(top_builddir)/miext/rootless/librootless.la subdir = test @@ -166,10 +168,10 @@ am__v_lt_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ misc$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ fixes$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ hashtabletest$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ os$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ touch$(EXEEXT) +@ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE@am__EXEEXT_2 = hashtabletest$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) fixes_SOURCES = fixes.c fixes_OBJECTS = fixes.$(OBJEXT) @@ -414,6 +416,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ @@ -658,11 +661,11 @@ top_srcdir = @top_srcdir@ @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_3) +@ENABLE_UNIT_TESTS_TRUE@ $(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_4) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) +@ENABLE_UNIT_TESTS_TRUE@ $(GLX_SYS_LIBS) $(am__append_5) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_17) @ENABLE_UNIT_TESTS_TRUE@xkb_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@input_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@xtest_LDADD = $(TEST_LDADD) @@ -674,12 +677,12 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@hashtabletest_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@os_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_LIBADD = $(XSERVER_LIBS) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_5) $(am__append_6) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_7) $(am__append_8) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_9) $(am__append_10) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_11) $(am__append_12) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_13) $(am__append_14) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_15) $(am__append_17) +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_6) $(am__append_7) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_8) $(am__append_9) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_10) $(am__append_11) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_12) $(am__append_13) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) $(am__append_15) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_16) $(am__append_18) @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_SOURCES = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.c \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_srcdir)/mi/miinitext.c diff --git a/xserver/test/list.c b/xserver/test/list.c index f9f54ee4e..28d9609ef 100644 --- a/xserver/test/list.c +++ b/xserver/test/list.c @@ -249,15 +249,15 @@ test_nt_list_append(void) /* Test using nt_list_next */ for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { - assert(item->a = i); - assert(item->b = i * 2); + assert(item->a == i); + assert(item->b == i * 2); } /* Test using nt_list_for_each_entry */ i = 1; nt_list_for_each_entry(item, foo, next) { - assert(item->a = i); - assert(item->b = i * 2); + assert(item->a == i); + assert(item->b == i * 2); i++; } assert(i == 11); @@ -270,11 +270,11 @@ test_nt_list_insert(void) struct foo *foo = calloc(10, sizeof(struct foo)); struct foo *item; - foo->a = 10; - foo->b = 20; + foo->a = 1; + foo->b = 2; nt_list_init(foo, next); - for (item = &foo[1], i = 9; i > 0; i--, item++) { + for (item = &foo[1], i = 10; i > 1; i--, item++) { item->a = i; item->b = i * 2; nt_list_init(item, next); @@ -282,16 +282,16 @@ test_nt_list_insert(void) } /* Test using nt_list_next */ - for (item = foo, i = 10; i > 0; i--, item = nt_list_next(item, next)) { - assert(item->a = i); - assert(item->b = i * 2); + for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) { + assert(item->a == i); + assert(item->b == i * 2); } /* Test using nt_list_for_each_entry */ i = 1; nt_list_for_each_entry(item, foo, next) { - assert(item->a = i); - assert(item->b = i * 2); + assert(item->a == i); + assert(item->b == i * 2); i++; } assert(i == 11); diff --git a/xserver/test/signal-logging.c b/xserver/test/signal-logging.c index 432012195..3d2d04801 100644 --- a/xserver/test/signal-logging.c +++ b/xserver/test/signal-logging.c @@ -113,12 +113,13 @@ double float_tests[] = { 0, 5, 0.1, 0.01, 5.2342, 10.2301, -1, -2.00, -0.6023, -1203.30 }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverflow" + static void number_formatting(void) { int i; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverflow" long unsigned int unsigned_tests[] = { 0,/* Zero */ 5, /* Single digit number */ 12, /* Two digit decimal number */ @@ -141,7 +142,6 @@ number_formatting(void) -0x15D027BF211B37A, /* Large > 32 bit number */ -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ } ; -#pragma GCC diagnostic pop for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++) assert(check_number_format_test(unsigned_tests[i])); @@ -152,6 +152,7 @@ number_formatting(void) for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++) assert(check_float_format_test(float_tests[i])); } +#pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" diff --git a/xserver/test/xi1/Makefile.in b/xserver/test/xi1/Makefile.in index f7b6e1eb5..ed7633458 100644 --- a/xserver/test/xi1/Makefile.in +++ b/xserver/test/xi1/Makefile.in @@ -257,6 +257,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/test/xi2/Makefile.in b/xserver/test/xi2/Makefile.in index 4b97bd0f4..ff9478fdc 100644 --- a/xserver/test/xi2/Makefile.in +++ b/xserver/test/xi2/Makefile.in @@ -387,6 +387,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/test/xi2/protocol-common.c b/xserver/test/xi2/protocol-common.c index 9a429e49f..9265ba390 100644 --- a/xserver/test/xi2/protocol-common.c +++ b/xserver/test/xi2/protocol-common.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" @@ -137,6 +138,18 @@ init_devices(void) { ClientRec client; struct devices local_devices; + int ret; + + /* + * Put a unique name in display pointer so that when tests are run in + * parallel, their xkbcomp outputs to /tmp/server-.xkm don't + * stomp on each other. + */ +#ifdef HAVE_GETPROGNAME + display = getprogname(); +#elif HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + display = program_invocation_short_name; +#endif client = init_client(0, NULL); @@ -145,15 +158,20 @@ init_devices(void) inputInfo.pointer = local_devices.vcp; inputInfo.keyboard = local_devices.vck; - ActivateDevice(local_devices.vcp, FALSE); - ActivateDevice(local_devices.vck, FALSE); + ret = ActivateDevice(local_devices.vcp, FALSE); + assert(ret == Success); + /* This may fail if xkbcomp fails or xkb-config is not found. */ + ret = ActivateDevice(local_devices.vck, FALSE); + assert(ret == Success); EnableDevice(local_devices.vcp, FALSE); EnableDevice(local_devices.vck, FALSE); AllocDevicePair(&client, "", &local_devices.mouse, &local_devices.kbd, TestPointerProc, CoreKeyboardProc, FALSE); - ActivateDevice(local_devices.mouse, FALSE); - ActivateDevice(local_devices.kbd, FALSE); + ret = ActivateDevice(local_devices.mouse, FALSE); + assert(ret == Success); + ret = ActivateDevice(local_devices.kbd, FALSE); + assert(ret == Success); EnableDevice(local_devices.mouse, FALSE); EnableDevice(local_devices.kbd, FALSE); diff --git a/xserver/xfixes/Makefile.in b/xserver/xfixes/Makefile.in index 5c0b6a017..4a0afb71c 100644 --- a/xserver/xfixes/Makefile.in +++ b/xserver/xfixes/Makefile.in @@ -264,6 +264,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c index 31a408fac..94d24a8e2 100644 --- a/xserver/xfixes/cursor.c +++ b/xserver/xfixes/cursor.c @@ -632,7 +632,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) int resIndex; ReplaceCursorLookupRec rcl; - /* + /* * Cursors exist only in the resource database, windows and grabs. * All of these are always pointed at by the resource database. Walk * the whole thing looking for cursors @@ -735,7 +735,7 @@ SProcXFixesChangeCursorByName(ClientPtr client) /* * Routines for manipulating the per-screen hide counts list. - * This list indicates which clients have requested cursor hiding + * This list indicates which clients have requested cursor hiding * for that screen. */ @@ -772,7 +772,7 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen) pChc->pNext = cs->pCursorHideCounts; cs->pCursorHideCounts = pChc; - /* + /* * Create a resource for this element so it can be deleted * when the client goes away. */ @@ -784,7 +784,7 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen) return Success; } -/* +/* * Delete the given hide-counts list element from its screen list. */ static void @@ -812,7 +812,7 @@ deleteCursorHideCount(CursorHideCountPtr pChcToDel, ScreenPtr pScreen) } } -/* +/* * Delete all the hide-counts list elements for this screen. */ static void @@ -848,9 +848,9 @@ ProcXFixesHideCursor(ClientPtr client) return ret; } - /* - * Has client hidden the cursor before on this screen? - * If so, just increment the count. + /* + * Has client hidden the cursor before on this screen? + * If so, just increment the count. */ pChc = findCursorHideCount(client, pWin->drawable.pScreen); @@ -859,8 +859,8 @@ ProcXFixesHideCursor(ClientPtr client) return Success; } - /* - * This is the first time this client has hid the cursor + /* + * This is the first time this client has hid the cursor * for this screen. */ ret = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, @@ -912,7 +912,7 @@ ProcXFixesShowCursor(ClientPtr client) return rc; } - /* + /* * Has client hidden the cursor on this screen? * If not, generate an error. */ diff --git a/xserver/xfixes/region.c b/xserver/xfixes/region.c index f9de52542..4492f1267 100644 --- a/xserver/xfixes/region.c +++ b/xserver/xfixes/region.c @@ -222,20 +222,13 @@ ProcXFixesCreateRegionFromGC(ClientPtr client) if (rc != Success) return rc; - switch (pGC->clientClipType) { - case CT_PIXMAP: - pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip); - if (!pRegion) - return BadAlloc; - break; - case CT_REGION: + if (pGC->clientClip) { pClip = (RegionPtr) pGC->clientClip; pRegion = XFixesRegionCopy(pClip); if (!pRegion) return BadAlloc; - break; - default: - return BadImplementation; /* assume sane server bits */ + } else { + return BadMatch; } if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) @@ -272,20 +265,12 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client) if (!pPicture->pDrawable) return RenderErrBase + BadPicture; - switch (pPicture->clientClipType) { - case CT_PIXMAP: - pRegion = BitmapToRegion(pPicture->pDrawable->pScreen, - (PixmapPtr) pPicture->clientClip); - if (!pRegion) - return BadAlloc; - break; - case CT_REGION: + if (pPicture->clientClip) { pRegion = XFixesRegionCopy((RegionPtr) pPicture->clientClip); if (!pRegion) return BadAlloc; - break; - default: - return BadImplementation; /* assume sane server bits */ + } else { + return BadMatch; } if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) diff --git a/xserver/xkb/Makefile.in b/xserver/xkb/Makefile.in index ddf9a4b40..7ec7ad2e0 100644 --- a/xserver/xkb/Makefile.in +++ b/xserver/xkb/Makefile.in @@ -272,6 +272,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ KDRIVE_INCS = @KDRIVE_INCS@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ diff --git a/xserver/xkb/XKBAlloc.c b/xserver/xkb/XKBAlloc.c index 20e0459af..78c98371d 100644 --- a/xserver/xkb/XKBAlloc.c +++ b/xserver/xkb/XKBAlloc.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/XKBGAlloc.c b/xserver/xkb/XKBGAlloc.c index 888078406..25917d304 100644 --- a/xserver/xkb/XKBGAlloc.c +++ b/xserver/xkb/XKBGAlloc.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/XKBMAlloc.c b/xserver/xkb/XKBMAlloc.c index 3ffd5dad1..37ed1a725 100644 --- a/xserver/xkb/XKBMAlloc.c +++ b/xserver/xkb/XKBMAlloc.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -357,7 +357,7 @@ XkbResizeKeyType(XkbDescPtr xkb, * might have to be enlarged. * If the key type decreased in size: * - keys that have a group width > the old width don't have to be - * resized (because they must have some other wider type associated + * resized (because they must have some other wider type associated * with some group). * + keys that have a group width == the old width might have to be * shrunk. diff --git a/xserver/xkb/XKBMisc.c b/xserver/xkb/XKBMisc.c index 6abd1d11a..df268b583 100644 --- a/xserver/xkb/XKBMisc.c +++ b/xserver/xkb/XKBMisc.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxBeep.c b/xserver/xkb/ddxBeep.c index caf78c94d..52353ea81 100644 --- a/xserver/xkb/ddxBeep.c +++ b/xserver/xkb/ddxBeep.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxCtrls.c b/xserver/xkb/ddxCtrls.c index 0805fb208..964ac3d51 100644 --- a/xserver/xkb/ddxCtrls.c +++ b/xserver/xkb/ddxCtrls.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxKillSrv.c b/xserver/xkb/ddxKillSrv.c index 1cabb1bd7..7c7e73970 100644 --- a/xserver/xkb/ddxKillSrv.c +++ b/xserver/xkb/ddxKillSrv.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxLEDs.c b/xserver/xkb/ddxLEDs.c index 81b7b00e0..e5aecb523 100644 --- a/xserver/xkb/ddxLEDs.c +++ b/xserver/xkb/ddxLEDs.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxLoad.c b/xserver/xkb/ddxLoad.c index 1dc0e4eee..f71815aa8 100644 --- a/xserver/xkb/ddxLoad.c +++ b/xserver/xkb/ddxLoad.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/ddxVT.c b/xserver/xkb/ddxVT.c index 65291026a..f3cd26a97 100644 --- a/xserver/xkb/ddxVT.c +++ b/xserver/xkb/ddxVT.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/maprules.c b/xserver/xkb/maprules.c index 6f5f8ccf3..28148d9a5 100644 --- a/xserver/xkb/maprules.c +++ b/xserver/xkb/maprules.c @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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. diff --git a/xserver/xkb/xkb.c b/xserver/xkb/xkb.c index c8a9e9e3f..f3988f9a7 100644 --- a/xserver/xkb/xkb.c +++ b/xserver/xkb/xkb.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -3986,7 +3986,7 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev, { XkbDescRec *xkb; CARD32 *tmp; - Atom bad; + Atom bad = None; tmp = data; xkb = dev->key->xkbInfo->desc; diff --git a/xserver/xkb/xkbAccessX.c b/xserver/xkb/xkbAccessX.c index 5f3de0d9e..7fd6a48df 100644 --- a/xserver/xkb/xkbAccessX.c +++ b/xserver/xkb/xkbAccessX.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -598,7 +598,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) Bool ignoreKeyEvent = FALSE; /* Don't transmit the KeyRelease if BounceKeys is on and - * this is the release of a key that was ignored due to + * this is the release of a key that was ignored due to * BounceKeys. */ if (ctrls->enabled_ctrls & XkbBounceKeysMask) { diff --git a/xserver/xkb/xkbActions.c b/xserver/xkb/xkbActions.c index c44f44bc1..2a196f151 100644 --- a/xserver/xkb/xkbActions.c +++ b/xserver/xkb/xkbActions.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/xkbEvents.c b/xserver/xkb/xkbEvents.c index 210d8ebe4..0dbbd6cbc 100644 --- a/xserver/xkb/xkbEvents.c +++ b/xserver/xkb/xkbEvents.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -237,7 +237,6 @@ XkbSendStateNotify(DeviceIntPtr kbd, xkbStateNotify * pSN) while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->stateNotifyMask & changed)) { pSN->sequenceNumber = interest->client->sequence; @@ -400,7 +399,6 @@ XkbSendControlsNotify(DeviceIntPtr kbd, xkbControlsNotify * pCN) pCN->numGroups = xkbi->desc->ctrls->num_groups; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->ctrlsNotifyMask & changedControls)) { if (!initialized) { @@ -447,7 +445,6 @@ XkbSendIndicatorNotify(DeviceIntPtr kbd, int xkbType, xkbIndicatorNotify * pEv) changed = pEv->changed; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (((xkbType == XkbIndicatorStateNotify) && (interest->iStateNotifyMask & changed)) || @@ -528,7 +525,6 @@ XkbHandleBell(BOOL force, initialized = 0; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->bellNotifyMask)) { if (!initialized) { @@ -581,7 +577,6 @@ XkbSendAccessXNotify(DeviceIntPtr kbd, xkbAccessXNotify * pEv) db_delay = pEv->debounceDelay; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->accessXNotifyMask & (1 << pEv->detail))) { if (!initialized) { @@ -627,7 +622,6 @@ XkbSendNamesNotify(DeviceIntPtr kbd, xkbNamesNotify * pEv) changedVirtualMods = pEv->changedVirtualMods; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->namesNotifyMask & pEv->changed)) { if (!initialized) { @@ -671,7 +665,6 @@ XkbSendCompatMapNotify(DeviceIntPtr kbd, xkbCompatMapNotify * pEv) initialized = 0; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->compatNotifyMask)) { if (!initialized) { @@ -722,7 +715,6 @@ XkbSendActionMessage(DeviceIntPtr kbd, xkbActionMessage * pEv) pEv->group = xkbi->state.group; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->actionMessageMask)) { if (!initialized) { @@ -766,7 +758,6 @@ XkbSendExtensionDeviceNotify(DeviceIntPtr dev, state = pEv->ledState; while (interest) { if ((!interest->client->clientGone) && - (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags & _XkbClientInitialized) && (interest->extDevNotifyMask & reason)) { if (!initialized) { diff --git a/xserver/xkb/xkbInit.c b/xserver/xkb/xkbInit.c index 06ec46e81..30e10bd15 100644 --- a/xserver/xkb/xkbInit.c +++ b/xserver/xkb/xkbInit.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -676,9 +676,9 @@ InitKeyboardDeviceStructFromString(DeviceIntPtr dev, /***====================================================================***/ /* - * Be very careful about what does and doesn't get freed by this - * function. To reduce fragmentation, XkbInitDevice allocates a - * single huge block per device and divides it up into most of the + * Be very careful about what does and doesn't get freed by this + * function. To reduce fragmentation, XkbInitDevice allocates a + * single huge block per device and divides it up into most of the * fixed-size structures for the device. Don't free anything that * is part of this larger block. */ diff --git a/xserver/xkb/xkbLEDs.c b/xserver/xkb/xkbLEDs.c index e1e22d178..4e1600207 100644 --- a/xserver/xkb/xkbLEDs.c +++ b/xserver/xkb/xkbLEDs.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. @@ -47,8 +47,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. * XkbIndicatorsToUpdate(dev,changed,check_devs_rtrn) * * Given a keyboard and a set of state components that have changed, - * this function returns the indicators on the default keyboard - * feedback that might be affected. It also reports whether or not + * this function returns the indicators on the default keyboard + * feedback that might be affected. It also reports whether or not * any extension devices might be affected in check_devs_rtrn. */ @@ -85,10 +85,10 @@ XkbIndicatorsToUpdate(DeviceIntPtr dev, * Bool *XkbApplyLEDChangeToKeyboard(xkbi,map,on,change) * - * Some indicators "drive" the keyboard when their state is explicitly + * Some indicators "drive" the keyboard when their state is explicitly * changed, as described in section 9.2.1 of the XKB protocol spec. - * This function updates the state and controls for the keyboard - * specified by 'xkbi' to reflect any changes that are required + * This function updates the state and controls for the keyboard + * specified by 'xkbi' to reflect any changes that are required * when the indicator described by 'map' is turned on or off. The * extent of the changes is reported in change, which must be defined. */ @@ -357,9 +357,9 @@ XkbUpdateAllDeviceIndicators(XkbChangesPtr changes, XkbEventCausePtr cause) * attempted change. If 'changes' is NULL, this function generates * XKB events to report any such changes to interested clients. * - * If 'cause' is non-NULL, it specifies the reason for the change, - * as reported in some XKB events. If it is NULL, this function - * assumes that the change is the result of a core protocol + * If 'cause' is non-NULL, it specifies the reason for the change, + * as reported in some XKB events. If it is NULL, this function + * assumes that the change is the result of a core protocol * ChangeKeyboardMapping request. */ @@ -407,7 +407,7 @@ XkbSetIndicators(DeviceIntPtr dev, * * Applies the indicator maps for any indicators specified in * 'update' from the default keyboard feedback on the device - * specified by 'dev.' + * specified by 'dev.' * * If 'changes' is NULL, this function generates and XKB events * required to report the necessary changes, otherwise it simply @@ -442,9 +442,9 @@ XkbUpdateIndicators(DeviceIntPtr dev, * XkbCheckIndicatorMaps(dev,sli,which) * * Updates the 'indicator accelerators' for the indicators specified - * by 'which' in the feedback specified by 'sli.' The indicator - * accelerators are internal to the server and are used to simplify - * and speed up the process of figuring out which indicators might + * by 'which' in the feedback specified by 'sli.' The indicator + * accelerators are internal to the server and are used to simplify + * and speed up the process of figuring out which indicators might * be affected by a particular change in keyboard state or controls. */ @@ -677,7 +677,7 @@ XkbCopySrvLedInfo(DeviceIntPtr from, * * Finds the XkbSrvLedInfoPtr for the specified 'class' and 'id' * on the device specified by 'dev.' If the class and id specify - * a valid device feedback, this function returns the existing + * a valid device feedback, this function returns the existing * feedback or allocates a new one. * */ @@ -839,7 +839,7 @@ XkbApplyLedNameChanges(DeviceIntPtr dev, * * Handles all of the secondary effects of the changes to the * feedback specified by 'sli' on the device specified by 'dev.' - * + * * If 'changed_maps' specifies any indicators, this function generates * XkbExtensionDeviceNotify events and possibly IndicatorMapNotify * events to report the changes, and recalculates the effective diff --git a/xserver/xkb/xkbPrKeyEv.c b/xserver/xkb/xkbPrKeyEv.c index b24fd6cb7..f7a6b4b14 100644 --- a/xserver/xkb/xkbPrKeyEv.c +++ b/xserver/xkb/xkbPrKeyEv.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/xkbSwap.c b/xserver/xkb/xkbSwap.c index 076da340b..ecec63ee2 100644 --- a/xserver/xkb/xkbSwap.c +++ b/xserver/xkb/xkbSwap.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/xkbUtils.c b/xserver/xkb/xkbUtils.c index c14a790df..6019f0f31 100644 --- a/xserver/xkb/xkbUtils.c +++ b/xserver/xkb/xkbUtils.c @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/xkbfmisc.c b/xserver/xkb/xkbfmisc.c index d96ee4b52..2ecdcd555 100644 --- a/xserver/xkb/xkbfmisc.c +++ b/xserver/xkb/xkbfmisc.c @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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. diff --git a/xserver/xkb/xkbgeom.h b/xserver/xkb/xkbgeom.h index 1999f5c71..5ade436be 100644 --- a/xserver/xkb/xkbgeom.h +++ b/xserver/xkb/xkbgeom.h @@ -6,19 +6,19 @@ software and its documentation for any purpose and without fee is hereby granted, 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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability +Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 +GRAPHICS 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. diff --git a/xserver/xkb/xkbout.c b/xserver/xkb/xkbout.c index 7bb6ceafe..5f77ab01d 100644 --- a/xserver/xkb/xkbout.c +++ b/xserver/xkb/xkbout.c @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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. diff --git a/xserver/xkb/xkbtext.c b/xserver/xkb/xkbtext.c index 308e119f5..419b4cc76 100644 --- a/xserver/xkb/xkbtext.c +++ b/xserver/xkb/xkbtext.c @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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. diff --git a/xserver/xkb/xkmread.c b/xserver/xkb/xkmread.c index b6241b5c7..0b9f0ef6d 100644 --- a/xserver/xkb/xkmread.c +++ b/xserver/xkb/xkmread.c @@ -6,19 +6,19 @@ fee is hereby granted, 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 Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS 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 + GRAPHICS 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.