From eric at anholt.net Wed Oct 1 11:24:06 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 01 Oct 2014 11:24:06 -0700 Subject: [PATCH 3/3] xfree86: Delete file modinit.h In-Reply-To: <1411196861-26958-3-git-send-email-consume.noise@gmail.com> References: <1411196861-26958-1-git-send-email-consume.noise@gmail.com> <1411196861-26958-3-git-send-email-consume.noise@gmail.com> Message-ID: <87lhozbqd5.fsf@eliezer.anholt.net> Daniel Martin writes: > All references to modinit.h have been remove with: > > a1d41e3 Move extension initialisation prototypes into extinit.h > > Signed-off-by: Daniel Martin Reviewed-by: Eric Anholt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From neil at linux.intel.com Wed Oct 1 12:06:54 2014 From: neil at linux.intel.com (Neil Roberts) Date: Wed, 1 Oct 2014 20:06:54 +0100 Subject: [PATCH xserver 0/3] Add support for GLX_ARB_context_flush_control Message-ID: <1412190417-14988-1-git-send-email-neil@linux.intel.com> This adds the server-side parts of GLX_ARB_context_flush_control. The corresponding client-side parts in Mesa are posted to the mesa-dev list here: http://lists.freedesktop.org/archives/mesa-dev/2014-October/068914.html There is also a patch needed for glproto which I will post here too. Apologies if this is not the right place. From neil at linux.intel.com Wed Oct 1 12:06:55 2014 From: neil at linux.intel.com (Neil Roberts) Date: Wed, 1 Oct 2014 20:06:55 +0100 Subject: [PATCH xserver 1/3] glx: Add extension string tracking for GL_ARB_context_flush_control In-Reply-To: <1412190417-14988-1-git-send-email-neil@linux.intel.com> References: <1412190417-14988-1-git-send-email-neil@linux.intel.com> Message-ID: <1412190417-14988-2-git-send-email-neil@linux.intel.com> --- glx/extension_string.c | 1 + glx/extension_string.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/glx/extension_string.c b/glx/extension_string.c index 4bef96f..e881d21 100644 --- a/glx/extension_string.c +++ b/glx/extension_string.c @@ -72,6 +72,7 @@ struct extension_info { static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ /* *INDENT-OFF* */ + { GLX(ARB_context_flush_control), VER(0,0), N, }, { GLX(ARB_create_context), VER(0,0), N, }, { GLX(ARB_create_context_profile), VER(0,0), N, }, { GLX(ARB_create_context_robustness), VER(0,0), N, }, diff --git a/glx/extension_string.h b/glx/extension_string.h index e7d3932..bac7b06 100644 --- a/glx/extension_string.h +++ b/glx/extension_string.h @@ -36,7 +36,8 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ - ARB_create_context_bit = 0, + ARB_context_flush_control_bit = 0, + ARB_create_context_bit, ARB_create_context_profile_bit, ARB_create_context_robustness_bit, ARB_fbconfig_float_bit, -- 1.9.3 From neil at linux.intel.com Wed Oct 1 12:06:56 2014 From: neil at linux.intel.com (Neil Roberts) Date: Wed, 1 Oct 2014 20:06:56 +0100 Subject: [PATCH xserver 2/3] glx: Allow attributes from GLX_ARB_context_flush_control In-Reply-To: <1412190417-14988-1-git-send-email-neil@linux.intel.com> References: <1412190417-14988-1-git-send-email-neil@linux.intel.com> Message-ID: <1412190417-14988-3-git-send-email-neil@linux.intel.com> The commit for adding the reset notification extension (90aa2486e) has a note saying that we can assume that if the underlying provider doesn't support the extension then it will generate BadMatch for these attributes. This patch takes the same approach. --- glx/createcontext.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/glx/createcontext.c b/glx/createcontext.c index cbeddec..be69ac6 100644 --- a/glx/createcontext.c +++ b/glx/createcontext.c @@ -100,6 +100,13 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) */ int reset = GLX_NO_RESET_NOTIFICATION_ARB; + /* The GLX_ARB_context_flush_control spec says: + * + * "The default value of GLX_CONTEXT_RELEASE_BEHAVIOR_ARB is + * GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB". + */ + int release_behavior = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB; + /* The GLX_ARB_create_context_profile spec says: * * "The default value for GLX_CONTEXT_PROFILE_MASK_ARB is @@ -194,6 +201,14 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) break; + case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB: + release_behavior = attribs[2 * i + 1]; + if (release_behavior != GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB + && release_behavior != GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB) + return BadValue; + + break; + default: return BadValue; } -- 1.9.3 From neil at linux.intel.com Wed Oct 1 12:06:57 2014 From: neil at linux.intel.com (Neil Roberts) Date: Wed, 1 Oct 2014 20:06:57 +0100 Subject: [PATCH xserver 3/3] glx/dri2: Enable GLX_ARB_context_flush_control In-Reply-To: <1412190417-14988-1-git-send-email-neil@linux.intel.com> References: <1412190417-14988-1-git-send-email-neil@linux.intel.com> Message-ID: <1412190417-14988-4-git-send-email-neil@linux.intel.com> If the driver supports __DRI2_FLUSH_CONTROL then the GLX_ARB_context_flush_control extension will now be enabled as well. If the flush behavior attribute is passed to glXCreateContextAttribsARB and the driver doesn't support __DRI2_FLUSH_CONTROL then the driver should already generate the correct error values so that the correct GLX errors are generated. The required Mesa version when building with DRI2 support has been bumped up to 10.4.0 so that it can be sure the __DRI2_FLUSH_CONTROL extension is defined. --- configure.ac | 2 +- glx/glxdri2.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 30c0c5c..2a061c3 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,7 +1108,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in yes,yes | auto,yes) AC_DEFINE(DRI2, 1, [Build DRI2 extension]) DRI2=yes - LIBGL="gl >= 9.2.0" + LIBGL="gl >= 10.4.0" SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" ;; esac diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c756bf5..1801a95 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -371,7 +371,8 @@ static Bool dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, const uint32_t *attribs, unsigned *major_ver, unsigned *minor_ver, - uint32_t *flags, int *api, int *reset, unsigned *error) + uint32_t *flags, int *api, int *reset, int *release, + unsigned *error) { unsigned i; @@ -386,6 +387,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, *major_ver = 1; *minor_ver = 0; *reset = __DRI_CTX_RESET_NO_NOTIFICATION; + *release = __DRI_CTX_RELEASE_BEHAVIOR_FLUSH; for (i = 0; i < num_attribs; i++) { switch (attribs[i * 2]) { @@ -434,6 +436,19 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, return False; } break; + case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB: + switch (attribs[i * 2 + 1]) { + case GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB: + *release = __DRI_CTX_RELEASE_BEHAVIOR_NONE; + break; + case GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB: + *release = __DRI_CTX_RELEASE_BEHAVIOR_FLUSH; + break; + default: + *error = BadValue; + return False; + } + break; default: /* If an unknown attribute is received, fail. */ @@ -475,19 +490,20 @@ 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; unsigned minor_ver; uint32_t flags = 0; int reset; + int release; int api = __DRI_API_OPENGL; if (num_attribs != 0) { if (!dri2_convert_glx_attribs(screen, num_attribs, attribs, &major_ver, &minor_ver, - &flags, &api, &reset, + &flags, &api, &reset, &release, (unsigned *) error)) return; @@ -510,6 +526,12 @@ create_driver_context(__GLXDRIcontext * context, __DRI_CTX_ATTRIB_RESET_STRATEGY; ctx_attribs[num_ctx_attribs++] = reset; } + + if (release != __DRI_CTX_RELEASE_BEHAVIOR_FLUSH) { + ctx_attribs[num_ctx_attribs++] = + __DRI_CTX_ATTRIB_RELEASE_BEHAVIOR; + ctx_attribs[num_ctx_attribs++] = release; + } } context->driContext = @@ -919,6 +941,14 @@ initializeExtensions(__GLXDRIscreen * screen) "AIGLX: enabled GLX_ARB_create_context_robustness\n"); } + if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0 && + screen->dri2->base.version >= 3) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_context_flush_control"); + LogMessage(X_INFO, + "AIGLX: enabled GLX_ARB_context_flush_control\n"); + } + /* Ignore unknown extensions */ } } -- 1.9.3 From neil at linux.intel.com Wed Oct 1 12:08:00 2014 From: neil at linux.intel.com (Neil Roberts) Date: Wed, 1 Oct 2014 20:08:00 +0100 Subject: [PATCH glproto] glproto: Add tokens for GLX_ARB_context_flush_control Message-ID: <1412190480-15139-1-git-send-email-neil@linux.intel.com> --- glxtokens.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glxtokens.h b/glxtokens.h index a95082e..68634ee 100644 --- a/glxtokens.h +++ b/glxtokens.h @@ -309,6 +309,14 @@ extern "C" { #define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 #define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + +/* + * GLX_ARB_context_flush_control + */ +#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 + #ifdef __cplusplus } #endif -- 1.9.3 From thellstrom at vmware.com Thu Oct 2 05:39:25 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Thu, 2 Oct 2014 14:39:25 +0200 Subject: [PATCH vmmouse] Back off if we detect a vmmouse kernel driver v2 Message-ID: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect utility doesn't detect a vmmouse if a kernel driver is active. v2: Change the vmmouse kernel device name, fix comment. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul --- configure.ac | 14 +++++++ tools/Makefile.am | 7 +++- tools/vmmouse_detect.c | 5 +++ tools/vmmouse_udev.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 tools/vmmouse_udev.c diff --git a/configure.ac b/configure.ac index ad05504..1197555 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages +libudev_check=yes +AC_ARG_WITH([libudev], + [AS_HELP_STRING([--without-libudev], + [Use to build without libudev on linux])], + [if test x$withval = xno; then libudev_check=no; fi] + []) + +if test x`uname` = xLinux -a $libudev_check = yes; then + PKG_CHECK_MODULES(LIBUDEV, [libudev], + [AC_DEFINE([HAVE_LIBUDEV], 1, + [Has libudev installed])], + []); +fi + PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) PKG_CHECK_EXISTS([xorg-server >= 1.1.0], diff --git a/tools/Makefile.am b/tools/Makefile.am index 8ae5516..a1396ba 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ + @LIBUDEV_LIBS@ + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ + calloutsdir=$(HAL_CALLOUTS_DIR) callouts_SCRIPTS = hal-probe-vmmouse diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c index 7939ff8..b743b2d 100644 --- a/tools/vmmouse_detect.c +++ b/tools/vmmouse_detect.c @@ -34,6 +34,8 @@ #include #include "vmmouse_client.h" +extern int vmmouse_uses_kernel_driver(void); + void segvCB(int sig) { @@ -46,6 +48,9 @@ segvCB(int sig) int main(void) { + if (vmmouse_uses_kernel_driver()) + return 1; + /* * If the vmmouse test is not run in a VMware virtual machine, it * will segfault instead of successfully accessing the port. diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c new file mode 100644 index 0000000..a79c37a --- /dev/null +++ b/tools/vmmouse_udev.c @@ -0,0 +1,100 @@ +/* + * Copyright 2014 by VMware, 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_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_LIBUDEV +#include +#include +#include + +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" + +/** + * vmmouse_uses_kernel_driver - Check whether there's an active + * vmmouse driver in the kernel. + * + * Returns 0 if there was no kernel driver found. + * Returns non-zero on error or if there was an active driver found. + * + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These + * devices are assumed to be active vmmouse drivers. + */ +int vmmouse_uses_kernel_driver(void) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *dev_list_entry; + struct udev_device *dev; + + udev = udev_new(); + if (!udev) + return 1; + + enumerate = udev_enumerate_new(udev); + if (udev_enumerate_add_match_subsystem(enumerate, "input")) + goto out_early_err; + if (udev_enumerate_scan_devices(enumerate)) + goto out_early_err; + devices = udev_enumerate_get_list_entry(enumerate); + + udev_list_entry_foreach(dev_list_entry, devices) { + const char *path, *name; + + path = udev_list_entry_get_name(dev_list_entry); + dev = udev_device_new_from_syspath(udev, path); + if (!dev) + goto out_late_err; + name = udev_device_get_sysattr_value(dev, "name"); + if (name && !strcasecmp(name, KERNEL_DEVNAME)) + goto out_found; + + udev_device_unref(dev); + } + + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 0; + + out_found: + out_late_err: + udev_device_unref(dev); + out_early_err: + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 1; +} +#else +int vmmouse_uses_kernel_driver(void) +{ + return 0; +} +#endif -- 1.8.3.2 From hdegoede at redhat.com Thu Oct 2 05:42:12 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Thu, 02 Oct 2014 14:42:12 +0200 Subject: [PATCH vmmouse] Back off if we detect a vmmouse kernel driver v2 In-Reply-To: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> References: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> Message-ID: <542D4824.4050108@redhat.com> Hi, On 10/02/2014 02:39 PM, Thomas Hellstrom wrote: > If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg > evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect > utility doesn't detect a vmmouse if a kernel driver is active. > > v2: Change the vmmouse kernel device name, fix comment. > > Signed-off-by: Thomas Hellstrom > Reviewed-by: Brian Paul Looks good: Reviewed-by: Hans de Goede Regards, Hans > --- > configure.ac | 14 +++++++ > tools/Makefile.am | 7 +++- > tools/vmmouse_detect.c | 5 +++ > tools/vmmouse_udev.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 124 insertions(+), 2 deletions(-) > create mode 100644 tools/vmmouse_udev.c > > diff --git a/configure.ac b/configure.ac > index ad05504..1197555 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) > XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) > > # Checks for pkg-config packages > +libudev_check=yes > +AC_ARG_WITH([libudev], > + [AS_HELP_STRING([--without-libudev], > + [Use to build without libudev on linux])], > + [if test x$withval = xno; then libudev_check=no; fi] > + []) > + > +if test x`uname` = xLinux -a $libudev_check = yes; then > + PKG_CHECK_MODULES(LIBUDEV, [libudev], > + [AC_DEFINE([HAVE_LIBUDEV], 1, > + [Has libudev installed])], > + []); > +fi > + > PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) > > PKG_CHECK_EXISTS([xorg-server >= 1.1.0], > diff --git a/tools/Makefile.am b/tools/Makefile.am > index 8ae5516..a1396ba 100644 > --- a/tools/Makefile.am > +++ b/tools/Makefile.am > @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect > > AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) > > - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c > - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la > + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c > + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ > + @LIBUDEV_LIBS@ > + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ > + > > calloutsdir=$(HAL_CALLOUTS_DIR) > callouts_SCRIPTS = hal-probe-vmmouse > diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c > index 7939ff8..b743b2d 100644 > --- a/tools/vmmouse_detect.c > +++ b/tools/vmmouse_detect.c > @@ -34,6 +34,8 @@ > #include > #include "vmmouse_client.h" > > +extern int vmmouse_uses_kernel_driver(void); > + > void > segvCB(int sig) > { > @@ -46,6 +48,9 @@ segvCB(int sig) > int > main(void) > { > + if (vmmouse_uses_kernel_driver()) > + return 1; > + > /* > * If the vmmouse test is not run in a VMware virtual machine, it > * will segfault instead of successfully accessing the port. > diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c > new file mode 100644 > index 0000000..a79c37a > --- /dev/null > +++ b/tools/vmmouse_udev.c > @@ -0,0 +1,100 @@ > +/* > + * Copyright 2014 by VMware, 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_CONFIG_H > +#include "config.h" > +#endif > + > +#ifdef HAVE_LIBUDEV > +#include > +#include > +#include > + > +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" > + > +/** > + * vmmouse_uses_kernel_driver - Check whether there's an active > + * vmmouse driver in the kernel. > + * > + * Returns 0 if there was no kernel driver found. > + * Returns non-zero on error or if there was an active driver found. > + * > + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These > + * devices are assumed to be active vmmouse drivers. > + */ > +int vmmouse_uses_kernel_driver(void) > +{ > + struct udev *udev; > + struct udev_enumerate *enumerate; > + struct udev_list_entry *devices, *dev_list_entry; > + struct udev_device *dev; > + > + udev = udev_new(); > + if (!udev) > + return 1; > + > + enumerate = udev_enumerate_new(udev); > + if (udev_enumerate_add_match_subsystem(enumerate, "input")) > + goto out_early_err; > + if (udev_enumerate_scan_devices(enumerate)) > + goto out_early_err; > + devices = udev_enumerate_get_list_entry(enumerate); > + > + udev_list_entry_foreach(dev_list_entry, devices) { > + const char *path, *name; > + > + path = udev_list_entry_get_name(dev_list_entry); > + dev = udev_device_new_from_syspath(udev, path); > + if (!dev) > + goto out_late_err; > + name = udev_device_get_sysattr_value(dev, "name"); > + if (name && !strcasecmp(name, KERNEL_DEVNAME)) > + goto out_found; > + > + udev_device_unref(dev); > + } > + > + udev_enumerate_unref(enumerate); > + udev_unref(udev); > + > + return 0; > + > + out_found: > + out_late_err: > + udev_device_unref(dev); > + out_early_err: > + udev_enumerate_unref(enumerate); > + udev_unref(udev); > + > + return 1; > +} > +#else > +int vmmouse_uses_kernel_driver(void) > +{ > + return 0; > +} > +#endif > From thellstrom at vmware.com Thu Oct 2 07:05:21 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Thu, 2 Oct 2014 16:05:21 +0200 Subject: [PATCH vmmouse] Back off if we detect a vmmouse kernel driver v2 In-Reply-To: <542D4824.4050108@redhat.com> References: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> <542D4824.4050108@redhat.com> Message-ID: <542D5BA1.4050005@vmware.com> On 10/02/2014 02:42 PM, Hans de Goede wrote: > Hi, > > On 10/02/2014 02:39 PM, Thomas Hellstrom wrote: >> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg >> evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect >> utility doesn't detect a vmmouse if a kernel driver is active. >> >> v2: Change the vmmouse kernel device name, fix comment. >> >> Signed-off-by: Thomas Hellstrom >> Reviewed-by: Brian Paul > Looks good: > > Reviewed-by: Hans de Goede > > Regards, > > Hans Thanks for reviewing. As Brian correctly points out there are some missing libudev error checks that I need to fix. /Thomas > >> --- >> configure.ac | 14 +++++++ >> tools/Makefile.am | 7 +++- >> tools/vmmouse_detect.c | 5 +++ >> tools/vmmouse_udev.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ >> 4 files changed, 124 insertions(+), 2 deletions(-) >> create mode 100644 tools/vmmouse_udev.c >> >> diff --git a/configure.ac b/configure.ac >> index ad05504..1197555 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) >> XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) >> >> # Checks for pkg-config packages >> +libudev_check=yes >> +AC_ARG_WITH([libudev], >> + [AS_HELP_STRING([--without-libudev], >> + [Use to build without libudev on linux])], >> + [if test x$withval = xno; then libudev_check=no; fi] >> + []) >> + >> +if test x`uname` = xLinux -a $libudev_check = yes; then >> + PKG_CHECK_MODULES(LIBUDEV, [libudev], >> + [AC_DEFINE([HAVE_LIBUDEV], 1, >> + [Has libudev installed])], >> + []); >> +fi >> + >> PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) >> >> PKG_CHECK_EXISTS([xorg-server >= 1.1.0], >> diff --git a/tools/Makefile.am b/tools/Makefile.am >> index 8ae5516..a1396ba 100644 >> --- a/tools/Makefile.am >> +++ b/tools/Makefile.am >> @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect >> >> AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) >> >> - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c >> - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la >> + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c >> + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ >> + @LIBUDEV_LIBS@ >> + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ >> + >> >> calloutsdir=$(HAL_CALLOUTS_DIR) >> callouts_SCRIPTS = hal-probe-vmmouse >> diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c >> index 7939ff8..b743b2d 100644 >> --- a/tools/vmmouse_detect.c >> +++ b/tools/vmmouse_detect.c >> @@ -34,6 +34,8 @@ >> #include >> #include "vmmouse_client.h" >> >> +extern int vmmouse_uses_kernel_driver(void); >> + >> void >> segvCB(int sig) >> { >> @@ -46,6 +48,9 @@ segvCB(int sig) >> int >> main(void) >> { >> + if (vmmouse_uses_kernel_driver()) >> + return 1; >> + >> /* >> * If the vmmouse test is not run in a VMware virtual machine, it >> * will segfault instead of successfully accessing the port. >> diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c >> new file mode 100644 >> index 0000000..a79c37a >> --- /dev/null >> +++ b/tools/vmmouse_udev.c >> @@ -0,0 +1,100 @@ >> +/* >> + * Copyright 2014 by VMware, 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_CONFIG_H >> +#include "config.h" >> +#endif >> + >> +#ifdef HAVE_LIBUDEV >> +#include >> +#include >> +#include >> + >> +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" >> + >> +/** >> + * vmmouse_uses_kernel_driver - Check whether there's an active >> + * vmmouse driver in the kernel. >> + * >> + * Returns 0 if there was no kernel driver found. >> + * Returns non-zero on error or if there was an active driver found. >> + * >> + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These >> + * devices are assumed to be active vmmouse drivers. >> + */ >> +int vmmouse_uses_kernel_driver(void) >> +{ >> + struct udev *udev; >> + struct udev_enumerate *enumerate; >> + struct udev_list_entry *devices, *dev_list_entry; >> + struct udev_device *dev; >> + >> + udev = udev_new(); >> + if (!udev) >> + return 1; >> + >> + enumerate = udev_enumerate_new(udev); >> + if (udev_enumerate_add_match_subsystem(enumerate, "input")) >> + goto out_early_err; >> + if (udev_enumerate_scan_devices(enumerate)) >> + goto out_early_err; >> + devices = udev_enumerate_get_list_entry(enumerate); >> + >> + udev_list_entry_foreach(dev_list_entry, devices) { >> + const char *path, *name; >> + >> + path = udev_list_entry_get_name(dev_list_entry); >> + dev = udev_device_new_from_syspath(udev, path); >> + if (!dev) >> + goto out_late_err; >> + name = udev_device_get_sysattr_value(dev, "name"); >> + if (name && !strcasecmp(name, KERNEL_DEVNAME)) >> + goto out_found; >> + >> + udev_device_unref(dev); >> + } >> + >> + udev_enumerate_unref(enumerate); >> + udev_unref(udev); >> + >> + return 0; >> + >> + out_found: >> + out_late_err: >> + udev_device_unref(dev); >> + out_early_err: >> + udev_enumerate_unref(enumerate); >> + udev_unref(udev); >> + >> + return 1; >> +} >> +#else >> +int vmmouse_uses_kernel_driver(void) >> +{ >> + return 0; >> +} >> +#endif >> > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: https://urldefense.proofpoint.com/v1/url?u=http://lists.x.org/archives/xorg-devel&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=l5Ago9ekmVFZ3c4M6eauqrJWGwjf6fTb%2BP3CxbBFkVM%3D%0A&m=LGREtk6G1AfFuwJ%2F3P0DuNOOrtFH%2BOPVux3RzzVcRgs%3D%0A&s=0a8a07472e2859da37834d584be733b97f8778eafa8c1bbe5cba735f9c80af17 > Info: https://urldefense.proofpoint.com/v1/url?u=http://lists.x.org/mailman/listinfo/xorg-devel&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=l5Ago9ekmVFZ3c4M6eauqrJWGwjf6fTb%2BP3CxbBFkVM%3D%0A&m=LGREtk6G1AfFuwJ%2F3P0DuNOOrtFH%2BOPVux3RzzVcRgs%3D%0A&s=85ca02eaba04281a0388a5a0b3d88804370f9ed0a03bb4d4ea37cec7c26397a9 From wallbraker at gmail.com Thu Oct 2 07:40:45 2014 From: wallbraker at gmail.com (Jakob Bornecrantz) Date: Thu, 2 Oct 2014 16:40:45 +0200 Subject: [PATCH vmmouse] Back off if we detect a vmmouse kernel driver v2 In-Reply-To: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> References: <1412253565-3637-1-git-send-email-thellstrom@vmware.com> Message-ID: On Thu, Oct 2, 2014 at 2:39 PM, Thomas Hellstrom wrote: > If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg > evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect > utility doesn't detect a vmmouse if a kernel driver is active. > > v2: Change the vmmouse kernel device name, fix comment. > > Signed-off-by: Thomas Hellstrom > Reviewed-by: Brian Paul > --- > configure.ac | 14 +++++++ > tools/Makefile.am | 7 +++- > tools/vmmouse_detect.c | 5 +++ > tools/vmmouse_udev.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 124 insertions(+), 2 deletions(-) > create mode 100644 tools/vmmouse_udev.c Reviewed-by: Jakob Bornecrantz Cheers, Jakob. > > diff --git a/configure.ac b/configure.ac > index ad05504..1197555 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) > XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) > > # Checks for pkg-config packages > +libudev_check=yes > +AC_ARG_WITH([libudev], > + [AS_HELP_STRING([--without-libudev], > + [Use to build without libudev on linux])], > + [if test x$withval = xno; then libudev_check=no; fi] > + []) > + > +if test x`uname` = xLinux -a $libudev_check = yes; then > + PKG_CHECK_MODULES(LIBUDEV, [libudev], > + [AC_DEFINE([HAVE_LIBUDEV], 1, > + [Has libudev installed])], > + []); > +fi > + > PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) > > PKG_CHECK_EXISTS([xorg-server >= 1.1.0], > diff --git a/tools/Makefile.am b/tools/Makefile.am > index 8ae5516..a1396ba 100644 > --- a/tools/Makefile.am > +++ b/tools/Makefile.am > @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect > > AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) > > - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c > - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la > + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c > + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ > + @LIBUDEV_LIBS@ > + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ > + > > calloutsdir=$(HAL_CALLOUTS_DIR) > callouts_SCRIPTS = hal-probe-vmmouse > diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c > index 7939ff8..b743b2d 100644 > --- a/tools/vmmouse_detect.c > +++ b/tools/vmmouse_detect.c > @@ -34,6 +34,8 @@ > #include > #include "vmmouse_client.h" > > +extern int vmmouse_uses_kernel_driver(void); > + > void > segvCB(int sig) > { > @@ -46,6 +48,9 @@ segvCB(int sig) > int > main(void) > { > + if (vmmouse_uses_kernel_driver()) > + return 1; > + > /* > * If the vmmouse test is not run in a VMware virtual machine, it > * will segfault instead of successfully accessing the port. > diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c > new file mode 100644 > index 0000000..a79c37a > --- /dev/null > +++ b/tools/vmmouse_udev.c > @@ -0,0 +1,100 @@ > +/* > + * Copyright 2014 by VMware, 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_CONFIG_H > +#include "config.h" > +#endif > + > +#ifdef HAVE_LIBUDEV > +#include > +#include > +#include > + > +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" > + > +/** > + * vmmouse_uses_kernel_driver - Check whether there's an active > + * vmmouse driver in the kernel. > + * > + * Returns 0 if there was no kernel driver found. > + * Returns non-zero on error or if there was an active driver found. > + * > + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These > + * devices are assumed to be active vmmouse drivers. > + */ > +int vmmouse_uses_kernel_driver(void) > +{ > + struct udev *udev; > + struct udev_enumerate *enumerate; > + struct udev_list_entry *devices, *dev_list_entry; > + struct udev_device *dev; > + > + udev = udev_new(); > + if (!udev) > + return 1; > + > + enumerate = udev_enumerate_new(udev); > + if (udev_enumerate_add_match_subsystem(enumerate, "input")) > + goto out_early_err; > + if (udev_enumerate_scan_devices(enumerate)) > + goto out_early_err; > + devices = udev_enumerate_get_list_entry(enumerate); > + > + udev_list_entry_foreach(dev_list_entry, devices) { > + const char *path, *name; > + > + path = udev_list_entry_get_name(dev_list_entry); > + dev = udev_device_new_from_syspath(udev, path); > + if (!dev) > + goto out_late_err; > + name = udev_device_get_sysattr_value(dev, "name"); > + if (name && !strcasecmp(name, KERNEL_DEVNAME)) > + goto out_found; > + > + udev_device_unref(dev); > + } > + > + udev_enumerate_unref(enumerate); > + udev_unref(udev); > + > + return 0; > + > + out_found: > + out_late_err: > + udev_device_unref(dev); > + out_early_err: > + udev_enumerate_unref(enumerate); > + udev_unref(udev); > + > + return 1; > +} > +#else > +int vmmouse_uses_kernel_driver(void) > +{ > + return 0; > +} > +#endif > -- > 1.8.3.2 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From swestrup at gmail.com Thu Oct 2 09:38:29 2014 From: swestrup at gmail.com (Stirling Westrup) Date: Thu, 2 Oct 2014 12:38:29 -0400 Subject: Can't hook into the Double Buffer extension. In-Reply-To: <1410878514.9541.9.camel@dmt> References: <1410878514.9541.9.camel@dmt> Message-ID: On Tue, Sep 16, 2014 at 10:41 AM, Adam Jackson wrote: > On Fri, 2014-09-12 at 14:59 -0400, Stirling Westrup wrote: > > I am writing a video driver for which I'd like to support the Double > > Buffer Extension. However I need to hook some of the calling functions > > described xorg/dbestruct.h, especially 'AllocateBackBuffer' and > > 'SwapBuffers'. > > You found an app that uses it? Impressive. > Not so surprising. I wrote the app. Basically we're trying to get frame-perfect synchronization across 16 instantiations of Xorg, all running on one server and talking via USB to 16 zero clients. Its a software-based video wall, and it works decently well. Alas the zero clients don't have either GL or DRI support, so I'm having to go old school with what extensions I use. The plan was to use the X Synchronization library and the DBE to time the frame changes in the video wall, but both of these have API issues and would need patches. (You can't currently create a new class of clock for X Sync). At the moment, yeah. Not so much out of malice as neglect, the > extension is not widely used and none of the open (or closed!) drivers > attempts to support it specially. I wouldn't object to a patch, > although I'd at least like to see it done with accessor functions that > return the window/screen private pointer rather than by exporting the > private keys. > That would be my approach as well, were I to write a patch. Currently the 'improved frame sync' feature for our wall is on hold due to more critical issues in our product which have recently turned up. When we get back to it, I'll submit some patches for X Sync and DBE. > Ideally we'd do what the GLX spec says and unify the view of "the back > buffer" across extensions, which I guess could include DRI3 at this > point. > I'm not very much up on either the GLX or DRI specs, so I'm not sure how that would affect the design of the interfaces. -- Stirling Westrup Programmer, Entrepreneur. https://www.linkedin.com/e/fpf/77228 http://www.linkedin.com/in/swestrup http://technaut.livejournal.com http://sourceforge.net/users/stirlingwestrup -------------- next part -------------- An HTML attachment was scrubbed... URL: From keithp at keithp.com Thu Oct 2 10:22:26 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 02 Oct 2014 10:22:26 -0700 Subject: [PATCH 3/3] xfree86: Delete file modinit.h In-Reply-To: <20140929055845.GA25535@unplugged.fritz.box> References: <1411196861-26958-1-git-send-email-consume.noise@gmail.com> <1411196861-26958-3-git-send-email-consume.noise@gmail.com> <20140929055845.GA25535@unplugged.fritz.box> Message-ID: <86iok2mlnx.fsf@hiro.keithp.com> Daniel Martin writes: > On Sat, Sep 20, 2014 at 09:07:41AM +0200, Daniel Martin wrote: >> All references to modinit.h have been remove with: >> >> a1d41e3 Move extension initialisation prototypes into extinit.h >> >> Signed-off-by: Daniel Martin All three of these are merged. d3d845c..b3e9791 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 2 10:23:36 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 02 Oct 2014 10:23:36 -0700 Subject: [PATCH] Fix present_pixmap when using present_notify_msc In-Reply-To: <1411852633-4457-1-git-send-email-axel.davy@ens.fr> References: <1411852633-4457-1-git-send-email-axel.davy@ens.fr> Message-ID: <86fvf6mllz.fsf@hiro.keithp.com> Axel Davy writes: > Calling present_notify_msc could cancel a pending pixmap presentation. > > Signed-off-by: Axel Davy Merged. b3e9791..9bc01df master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 2 10:30:23 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 02 Oct 2014 10:30:23 -0700 Subject: [PULL] Dead code cleanups In-Reply-To: <1411759821.20066.12.camel@dmt> References: <1411759821.20066.12.camel@dmt> Message-ID: <86d2aamlao.fsf@hiro.keithp.com> Adam Jackson writes: > Adam Jackson (12): > loader: Deobfuscate RTLD_* macro stuff > mi: Remove Windows 8-bpp colormap compatibility > xfree86: Remove xv clip notify driver hook > xfree86: Remove Option "TextClockFreq" > xfree86: Remove spurious xf86ConfigError > xfree86: Remove useless back-pointer to pScrn from colormap code > xfree86: Remove DisplayID support > xfree86: Remove xf86Info.log (v2) > xfree86: Remove unused xf86Info.useDefaultFontPathFrom > xfree86: configServerFlags never fails, make it return void > xfree86: Remove pointless xf86PrintMarkers > x86emu: Undefine _NO_INLINE I added another patch which removed the last 'return FALSE' from configServerFlags, otherwise, this is all merged. 9bc01df..95a5b92 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 2 16:25:18 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 02 Oct 2014 16:25:18 -0700 Subject: [PATCH 18/19] xfree86: Remove driver entity hooks and private In-Reply-To: <1412092387.2407.18.camel@dmt> References: <1411666655-1089-1-git-send-email-ajax@redhat.com> <1411666655-1089-19-git-send-email-ajax@redhat.com> <201409252125.s8PLPPSe028925@glazunov.sibelius.xs4all.nl> <86ppeep2y5.fsf@hiro.keithp.com> <1412092387.2407.18.camel@dmt> Message-ID: <86vbo2kqap.fsf@hiro.keithp.com> Adam Jackson writes: > Can we consider coming up with a heuristic for the oldest server version > that current git versions of drivers will continue to support? The > amount of #ifdef in the drivers is getting a bit absurd, and it's a bit > disingenuous to pretend our support goes back as far as we currently let > build. The question is back porting support for new hardware to old distros; that's generally easier done by taking the new driver and compiling it with the old X server bits than by back-porting hardware support into the old driver. For a driver using KMS and Glamor, it might not actually matter all that much as the hardware-specific code in the driver heads to zero. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 2 17:08:41 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 2 Oct 2014 17:08:41 -0700 Subject: [PATCH] Use unique display name for each xi2 test program [v2] In-Reply-To: <1411539599-6042-2-git-send-email-alan.coopersmith@oracle.com> References: <1411539599-6042-2-git-send-email-alan.coopersmith@oracle.com> Message-ID: <1412294921-5018-1-git-send-email-keithp@keithp.com> From: Alan Coopersmith 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. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard --- configure.ac | 4 +++- include/dix-config.h.in | 7 +++++++ test/xi2/protocol-common.c | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 30c0c5c..baaee1d 100644 --- a/configure.ac +++ b/configure.ac @@ -217,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_name], [], [], [[#include ]]) + dnl Find the math libary, then check for cbrt function in it. AC_CHECK_LIB(m, sqrt) AC_CHECK_FUNCS([cbrt]) diff --git a/include/dix-config.h.in b/include/dix-config.h.in index f170c1c..7077cbc 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -72,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_name', and + to 0 if you don't. */ +#undef HAVE_DECL_PROGRAM_INVOCATION_NAME + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -100,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 diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index 64a5777..1f37b57 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" @@ -139,6 +140,22 @@ init_devices(void) 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_NAME + display = program_invocation_name; + if (display) { + char *slash = strrchr(display, '/'); + if (slash) + display = slash + 1; + } +#endif + client = init_client(0, NULL); AllocDevicePair(&client, "Virtual core", &local_devices.vcp, &local_devices.vck, -- 2.1.1 From alan.coopersmith at oracle.com Thu Oct 2 17:17:26 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 02 Oct 2014 17:17:26 -0700 Subject: [PATCH] Use unique display name for each xi2 test program [v2] In-Reply-To: <1412294921-5018-1-git-send-email-keithp@keithp.com> References: <1411539599-6042-2-git-send-email-alan.coopersmith@oracle.com> <1412294921-5018-1-git-send-email-keithp@keithp.com> Message-ID: <542DEB16.3040503@oracle.com> On 10/ 2/14 05:08 PM, Keith Packard wrote: > From: Alan Coopersmith > > 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. http://man7.org/linux/man-pages/man3/program_invocation_name.3.html suggests that simply using program_invocation_short_name instead takes care of reducing to the basename for you. (As getprogname() does on Solaris & BSD.) Otherwise, whatever works for you on Linux is fine with me. -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From libv at skynet.be Thu Oct 2 10:44:57 2014 From: libv at skynet.be (Luc Verhaegen) Date: Thu, 2 Oct 2014 19:44:57 +0200 Subject: FOSDEM15: Graphics DevRoom: call for speakers. Message-ID: <20141002174457.GA11725@skynet.be> Hi, At FOSDEM on the 31st of january and the 1st of February 2015, there will be another graphics DevRoom. URL: https://fosdem.org/2015/ The focus of this DevRoom is of course the same as last year, namely: * Graphics drivers: from display to media to 3d drivers, both in kernel or userspace. Be it part of DRM, KMS, (direct)FB, V4L, Xorg, Mesa... * Input drivers: kernel and userspace. * Windowing systems: X, Wayland, Mir, directFB, ... * Even colour management and other areas which i might have overlooked above are accepted. Slots are 50 minutes long, and scheduled hourly. This partly to avoid confusion and people running all over the place all the time. As a speaker, you do not have to fill your whole hour, gaps are never wasted time. Slots will be handed out on a first come, first serve basis. The best slots will go to those who apply the earliest. The amount of slots is currently not known yet, but i expect there to be around 16 available (8 on each day), so act quickly. Talk Submission: ---------------- Like last year, the pentabarf system will be used for talk submission. It is not perfect from a devroom organizer and talk submitters usability point-of-view, but the fosdem organizers are working on it. It is however workable and it ended up working out pretty well last year. https://penta.fosdem.org/submission/FOSDEM15 Remember that FOSDEM is not like XDC, it's not some 50 odd people meeting with a sliding schedule which only gets filled out on the last day. Upwards of 8000 people are visiting this event, and most of them get a printed booklet or use the schedule on the FOSDEM website or an app for their phone to figure out what to watch or participate in next. So please put some effort in your talk submission and details. Since this an open source community event, please refrain from turning in a talk that is a pure corporate or product commercial. Also, if you are unsure on whether you can come or not (this is FOSDEM, why are you not there anyway?), please wait with submitting your talk. Submitting a talk and then not turning up because you could not be bothered is a sure-fire way to get larted and then to never be allowed to talk again. As for deadlines, i hope to have a pretty much complete schedule between christmas and the new year. The rockhard printed schedule deadline is probably January 9th, after that you will not be featured in the booklet and you will have a lot less visitors. I will hopefully be able to lock down entries and descriptions after that date. Don't count on this deadline: first come first serve! There are perhaps only 16 slots. And the worst slots will be assigned to those who come last. Do you really want to talk on saturday at 10:00 when people are still in zombie mode after the beer event, if they are there at all? Use your account from last year, so you can try to recycle some of your data from last year. If you have forgotten your password, then you can reset it here: https://penta.fosdem.org/user/forgot_password Necessary information: ---------------------- Below is a list of what i need to see filled in when you apply for a devroom before i consider it a valid submission. Remember: first come, first serve. The best slots are for the earliest submissions and there are only around 16 slots. On your personal page: * General: * First and last name * Nickname * Image * Contact: * email * mobile number (this is a very hard requirement as there will be no other reliable form of emergency communication on the day) * Description: * Abstract * Description Create an event: * On the General page: * Event title * Event subtitle. * Track: Graphics Devroom * Event type: Lecture (talk) or Meeting (BoF) * Persons: * Add yourself as speaker. * Description: * Abstract: * Full Description * Links: * Add relevant links. Everything else can be ignored or will be filled in by me or the FOSDEM organizers. That's about it. Hope to see you all at FOSDEM :) Luc Verhaegen. From check.nyah at gmail.com Fri Oct 3 02:25:55 2014 From: check.nyah at gmail.com (Check Nyah) Date: Fri, 3 Oct 2014 10:25:55 +0100 Subject: Problem buidling Xserver with Xephyr Message-ID: Hello, I've been running this command to build the Xserver with Xephyr but I can't find Xephyr in the ./hw/kdrive/ephyr/ directory. All I can see is .deps/ and man/ I run this : [xorg-xserver]:$./autogen.sh --without-dtrace --enable-xephyr --enable-kdrive --enable-xfake --enable-xfbdev --enable-kdrive-kbd --enable-kdrive-mouse --enable-kdrive-evdev --enable-glx-tls --with-xkb-bin-directory=/usr/bin --with-xkb-path=/usr/share/X11/xkb;make checked the configure.log and Xephyr is enabled. I don't understand what can cause this. Can someone please help me out here? Cheers! Nyah -- Compilers can produce warnings - make the compiler programmers happy: Use them! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.coopersmith at oracle.com Fri Oct 3 08:39:04 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Fri, 03 Oct 2014 08:39:04 -0700 Subject: Problem buidling Xserver with Xephyr In-Reply-To: References: Message-ID: <542EC318.3050803@oracle.com> On 10/ 3/14 02:25 AM, Check Nyah wrote: > > Hello, > > I've been running this command to build the Xserver with Xephyr but I can't find > Xephyr in the ./hw/kdrive/ephyr/ directory. All I can see is .deps/ and man/ > > > I run this : > [xorg-xserver]:$./autogen.sh --without-dtrace --enable-xephyr --enable-kdrive > --enable-xfake --enable-xfbdev --enable-kdrive-kbd --enable-kdrive-mouse > --enable-kdrive-evdev --enable-glx-tls --with-xkb-bin-directory=/usr/bin > --with-xkb-path=/usr/share/X11/xkb;make > > checked the configure.log and Xephyr is enabled. I don't understand what can > cause this. Can someone please help me out here? Have you logged the make output to a file and looked through it for errors? Does it try building anything in hw/kdrive/ephyr and fail? Or does it fail somewhere earlier in the build before it gets that far? -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From check.nyah at gmail.com Fri Oct 3 14:27:47 2014 From: check.nyah at gmail.com (Check Nyah) Date: Fri, 3 Oct 2014 22:27:47 +0100 Subject: Problem buidling Xserver with Xephyr In-Reply-To: <542EC318.3050803@oracle.com> References: <542EC318.3050803@oracle.com> Message-ID: Hello, >Have you logged the make output to a file and looked through it for errors? > Does it try building anything in hw/kdrive/ephyr and fail? > Or does it fail somewhere earlier in the build before it gets that far? > > Here is my log: http://paste.kde.org/pourgbweb It seems ephyr directory is not built. Don't understand why make skips the directory. Giving it another look. Cheers! Nyah -- Compilers can produce warnings - make the compiler programmers happy: Use them! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.coopersmith at oracle.com Fri Oct 3 16:44:08 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Fri, 03 Oct 2014 16:44:08 -0700 Subject: Problem buidling Xserver with Xephyr In-Reply-To: References: <542EC318.3050803@oracle.com> Message-ID: <542F34C8.6000806@oracle.com> On 10/ 3/14 02:27 PM, Check Nyah wrote: > > Hello, > > >Have you logged the make output to a file and looked through it for errors? > > Does it try building anything in hw/kdrive/ephyr and fail? > Or does it fail somewhere earlier in the build before it gets that far? > > > Here is my log: http://paste.kde.org/pourgbweb > > It seems ephyr directory is not built. Don't understand why make skips the > directory. Giving it another look. It didn't go into hw/kdrive, which suggests that configure decided you couldn't build kdrive for some reason. Check your configure output and config.log for clues. -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From crazycasta at gmail.com Fri Oct 3 14:41:38 2014 From: crazycasta at gmail.com (Alex Orange) Date: Fri, 3 Oct 2014 15:41:38 -0600 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. Message-ID: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said patch does indeed remove the problematic writes to bad memory, however it also introduces errors in the algoritm. This patch has the effect of reverting said patch and adding an if in the proper location to catch the out of bounds memory write without causing problems to the overall algorithm. Signed-off-by: Alex Orange --- fb/fbseg.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fb/fbseg.c b/fb/fbseg.c index 1848387..16e0426 100644 --- a/fb/fbseg.c +++ b/fb/fbseg.c @@ -65,12 +65,6 @@ fbBresSolid(DrawablePtr pDrawable, if (axis == X_AXIS) { bits = 0; while (len--) { - if (e >= 0) { - WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits)); - bits = 0; - dst += dstStride; - e += e3; - } bits |= mask; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { @@ -80,12 +74,23 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } e += e1; + if (e >= 0) { + if (bits) { + WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits)); + bits = 0; + } + dst += dstStride; + e += e3; + } } if (bits) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); } else { while (len--) { + WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); + dst += dstStride; + e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, signdx, dstBpp); @@ -94,9 +99,6 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } } - WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); - dst += dstStride; - e += e1; } } -- 1.8.5.5 From chris at chris-wilson.co.uk Sun Oct 5 00:06:31 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Sun, 5 Oct 2014 08:06:31 +0100 Subject: [PATCH] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails Message-ID: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> I was looking at a bug report today of intel/ati prime and noticed a number of sna_share_pixmap_backing() failures (called from DRI2UpdatePrime). These were failing as the request was for the scanout buffer (which is tiled and so we refuse to share it, and since it is already on the scanout we refuse to change tiling). But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, the copy is aborted and the update lost. If the copy is made to the normal window drawable is that enough for it to be propagated back through damage tracking? --- src/radeon_dri2.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 9a9918b..0d113b9 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -409,26 +409,27 @@ radeon_dri2_copy_region2(ScreenPtr pScreen, dst_drawable = &dst_private->pixmap->drawable; if (src_private->attachment == DRI2BufferFrontLeft) { + src_drawable = NULL; #ifdef USE_DRI2_PRIME - if (drawable->pScreen != pScreen) { + if (drawable->pScreen != pScreen) src_drawable = DRI2UpdatePrime(drawable, src_buffer); - if (!src_drawable) - return; - } else #endif + if (src_drawable == NULL) src_drawable = drawable; } if (dst_private->attachment == DRI2BufferFrontLeft) { + dst_drawable = NULL; #ifdef USE_DRI2_PRIME if (drawable->pScreen != pScreen) { dst_drawable = DRI2UpdatePrime(drawable, dest_buffer); - if (!dst_drawable) - return; - dst_ppix = (PixmapPtr)dst_drawable; - if (dst_drawable != drawable) - translate = TRUE; - } else + if (dst_drawable) { + dst_ppix = (PixmapPtr)dst_drawable; + if (dst_drawable != drawable) + translate = TRUE; + } + } #endif + if (dst_drawable == NULL) dst_drawable = drawable; } -- 2.1.1 From michel at daenzer.net Sun Oct 5 19:04:51 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Mon, 06 Oct 2014 11:04:51 +0900 Subject: [PATCH] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails In-Reply-To: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> References: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> Message-ID: <5431F8C3.2040000@daenzer.net> On 05.10.2014 16:06, Chris Wilson wrote: > I was looking at a bug report today of intel/ati prime and noticed a > number of sna_share_pixmap_backing() failures (called from > DRI2UpdatePrime). These were failing as the request was for the scanout > buffer (which is tiled and so we refuse to share it, and since it is > already on the scanout we refuse to change tiling). > > But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, > the copy is aborted and the update lost. If the copy is made to the > normal window drawable is that enough for it to be propagated back > through damage tracking? Have you asked the reporter of that bug to test your patch? -- Earthling Michel D?nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From chris at chris-wilson.co.uk Sun Oct 5 23:39:07 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Mon, 6 Oct 2014 07:39:07 +0100 Subject: [PATCH] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails In-Reply-To: <5431F8C3.2040000@daenzer.net> References: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> <5431F8C3.2040000@daenzer.net> Message-ID: <20141006063907.GB31284@nuc-i3427.alporthouse.com> On Mon, Oct 06, 2014 at 11:04:51AM +0900, Michel D?nzer wrote: > On 05.10.2014 16:06, Chris Wilson wrote: > >I was looking at a bug report today of intel/ati prime and noticed a > >number of sna_share_pixmap_backing() failures (called from > >DRI2UpdatePrime). These were failing as the request was for the scanout > >buffer (which is tiled and so we refuse to share it, and since it is > >already on the scanout we refuse to change tiling). > > > >But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, > >the copy is aborted and the update lost. If the copy is made to the > >normal window drawable is that enough for it to be propagated back > >through damage tracking? > > Have you asked the reporter of that bug to test your patch? They didn't notice the issue, presumably because it only happens quite early in the DE startup. However, I do remember Dave mentioning what seemed to be a similar issue: a peristent blank window. Hence the inquisitive nature of the patch. -Chris -- Chris Wilson, Intel Open Source Technology Centre From mike at fireburn.co.uk Mon Oct 6 00:37:21 2014 From: mike at fireburn.co.uk (Mike Lothian) Date: Mon, 6 Oct 2014 08:37:21 +0100 Subject: [PATCH] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails In-Reply-To: <20141006063907.GB31284@nuc-i3427.alporthouse.com> References: <1412492791-4121-1-git-send-email-chris@chris-wilson.co.uk> <5431F8C3.2040000@daenzer.net> <20141006063907.GB31284@nuc-i3427.alporthouse.com> Message-ID: Is this the issue in KDE that when I start a game I have to toggle compositing a couple of times to get it rendering? On 6 Oct 2014 07:39, "Chris Wilson" wrote: > On Mon, Oct 06, 2014 at 11:04:51AM +0900, Michel D?nzer wrote: > > On 05.10.2014 16:06, Chris Wilson wrote: > > >I was looking at a bug report today of intel/ati prime and noticed a > > >number of sna_share_pixmap_backing() failures (called from > > >DRI2UpdatePrime). These were failing as the request was for the scanout > > >buffer (which is tiled and so we refuse to share it, and since it is > > >already on the scanout we refuse to change tiling). > > > > > >But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, > > >the copy is aborted and the update lost. If the copy is made to the > > >normal window drawable is that enough for it to be propagated back > > >through damage tracking? > > > > Have you asked the reporter of that bug to test your patch? > > They didn't notice the issue, presumably because it only happens quite > early in the DE startup. However, I do remember Dave mentioning what > seemed to be a similar issue: a peristent blank window. Hence the > inquisitive nature of the patch. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at chris-wilson.co.uk Mon Oct 6 01:27:05 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Mon, 6 Oct 2014 09:27:05 +0100 Subject: [PATCH] randr/prime: Don't stop on the first pipe when disabling ReplaceScanoutPixmap Message-ID: <1412584025-27646-1-git-send-email-chris@chris-wilson.co.uk> As we define sizeFits based on whether a CRTC is active, and skip trying to redirect the scanout on a disable pipe, we then attempt to undo it later and fail because crtc->scanout_pixmap != DRI2_Pixmap and !sizeFits. Paper over this failure by skipping unredirected CRTC when disabling. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653 Signed-off-by: Chris Wilson Cc: Dave Airlie --- randr/rrcrtc.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 69b3ecf..43ae653 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1667,23 +1667,24 @@ Bool RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) { rrScrPriv(pDrawable->pScreen); - int i; - Bool size_fits = FALSE; - Bool changed = FALSE; Bool ret = TRUE; + int i; for (i = 0; i < pScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pScrPriv->crtcs[i]; + Bool size_fits, changed; if (!crtc->mode && enable) continue; + if (!crtc->scanout_pixmap && !enable) + continue; changed = FALSE; - if (crtc->mode && crtc->x == pDrawable->x && - crtc->y == pDrawable->y && - crtc->mode->mode.width == pDrawable->width && - crtc->mode->mode.height == pDrawable->height) - size_fits = TRUE; + size_fits = (crtc->mode && + crtc->x == pDrawable->x && + crtc->y == pDrawable->y && + crtc->mode->mode.width == pDrawable->width && + crtc->mode->mode.height == pDrawable->height); /* is the pixmap already set? */ if (crtc->scanout_pixmap == pPixmap) { @@ -1692,22 +1693,24 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) /* set scanout to NULL */ crtc->scanout_pixmap = NULL; changed = TRUE; - } else { - /* if the size fits then we are already setup */ - if (size_fits) - return TRUE; + } else if (!size_fits) { /* if the size no longer fits then drop off */ crtc->scanout_pixmap = NULL; changed = TRUE; ret = FALSE; + } else { + /* if the size fits then we are already setup */ } } else { - if (!size_fits) - return FALSE; - if (enable) { + if (!size_fits) { + ret = FALSE; + } else if (enable) { crtc->scanout_pixmap = pPixmap; pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap); changed = TRUE; + } else { + /* reject an attempt to disable someone else's scanout_pixmap */ + ret = FALSE; } } @@ -1718,5 +1721,7 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) crtc->rotation, crtc->numOutputs, crtc->outputs); } } + + /* XXX unwind failure? */ return ret; } -- 1.9.1 From chris at chris-wilson.co.uk Mon Oct 6 02:02:22 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Mon, 6 Oct 2014 10:02:22 +0100 Subject: [PATCH] randr/prime: Don't stop on the first pipe when disabling ReplaceScanoutPixmap In-Reply-To: <1412584025-27646-1-git-send-email-chris@chris-wilson.co.uk> References: <1412584025-27646-1-git-send-email-chris@chris-wilson.co.uk> Message-ID: <1412586142-13856-1-git-send-email-chris@chris-wilson.co.uk> As we define sizeFits based on whether a CRTC is active, and skip trying to redirect the scanout on a disable pipe, we then attempt to undo it later and fail because crtc->scanout_pixmap != DRI2_Pixmap and !sizeFits. Paper over this failure by skipping unredirected CRTC when disabling. v2: Unwind upon failure Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653 Signed-off-by: Chris Wilson Cc: Dave Airlie --- randr/rrcrtc.c | 67 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 7a42582..a6f2028 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1687,23 +1687,30 @@ Bool RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) { rrScrPriv(pDrawable->pScreen); - int i; - Bool size_fits = FALSE; - Bool changed = FALSE; Bool ret = TRUE; + PixmapPtr *saved_scanout_pixmap; + int i; + + saved_scanout_pixmap = malloc(sizeof(PixmapPtr)*pScrPriv->numCrtcs); + if (saved_scanout_pixmap == NULL) + return FALSE; for (i = 0; i < pScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pScrPriv->crtcs[i]; + Bool size_fits; + + saved_scanout_pixmap[i] = crtc->scanout_pixmap; if (!crtc->mode && enable) continue; + if (!crtc->scanout_pixmap && !enable) + continue; - changed = FALSE; - if (crtc->mode && crtc->x == pDrawable->x && - crtc->y == pDrawable->y && - crtc->mode->mode.width == pDrawable->width && - crtc->mode->mode.height == pDrawable->height) - size_fits = TRUE; + size_fits = (crtc->mode && + crtc->x == pDrawable->x && + crtc->y == pDrawable->y && + crtc->mode->mode.width == pDrawable->width && + crtc->mode->mode.height == pDrawable->height); /* is the pixmap already set? */ if (crtc->scanout_pixmap == pPixmap) { @@ -1711,32 +1718,48 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) if (enable == FALSE) { /* set scanout to NULL */ crtc->scanout_pixmap = NULL; - changed = TRUE; - } else { - /* if the size fits then we are already setup */ - if (size_fits) - return TRUE; + } + else if (!size_fits) { /* if the size no longer fits then drop off */ crtc->scanout_pixmap = NULL; - changed = TRUE; + pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); + + (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, + crtc->rotation, crtc->numOutputs, crtc->outputs); + saved_scanout_pixmap[i] = crtc->scanout_pixmap; ret = FALSE; } - } else { + else { + /* if the size fits then we are already setup */ + } + } + else { if (!size_fits) - return FALSE; - if (enable) { + ret = FALSE; + else if (enable) crtc->scanout_pixmap = pPixmap; - pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap); - changed = TRUE; - } + else + /* reject an attempt to disable someone else's scanout_pixmap */ + ret = FALSE; } + } + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (crtc->scanout_pixmap == saved_scanout_pixmap[i]) + continue; - if (changed && pScrPriv->rrCrtcSet) { + if (ret) { pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, crtc->rotation, crtc->numOutputs, crtc->outputs); } + else + crtc->scanout_pixmap = saved_scanout_pixmap[i]; } + free(saved_scanout_pixmap); + return ret; } -- 2.1.1 From thellstrom at vmware.com Mon Oct 6 04:17:13 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Mon, 6 Oct 2014 13:17:13 +0200 Subject: [PATCH] Back off if we detect a vmmouse kernel driver v3 Message-ID: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect utility doesn't detect a vmmouse if a kernel driver is active. v2: Change the vmmouse kernel device name, fix comment. v3: Fix up libudev error handling. Signed-off-by: Thomas Hellstrom --- configure.ac | 14 +++++++ tools/Makefile.am | 7 +++- tools/vmmouse_detect.c | 5 +++ tools/vmmouse_udev.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 tools/vmmouse_udev.c diff --git a/configure.ac b/configure.ac index ad05504..1197555 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages +libudev_check=yes +AC_ARG_WITH([libudev], + [AS_HELP_STRING([--without-libudev], + [Use to build without libudev on linux])], + [if test x$withval = xno; then libudev_check=no; fi] + []) + +if test x`uname` = xLinux -a $libudev_check = yes; then + PKG_CHECK_MODULES(LIBUDEV, [libudev], + [AC_DEFINE([HAVE_LIBUDEV], 1, + [Has libudev installed])], + []); +fi + PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) PKG_CHECK_EXISTS([xorg-server >= 1.1.0], diff --git a/tools/Makefile.am b/tools/Makefile.am index 8ae5516..a1396ba 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ + @LIBUDEV_LIBS@ + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ + calloutsdir=$(HAL_CALLOUTS_DIR) callouts_SCRIPTS = hal-probe-vmmouse diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c index 7939ff8..b743b2d 100644 --- a/tools/vmmouse_detect.c +++ b/tools/vmmouse_detect.c @@ -34,6 +34,8 @@ #include #include "vmmouse_client.h" +extern int vmmouse_uses_kernel_driver(void); + void segvCB(int sig) { @@ -46,6 +48,9 @@ segvCB(int sig) int main(void) { + if (vmmouse_uses_kernel_driver()) + return 1; + /* * If the vmmouse test is not run in a VMware virtual machine, it * will segfault instead of successfully accessing the port. diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c new file mode 100644 index 0000000..4e51dd6 --- /dev/null +++ b/tools/vmmouse_udev.c @@ -0,0 +1,105 @@ +/* + * Copyright 2014 by VMware, 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_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_LIBUDEV +#include +#include +#include + +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" + +/** + * vmmouse_uses_kernel_driver - Check whether there's an active + * vmmouse driver in the kernel. + * + * Returns 0 if there was no kernel driver found. + * Returns non-zero on error or if there was an active driver found. + * + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These + * devices are assumed to be active vmmouse drivers. + */ +int vmmouse_uses_kernel_driver(void) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *dev_list_entry; + struct udev_device *dev; + + udev = udev_new(); + if (!udev) + return 1; + + /* + * Udev error return codes that are not caught immediately are + * typically caught in the input argument check in the udev + * function calls following the failing call! + */ + enumerate = udev_enumerate_new(udev); + if (udev_enumerate_add_match_subsystem(enumerate, "input")) + goto out_err; + if (udev_enumerate_scan_devices(enumerate)) + goto out_err; + + devices = udev_enumerate_get_list_entry(enumerate); + udev_list_entry_foreach(dev_list_entry, devices) { + const char *path, *name; + + path = udev_list_entry_get_name(dev_list_entry); + dev = udev_device_new_from_syspath(udev, path); + if (!dev) + goto out_err; + name = udev_device_get_sysattr_value(dev, "name"); + if (name && !strcasecmp(name, KERNEL_DEVNAME)) + goto out_found; + + udev_device_unref(dev); + } + + out_not_found: + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 0; + + out_found: + udev_device_unref(dev); + out_err: + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return 1; +} +#else +int vmmouse_uses_kernel_driver(void) +{ + return 0; +} +#endif -- 1.8.3.2 From pharris at opentext.com Mon Oct 6 07:37:03 2014 From: pharris at opentext.com (Peter Harris) Date: Mon, 6 Oct 2014 10:37:03 -0400 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. In-Reply-To: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> References: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> Message-ID: <5432A90F.40305@opentext.com> On 2014-10-03 17:41, Alex Orange wrote: > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 > > Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said > patch does indeed remove the problematic writes to bad memory, however > it also introduces errors in the algoritm. This patch has the effect of > reverting said patch and adding an if in the proper location to catch > the out of bounds memory write without causing problems to the overall > algorithm. > > Signed-off-by: Alex Orange Reviewed-by: Peter Harris Tested-by: Peter Harris Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From syeh at vmware.com Mon Oct 6 07:59:13 2014 From: syeh at vmware.com (Sinclair Yeh) Date: Mon, 6 Oct 2014 07:59:13 -0700 Subject: [PATCH] Back off if we detect a vmmouse kernel driver v3 In-Reply-To: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> References: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> Message-ID: <20141006145903.GA14150@syeh-linux> On Mon, Oct 06, 2014 at 01:17:13PM +0200, Thomas Hellstrom wrote: > If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg > evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect > utility doesn't detect a vmmouse if a kernel driver is active. > > v2: Change the vmmouse kernel device name, fix comment. > v3: Fix up libudev error handling. > > Signed-off-by: Thomas Hellstrom > --- > configure.ac | 14 +++++++ > tools/Makefile.am | 7 +++- > tools/vmmouse_detect.c | 5 +++ > tools/vmmouse_udev.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 129 insertions(+), 2 deletions(-) > create mode 100644 tools/vmmouse_udev.c > > diff --git a/configure.ac b/configure.ac > index ad05504..1197555 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) > XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) > > # Checks for pkg-config packages > +libudev_check=yes > +AC_ARG_WITH([libudev], > + [AS_HELP_STRING([--without-libudev], > + [Use to build without libudev on linux])], > + [if test x$withval = xno; then libudev_check=no; fi] > + []) > + > +if test x`uname` = xLinux -a $libudev_check = yes; then > + PKG_CHECK_MODULES(LIBUDEV, [libudev], > + [AC_DEFINE([HAVE_LIBUDEV], 1, > + [Has libudev installed])], > + []); > +fi > + > PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) > > PKG_CHECK_EXISTS([xorg-server >= 1.1.0], > diff --git a/tools/Makefile.am b/tools/Makefile.am > index 8ae5516..a1396ba 100644 > --- a/tools/Makefile.am > +++ b/tools/Makefile.am > @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect > > AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) > > - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c > - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la > + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c > + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ > + @LIBUDEV_LIBS@ > + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ > + > > calloutsdir=$(HAL_CALLOUTS_DIR) > callouts_SCRIPTS = hal-probe-vmmouse > diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c > index 7939ff8..b743b2d 100644 > --- a/tools/vmmouse_detect.c > +++ b/tools/vmmouse_detect.c > @@ -34,6 +34,8 @@ > #include > #include "vmmouse_client.h" > > +extern int vmmouse_uses_kernel_driver(void); > + > void > segvCB(int sig) > { > @@ -46,6 +48,9 @@ segvCB(int sig) > int > main(void) > { > + if (vmmouse_uses_kernel_driver()) > + return 1; > + > /* > * If the vmmouse test is not run in a VMware virtual machine, it > * will segfault instead of successfully accessing the port. > diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c > new file mode 100644 > index 0000000..4e51dd6 > --- /dev/null > +++ b/tools/vmmouse_udev.c > @@ -0,0 +1,105 @@ > +/* > + * Copyright 2014 by VMware, 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_CONFIG_H > +#include "config.h" > +#endif > + > +#ifdef HAVE_LIBUDEV > +#include > +#include > +#include > + > +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" > + > +/** > + * vmmouse_uses_kernel_driver - Check whether there's an active > + * vmmouse driver in the kernel. > + * > + * Returns 0 if there was no kernel driver found. > + * Returns non-zero on error or if there was an active driver found. > + * > + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These > + * devices are assumed to be active vmmouse drivers. > + */ > +int vmmouse_uses_kernel_driver(void) > +{ > + struct udev *udev; > + struct udev_enumerate *enumerate; > + struct udev_list_entry *devices, *dev_list_entry; > + struct udev_device *dev; > + > + udev = udev_new(); > + if (!udev) > + return 1; > + > + /* > + * Udev error return codes that are not caught immediately are > + * typically caught in the input argument check in the udev > + * function calls following the failing call! > + */ > + enumerate = udev_enumerate_new(udev); > + if (udev_enumerate_add_match_subsystem(enumerate, "input")) > + goto out_err; > + if (udev_enumerate_scan_devices(enumerate)) > + goto out_err; > + > + devices = udev_enumerate_get_list_entry(enumerate); > + udev_list_entry_foreach(dev_list_entry, devices) { > + const char *path, *name; > + > + path = udev_list_entry_get_name(dev_list_entry); > + dev = udev_device_new_from_syspath(udev, path); > + if (!dev) > + goto out_err; > + name = udev_device_get_sysattr_value(dev, "name"); > + if (name && !strcasecmp(name, KERNEL_DEVNAME)) > + goto out_found; > + > + udev_device_unref(dev); > + } > + > + out_not_found: > + udev_enumerate_unref(enumerate); > + udev_unref(udev); > + > + return 0; > + > + out_found: > + udev_device_unref(dev); > + out_err: > + udev_enumerate_unref(enumerate); > + udev_unref(udev); If there's an error, would it make sense to let the vmmouse driver try to drive it, e.g. return 0? It seems to me that the failure case should return the same value as the case when udev is not enabled. I'm not sure how udev is used in vmmouse driver, so maybe it'll run into the same failure on its side. In that case the code looks okay to me. Sinclair > + > + return 1; > +} > +#else > +int vmmouse_uses_kernel_driver(void) > +{ > + return 0; > +} > +#endif > -- > 1.8.3.2 > From jamey at minilop.net Mon Oct 6 12:32:46 2014 From: jamey at minilop.net (Jamey Sharp) Date: Mon, 6 Oct 2014 12:32:46 -0700 Subject: Writing a new driver for nested Xorg servers based on Xephyr code In-Reply-To: References: Message-ID: On Sep 26, 2014 7:52 AM, "La?rcio de Sousa" < laerciosousa at sme-mogidascruzes.sp.gov.br> wrote: > Now I've started playing with xf86-video-nested and Xephyr code, trying to merge as much code as possible. It's still in an embrionary stage, so I want to ask you some questions: > > * Is there an official position from X.Org development team about deprecating Xephyr in favour of a driver based approach for nesting Xorg server? Or at least let both approaches coexist (maybe moving common code to a shared library, as I've asked you previously)? Asking for an official position isn't especially effective in this community, as we don't have anyone designated as a decision-maker. But perhaps we can have a conversation about this question at the X.Org Developers Conference in Bordeaux this week. My personal opinion is that we might as well turn all the current X servers into Xorg loadable drivers, but obviously we don't have a community-wide consensus on that. ;-) > * In case I decide to proceed with Xephyr code merging into a video driver, should I do it in current project xf86-video-nested, or fork a new one (e.g. xf86-video-ephyr)? I would suggest doing it in the nested project, even if you wind up rewriting it from scratch. There isn't much value in keeping the current nested code if you get something Xephyr-like working. I'm glad to see you picking this up! Jamey -------------- next part -------------- An HTML attachment was scrubbed... URL: From thellstrom at vmware.com Mon Oct 6 13:30:12 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Mon, 6 Oct 2014 22:30:12 +0200 Subject: [PATCH] Back off if we detect a vmmouse kernel driver v3 In-Reply-To: <20141006145903.GA14150@syeh-linux> References: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> <20141006145903.GA14150@syeh-linux> Message-ID: <5432FBD4.1070502@vmware.com> On 10/06/2014 04:59 PM, Sinclair Yeh wrote: > On Mon, Oct 06, 2014 at 01:17:13PM +0200, Thomas Hellstrom wrote: >> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg >> evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect >> utility doesn't detect a vmmouse if a kernel driver is active. >> >> v2: Change the vmmouse kernel device name, fix comment. >> v3: Fix up libudev error handling. >> >> Signed-off-by: Thomas Hellstrom >> --- >> configure.ac | 14 +++++++ >> tools/Makefile.am | 7 +++- >> tools/vmmouse_detect.c | 5 +++ >> tools/vmmouse_udev.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ >> 4 files changed, 129 insertions(+), 2 deletions(-) >> create mode 100644 tools/vmmouse_udev.c >> >> diff --git a/configure.ac b/configure.ac >> index ad05504..1197555 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) >> XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) >> >> # Checks for pkg-config packages >> +libudev_check=yes >> +AC_ARG_WITH([libudev], >> + [AS_HELP_STRING([--without-libudev], >> + [Use to build without libudev on linux])], >> + [if test x$withval = xno; then libudev_check=no; fi] >> + []) >> + >> +if test x`uname` = xLinux -a $libudev_check = yes; then >> + PKG_CHECK_MODULES(LIBUDEV, [libudev], >> + [AC_DEFINE([HAVE_LIBUDEV], 1, >> + [Has libudev installed])], >> + []); >> +fi >> + >> PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) >> >> PKG_CHECK_EXISTS([xorg-server >= 1.1.0], >> diff --git a/tools/Makefile.am b/tools/Makefile.am >> index 8ae5516..a1396ba 100644 >> --- a/tools/Makefile.am >> +++ b/tools/Makefile.am >> @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect >> >> AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) >> >> - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c >> - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la >> + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c >> + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ >> + @LIBUDEV_LIBS@ >> + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ >> + >> >> calloutsdir=$(HAL_CALLOUTS_DIR) >> callouts_SCRIPTS = hal-probe-vmmouse >> diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c >> index 7939ff8..b743b2d 100644 >> --- a/tools/vmmouse_detect.c >> +++ b/tools/vmmouse_detect.c >> @@ -34,6 +34,8 @@ >> #include >> #include "vmmouse_client.h" >> >> +extern int vmmouse_uses_kernel_driver(void); >> + >> void >> segvCB(int sig) >> { >> @@ -46,6 +48,9 @@ segvCB(int sig) >> int >> main(void) >> { >> + if (vmmouse_uses_kernel_driver()) >> + return 1; >> + >> /* >> * If the vmmouse test is not run in a VMware virtual machine, it >> * will segfault instead of successfully accessing the port. >> diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c >> new file mode 100644 >> index 0000000..4e51dd6 >> --- /dev/null >> +++ b/tools/vmmouse_udev.c >> @@ -0,0 +1,105 @@ >> +/* >> + * Copyright 2014 by VMware, 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_CONFIG_H >> +#include "config.h" >> +#endif >> + >> +#ifdef HAVE_LIBUDEV >> +#include >> +#include >> +#include >> + >> +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" >> + >> +/** >> + * vmmouse_uses_kernel_driver - Check whether there's an active >> + * vmmouse driver in the kernel. >> + * >> + * Returns 0 if there was no kernel driver found. >> + * Returns non-zero on error or if there was an active driver found. >> + * >> + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These >> + * devices are assumed to be active vmmouse drivers. >> + */ >> +int vmmouse_uses_kernel_driver(void) >> +{ >> + struct udev *udev; >> + struct udev_enumerate *enumerate; >> + struct udev_list_entry *devices, *dev_list_entry; >> + struct udev_device *dev; >> + >> + udev = udev_new(); >> + if (!udev) >> + return 1; >> + >> + /* >> + * Udev error return codes that are not caught immediately are >> + * typically caught in the input argument check in the udev >> + * function calls following the failing call! >> + */ >> + enumerate = udev_enumerate_new(udev); >> + if (udev_enumerate_add_match_subsystem(enumerate, "input")) >> + goto out_err; >> + if (udev_enumerate_scan_devices(enumerate)) >> + goto out_err; >> + >> + devices = udev_enumerate_get_list_entry(enumerate); >> + udev_list_entry_foreach(dev_list_entry, devices) { >> + const char *path, *name; >> + >> + path = udev_list_entry_get_name(dev_list_entry); >> + dev = udev_device_new_from_syspath(udev, path); >> + if (!dev) >> + goto out_err; >> + name = udev_device_get_sysattr_value(dev, "name"); >> + if (name && !strcasecmp(name, KERNEL_DEVNAME)) >> + goto out_found; >> + >> + udev_device_unref(dev); >> + } >> + >> + out_not_found: >> + udev_enumerate_unref(enumerate); >> + udev_unref(udev); >> + >> + return 0; >> + >> + out_found: >> + udev_device_unref(dev); >> + out_err: >> + udev_enumerate_unref(enumerate); >> + udev_unref(udev); > If there's an error, would it make sense to let the vmmouse driver try > to drive it, e.g. return 0? If udev errors, and we enable the user-space vmmouse driver, it might clash with a kernel driver which is a bad situation. If we instead back off, the mouse will be treated as a normal ps/2 mouse. We'll lose the VMMouse features, but the mouse will still work. > > It seems to me that the failure case should return the same value as > the case when udev is not enabled. The --without-libudev option is intended for the situation where the distro maintainer knows for sure that there will be no kernel vmmouse driver enabled and where he doesn't want to or can't introduce a libudev dependency. In that situation, we always enable the vmmouse. > I'm not sure how udev is used in vmmouse driver, so maybe it'll run > into the same failure on its side. In that case the code looks okay > to me. The vmmouse driver itself doesn't use libudev, so the errors are treated the way they are only because of the above considerations. > Sinclair > > Thanks, Thomas >> + >> + return 1; >> +} >> +#else >> +int vmmouse_uses_kernel_driver(void) >> +{ >> + return 0; >> +} >> +#endif >> -- >> 1.8.3.2 >> From chris at chris-wilson.co.uk Mon Oct 6 23:22:27 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Tue, 7 Oct 2014 07:22:27 +0100 Subject: [PATCH] randr/prime: Don't stop on the first pipe when disabling ReplaceScanoutPixmap In-Reply-To: <1412586142-13856-1-git-send-email-chris@chris-wilson.co.uk> References: <1412584025-27646-1-git-send-email-chris@chris-wilson.co.uk> <1412586142-13856-1-git-send-email-chris@chris-wilson.co.uk> Message-ID: <20141007062227.GD31284@nuc-i3427.alporthouse.com> On Mon, Oct 06, 2014 at 10:02:22AM +0100, Chris Wilson wrote: > As we define sizeFits based on whether a CRTC is active, and skip trying > to redirect the scanout on a disable pipe, we then attempt to undo it > later and fail because crtc->scanout_pixmap != DRI2_Pixmap and > !sizeFits. Paper over this failure by skipping unredirected CRTC when > disabling. > > v2: Unwind upon failure Reported-by: Christoph Haag > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653 > Signed-off-by: Chris Wilson > Cc: Dave Airlie Tested-by: Christoph Haag -Chris -- Chris Wilson, Intel Open Source Technology Centre From sndirsch at suse.de Tue Oct 7 02:29:32 2014 From: sndirsch at suse.de (Stefan Dirsch) Date: Tue, 7 Oct 2014 11:29:32 +0200 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. Message-ID: <1412674172-9607-1-git-send-email-sndirsch@suse.de> Without this the build fails on systems with the latest glibc, throwing this error: In file included from /usr/include/string.h:634:0, from /usr/include/xorg/os.h:53, from /usr/include/xorg/misc.h:115, from /usr/include/xorg/screenint.h:50, from /usr/include/xorg/scrnintstr.h:50, from /usr/include/xorg/xvdix.h:55, from /usr/include/xorg/xf86xv.h:32, from vmwgfx_overlay.c:38: /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' strndup(const char *str, size_t n); This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), causing os.h to redefine it. Signed-off-by: Stefan Dirsch --- vmwgfx/vmwgfx_overlay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c index ef1d541..2b05b0e 100644 --- a/vmwgfx/vmwgfx_overlay.c +++ b/vmwgfx/vmwgfx_overlay.c @@ -35,6 +35,7 @@ */ +#include "xorg-server.h" #include "xf86xv.h" #include "fourcc.h" #define debug_printf(...) -- 1.8.4.5 From sndirsch at suse.de Tue Oct 7 02:32:01 2014 From: sndirsch at suse.de (Stefan Dirsch) Date: Tue, 7 Oct 2014 11:32:01 +0200 Subject: [PATCH] vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h Message-ID: <1412674321-9709-1-git-send-email-sndirsch@suse.de> xf86_OSproc.h cannot be included without first including xorg-server.h. Without this the build fails on systems with the latest glibc, throwing this error: In file included from /usr/include/string.h:634:0, from /usr/include/xorg/os.h:53, from /usr/include/xorg/misc.h:115, from /usr/include/xorg/window.h:50, from /usr/include/xorg/globals.h:7, from /usr/include/xorg/opaque.h:34, from /usr/include/xorg/xf86_OSproc.h:127, from vmmouse_client.h:42, from vmmouse_client.c:38: /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' strndup(const char *str, size_t n); This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), causing os.h to redefine it. Signed-off-by: Stefan Dirsch --- shared/vmmouse_client.h | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/vmmouse_client.h b/shared/vmmouse_client.h index b01bf08..1de51e5 100644 --- a/shared/vmmouse_client.h +++ b/shared/vmmouse_client.h @@ -39,6 +39,7 @@ #ifndef _VMMOUSE_CLIENT_H_ #define _VMMOUSE_CLIENT_H_ +#include "xorg-server.h" #include "xf86_OSproc.h" /* -- 1.8.4.5 From consume.noise at gmail.com Tue Oct 7 02:46:22 2014 From: consume.noise at gmail.com (Daniel Martin) Date: Tue, 7 Oct 2014 11:46:22 +0200 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <1412674172-9607-1-git-send-email-sndirsch@suse.de> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> Message-ID: On 7 October 2014 11:29, Stefan Dirsch wrote: > Without this the build fails on systems with the latest glibc, > throwing this error: > > In file included from /usr/include/string.h:634:0, > from /usr/include/xorg/os.h:53, > from /usr/include/xorg/misc.h:115, > from /usr/include/xorg/screenint.h:50, > from /usr/include/xorg/scrnintstr.h:50, > from /usr/include/xorg/xvdix.h:55, > from /usr/include/xorg/xf86xv.h:32, > from vmwgfx_overlay.c:38: > /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' > strndup(const char *str, size_t n); > > This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), > causing os.h to redefine it. Have a look at this commit in xf86-video-intel: http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=d209b03915e4d12ce445d72ac09bb4fe664ba664 With that HAVE_STRNDUP will be defined in config.h, which looks like a better solution to me. Cheers, Daniel Martin From michel at daenzer.net Tue Oct 7 02:54:03 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Tue, 07 Oct 2014 18:54:03 +0900 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> Message-ID: <5433B83B.9050204@daenzer.net> On 07.10.2014 18:46, Daniel Martin wrote: > On 7 October 2014 11:29, Stefan Dirsch wrote: >> Without this the build fails on systems with the latest glibc, >> throwing this error: >> >> In file included from /usr/include/string.h:634:0, >> from /usr/include/xorg/os.h:53, >> from /usr/include/xorg/misc.h:115, >> from /usr/include/xorg/screenint.h:50, >> from /usr/include/xorg/scrnintstr.h:50, >> from /usr/include/xorg/xvdix.h:55, >> from /usr/include/xorg/xf86xv.h:32, >> from vmwgfx_overlay.c:38: >> /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' >> strndup(const char *str, size_t n); >> >> This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), >> causing os.h to redefine it. > > Have a look at this commit in xf86-video-intel: > http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=d209b03915e4d12ce445d72ac09bb4fe664ba664 > > With that HAVE_STRNDUP will be defined in config.h, > which looks like a better solution to me. I disagree. xorg-server.h must be included before any other headers from xorg/, so Stefan's patch is the proper solution. -- Earthling Michel D?nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From daniel at fooishbar.org Tue Oct 7 03:56:55 2014 From: daniel at fooishbar.org (Daniel Stone) Date: Tue, 7 Oct 2014 11:56:55 +0100 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <5433B83B.9050204@daenzer.net> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> Message-ID: Hi, On 7 October 2014 10:54, Michel D?nzer wrote: > On 07.10.2014 18:46, Daniel Martin wrote: > >> On 7 October 2014 11:29, Stefan Dirsch wrote: >> >>> Without this the build fails on systems with the latest glibc, >>> throwing this error: >>> [...] >>> >>> This is caused by HAVE_STRNDUP not being set (it is set from >>> xorg-server.h), >>> causing os.h to redefine it. >>> >> >> Have a look at this commit in xf86-video-intel: >> http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id= >> d209b03915e4d12ce445d72ac09bb4fe664ba664 >> >> With that HAVE_STRNDUP will be defined in config.h, >> which looks like a better solution to me. >> > > I disagree. xorg-server.h must be included before any other headers from > xorg/, so Stefan's patch is the proper solution. Yes, absolutely. xorg-server.h does things like define _XSERVER64, which changes the size of CARD32 and thus the entire server ABI. Not including xorg-server.h first is terminally broken; this is just one symptom. Stefan: Reviewed-by: Daniel Stone Cheers, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at fooishbar.org Tue Oct 7 04:03:50 2014 From: daniel at fooishbar.org (Daniel Stone) Date: Tue, 7 Oct 2014 12:03:50 +0100 Subject: [PATCH] vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h In-Reply-To: <1412674321-9709-1-git-send-email-sndirsch@suse.de> References: <1412674321-9709-1-git-send-email-sndirsch@suse.de> Message-ID: On 7 October 2014 10:32, Stefan Dirsch wrote: > xf86_OSproc.h cannot be included without first including xorg-server.h. > > Without this the build fails on systems with the latest glibc, > throwing this error: > [...] > > This is caused by HAVE_STRNDUP not being set (it is set from > xorg-server.h), > causing os.h to redefine it. > > Signed-off-by: Stefan Dirsch > Reviewed-by: Daniel Stone (But I do wish these wrappers weren't part of the public API ... !) Cheers, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From syeh at vmware.com Tue Oct 7 08:01:08 2014 From: syeh at vmware.com (Sinclair Yeh) Date: Tue, 7 Oct 2014 08:01:08 -0700 Subject: [PATCH] Back off if we detect a vmmouse kernel driver v3 In-Reply-To: <5432FBD4.1070502@vmware.com> References: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> <20141006145903.GA14150@syeh-linux> <5432FBD4.1070502@vmware.com> Message-ID: <20141007150108.GA4462@syeh-linux> Reviewed-by: Sinclair Yeh On Mon, Oct 06, 2014 at 10:30:12PM +0200, Thomas Hellstrom wrote: > On 10/06/2014 04:59 PM, Sinclair Yeh wrote: > > On Mon, Oct 06, 2014 at 01:17:13PM +0200, Thomas Hellstrom wrote: > >> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg > >> evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect > >> utility doesn't detect a vmmouse if a kernel driver is active. > >> > >> v2: Change the vmmouse kernel device name, fix comment. > >> v3: Fix up libudev error handling. > >> > >> Signed-off-by: Thomas Hellstrom > >> --- > >> configure.ac | 14 +++++++ > >> tools/Makefile.am | 7 +++- > >> tools/vmmouse_detect.c | 5 +++ > >> tools/vmmouse_udev.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ > >> 4 files changed, 129 insertions(+), 2 deletions(-) > >> create mode 100644 tools/vmmouse_udev.c > >> > >> diff --git a/configure.ac b/configure.ac > >> index ad05504..1197555 100644 > >> --- a/configure.ac > >> +++ b/configure.ac > >> @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) > >> XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) > >> > >> # Checks for pkg-config packages > >> +libudev_check=yes > >> +AC_ARG_WITH([libudev], > >> + [AS_HELP_STRING([--without-libudev], > >> + [Use to build without libudev on linux])], > >> + [if test x$withval = xno; then libudev_check=no; fi] > >> + []) > >> + > >> +if test x`uname` = xLinux -a $libudev_check = yes; then > >> + PKG_CHECK_MODULES(LIBUDEV, [libudev], > >> + [AC_DEFINE([HAVE_LIBUDEV], 1, > >> + [Has libudev installed])], > >> + []); > >> +fi > >> + > >> PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) > >> > >> PKG_CHECK_EXISTS([xorg-server >= 1.1.0], > >> diff --git a/tools/Makefile.am b/tools/Makefile.am > >> index 8ae5516..a1396ba 100644 > >> --- a/tools/Makefile.am > >> +++ b/tools/Makefile.am > >> @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect > >> > >> AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) > >> > >> - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c > >> - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la > >> + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c > >> + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ > >> + @LIBUDEV_LIBS@ > >> + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ > >> + > >> > >> calloutsdir=$(HAL_CALLOUTS_DIR) > >> callouts_SCRIPTS = hal-probe-vmmouse > >> diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c > >> index 7939ff8..b743b2d 100644 > >> --- a/tools/vmmouse_detect.c > >> +++ b/tools/vmmouse_detect.c > >> @@ -34,6 +34,8 @@ > >> #include > >> #include "vmmouse_client.h" > >> > >> +extern int vmmouse_uses_kernel_driver(void); > >> + > >> void > >> segvCB(int sig) > >> { > >> @@ -46,6 +48,9 @@ segvCB(int sig) > >> int > >> main(void) > >> { > >> + if (vmmouse_uses_kernel_driver()) > >> + return 1; > >> + > >> /* > >> * If the vmmouse test is not run in a VMware virtual machine, it > >> * will segfault instead of successfully accessing the port. > >> diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c > >> new file mode 100644 > >> index 0000000..4e51dd6 > >> --- /dev/null > >> +++ b/tools/vmmouse_udev.c > >> @@ -0,0 +1,105 @@ > >> +/* > >> + * Copyright 2014 by VMware, 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_CONFIG_H > >> +#include "config.h" > >> +#endif > >> + > >> +#ifdef HAVE_LIBUDEV > >> +#include > >> +#include > >> +#include > >> + > >> +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" > >> + > >> +/** > >> + * vmmouse_uses_kernel_driver - Check whether there's an active > >> + * vmmouse driver in the kernel. > >> + * > >> + * Returns 0 if there was no kernel driver found. > >> + * Returns non-zero on error or if there was an active driver found. > >> + * > >> + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These > >> + * devices are assumed to be active vmmouse drivers. > >> + */ > >> +int vmmouse_uses_kernel_driver(void) > >> +{ > >> + struct udev *udev; > >> + struct udev_enumerate *enumerate; > >> + struct udev_list_entry *devices, *dev_list_entry; > >> + struct udev_device *dev; > >> + > >> + udev = udev_new(); > >> + if (!udev) > >> + return 1; > >> + > >> + /* > >> + * Udev error return codes that are not caught immediately are > >> + * typically caught in the input argument check in the udev > >> + * function calls following the failing call! > >> + */ > >> + enumerate = udev_enumerate_new(udev); > >> + if (udev_enumerate_add_match_subsystem(enumerate, "input")) > >> + goto out_err; > >> + if (udev_enumerate_scan_devices(enumerate)) > >> + goto out_err; > >> + > >> + devices = udev_enumerate_get_list_entry(enumerate); > >> + udev_list_entry_foreach(dev_list_entry, devices) { > >> + const char *path, *name; > >> + > >> + path = udev_list_entry_get_name(dev_list_entry); > >> + dev = udev_device_new_from_syspath(udev, path); > >> + if (!dev) > >> + goto out_err; > >> + name = udev_device_get_sysattr_value(dev, "name"); > >> + if (name && !strcasecmp(name, KERNEL_DEVNAME)) > >> + goto out_found; > >> + > >> + udev_device_unref(dev); > >> + } > >> + > >> + out_not_found: > >> + udev_enumerate_unref(enumerate); > >> + udev_unref(udev); > >> + > >> + return 0; > >> + > >> + out_found: > >> + udev_device_unref(dev); > >> + out_err: > >> + udev_enumerate_unref(enumerate); > >> + udev_unref(udev); > > If there's an error, would it make sense to let the vmmouse driver try > > to drive it, e.g. return 0? > > If udev errors, and we enable the user-space vmmouse driver, it might > clash with a kernel driver which is a bad situation. If we instead back > off, the mouse will be treated as a normal ps/2 mouse. We'll lose the > VMMouse features, but the mouse will still work. > > > > > It seems to me that the failure case should return the same value as > > the case when udev is not enabled. > The --without-libudev option is intended for the situation where the > distro maintainer knows for sure that there will be no kernel vmmouse > driver enabled and where he doesn't want to or can't introduce a libudev > dependency. In that situation, we always enable the vmmouse. > > > I'm not sure how udev is used in vmmouse driver, so maybe it'll run > > into the same failure on its side. In that case the code looks okay > > to me. > > The vmmouse driver itself doesn't use libudev, so the errors are treated > the way they are only because of the above considerations. > > > Sinclair > > > > > > Thanks, > Thomas > > > > >> + > >> + return 1; > >> +} > >> +#else > >> +int vmmouse_uses_kernel_driver(void) > >> +{ > >> + return 0; > >> +} > >> +#endif > >> -- > >> 1.8.3.2 > >> > From eric at anholt.net Wed Oct 8 01:58:23 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 8 Oct 2014 01:58:23 -0700 Subject: [PATCH 2/4] modesetting: Fix some weird formatting after x-indent-all.sh. In-Reply-To: <1412758705-444-1-git-send-email-eric@anholt.net> References: <1412758705-444-1-git-send-email-eric@anholt.net> Message-ID: <1412758705-444-2-git-send-email-eric@anholt.net> Signed-off-by: Eric Anholt --- hw/xfree86/drivers/modesetting/drmmode_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index ca02a4d..d959837 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -976,7 +976,9 @@ static const xf86OutputFuncsRec drmmode_output_funcs = { .destroy = drmmode_output_destroy }; -static int subpixel_conv_table[7] = { 0, SubPixelUnknown, +static int subpixel_conv_table[7] = { + 0, + SubPixelUnknown, SubPixelHorizontalRGB, SubPixelHorizontalBGR, SubPixelVerticalRGB, @@ -984,7 +986,8 @@ static int subpixel_conv_table[7] = { 0, SubPixelUnknown, SubPixelNone }; -static const char *const output_names[] = { "None", +static const char *const output_names[] = { + "None", "VGA", "DVI", "DVI", -- 2.1.1 From eric at anholt.net Wed Oct 8 01:58:24 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 8 Oct 2014 01:58:24 -0700 Subject: [PATCH 3/4] modesetting: Deduplicate some scrn setup. In-Reply-To: <1412758705-444-1-git-send-email-eric@anholt.net> References: <1412758705-444-1-git-send-email-eric@anholt.net> Message-ID: <1412758705-444-3-git-send-email-eric@anholt.net> Signed-off-by: Eric Anholt --- hw/xfree86/drivers/modesetting/driver.c | 55 +++++++++++++-------------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index f509a19..c713746 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -306,6 +306,24 @@ ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data) } } +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, @@ -322,18 +340,7 @@ ms_pci_probe(DriverPtr driver, devpath = xf86FindOptionValue(devSection->options, "kmsdev"); if (probe_hw_pci(devpath, dev)) { - 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; + ms_setup_scrn_hooks(scrn); xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "claimed PCI slot %d@%d:%d:%d\n", @@ -365,16 +372,8 @@ ms_platform_probe(DriverPtr driver, scrn = xf86AllocateScreen(driver, scr_flags); xf86AddEntityToScreen(scrn, entity_num); - scrn->driverName = "modesetting"; - scrn->name = "modesetting"; - scrn->PreInit = PreInit; - scrn->ScreenInit = ScreenInit; - scrn->SwitchMode = SwitchMode; - scrn->AdjustFrame = AdjustFrame; - scrn->EnterVT = EnterVT; - scrn->LeaveVT = LeaveVT; - scrn->FreeScreen = FreeScreen; - scrn->ValidMode = ValidMode; + ms_setup_scrn_hooks(scrn); + xf86DrvMsg(scrn->scrnIndex, X_INFO, "using drv %s\n", path ? path : "default device"); } @@ -416,18 +415,8 @@ Probe(DriverPtr drv, int flags) if (scrn) { foundScreen = TRUE; - scrn->driverVersion = 1; - scrn->driverName = "modesetting"; - scrn->name = "modesetting"; + ms_setup_scrn_hooks(scrn); scrn->Probe = Probe; - scrn->PreInit = PreInit; - scrn->ScreenInit = ScreenInit; - scrn->SwitchMode = SwitchMode; - scrn->AdjustFrame = AdjustFrame; - scrn->EnterVT = EnterVT; - scrn->LeaveVT = LeaveVT; - scrn->FreeScreen = FreeScreen; - scrn->ValidMode = ValidMode; xf86DrvMsg(scrn->scrnIndex, X_INFO, "using %s\n", dev ? dev : "default device"); -- 2.1.1 From eric at anholt.net Wed Oct 8 01:58:25 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 8 Oct 2014 01:58:25 -0700 Subject: [PATCH 4/4] modesetting: Add support for rendering using glamor. In-Reply-To: <1412758705-444-1-git-send-email-eric@anholt.net> References: <1412758705-444-1-git-send-email-eric@anholt.net> Message-ID: <1412758705-444-4-git-send-email-eric@anholt.net> 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 --- hw/xfree86/drivers/modesetting/Makefile.am | 1 + hw/xfree86/drivers/modesetting/driver.c | 101 ++++++++++++++++++++++--- hw/xfree86/drivers/modesetting/driver.h | 1 + hw/xfree86/drivers/modesetting/modesetting.man | 3 + 4 files changed, 95 insertions(+), 11 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am index ca3279e..e6834e2 100644 --- a/hw/xfree86/drivers/modesetting/Makefile.am +++ b/hw/xfree86/drivers/modesetting/Makefile.am @@ -28,6 +28,7 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARN AM_CPPFLAGS = \ $(XORG_INCS) \ + -I$(top_srcdir)/glamor \ -I$(srcdir)/../../ddc \ -I$(srcdir)/../../i2c \ -I$(srcdir)/../../modes \ diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index c713746..c62147a 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -61,6 +61,11 @@ #include "driver.h" +#ifdef GLAMOR +#define GLAMOR_FOR_XORG 1 +#include "glamor.h" +#endif + static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); static Bool CloseScreen(ScreenPtr pScreen); static Bool EnterVT(ScrnInfoPtr pScrn); @@ -122,12 +127,14 @@ 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} }; @@ -577,6 +584,43 @@ FreeRec(ScrnInfoPtr pScrn) } +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->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->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 @@ -594,7 +638,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) EntPtr msEnt = NULL; char *BusID = NULL; const char *devicename; - Bool prefer_shadow = TRUE; uint64_t value = 0; int ret; int bppflags; @@ -732,11 +775,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->drmmode.sw_cursor = TRUE; } - ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); - if (!ret) { - prefer_shadow = ! !value; - } - ms->cursor_width = 64; ms->cursor_height = 64; ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); @@ -748,12 +786,26 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->cursor_height = value; } - ms->drmmode.shadow_enable = - xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow); + try_enable_glamor(pScrn); + + if (!ms->glamor) { + 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"); + } - 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; @@ -832,6 +884,20 @@ CreateScreenResources(ScreenPtr pScreen) if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; +#ifdef GLAMOR + if (ms->glamor) { + if (!glamor_egl_create_textured_screen_ext(pScreen, + ms->drmmode.front_bo->handle, + pScrn->displayWidth * + pScrn->bitsPerPixel / 8, + NULL)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "glamor_egl_create_textured_screen_ext() failed\n"); + return FALSE; + } + } +#endif + drmmode_uevent_init(pScrn, &ms->drmmode); if (!ms->drmmode.sw_cursor) @@ -984,6 +1050,19 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) fbPictureInit(pScreen, NULL, 0); +#ifdef GLAMOR + if (ms->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; diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 8a920b9..35f2419 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -74,6 +74,7 @@ typedef struct _modesettingRec { Bool dirty_enabled; uint32_t cursor_width, cursor_height; + Bool glamor; } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) diff --git a/hw/xfree86/drivers/modesetting/modesetting.man b/hw/xfree86/drivers/modesetting/modesetting.man index 34baa9c..9cb27d7 100644 --- a/hw/xfree86/drivers/modesetting/modesetting.man +++ b/hw/xfree86/drivers/modesetting/modesetting.man @@ -47,6 +47,9 @@ The framebuffer device to use. Default: /dev/dri/card0. .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__) -- 2.1.1 From eric at anholt.net Wed Oct 8 01:58:22 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 8 Oct 2014 01:58:22 -0700 Subject: [PATCH 1/4] modesetting: Run x-indent-all.sh. Message-ID: <1412758705-444-1-git-send-email-eric@anholt.net> 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 --- hw/xfree86/drivers/modesetting/driver.c | 579 ++--- hw/xfree86/drivers/modesetting/driver.h | 6 +- hw/xfree86/drivers/modesetting/drmmode_display.c | 2497 +++++++++++----------- hw/xfree86/drivers/modesetting/drmmode_display.h | 14 +- 4 files changed, 1586 insertions(+), 1510 deletions(-) I've elided the actual patch contents here since it's large and automatically generated (mostly tabs to spaces). You can find it on people.freedesktop.org:~anholt/xserver on the modesetting-glamor branch. diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index adfb69c..f509a19 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -66,8 +66,8 @@ 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 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); @@ -76,26 +76,25 @@ 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); + 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 - }, + PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, + 0x00030000, 0x00ff0000, 0}, - { 0, 0, 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); + int entity_num, int flags, + struct xf86_platform_device *device, + intptr_t match_data); #endif _X_EXPORT DriverRec modesetting = { @@ -115,12 +114,11 @@ _X_EXPORT DriverRec modesetting = { }; static SymTabRec Chipsets[] = { - {0, "kms" }, + {0, "kms"}, {-1, NULL} }; -typedef enum -{ +typedef enum { OPTION_SW_CURSOR, OPTION_DEVICE_PATH, OPTION_SHADOW_FB, @@ -128,8 +126,8 @@ typedef enum 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_DEVICE_PATH, "kmsdev", OPTV_STRING, {0}, FALSE}, + {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -155,25 +153,26 @@ static XF86ModuleVersionInfo VersRec = { _X_EXPORT XF86ModuleData modesettingModuleData = { &VersRec, Setup, NULL }; static void * -Setup(void * module, void * opts, int *errmaj, int *errmin) +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; + 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; } } @@ -181,28 +180,31 @@ static void Identify(int flags) { xf86PrintChipsets("modesetting", "Driver for Modesetting Kernel Drivers", - Chipsets); + Chipsets); } -static int open_hw(const char *dev) +static int +open_hw(const char *dev) { int fd; + if (dev) - fd = open(dev, O_RDWR, 0); + fd = open(dev, O_RDWR, 0); else { - dev = getenv("KMSDEVICE"); - if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) { - dev = "/dev/dri/card0"; - fd = open(dev,O_RDWR, 0); - } + dev = getenv("KMSDEVICE"); + if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) { + dev = "/dev/dri/card0"; + fd = open(dev, O_RDWR, 0); + } } if (fd == -1) - xf86DrvMsg(-1, X_ERROR,"open %s: %s\n", dev, strerror(errno)); + xf86DrvMsg(-1, X_ERROR, "open %s: %s\n", dev, strerror(errno)); return fd; } -static int check_outputs(int fd) +static int +check_outputs(int fd) { drmModeResPtr res = drmModeGetResources(fd); int ret; @@ -214,7 +216,8 @@ static int check_outputs(int fd) return ret; } -static Bool probe_hw(const char *dev, struct xf86_platform_device *platform_dev) +static Bool +probe_hw(const char *dev, struct xf86_platform_device *platform_dev) { int fd; @@ -230,6 +233,7 @@ static Bool probe_hw(const char *dev, struct xf86_platform_device *platform_dev) fd = open_hw(dev); if (fd != -1) { int ret = check_outputs(fd); + close(fd); return ret; } @@ -248,15 +252,15 @@ ms_DRICreatePCIBusID(const struct pci_device *dev) return busID; } - -static Bool probe_hw_pci(const char *dev, struct pci_device *pdev) +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; + return FALSE; sv.drm_di_major = 1; sv.drm_di_minor = 4; @@ -267,7 +271,6 @@ static Bool probe_hw_pci(const char *dev, struct pci_device *pdev) return FALSE; } - id = drmGetBusid(fd); devid = ms_DRICreatePCIBusID(pdev); @@ -279,6 +282,7 @@ static Bool probe_hw_pci(const char *dev, struct pci_device *pdev) free(devid); return ret; } + static const OptionInfoRec * AvailableOptions(int chipid, int busid) { @@ -289,55 +293,56 @@ 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; + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32 *) data; + (*flag) = 0; + return TRUE; + case SUPPORTS_SERVER_FDS: + return TRUE; + default: + return FALSE; } } #if XSERVER_LIBPCIACCESS static Bool ms_pci_probe(DriverPtr driver, - int entity_num, struct pci_device *dev, intptr_t match_data) + 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); + 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)) { - 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; - - 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; + const char *devpath; + GDevPtr devSection = xf86GetDevFromEntity(scrn->entityList[0], + scrn->entityInstanceList[0]); + + devpath = xf86FindOptionValue(devSection->options, "kmsdev"); + if (probe_hw_pci(devpath, dev)) { + 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; + + 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; } @@ -346,14 +351,15 @@ ms_pci_probe(DriverPtr driver, #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) + 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; + scr_flags = XF86_ALLOCATE_GPU_SCREEN; if (probe_hw(path, dev)) { scrn = xf86AllocateScreen(driver, scr_flags); @@ -388,44 +394,44 @@ Probe(DriverPtr drv, int flags) /* For now, just bail out for PROBE_DETECT. */ if (flags & PROBE_DETECT) - return FALSE; + 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; + 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; - scrn->driverVersion = 1; - scrn->driverName = "modesetting"; - scrn->name = "modesetting"; - scrn->Probe = Probe; - scrn->PreInit = PreInit; - scrn->ScreenInit = ScreenInit; - scrn->SwitchMode = SwitchMode; - scrn->AdjustFrame = AdjustFrame; - scrn->EnterVT = EnterVT; - scrn->LeaveVT = LeaveVT; - scrn->FreeScreen = FreeScreen; - scrn->ValidMode = ValidMode; - - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "using %s\n", dev ? dev : "default device"); - } + 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; + scrn->driverVersion = 1; + scrn->driverName = "modesetting"; + scrn->name = "modesetting"; + scrn->Probe = Probe; + scrn->PreInit = PreInit; + scrn->ScreenInit = ScreenInit; + scrn->SwitchMode = SwitchMode; + scrn->AdjustFrame = AdjustFrame; + scrn->EnterVT = EnterVT; + scrn->LeaveVT = LeaveVT; + scrn->FreeScreen = FreeScreen; + scrn->ValidMode = ValidMode; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "using %s\n", dev ? dev : "default device"); + } } free(devSections); @@ -437,51 +443,51 @@ static Bool GetRec(ScrnInfoPtr pScrn) { if (pScrn->driverPrivate) - return TRUE; + return TRUE; pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1); return TRUE; } -static int dispatch_dirty_region(ScrnInfoPtr scrn, - PixmapPtr pixmap, - DamagePtr damage, - int fb_id) +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); if (num_cliprects) { - drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); - BoxPtr rect = REGION_RECTS(dirty); - int i, ret; - - 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); - if (ret) { - if (ret == -EINVAL) - return ret; - } + drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); + BoxPtr rect = REGION_RECTS(dirty); + int i, ret; + + 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); + if (ret) { + if (ret == -EINVAL) + return ret; + } } return 0; } -static void dispatch_dirty(ScreenPtr pScreen) +static void +dispatch_dirty(ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(scrn); @@ -491,16 +497,18 @@ static void dispatch_dirty(ScreenPtr pScreen) 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; + 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) +static void +dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) { modesettingPtr ms = modesettingPTR(scrn); PixmapPtr pixmap = crtc->randr_crtc->scanout_pixmap; @@ -516,25 +524,27 @@ static void dispatch_dirty_crtc(ScrnInfoPtr scrn, xf86CrtcPtr crtc) } } -static void dispatch_slave_dirty(ScreenPtr pScreen) +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]; + xf86CrtcPtr crtc = xf86_config->crtc[c]; - if (!crtc->randr_crtc) - continue; - if (!crtc->randr_crtc->scanout_pixmap) - continue; + if (!crtc->randr_crtc) + continue; + if (!crtc->randr_crtc->scanout_pixmap) + continue; - dispatch_dirty_crtc(scrn, crtc); + dispatch_dirty_crtc(scrn, crtc); } } -static void msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +static void +msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); @@ -568,7 +578,7 @@ FreeRec(ScrnInfoPtr pScrn) else #ifdef XF86_PDEV_SERVER_FD if (!(ms->pEnt->location.type == BUS_PLATFORM && - (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))) + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))) #endif ret = close(ms->fd); (void) ret; @@ -602,38 +612,40 @@ PreInit(ScrnInfoPtr pScrn, int flags) int defaultdepth, defaultbpp; if (pScrn->numEntities != 1) - return FALSE; + return FALSE; pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (flags & PROBE_DETECT) { - return FALSE; + return FALSE; } /* Allocate driverPrivate */ if (!GetRec(pScrn)) - return FALSE; + return FALSE; ms = modesettingPTR(pScrn); ms->SaveGeneration = -1; ms->pEnt = pEnt; - pScrn->displayWidth = 640; /* default it */ + 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; + msEnt = xf86GetEntityPrivate(pScrn->entityList[0], + modesettingEntityIndex)->ptr; + ms->entityPrivate = msEnt; + } + else + ms->entityPrivate = NULL; if (xf86IsEntityShared(pScrn->entityList[0])) { - if (xf86IsPrimInitDone(pScrn->entityList[0])) { - /* do something */ - } else { - xf86SetPrimInitDone(pScrn->entityList[0]); - } + if (xf86IsPrimInitDone(pScrn->entityList[0])) { + /* do something */ + } + else { + xf86SetPrimInitDone(pScrn->entityList[0]); + } } pScrn->monitor = pScrn->confScreen->monitor; @@ -644,15 +656,19 @@ PreInit(ScrnInfoPtr pScrn, int flags) 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; + 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; + char *path = + xf86_platform_device_odev_attributes(pEnt->location.id.plat)-> + path; ms->fd = open_hw(path); } } - else + else #endif if (pEnt->location.type == BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); @@ -670,12 +686,13 @@ PreInit(ScrnInfoPtr pScrn, int flags) ); } ms->fd = drmOpen(NULL, BusID); - } else { + } + else { devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev"); ms->fd = open_hw(devicename); } if (ms->fd < 0) - return FALSE; + return FALSE; ms->drmmode.fd = ms->fd; @@ -689,81 +706,84 @@ PreInit(ScrnInfoPtr pScrn, int flags) #endif drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); if (defaultdepth == 24 && defaultbpp == 24) - bppflags = SupportConvert32to24 | Support24bppFb; + bppflags = SupportConvert32to24 | Support24bppFb; else - bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; - + bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; + if (!xf86SetDepthBpp - (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) - return FALSE; + (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) + return FALSE; switch (pScrn->depth) { case 15: case 16: case 24: - break; + break; default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by the driver\n", - pScrn->depth); - return FALSE; + 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; + return FALSE; memcpy(ms->Options, Options, sizeof(Options)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options); if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) - return FALSE; + return FALSE; if (!xf86SetDefaultVisual(pScrn, -1)) - return FALSE; + return FALSE; if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) { - ms->drmmode.sw_cursor = TRUE; + ms->drmmode.sw_cursor = TRUE; } ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); if (!ret) { - prefer_shadow = !!value; + prefer_shadow = ! !value; } ms->cursor_width = 64; ms->cursor_height = 64; ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); if (!ret) { - ms->cursor_width = value; + ms->cursor_width = value; } ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_HEIGHT, &value); if (!ret) { - ms->cursor_height = value; + ms->cursor_height = value; } - ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow); + 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"); + 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; + 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 }; + Gamma zeros = { 0.0, 0.0, 0.0 }; - if (!xf86SetGamma(pScrn, zeros)) { - return FALSE; - } + if (!xf86SetGamma(pScrn, zeros)) { + return FALSE; + } } if (pScrn->modes == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); + return FALSE; } pScrn->currentMode = pScrn->modes; @@ -773,23 +793,23 @@ PreInit(ScrnInfoPtr pScrn, int flags) /* Load the required sub modules */ if (!xf86LoadSubModule(pScrn, "fb")) { - return FALSE; + return FALSE; } if (ms->drmmode.shadow_enable) { - if (!xf86LoadSubModule(pScrn, "shadow")) { - return FALSE; - } + if (!xf86LoadSubModule(pScrn, "shadow")) { + return FALSE; + } } return TRUE; - fail: + fail: return FALSE; } static void * msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, - CARD32 *size, void *closure) + CARD32 *size, void *closure) { ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(pScrn); @@ -798,7 +818,7 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; *size = stride; - return ((uint8_t *)ms->drmmode.front_bo->ptr + row * stride + offset); + return ((uint8_t *) ms->drmmode.front_bo->ptr + row * stride + offset); } static void @@ -815,12 +835,13 @@ CreateScreenResources(ScreenPtr pScreen) PixmapPtr rootPixmap; Bool ret; void *pixels; + pScreen->CreateScreenResources = ms->createScreenResources; ret = pScreen->CreateScreenResources(pScreen); pScreen->CreateScreenResources = CreateScreenResources; if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) - return FALSE; + return FALSE; drmmode_uevent_init(pScrn, &ms->drmmode); @@ -828,33 +849,34 @@ CreateScreenResources(ScreenPtr pScreen) drmmode_map_cursor_bos(pScrn, &ms->drmmode); pixels = drmmode_map_front_bo(&ms->drmmode); if (!pixels) - return FALSE; + return FALSE; rootPixmap = pScreen->GetScreenPixmap(pScreen); if (ms->drmmode.shadow_enable) - pixels = ms->drmmode.shadow_fb; - + pixels = ms->drmmode.shadow_fb; + if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) - FatalError("Couldn't adjust screen pixmap\n"); + FatalError("Couldn't adjust screen pixmap\n"); if (ms->drmmode.shadow_enable) { - if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, - msShadowWindow, 0, 0)) - return FALSE; + if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, + msShadowWindow, 0, 0)) + return FALSE; } 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; + 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; } @@ -863,7 +885,7 @@ static Bool msShadowInit(ScreenPtr pScreen) { if (!shadowSetup(pScreen)) { - return FALSE; + return FALSE; } return TRUE; } @@ -876,11 +898,11 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) modesettingPtr ms = modesettingPTR(scrn); Bool ret; int size = ppix->devKind * ppix->drawable.height; - int ihandle = (int)(long)fd_handle; + int ihandle = (int) (long) fd_handle; ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size); if (ret == FALSE) - return ret; + return ret; return TRUE; } @@ -893,7 +915,7 @@ SetMaster(ScrnInfoPtr pScrn) #ifdef XF86_PDEV_SERVER_FD if (ms->pEnt->location.type == BUS_PLATFORM && - (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) return TRUE; #endif @@ -920,62 +942,64 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) /* HW dependent - FIXME */ pScrn->displayWidth = pScrn->virtualX; if (!drmmode_create_initial_bos(pScrn, &ms->drmmode)) - return FALSE; + 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; - } - + 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; + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; if (!miSetPixmapDepths()) - return FALSE; + return FALSE; - if (!dixRegisterScreenSpecificPrivateKey(pScreen, &ms->drmmode.pixmapPrivateKeyRec, - PRIVATE_PIXMAP, sizeof(msPixmapPrivRec))) { - 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; + 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; - } - } + /* 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); if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "shadow fb init failed\n"); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n"); + return FALSE; } - + ms->createScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = CreateScreenResources; @@ -987,9 +1011,9 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) /* 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_ARGB); + xf86_cursors_init(pScreen, ms->cursor_width, ms->cursor_height, + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | + 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 */ @@ -1005,15 +1029,15 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; if (!xf86CrtcScreenInit(pScreen)) - return FALSE; + return FALSE; if (!miCreateDefColormap(pScreen)) - return FALSE; + return FALSE; xf86DPMSInit(pScreen, xf86DPMSSet, 0); if (serverGeneration == 1) - xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); return EnterVT(pScrn); } @@ -1036,13 +1060,14 @@ 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)) + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) return; #endif @@ -1062,7 +1087,7 @@ EnterVT(ScrnInfoPtr pScrn) SetMaster(pScrn); if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) - return FALSE; + return FALSE; return TRUE; } @@ -1080,15 +1105,15 @@ CloseScreen(ScreenPtr pScreen) modesettingPtr ms = modesettingPTR(pScrn); if (ms->damage) { - DamageUnregister(ms->damage); - DamageDestroy(ms->damage); - ms->damage = NULL; + 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; + shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); + free(ms->drmmode.shadow_fb); + ms->drmmode.shadow_fb = NULL; } drmmode_uevent_fini(pScrn, &ms->drmmode); diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 450b29c..8a920b9 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -35,16 +35,14 @@ #include "drmmode_display.h" #define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg); -typedef struct -{ +typedef struct { int lastInstance; int refCount; ScrnInfoPtr pScrn_1; ScrnInfoPtr pScrn_2; } EntRec, *EntPtr; -typedef struct _modesettingRec -{ +typedef struct _modesettingRec { int fd; EntPtr entityPrivate; diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 9723ccd..ca02a4d 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -49,181 +49,183 @@ #include "driver.h" -static struct dumb_bo *dumb_bo_create(int fd, - const unsigned width, const unsigned height, - const unsigned bpp) +static 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; + 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; + free(bo); + return NULL; } -static int dumb_bo_map(int fd, struct dumb_bo *bo) +static int +dumb_bo_map(int fd, struct dumb_bo *bo) { - struct drm_mode_map_dumb arg; - int ret; - void *map; + struct drm_mode_map_dumb arg; + int ret; + void *map; - if (bo->ptr) { - bo->map_count++; - return 0; - } + if (bo->ptr) { + bo->map_count++; + return 0; + } - memset(&arg, 0, sizeof(arg)); - arg.handle = bo->handle; + memset(&arg, 0, sizeof(arg)); + arg.handle = bo->handle; - ret = drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); - if (ret) - return ret; + 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; + 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; + bo->ptr = map; + return 0; } #if 0 -static int dumb_bo_unmap(int fd, struct dumb_bo *bo) +static int +dumb_bo_unmap(int fd, struct dumb_bo *bo) { - bo->map_count--; - return 0; + bo->map_count--; + return 0; } #endif -static int dumb_bo_destroy(int fd, struct dumb_bo *bo) +static 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 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; } -static struct dumb_bo *dumb_get_bo_from_handle(int fd, int handle, int pitch, int size) +static struct dumb_bo * +dumb_get_bo_from_handle(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; + 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; } -Bool drmmode_SetSlaveBO(PixmapPtr ppix, - drmmode_ptr drmmode, - int fd_handle, int pitch, int size) +Bool +drmmode_SetSlaveBO(PixmapPtr ppix, + drmmode_ptr drmmode, int fd_handle, int pitch, int size) { - msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); + msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); - ppriv->backing_bo = dumb_get_bo_from_handle(drmmode->fd, fd_handle, pitch, size); - if (!ppriv->backing_bo) - return FALSE; + ppriv->backing_bo = + dumb_get_bo_from_handle(drmmode->fd, fd_handle, pitch, size); + if (!ppriv->backing_bo) + return FALSE; - close(fd_handle); - return TRUE; + close(fd_handle); + return TRUE; } static void -drmmode_ConvertFromKMode(ScrnInfoPtr scrn, - drmModeModeInfo *kmode, - DisplayModePtr mode) +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); + 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) +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; + 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; } @@ -231,331 +233,337 @@ static void drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) { #if 0 - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); -// drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -// drmmode_ptr drmmode = drmmode_crtc->drmmode; - - /* bonghits in the randr 1.2 - uses dpms to disable crtc - bad buzz */ - if (mode == DPMSModeOff) { -// drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, -// 0, 0, 0, NULL, 0, NULL); - } + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + +// drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; +// drmmode_ptr drmmode = drmmode_crtc->drmmode; + + /* bonghits in the randr 1.2 - uses dpms to disable crtc - bad buzz */ + if (mode == DPMSModeOff) { +// drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, +// 0, 0, 0, NULL, 0, NULL); + } #endif } #if 0 static PixmapPtr -create_pixmap_for_fbcon(drmmode_ptr drmmode, - ScrnInfoPtr pScrn, int crtc_id) +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; + 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) + 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->front_bo->pitch, - drmmode->front_bo->handle, - &drmmode->fb_id); - if (ret < 0) { - ErrorF("failed to add fb %d\n", ret); - return FALSE; - } + 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->front_bo->pitch, + drmmode->front_bo->handle, &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++; } - 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); - /* 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 (!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); + /* 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); + 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; - } + 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; + else + crtc->active = TRUE; #endif - return ret; + return ret; } static void -drmmode_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg) +drmmode_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { } static void -drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int y) +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; + 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); + drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); } static void -drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) +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; - uint32_t handle = drmmode_crtc->cursor_bo->handle; - int ret; - /* 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]); - - ret = drmModeSetCursor(drmmode_crtc->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 */ - } + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + int i; + uint32_t *ptr; + uint32_t handle = drmmode_crtc->cursor_bo->handle; + int ret; + + /* 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]); + + ret = + drmModeSetCursor(drmmode_crtc->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_hide_cursor (xf86CrtcPtr crtc) +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; + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; - drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, - ms->cursor_width, ms->cursor_height); + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, + ms->cursor_width, ms->cursor_height); } static void -drmmode_show_cursor (xf86CrtcPtr crtc) +drmmode_show_cursor(xf86CrtcPtr crtc) { - modesettingPtr ms = modesettingPTR(crtc->scrn); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - drmmode_ptr drmmode = drmmode_crtc->drmmode; - uint32_t handle = drmmode_crtc->cursor_bo->handle; - static Bool use_set_cursor2 = TRUE; - - if (use_set_cursor2) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - CursorPtr cursor = xf86_config->cursor; - int ret; - 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 == -EINVAL) - use_set_cursor2 = FALSE; - else - return; - } - - drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, - ms->cursor_width, ms->cursor_height); + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_ptr drmmode = drmmode_crtc->drmmode; + uint32_t handle = drmmode_crtc->cursor_bo->handle; + static Bool use_set_cursor2 = TRUE; + + if (use_set_cursor2) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + CursorPtr cursor = xf86_config->cursor; + int ret; + + 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 == -EINVAL) + use_set_cursor2 = FALSE; + else + return; + } + + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, + ms->cursor_width, ms->cursor_height); } static void -drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green, - uint16_t *blue, int size) +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; + 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); + 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; + 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) +static void * +drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { - return NULL; + return NULL; } -static PixmapPtr drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, - int height) +static PixmapPtr +drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { - return NULL; + return NULL; } static const xf86CrtcFuncsRec drmmode_crtc_funcs = { @@ -568,7 +576,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .load_cursor_argb = drmmode_load_cursor_argb, .gamma_set = drmmode_crtc_gamma_set, - .destroy = NULL, /* XXX */ + .destroy = NULL, /* XXX */ .set_scanout_pixmap = drmmode_set_scanout_pixmap, .shadow_allocate = drmmode_shadow_allocate, .shadow_create = drmmode_shadow_create, @@ -577,222 +585,224 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { 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; - crtc->driver_private = drmmode_crtc; + 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; + 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; + /* 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; + 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; + 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) +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); + 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); + 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; + 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; + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmModeConnectorPtr koutput = drmmode_output->mode_output; + drmmode_ptr drmmode = drmmode_output->drmmode; - if (!koutput) - return; + if (!koutput) + return; - drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, - drmmode_output->dpms_enum_id, mode); - 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; + return TRUE; /* ignore blob prop */ if (prop->flags & DRM_MODE_PROP_BLOB) - return TRUE; + return TRUE; /* ignore standard property */ - if (!strcmp(prop->name, "EDID") || - !strcmp(prop->name, "DPMS")) - return TRUE; + if (!strcmp(prop->name, "EDID") || !strcmp(prop->name, "DPMS")) + return TRUE; return FALSE; } @@ -806,128 +816,143 @@ drmmode_output_create_resources(xf86OutputPtr output) drmModePropertyPtr drmmode_prop; int i, j, err; - drmmode_output->props = calloc(mode_output->count_props, sizeof(drmmode_prop_rec)); + drmmode_output->props = + calloc(mode_output->count_props, sizeof(drmmode_prop_rec)); if (!drmmode_output->props) - return; - + 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++; + 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); - } - } + 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) + 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; - } - } - } + 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; @@ -952,401 +977,416 @@ static const xf86OutputFuncsRec drmmode_output_funcs = { }; 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", + 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, int *num_dvi, int *num_hdmi) +drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num, + int *num_dvi, int *num_hdmi) { - 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); - + 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) +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; + 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); - } + 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_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height) +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; - struct dumb_bo *old_front = NULL; - 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; - - if (scrn->virtualX == width && scrn->virtualY == height) - return TRUE; - - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Allocate new frame buffer %dx%d stride\n", - width, height); - - old_width = scrn->virtualX; - old_height = scrn->virtualY; - old_pitch = drmmode->front_bo->pitch; - old_fb_id = drmmode->fb_id; - old_front = drmmode->front_bo; - - drmmode->front_bo = dumb_bo_create(drmmode->fd, width, height, scrn->bitsPerPixel); - if (!drmmode->front_bo) - goto fail; - - pitch = drmmode->front_bo->pitch; - - scrn->virtualX = width; - scrn->virtualY = height; - scrn->displayWidth = pitch / cpp; - - ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, - scrn->bitsPerPixel, pitch, - drmmode->front_bo->handle, - &drmmode->fb_id); - if (ret) - goto fail; - - new_pixels = drmmode_map_front_bo(drmmode); - if (!new_pixels) - goto fail; - - if (!drmmode->shadow_enable) - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - pitch, new_pixels); - else { - void *new_shadow; - uint32_t size = scrn->displayWidth * scrn->virtualY * - ((scrn->bitsPerPixel + 7) >> 3); - new_shadow = calloc(1, size); - if (new_shadow == NULL) - goto fail; - free(drmmode->shadow_fb); - drmmode->shadow_fb = new_shadow; - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - pitch, drmmode->shadow_fb); - } - - 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); - dumb_bo_destroy(drmmode->fd, old_front); - } - - return TRUE; + 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; + struct dumb_bo *old_front = NULL; + 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; + + if (scrn->virtualX == width && scrn->virtualY == height) + return TRUE; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Allocate new frame buffer %dx%d stride\n", width, height); + + old_width = scrn->virtualX; + old_height = scrn->virtualY; + old_pitch = drmmode->front_bo->pitch; + old_fb_id = drmmode->fb_id; + old_front = drmmode->front_bo; + + drmmode->front_bo = + dumb_bo_create(drmmode->fd, width, height, scrn->bitsPerPixel); + if (!drmmode->front_bo) + goto fail; + + pitch = drmmode->front_bo->pitch; + + scrn->virtualX = width; + scrn->virtualY = height; + scrn->displayWidth = pitch / cpp; + + ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, + scrn->bitsPerPixel, pitch, + drmmode->front_bo->handle, &drmmode->fb_id); + if (ret) + goto fail; + + new_pixels = drmmode_map_front_bo(drmmode); + if (!new_pixels) + goto fail; + + if (!drmmode->shadow_enable) + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, + pitch, new_pixels); + else { + void *new_shadow; + uint32_t size = scrn->displayWidth * scrn->virtualY * + ((scrn->bitsPerPixel + 7) >> 3); + new_shadow = calloc(1, size); + if (new_shadow == NULL) + goto fail; + free(drmmode->shadow_fb); + drmmode->shadow_fb = new_shadow; + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, + pitch, drmmode->shadow_fb); + } + + 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); + dumb_bo_destroy(drmmode->fd, old_front); + } + + return TRUE; fail: - if (drmmode->front_bo) - dumb_bo_destroy(drmmode->fd, 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; + if (drmmode->front_bo) + dumb_bo_destroy(drmmode->fd, 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 + drmmode_xf86crtc_resize }; -Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) +Bool +drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) { - int i, num_dvi = 0, num_hdmi = 0; - 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; - } + int i, num_dvi = 0, num_hdmi = 0; + 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); + xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs); - drmmode->scrn = pScrn; - drmmode->cpp = cpp; - drmmode->mode_res = drmModeGetResources(drmmode->fd); - if (!drmmode->mode_res) - return FALSE; + 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); + 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, &num_dvi, &num_hdmi); + for (i = 0; i < drmmode->mode_res->count_connectors; i++) + drmmode_output_init(pScrn, drmmode, i, &num_dvi, &num_hdmi); - /* workout clones */ - drmmode_clones_init(pScrn, drmmode); + /* workout clones */ + drmmode_clones_init(pScrn, drmmode); #if XF86_CRTC_VERSION >= 5 - xf86ProviderSetup(pScrn, NULL, "modesetting"); + xf86ProviderSetup(pScrn, NULL, "modesetting"); #endif - xf86InitialConfiguration(pScrn, TRUE); + xf86InitialConfiguration(pScrn, TRUE); - return TRUE; + return TRUE; } -void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y) +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); - } + 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) +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; + 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) +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]; + 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; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - for (i = 0 ; i < 256; i++) { + 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) { + switch (pScrn->depth) { case 15: for (i = 0; i < numColors; i++) { index = indices[i]; @@ -1356,56 +1396,55 @@ static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors, 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 */ + 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) +Bool +drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) { - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, - "Initializing kms color map\n"); + 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 at suse.de) */ + drmmode_load_palette, NULL, CMAP_PALETTED_TRUECOLOR +#if 0 /* This option messes up text mode! (eich at suse.de) */ | CMAP_LOAD_EVEN_IF_OFFSCREEN #endif | CMAP_RELOAD_ON_MODE_SWITCH)) - return FALSE; + return FALSE; return TRUE; } @@ -1413,204 +1452,220 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) 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); + 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) +void +drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef HAVE_UDEV - 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; + 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) +void +drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode) { #ifdef HAVE_UDEV - if (drmmode->uevent_handler) { - struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor); - xf86RemoveGeneralHandler(drmmode->uevent_handler); + 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); - } + 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) +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; - - drmmode->front_bo = dumb_bo_create(drmmode->fd, width, height, bpp); - if (!drmmode->front_bo) - return FALSE; - pScrn->displayWidth = drmmode->front_bo->pitch / 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; + 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; + + drmmode->front_bo = dumb_bo_create(drmmode->fd, width, height, bpp); + if (!drmmode->front_bo) + return FALSE; + pScrn->displayWidth = drmmode->front_bo->pitch / 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) +void * +drmmode_map_front_bo(drmmode_ptr drmmode) { - int ret; + int ret; - if (drmmode->front_bo->ptr) - return drmmode->front_bo->ptr; + if (drmmode->front_bo->ptr) + return drmmode->front_bo->ptr; - ret = dumb_bo_map(drmmode->fd, drmmode->front_bo); - if (ret) - return NULL; + ret = dumb_bo_map(drmmode->fd, drmmode->front_bo); + if (ret) + return NULL; + + return drmmode->front_bo->ptr; - return drmmode->front_bo->ptr; - } -void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv) +void * +drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv) { - int ret; + int ret; - if (ppriv->backing_bo->ptr) - return ppriv->backing_bo->ptr; + if (ppriv->backing_bo->ptr) + return ppriv->backing_bo->ptr; - ret = dumb_bo_map(drmmode->fd, ppriv->backing_bo); - if (ret) - return NULL; + ret = dumb_bo_map(drmmode->fd, ppriv->backing_bo); + if (ret) + return NULL; - return ppriv->backing_bo->ptr; + return ppriv->backing_bo->ptr; } -Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) +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; + 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) +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; - } - - dumb_bo_destroy(drmmode->fd, drmmode->front_bo); - drmmode->front_bo = NULL; - - 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); - } + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + + if (drmmode->fb_id) { + drmModeRmFB(drmmode->fd, drmmode->fb_id); + drmmode->fb_id = 0; + } + + dumb_bo_destroy(drmmode->fd, drmmode->front_bo); + drmmode->front_bo = NULL; + + 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) +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; + 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/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index 7bfe885..438743b 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -74,11 +74,10 @@ typedef struct { 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 */ + 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; @@ -97,16 +96,16 @@ typedef struct _msPixmapPriv { 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)) 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); + 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); @@ -120,8 +119,8 @@ 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); - +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 @@ -132,5 +131,4 @@ void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, int *depth #define MS_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) - #endif -- 2.1.1 From jcristau at debian.org Wed Oct 8 04:54:50 2014 From: jcristau at debian.org (Julien Cristau) Date: Wed, 8 Oct 2014 13:54:50 +0200 Subject: [PATCH 03/18] rootless: remove redundant RootlessShapedWindowIn In-Reply-To: <1411497154-7684-4-git-send-email-ajax@redhat.com> References: <1411497154-7684-1-git-send-email-ajax@redhat.com> <1411497154-7684-4-git-send-email-ajax@redhat.com> Message-ID: <20141008115450.GJ3591@betterave.cristau.org> On Tue, Sep 23, 2014 at 14:32:19 -0400, Adam Jackson wrote: > miShapedWindowIn is identical. Which you would expect, since neither > one takes an actual WindowPtr argument, so they couldn't possibly make > reference to rootlessness. > > Signed-off-by: Adam Jackson > --- > miext/rootless/rootlessValTree.c | 65 ++-------------------------------------- > 1 file changed, 3 insertions(+), 62 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From ajax at redhat.com Wed Oct 8 05:17:12 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:12 +0200 Subject: [PATCH 0/7] Clean up hw/xwin/ renderers (and etc.) Message-ID: <1412770639-5577-1-git-send-email-ajax@redhat.com> The xwin ddx contains a multitude of rendering engines. The documentation claims that two of them are unsupported and broken, and neither of them have gotten any love in a very long time. So the first two patches in this series delete those two backends. Hooray! The remaining patches are more proof-of-concept than things I seriously want merged. They remove the mi implementations of some of the GC ops (and GetImage), since they're no longer used in-tree. It's not a huge win to do so: text data bss dec hex filename 2117700 54298 66912 2238910 2229be hw/xfree86/Xorg.before 2110554 54298 66912 2231764 220dd4 hw/xfree86/Xorg.after But maybe people like the idea anyway. If nothing else we should mark them _X_COLD. b/configure.ac | 2 b/doc/Xserver-spec.xml | 4 b/hw/xwin/InitOutput.c | 6 b/hw/xwin/Makefile.am | 21 - b/hw/xwin/man/XWin.man | 4 b/hw/xwin/win.h | 182 --------- b/hw/xwin/wincreatewnd.c | 23 - b/hw/xwin/winengine.c | 23 - b/hw/xwin/winmisc.c | 63 --- b/hw/xwin/winscrinit.c | 139 ------- b/hw/xwin/winwindow.c | 219 ----------- b/hw/xwin/winwndproc.c | 12 b/mi/Makefile.am | 2 b/mi/mi.h | 55 -- hw/xwin/winclip.c | 42 -- hw/xwin/winfillsp.c | 842 --------------------------------------------- hw/xwin/winfont.c | 82 ---- hw/xwin/wingc.c | 235 ------------ hw/xwin/wingetsp.c | 171 --------- hw/xwin/winnativegdi.c | 491 -------------------------- hw/xwin/winpfbdd.c | 620 --------------------------------- hw/xwin/winpixmap.c | 223 ----------- hw/xwin/winpolyline.c | 53 -- hw/xwin/winrop.c | 142 ------- hw/xwin/winsetsp.c | 175 --------- mi/mibitblt.c | 776 ----------------------------------------- mi/mifillrct.c | 132 ------- 27 files changed, 7 insertions(+), 4732 deletions(-) - ajax From ajax at redhat.com Wed Oct 8 05:17:14 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:14 +0200 Subject: [PATCH 2/7] xwin: Remove primary DirectDraw engine In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-3-git-send-email-ajax@redhat.com> Again, as the documentation says, "unsupported, obsolete". Signed-off-by: Adam Jackson --- configure.ac | 1 - hw/xwin/InitOutput.c | 3 - hw/xwin/Makefile.am | 6 - hw/xwin/man/XWin.man | 2 - hw/xwin/win.h | 12 - hw/xwin/winengine.c | 14 -- hw/xwin/winpfbdd.c | 620 --------------------------------------------------- hw/xwin/winwndproc.c | 12 +- 8 files changed, 2 insertions(+), 668 deletions(-) delete mode 100644 hw/xwin/winpfbdd.c diff --git a/configure.ac b/configure.ac index a12e9e2..3a72947 100644 --- a/configure.ac +++ b/configure.ac @@ -2206,7 +2206,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_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]) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 96e1006..e867119 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -735,9 +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 ); ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n"); diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index dea55b4..0ea8ba7 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -37,12 +37,6 @@ DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la endif -if XWIN_PRIMARYFB -SRCS_PRIMARYFB = \ - winpfbdd.c -DEFS_PRIMARYFB = -DXWIN_PRIMARYFB -endif - if XWIN_RANDR SRCS_RANDR = \ winrandr.c diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index f3eca1e..a043ac2 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -261,8 +261,6 @@ Shadow GDI Shadow DirectDraw .IP 4 4 Shadow DirectDraw Non-Locking -.IP 8 4 -Primary DirectDraw (unsupported, obsolete) .RE .SH FULLSCREEN OPTIONS diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 6b3e42a..ed1ad01 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -103,9 +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 #define AltMapIndex Mod1MapIndex #define NumLockMapIndex Mod2MapIndex @@ -913,15 +910,6 @@ winMouseButtonsHandle(ScreenPtr pScreen, void winEnqueueMotion(int x, int y); -#ifdef XWIN_PRIMARYFB -/* - * winpfbddd.c - */ - -Bool - winSetEngineFunctionsPrimaryDD(ScreenPtr pScreen); -#endif - /* * winscrinit.c */ diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c index 8aa9051..b473b3a 100644 --- a/hw/xwin/winengine.c +++ b/hw/xwin/winengine.c @@ -90,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 */ @@ -202,11 +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 default: FatalError("winSetEngine - Invalid engine type\n"); } diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c deleted file mode 100644 index 0106161..0000000 --- a/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/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index e3adb56..1b09921 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -163,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; } @@ -191,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"); -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:15 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:15 +0200 Subject: [PATCH 3/7] mi: Remove miPutImage In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-4-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mi.h | 12 ------- mi/mibitblt.c | 105 ---------------------------------------------------------- 2 files changed, 117 deletions(-) diff --git a/mi/mi.h b/mi/mi.h index d5a5ba3..1d9f76a 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -113,18 +113,6 @@ extern _X_EXPORT void miGetImage(DrawablePtr /*pDraw */ , char * /*pdstLine */ ); -extern _X_EXPORT void miPutImage(DrawablePtr /*pDraw */ , - GCPtr /*pGC */ , - int /*depth */ , - int /*x */ , - int /*y */ , - int /*w */ , - int /*h */ , - int /*leftPad */ , - int /*format */ , - char * /*pImage */ - ); - /* micopy.c */ #define miGetCompositeClip(pGC) ((pGC)->pCompositeClip) diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 3ed4ed1..c2e4d56 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -669,108 +669,3 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, (MiBits *) pDst); } } - -/* 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 - * 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 - * 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 - * 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 - * plane and recursive call ourself with the format set to XYBitmap - * (This clever idea courtesy of RGD.) - * ZPixmap format: - * This part is simple, just call SetSpans - */ -void -miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, char *pImage) -{ - DDXPointPtr pptFirst, ppt; - int *pwidthFirst, *pwidth; - RegionPtr prgnSrc; - BoxRec box; - unsigned long oldFg, oldBg; - ChangeGCVal gcv[3]; - unsigned long oldPlanemask; - unsigned long i; - long bytesPer; - - if (!w || !h) - return; - switch (format) { - case XYBitmap: - - box.x1 = 0; - box.y1 = 0; - box.x2 = w; - box.y2 = h; - prgnSrc = RegionCreate(&box, 1); - - miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage, - leftPad, w, h, x, y); - RegionDestroy(prgnSrc); - break; - - case XYPixmap: - depth = pGC->depth; - oldPlanemask = pGC->planemask; - oldFg = pGC->fgPixel; - oldBg = pGC->bgPixel; - gcv[0].val = (XID) ~0; - gcv[1].val = (XID) 0; - ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv); - bytesPer = (long) h *BitmapBytePad(w + leftPad); - - for (i = (unsigned long) 1 << (depth - 1); i != 0; i >>= 1, pImage += bytesPer) { - if (i & oldPlanemask) { - gcv[0].val = (XID) i; - ChangeGC(NullClient, pGC, GCPlaneMask, gcv); - ValidateGC(pDraw, pGC); - (*pGC->ops->PutImage) (pDraw, pGC, 1, x, y, w, h, leftPad, - XYBitmap, (char *) pImage); - } - } - gcv[0].val = (XID) oldPlanemask; - gcv[1].val = (XID) oldFg; - gcv[2].val = (XID) oldBg; - ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, - gcv); - ValidateGC(pDraw, pGC); - break; - - case ZPixmap: - ppt = pptFirst = malloc(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = malloc(h * sizeof(int)); - if (!pptFirst || !pwidthFirst) { - free(pwidthFirst); - free(pptFirst); - return; - } - if (pGC->miTranslate) { - x += pDraw->x; - y += pDraw->y; - } - - for (i = 0; i < h; i++) { - ppt->x = x; - ppt->y = y + i; - ppt++; - *pwidth++ = w; - } - - (*pGC->ops->SetSpans) (pDraw, pGC, (char *) pImage, pptFirst, - pwidthFirst, h, TRUE); - free(pwidthFirst); - free(pptFirst); - break; - } -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:16 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:16 +0200 Subject: [PATCH 4/7] mi: Remove miCopyArea In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-5-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mi.h | 11 ---- mi/mibitblt.c | 187 ---------------------------------------------------------- 2 files changed, 198 deletions(-) diff --git a/mi/mi.h b/mi/mi.h index 1d9f76a..884af9a 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -80,17 +80,6 @@ extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ , /* mibitblt.c */ -extern _X_EXPORT RegionPtr miCopyArea(DrawablePtr /*pSrcDrawable */ , - DrawablePtr /*pDstDrawable */ , - GCPtr /*pGC */ , - int /*xIn */ , - int /*yIn */ , - int /*widthSrc */ , - int /*heightSrc */ , - int /*xOut */ , - int /*yOut */ - ); - extern _X_EXPORT RegionPtr miCopyPlane(DrawablePtr /*pSrcDrawable */ , DrawablePtr /*pDstDrawable */ , GCPtr /*pGC */ , diff --git a/mi/mibitblt.c b/mi/mibitblt.c index c2e4d56..f6c5998 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -66,193 +66,6 @@ SOFTWARE. extern int ffs(int); #endif -/* 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 -miCopyArea(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut) -{ - DDXPointPtr ppt, pptFirst; - unsigned int *pwidthFirst, *pwidth, *pbits; - BoxRec srcBox, *prect; - - /* may be a new region, or just a copy */ - RegionPtr prgnSrcClip; - - /* non-0 if we've created a src clip */ - RegionPtr prgnExposed; - int realSrcClip = 0; - int srcx, srcy, dstx, dsty, i, j, y, width, height, xMin, xMax, yMin, yMax; - unsigned int *ordering; - int numRects; - BoxPtr boxes; - - srcx = xIn + pSrcDrawable->x; - srcy = yIn + pSrcDrawable->y; - - /* If the destination isn't realized, this is easy */ - if (pDstDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) pDstDrawable)->realized) - return NULL; - - /* clip the source */ - if (pSrcDrawable->type == DRAWABLE_PIXMAP) { - BoxRec box; - - box.x1 = pSrcDrawable->x; - box.y1 = pSrcDrawable->y; - box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; - box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - - prgnSrcClip = RegionCreate(&box, 1); - realSrcClip = 1; - } - else { - if (pGC->subWindowMode == IncludeInferiors) { - prgnSrcClip = NotClippedByChildren((WindowPtr) pSrcDrawable); - realSrcClip = 1; - } - else - prgnSrcClip = &((WindowPtr) pSrcDrawable)->clipList; - } - - /* If the src drawable is a window, we need to translate the srcBox so - * that we can compare it with the window's clip region later on. */ - srcBox.x1 = srcx; - srcBox.y1 = srcy; - srcBox.x2 = srcx + widthSrc; - srcBox.y2 = srcy + heightSrc; - - dstx = xOut; - dsty = yOut; - if (pGC->miTranslate) { - dstx += pDstDrawable->x; - dsty += pDstDrawable->y; - } - - pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec)); - pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int)); - numRects = RegionNumRects(prgnSrcClip); - boxes = RegionRects(prgnSrcClip); - ordering = malloc(numRects * sizeof(unsigned int)); - if (!pptFirst || !pwidthFirst || !ordering) { - free(ordering); - free(pwidthFirst); - free(pptFirst); - return NULL; - } - - /* If not the same drawable then order of move doesn't matter. - Following assumes that boxes are sorted from top - to bottom and left to right. - */ - if ((pSrcDrawable != pDstDrawable) && - ((pGC->subWindowMode != IncludeInferiors) || - (pSrcDrawable->type == DRAWABLE_PIXMAP) || - (pDstDrawable->type == DRAWABLE_PIXMAP))) - for (i = 0; i < numRects; i++) - ordering[i] = i; - else { /* within same drawable, must sequence moves carefully! */ - if (dsty <= srcBox.y1) { /* Scroll up or stationary vertical. - Vertical order OK */ - if (dstx <= srcBox.x1) /* Scroll left or stationary horizontal. - Horizontal order OK as well */ - for (i = 0; i < numRects; i++) - ordering[i] = i; - else { /* scroll right. must reverse horizontal banding of rects. */ - for (i = 0, j = 1, xMax = 0; i < numRects; j = i + 1, xMax = i) { - /* find extent of current horizontal band */ - y = boxes[i].y1; /* band has this y coordinate */ - while ((j < numRects) && (boxes[j].y1 == y)) - j++; - /* reverse the horizontal band in the output ordering */ - for (j--; j >= xMax; j--, i++) - ordering[i] = j; - } - } - } - else { /* Scroll down. Must reverse vertical banding. */ - if (dstx < srcBox.x1) { /* Scroll left. Horizontal order OK. */ - for (i = numRects - 1, j = i - 1, yMin = i, yMax = 0; - i >= 0; j = i - 1, yMin = i) { - /* find extent of current horizontal band */ - y = boxes[i].y1; /* band has this y coordinate */ - while ((j >= 0) && (boxes[j].y1 == y)) - j--; - /* reverse the horizontal band in the output ordering */ - for (j++; j <= yMin; j++, i--, yMax++) - ordering[yMax] = j; - } - } - else /* Scroll right or horizontal stationary. - Reverse horizontal order as well (if stationary, horizontal - order can be swapped without penalty and this is faster - to compute). */ - for (i = 0, j = numRects - 1; i < numRects; i++, j--) - ordering[i] = j; - } - } - - for (i = 0; i < numRects; i++) { - prect = &boxes[ordering[i]]; - xMin = max(prect->x1, srcBox.x1); - xMax = min(prect->x2, srcBox.x2); - yMin = max(prect->y1, srcBox.y1); - yMax = min(prect->y2, srcBox.y2); - /* is there anything visible here? */ - if (xMax <= xMin || yMax <= yMin) - continue; - - ppt = pptFirst; - pwidth = pwidthFirst; - y = yMin; - height = yMax - yMin; - width = xMax - xMin; - - for (j = 0; j < height; j++) { - /* We must untranslate before calling GetSpans */ - ppt->x = xMin; - ppt++->y = y++; - *pwidth++ = width; - } - pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth)); - if (pbits) { - (*pSrcDrawable->pScreen->GetSpans) (pSrcDrawable, width, pptFirst, - (int *) pwidthFirst, height, - (char *) pbits); - ppt = pptFirst; - pwidth = pwidthFirst; - xMin -= (srcx - dstx); - y = yMin - (srcy - dsty); - for (j = 0; j < height; j++) { - ppt->x = xMin; - ppt++->y = y++; - *pwidth++ = width; - } - - (*pGC->ops->SetSpans) (pDstDrawable, pGC, (char *) pbits, pptFirst, - (int *) pwidthFirst, height, TRUE); - free(pbits); - } - } - prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, - widthSrc, heightSrc, xOut, yOut, - (unsigned long) 0); - if (realSrcClip) - RegionDestroy(prgnSrcClip); - - free(ordering); - free(pwidthFirst); - free(pptFirst); - return prgnExposed; -} - /* MIGETPLANE -- gets a bitmap representing one plane of pDraw * A helper used for CopyPlane and XY format GetImage * No clever strategy here, we grab a scanline at a time, pull out the -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:17 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:17 +0200 Subject: [PATCH 5/7] mi: Remove miCopyPlane In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-6-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mi.h | 12 ---- mi/mibitblt.c | 225 ---------------------------------------------------------- 2 files changed, 237 deletions(-) diff --git a/mi/mi.h b/mi/mi.h index 884af9a..48bc272 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -80,18 +80,6 @@ extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ , /* mibitblt.c */ -extern _X_EXPORT RegionPtr miCopyPlane(DrawablePtr /*pSrcDrawable */ , - DrawablePtr /*pDstDrawable */ , - GCPtr /*pGC */ , - int /*srcx */ , - int /*srcy */ , - int /*width */ , - int /*height */ , - int /*dstx */ , - int /*dsty */ , - unsigned long /*bitPlane */ - ); - extern _X_EXPORT void miGetImage(DrawablePtr /*pDraw */ , int /*sx */ , int /*sy */ , diff --git a/mi/mibitblt.c b/mi/mibitblt.c index f6c5998..bbba14b 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -172,231 +172,6 @@ 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 - * bitmap and stipple those bits onto the destination drawable by doing a - * 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 -miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, - MiBits * pbits, int srcx, int w, int h, int dstx, int dsty) -{ - int oldfill, i; - unsigned long oldfg; - int *pwidth, *pwidthFirst; - ChangeGCVal gcv[6]; - PixmapPtr pStipple, pPixmap; - DDXPointRec oldOrg; - GCPtr pGCT; - DDXPointPtr ppt, pptFirst; - xRectangle rect; - RegionPtr prgnSrcClip; - - pPixmap = (*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, w + srcx, h, 1, CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) - return; - - /* Put the image into a 1 bit deep pixmap */ - pGCT = GetScratchGC(1, pDraw->pScreen); - if (!pGCT) { - (*pDraw->pScreen->DestroyPixmap) (pPixmap); - return; - } - /* First set the whole pixmap to 0 */ - gcv[0].val = 0; - ChangeGC(NullClient, pGCT, GCBackground, gcv); - ValidateGC((DrawablePtr) pPixmap, pGCT); - miClearDrawable((DrawablePtr) pPixmap, pGCT); - ppt = pptFirst = malloc(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = malloc(h * sizeof(int)); - if (!pptFirst || !pwidthFirst) { - free(pwidthFirst); - free(pptFirst); - FreeScratchGC(pGCT); - return; - } - - /* we need a temporary region because ChangeClip must be assumed - to destroy what it's sent. note that this means we don't - have to free prgnSrcClip ourselves. - */ - prgnSrcClip = RegionCreate(NULL, 0); - RegionCopy(prgnSrcClip, prgnSrc); - RegionTranslate(prgnSrcClip, srcx, 0); - (*pGCT->funcs->ChangeClip) (pGCT, CT_REGION, prgnSrcClip, 0); - ValidateGC((DrawablePtr) pPixmap, pGCT); - - /* Since we know pDraw is always a pixmap, we never need to think - * about translation here */ - for (i = 0; i < h; i++) { - ppt->x = 0; - ppt++->y = i; - *pwidth++ = w + srcx; - } - - (*pGCT->ops->SetSpans) ((DrawablePtr) pPixmap, pGCT, (char *) pbits, - pptFirst, pwidthFirst, h, TRUE); - free(pwidthFirst); - free(pptFirst); - - /* Save current values from the client GC */ - oldfill = pGC->fillStyle; - pStipple = pGC->stipple; - if (pStipple) - pStipple->refcnt++; - oldOrg = pGC->patOrg; - - /* Set a new stipple in the drawable */ - gcv[0].val = FillStippled; - gcv[1].ptr = pPixmap; - gcv[2].val = dstx - srcx; - gcv[3].val = dsty; - - ChangeGC(NullClient, pGC, - GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin, - gcv); - ValidateGC(pDraw, pGC); - - /* Fill the drawable with the stipple. This will draw the - * foreground color whereever 1 bits are set, leaving everything - * with 0 bits untouched. Note that the part outside the clip - * region is all 0s. */ - rect.x = dstx; - rect.y = dsty; - rect.width = w; - rect.height = h; - (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); - - /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only - * within the clipping region, the part outside is still all 0s */ - gcv[0].val = GXinvert; - ChangeGC(NullClient, pGCT, GCFunction, gcv); - ValidateGC((DrawablePtr) pPixmap, pGCT); - (*pGCT->ops->CopyArea) ((DrawablePtr) pPixmap, (DrawablePtr) pPixmap, - pGCT, 0, 0, w + srcx, h, 0, 0); - - /* Swap foreground and background colors on the GC for the drawable. - * Now when we fill the drawable, we will fill in the "Background" - * values */ - oldfg = pGC->fgPixel; - gcv[0].val = pGC->bgPixel; - gcv[1].val = oldfg; - gcv[2].ptr = pPixmap; - ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv); - ValidateGC(pDraw, pGC); - /* PolyFillRect might have bashed the rectangle */ - rect.x = dstx; - rect.y = dsty; - rect.width = w; - rect.height = h; - (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect); - - /* Now put things back */ - if (pStipple) - pStipple->refcnt--; - gcv[0].val = oldfg; - gcv[1].val = pGC->fgPixel; - gcv[2].val = oldfill; - gcv[3].ptr = pStipple; - gcv[4].val = oldOrg.x; - gcv[5].val = oldOrg.y; - ChangeGC(NullClient, pGC, - GCForeground | GCBackground | GCFillStyle | GCStipple | - GCTileStipXOrigin | GCTileStipYOrigin, gcv); - - ValidateGC(pDraw, pGC); - /* put what we hope is a smaller clip region back in the scratch gc */ - (*pGCT->funcs->ChangeClip) (pGCT, CT_NONE, NULL, 0); - FreeScratchGC(pGCT); - (*pDraw->pScreen->DestroyPixmap) (pPixmap); - -} - -/* MICOPYPLANE -- public entry for the CopyPlane request. - * 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 - */ -RegionPtr -miCopyPlane(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - int srcx, - int srcy, - int width, int height, int dstx, int dsty, unsigned long bitPlane) -{ - MiBits *ptile; - BoxRec box; - RegionPtr prgnSrc, prgnExposed; - - /* incorporate the source clip */ - - box.x1 = srcx + pSrcDrawable->x; - box.y1 = srcy + pSrcDrawable->y; - box.x2 = box.x1 + width; - box.y2 = box.y1 + height; - /* clip to visible drawable */ - if (box.x1 < pSrcDrawable->x) - box.x1 = pSrcDrawable->x; - if (box.y1 < pSrcDrawable->y) - box.y1 = pSrcDrawable->y; - if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) - box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; - if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) - box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - prgnSrc = RegionCreate(&box, 1); - - if (pSrcDrawable->type != DRAWABLE_PIXMAP) { - /* clip to visible drawable */ - - if (pGC->subWindowMode == IncludeInferiors) { - RegionPtr clipList = NotClippedByChildren((WindowPtr) pSrcDrawable); - - RegionIntersect(prgnSrc, prgnSrc, clipList); - RegionDestroy(clipList); - } - else - RegionIntersect(prgnSrc, prgnSrc, - &((WindowPtr) pSrcDrawable)->clipList); - } - - box = *RegionExtents(prgnSrc); - RegionTranslate(prgnSrc, -box.x1, -box.y1); - - if ((box.x2 > box.x1) && (box.y2 > box.y1)) { - /* minimize the size of the data extracted */ - /* note that we convert the plane mask bitPlane into a plane number */ - box.x1 -= pSrcDrawable->x; - box.x2 -= pSrcDrawable->x; - box.y1 -= pSrcDrawable->y; - box.y2 -= pSrcDrawable->y; - ptile = miGetPlane(pSrcDrawable, ffs(bitPlane) - 1, - box.x1, box.y1, - box.x2 - box.x1, box.y2 - box.y1, (MiBits *) NULL); - if (ptile) { - miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0, - box.x2 - box.x1, box.y2 - box.y1, - dstx + box.x1 - srcx, dsty + box.y1 - srcy); - free(ptile); - } - } - prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane); - RegionDestroy(prgnSrc); - return prgnExposed; -} - /* MIGETIMAGE -- public entry for the GetImage Request * We're getting the image into a memory buffer. While we have to use GetSpans * to read a line from the device (since we don't know what that looks like), -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:18 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:18 +0200 Subject: [PATCH 6/7] mi: Remove miPolyFillRect In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-7-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- doc/Xserver-spec.xml | 4 +- mi/Makefile.am | 1 - mi/mi.h | 8 ---- mi/mifillrct.c | 132 --------------------------------------------------- 4 files changed, 2 insertions(+), 143 deletions(-) delete mode 100644 mi/mifillrct.c diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml index 4c34419..3d5c069 100644 --- a/doc/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -4229,8 +4229,8 @@ An example implementation is miFillPolygon() in Xserver/mi/mipoly.c. PolyFillRect fills multiple rectangles. -Example implementations are fbPolyFillRect() in Xserver/fb/fbfillrect.c and -miPolyFillRect() in Xserver/mi/mifillrct.c. +An example implementations is fbPolyFillRect() in Xserver/fb/fbfillrect.c. +
diff --git a/mi/Makefile.am b/mi/Makefile.am index 0cef779..407900a 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -23,7 +23,6 @@ libmi_la_SOURCES = \ miexpose.c \ mifillarc.c \ mifillarc.h \ - mifillrct.c \ mifpolycon.c \ mifpoly.h \ migc.c \ diff --git a/mi/mi.h b/mi/mi.h index 48bc272..356f494 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -225,14 +225,6 @@ extern _X_EXPORT void miClearDrawable(DrawablePtr /*pDraw */ , GCPtr /*pGC */ ); -/* mifillrct.c */ - -extern _X_EXPORT void miPolyFillRect(DrawablePtr /*pDrawable */ , - GCPtr /*pGC */ , - int /*nrectFill */ , - xRectangle * /*prectInit */ - ); - /* miglblt.c */ extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable, diff --git a/mi/mifillrct.c b/mi/mifillrct.c deleted file mode 100644 index 79c4057..0000000 --- a/mi/mifillrct.c +++ /dev/null @@ -1,132 +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 "pixmap.h" -#include "mi.h" -#include "misc.h" - -/* mi rectangles - written by newman, with debts to all and sundry -*/ - -/* MIPOLYFILLRECT -- public entry for PolyFillRect request - * very straight forward: translate rectangles if necessary - * then call FillSpans to fill each rectangle. We let FillSpans worry about - * clipping to the destination - */ -void -miPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, /* number of rectangles to fill */ - xRectangle *prectInit /* Pointer to first rectangle to fill */ - ) -{ - int i; - int height; - int width; - xRectangle *prect; - int xorg; - int yorg; - int maxheight; - DDXPointPtr pptFirst; - DDXPointPtr ppt; - int *pwFirst; - int *pw; - - if (pGC->miTranslate) { - xorg = pDrawable->x; - yorg = pDrawable->y; - prect = prectInit; - maxheight = 0; - for (i = 0; i < nrectFill; i++, prect++) { - prect->x += xorg; - prect->y += yorg; - maxheight = max(maxheight, prect->height); - } - } - else { - prect = prectInit; - maxheight = 0; - for (i = 0; i < nrectFill; i++, prect++) - maxheight = max(maxheight, prect->height); - } - - pptFirst = malloc(maxheight * sizeof(DDXPointRec)); - pwFirst = malloc(maxheight * sizeof(int)); - if (!pptFirst || !pwFirst) { - free(pwFirst); - free(pptFirst); - return; - } - - prect = prectInit; - while (nrectFill--) { - ppt = pptFirst; - pw = pwFirst; - height = prect->height; - width = prect->width; - xorg = prect->x; - yorg = prect->y; - while (height--) { - *pw++ = width; - ppt->x = xorg; - ppt->y = yorg; - ppt++; - yorg++; - } - (*pGC->ops->FillSpans) (pDrawable, pGC, - prect->height, pptFirst, pwFirst, 1); - prect++; - } - free(pwFirst); - free(pptFirst); -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:19 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:19 +0200 Subject: [PATCH 7/7] mi: Remove miGetImage In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-8-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 1 - mi/mi.h | 12 --- mi/mibitblt.c | 259 --------------------------------------------------------- 3 files changed, 272 deletions(-) delete mode 100644 mi/mibitblt.c diff --git a/mi/Makefile.am b/mi/Makefile.am index 407900a..c3e26e3 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -11,7 +11,6 @@ AM_CFLAGS = $(DIX_CFLAGS) libmi_la_SOURCES = \ mi.h \ miarc.c \ - mibitblt.c \ micmap.c \ micmap.h \ micoord.h \ diff --git a/mi/mi.h b/mi/mi.h index 356f494..6a773c3 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -78,18 +78,6 @@ extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ , xArc * /*parcs */ ); -/* mibitblt.c */ - -extern _X_EXPORT void miGetImage(DrawablePtr /*pDraw */ , - int /*sx */ , - int /*sy */ , - int /*w */ , - int /*h */ , - unsigned int /*format */ , - unsigned long /*planeMask */ , - char * /*pdstLine */ - ); - /* micopy.c */ #define miGetCompositeClip(pGC) ((pGC)->pCompositeClip) diff --git a/mi/mibitblt.c b/mi/mibitblt.c deleted file mode 100644 index bbba14b..0000000 --- a/mi/mibitblt.c +++ /dev/null @@ -1,259 +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. - -******************************************************************/ -/* Author: Todd Newman (aided and abetted by Mr. Drewry) */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include - -#include "misc.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "mi.h" -#include "regionstr.h" -#include -#include "servermd.h" - -#ifndef HAVE_FFS -extern int ffs(int); -#endif - -/* MIGETPLANE -- gets a bitmap representing one plane of pDraw - * 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. - */ -/* - * This should be replaced with something more general. mi shouldn't have to - * care about such things as scanline padding et alia. - */ -static -MiBits * -miGetPlane(DrawablePtr pDraw, int planeNum, /* number of the bitPlane */ - int sx, int sy, int w, int h, MiBits * result) -{ - int i, j, k, width, bitsPerPixel, widthInBytes; - DDXPointRec pt = { 0, 0 }; - MiBits pixel; - MiBits bit; - unsigned char *pCharsOut = NULL; - -#if BITMAP_SCANLINE_UNIT == 8 -#define OUT_TYPE unsigned char -#endif -#if BITMAP_SCANLINE_UNIT == 16 -#define OUT_TYPE CARD16 -#endif -#if BITMAP_SCANLINE_UNIT == 32 -#define OUT_TYPE CARD32 -#endif -#if BITMAP_SCANLINE_UNIT == 64 -#define OUT_TYPE CARD64 -#endif - - OUT_TYPE *pOut; - int delta = 0; - - sx += pDraw->x; - sy += pDraw->y; - widthInBytes = BitmapBytePad(w); - if (!result) - result = calloc(h, widthInBytes); - if (!result) - return NULL; - bitsPerPixel = pDraw->bitsPerPixel; - pOut = (OUT_TYPE *) result; - if (bitsPerPixel == 1) { - pCharsOut = (unsigned char *) result; - width = w; - } - else { - delta = (widthInBytes / (BITMAP_SCANLINE_UNIT / 8)) - - (w / BITMAP_SCANLINE_UNIT); - width = 1; -#if IMAGE_BYTE_ORDER == MSBFirst - planeNum += (32 - bitsPerPixel); -#endif - } - pt.y = sy; - for (i = h; --i >= 0; pt.y++) { - pt.x = sx; - if (bitsPerPixel == 1) { - (*pDraw->pScreen->GetSpans) (pDraw, width, &pt, &width, 1, - (char *) pCharsOut); - pCharsOut += widthInBytes; - } - else { - k = 0; - for (j = w; --j >= 0; pt.x++) { - /* Fetch the next pixel */ - (*pDraw->pScreen->GetSpans) (pDraw, width, &pt, &width, 1, - (char *) &pixel); - /* - * Now get the bit and insert into a bitmap in XY format. - */ - bit = (pixel >> planeNum) & 1; -#if 0 - /* XXX assuming bit order == byte order */ -#if BITMAP_BIT_ORDER == LSBFirst - bit <<= k; -#else - bit <<= ((BITMAP_SCANLINE_UNIT - 1) - k); -#endif -#else - /* XXX assuming byte order == LSBFirst */ - if (screenInfo.bitmapBitOrder == LSBFirst) - bit <<= k; - else - bit <<= ((screenInfo.bitmapScanlineUnit - 1) - - (k % screenInfo.bitmapScanlineUnit)) + - ((k / screenInfo.bitmapScanlineUnit) * - screenInfo.bitmapScanlineUnit); -#endif - *pOut |= (OUT_TYPE) bit; - k++; - if (k == BITMAP_SCANLINE_UNIT) { - pOut++; - k = 0; - } - } - pOut += delta; - } - } - return result; - -} - -/* MIGETIMAGE -- public entry for the GetImage Request - * We're getting the image into a memory buffer. While we have to use GetSpans - * to read a line from the device (since we don't know what that looks like), - * we can just write into the destination buffer - * - * two different strategies are used, depending on whether we're getting the - * image in Z format or XY format - * Z format: - * Line at a time, GetSpans a line into the destination buffer, then if the - * planemask is not all ones, we do a SetSpans into a temporary buffer (to get - * bits turned off) and then another GetSpans to get stuff back (because - * pixmaps are opaque, and we are passed in the memory to write into). This is - * pretty ugly and slow but works. Life is hard. - * XY format: - * get the single plane specified in planemask - */ -void -miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, - unsigned int format, unsigned long planeMask, char *pDst) -{ - unsigned char depth; - int i, linelength, width, srcx, srcy; - DDXPointRec pt = { 0, 0 }; - PixmapPtr pPixmap = NULL; - GCPtr pGC = NULL; - - depth = pDraw->depth; - if (format == ZPixmap) { - if ((((1LL << depth) - 1) & planeMask) != (1LL << depth) - 1) { - ChangeGCVal gcv; - xPoint xpt; - - pGC = GetScratchGC(depth, pDraw->pScreen); - if (!pGC) - return; - pPixmap = (*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, w, 1, depth, CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) { - FreeScratchGC(pGC); - return; - } - /* - * Clear the pixmap before doing anything else - */ - ValidateGC((DrawablePtr) pPixmap, pGC); - xpt.x = xpt.y = 0; - width = w; - (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &xpt, &width, - TRUE); - - /* alu is already GXCopy */ - gcv.val = (XID) planeMask; - ChangeGC(NullClient, pGC, GCPlaneMask, &gcv); - ValidateGC((DrawablePtr) pPixmap, pGC); - } - - linelength = PixmapBytePad(w, depth); - srcx = sx + pDraw->x; - srcy = sy + pDraw->y; - for (i = 0; i < h; i++) { - pt.x = srcx; - pt.y = srcy + i; - width = w; - (*pDraw->pScreen->GetSpans) (pDraw, w, &pt, &width, 1, pDst); - if (pPixmap) { - pt.x = 0; - pt.y = 0; - width = w; - (*pGC->ops->SetSpans) ((DrawablePtr) pPixmap, pGC, pDst, - &pt, &width, 1, TRUE); - (*pDraw->pScreen->GetSpans) ((DrawablePtr) pPixmap, w, &pt, - &width, 1, pDst); - } - pDst += linelength; - } - if (pPixmap) { - (*pGC->pScreen->DestroyPixmap) (pPixmap); - FreeScratchGC(pGC); - } - } - else { - (void) miGetPlane(pDraw, ffs(planeMask) - 1, sx, sy, w, h, - (MiBits *) pDst); - } -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 05:17:13 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 14:17:13 +0200 Subject: [PATCH 1/7] xwin: Remove native GDI engine In-Reply-To: <1412770639-5577-1-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> Message-ID: <1412770639-5577-2-git-send-email-ajax@redhat.com> 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. Signed-off-by: Adam Jackson --- configure.ac | 1 - hw/xwin/InitOutput.c | 3 - hw/xwin/Makefile.am | 15 - hw/xwin/man/XWin.man | 2 - hw/xwin/win.h | 170 ---------- hw/xwin/winclip.c | 42 --- hw/xwin/wincreatewnd.c | 23 +- hw/xwin/winengine.c | 9 - hw/xwin/winfillsp.c | 842 ------------------------------------------------- hw/xwin/winfont.c | 82 ----- hw/xwin/wingc.c | 235 -------------- hw/xwin/wingetsp.c | 171 ---------- hw/xwin/winmisc.c | 63 ---- hw/xwin/winnativegdi.c | 491 ---------------------------- hw/xwin/winpixmap.c | 223 ------------- hw/xwin/winpolyline.c | 53 ---- hw/xwin/winrop.c | 142 --------- hw/xwin/winscrinit.c | 139 -------- hw/xwin/winsetsp.c | 175 ---------- hw/xwin/winwindow.c | 219 ------------- 20 files changed, 3 insertions(+), 3097 deletions(-) delete mode 100644 hw/xwin/winclip.c delete mode 100644 hw/xwin/winfillsp.c delete mode 100644 hw/xwin/winfont.c delete mode 100644 hw/xwin/wingc.c delete mode 100644 hw/xwin/wingetsp.c delete mode 100644 hw/xwin/winnativegdi.c delete mode 100644 hw/xwin/winpixmap.c delete mode 100644 hw/xwin/winpolyline.c delete mode 100644 hw/xwin/winrop.c delete mode 100644 hw/xwin/winsetsp.c diff --git a/configure.ac b/configure.ac index 30c0c5c..a12e9e2 100644 --- a/configure.ac +++ b/configure.ac @@ -2206,7 +2206,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]) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 88bc85a..96e1006 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -738,9 +738,6 @@ winUseMsg(void) #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"); diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 2c7fde3..dea55b4 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -37,21 +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 diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index c71f6a1..f3eca1e 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -263,8 +263,6 @@ Shadow DirectDraw 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/hw/xwin/win.h b/hw/xwin/win.h index 7af35e7..6b3e42a 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -106,9 +106,6 @@ #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 +301,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 +573,6 @@ typedef struct _winPrivScreenRec { SetShapeProcPtr SetShape; winCursorRec cursor; - -#ifdef XWIN_NATIVEGDI - RealizeFontPtr RealizeFont; - UnrealizeFontPtr UnrealizeFont; -#endif - } winPrivScreenRec; #ifdef XWIN_MULTIWINDOWEXTWM @@ -775,15 +760,6 @@ void winBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadMask); -#ifdef XWIN_NATIVEGDI -/* - * winclip.c - */ - -RegionPtr - winPixmapToRegionNativeGDI(PixmapPtr pPix); -#endif - #ifdef XWIN_CLIPBOARD /* * winclipboardinit.c @@ -859,52 +835,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 +886,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,19 +913,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 @@ -1016,38 +922,6 @@ 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 +932,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 +966,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/hw/xwin/winclip.c b/hw/xwin/winclip.c deleted file mode 100644 index 941e948..0000000 --- a/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/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c index 6732dcb..fa9cb5f 100644 --- a/hw/xwin/wincreatewnd.c +++ b/hw/xwin/wincreatewnd.c @@ -110,20 +110,9 @@ 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); + break; /* Send first paint message */ UpdateWindow(*phwnd); @@ -474,12 +463,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/hw/xwin/winengine.c b/hw/xwin/winengine.c index 1f55ada..8aa9051 100644 --- a/hw/xwin/winengine.c +++ b/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); @@ -211,11 +207,6 @@ winSetEngine(ScreenPtr pScreen) 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/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c deleted file mode 100644 index bd0a15e..0000000 --- a/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/hw/xwin/winfont.c b/hw/xwin/winfont.c deleted file mode 100644 index 7bcbce1..0000000 --- a/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/hw/xwin/wingc.c b/hw/xwin/wingc.c deleted file mode 100644 index 5986e0a..0000000 --- a/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/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c deleted file mode 100644 index 049e2c9..0000000 --- a/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/hw/xwin/winmisc.c b/hw/xwin/winmisc.c index 10f9732..bea6290 100644 --- a/hw/xwin/winmisc.c +++ b/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/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c deleted file mode 100644 index 1859698..0000000 --- a/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/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c deleted file mode 100644 index ef158c8..0000000 --- a/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/hw/xwin/winpolyline.c b/hw/xwin/winpolyline.c deleted file mode 100644 index 8b7e106..0000000 --- a/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/hw/xwin/winrop.c b/hw/xwin/winrop.c deleted file mode 100644 index 1f9ff73..0000000 --- a/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/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index 23152cb..ed1773c 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -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/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c deleted file mode 100644 index 11108cb..0000000 --- a/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/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index 8c1c28f..934f6d8 100644 --- a/hw/xwin/winwindow.c +++ b/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() */ -- 1.9.3 From ajax at nwnk.net Wed Oct 8 05:25:05 2014 From: ajax at nwnk.net (Adam Jackson) Date: Wed, 08 Oct 2014 14:25:05 +0200 Subject: Writing a new driver for nested Xorg servers based on Xephyr code In-Reply-To: References: Message-ID: <1412771105.26586.12.camel@dmt> On Mon, 2014-10-06 at 12:32 -0700, Jamey Sharp wrote: > On Sep 26, 2014 7:52 AM, "La?rcio de Sousa" > wrote: > > Now I've started playing with xf86-video-nested and Xephyr code, > trying to merge as much code as possible. It's still in an embrionary > stage, so I want to ask you some questions: > > > > * Is there an official position from X.Org development team about > deprecating Xephyr in favour of a driver based approach for nesting > Xorg server? Or at least let both approaches coexist (maybe moving > common code to a shared library, as I've asked you previously)? > > Asking for an official position isn't especially effective in this > community, as we don't have anyone designated as a decision-maker. But > perhaps we can have a conversation about this question at the X.Org > Developers Conference in Bordeaux this week. > > My personal opinion is that we might as well turn all the current X > servers into Xorg loadable drivers, but obviously we don't have a > community-wide consensus on that. ;-) Eh. I like the idea I guess, but I don't think the xfree86 DDX is a good place to realize the idea. Trying to wedge xwayland into that model was a little painful, since you basically need to invent whole new driver classes to convince Xorg to do less work (not eating events from the tty, etc). And then you have to start considering how to handle mixed setups like nested as screen 0 and fbdev as screen 1... it's all quite hideous. If xfree86's driver model were cleaned up (epoched, really) to make this more sensible to reason about, I'd be more enthusiastic. As it is turning Xnest into an Xorg-loadable driver solves problems I'm not having while creating whole new ones. - ajax From ajax at nwnk.net Wed Oct 8 05:32:52 2014 From: ajax at nwnk.net (Adam Jackson) Date: Wed, 08 Oct 2014 14:32:52 +0200 Subject: [PATCH 0/2] configure.ac fixes for cygwin In-Reply-To: <1412082550-7192-1-git-send-email-jon.turney@dronecode.org.uk> References: <1412082550-7192-1-git-send-email-jon.turney@dronecode.org.uk> Message-ID: <1412771572.26586.13.camel@dmt> On Tue, 2014-09-30 at 14:09 +0100, Jon TURNEY wrote: > A couple of configure.ac fixes for cygwin > > Jon TURNEY (2): > configure.ac: Avoid "Your OS is unknown" warning when configuring for > Cygwin > configure.ac: Force --disable-libdrm on Cygwin > > configure.ac | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Series is: Reviewed-by: Adam Jackson - ajax From ajax at redhat.com Wed Oct 8 06:08:17 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 08 Oct 2014 15:08:17 +0200 Subject: [PATCH 18/19] xfree86: Remove driver entity hooks and private In-Reply-To: <86vbo2kqap.fsf@hiro.keithp.com> References: <1411666655-1089-1-git-send-email-ajax@redhat.com> <1411666655-1089-19-git-send-email-ajax@redhat.com> <201409252125.s8PLPPSe028925@glazunov.sibelius.xs4all.nl> <86ppeep2y5.fsf@hiro.keithp.com> <1412092387.2407.18.camel@dmt> <86vbo2kqap.fsf@hiro.keithp.com> Message-ID: <1412773697.26586.31.camel@dmt> On Thu, 2014-10-02 at 16:25 -0700, Keith Packard wrote: > Adam Jackson writes: > > > Can we consider coming up with a heuristic for the oldest server version > > that current git versions of drivers will continue to support? The > > amount of #ifdef in the drivers is getting a bit absurd, and it's a bit > > disingenuous to pretend our support goes back as far as we currently let > > build. > > The question is back porting support for new hardware to old distros; > that's generally easier done by taking the new driver and compiling it > with the old X server bits than by back-porting hardware support into > the old driver. "The old X server" isn't a thing for me, anymore. In RHEL6 we've been doing rebases on even-numbered minor releases, I really never need to build against a server that's more than ~18 months old. And we're likely to continue that pattern in RHEL7. Admittedly, I'm not the only X server vendor in the world. But the amount of API-compat code in the drivers probably shouldn't increase without bound. The majority of our drivers don't really have maintainers, so it'd be nice to have some consensus about how old of a server is too old. - ajax From wharms at bfs.de Wed Oct 8 06:56:14 2014 From: wharms at bfs.de (walter harms) Date: Wed, 08 Oct 2014 15:56:14 +0200 Subject: [PATCH 2/4] modesetting: Fix some weird formatting after x-indent-all.sh. In-Reply-To: <1412758705-444-2-git-send-email-eric@anholt.net> References: <1412758705-444-1-git-send-email-eric@anholt.net> <1412758705-444-2-git-send-email-eric@anholt.net> Message-ID: <5435427E.1040709@bfs.de> Am 08.10.2014 10:58, schrieb Eric Anholt: > Signed-off-by: Eric Anholt > --- > hw/xfree86/drivers/modesetting/drmmode_display.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c > index ca02a4d..d959837 100644 > --- a/hw/xfree86/drivers/modesetting/drmmode_display.c > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c > @@ -976,7 +976,9 @@ static const xf86OutputFuncsRec drmmode_output_funcs = { > .destroy = drmmode_output_destroy > }; > > -static int subpixel_conv_table[7] = { 0, SubPixelUnknown, > +static int subpixel_conv_table[7] = { > + 0, > + SubPixelUnknown, maybe the [7] can be removed ? re, wh > SubPixelHorizontalRGB, > SubPixelHorizontalBGR, > SubPixelVerticalRGB, > @@ -984,7 +986,8 @@ static int subpixel_conv_table[7] = { 0, SubPixelUnknown, > SubPixelNone > }; > > -static const char *const output_names[] = { "None", > +static const char *const output_names[] = { > + "None", > "VGA", > "DVI", > "DVI", From ajax at redhat.com Wed Oct 8 06:57:42 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:42 +0200 Subject: [00/21] fb/mi diet and microtuning Message-ID: <1412776683-29739-1-git-send-email-ajax@redhat.com> Most of this is just removing driver-visible entrypoints from the ABI, moving implementations closer to their consumers, and marking things static where appropriate. 13 and 15 are a bit more interesting, removing "fast paths" that actually end up being pessimizations. I'm a little hesitant about that; I've only benchmarked the changes on relatively modern Intel CPUs. It's possible that CPUs with a different memory latency hierarchy do in fact benefit from special-casing the even paths. (I'm also making the assumption that the "odd" code is a functional superset of the "even" code, which seems plausible, but I've not verified that with xts yet.) Regrettably the performance data I have on this is on a machine at home and I'm at XDC, and it takes about an hour to do an appropriate x11perf run, so while I'll happily come up with the data I don't have it immediately handy. 12 removes the 64-bit-wide path from fb. I had previously attempted to make it build, but it seems not to be worth the effort. text data bss dec hex filename 1805302 42330 62016 1909648 1d2390 hw/vfb/Xvfb.before 1796488 41882 62016 1900386 1cff62 hw/vfb/Xvfb.after b/fb/Makefile.am | 2 b/fb/fb.h | 338 -------------------------- b/fb/fbbits.c | 12 b/fb/fbblt.c | 271 --------------------- b/fb/fbbltone.c | 314 ++++++++++-------------- b/fb/fbfill.c | 84 ++++++ b/fb/fbgc.c | 83 ------ b/fb/fbglyph.c | 8 b/fb/fbline.c | 4 b/fb/fbpict.c | 10 b/fb/fbpict.h | 4 b/fb/fbpoint.c | 2 b/fb/fbpush.c | 4 b/fb/fbrop.h | 10 b/fb/fbseg.c | 22 - b/fb/fbutil.c | 308 ----------------------- b/fb/wfbrename.h | 22 - b/hw/xfree86/sdksyms.sh | 3 b/mi/Makefile.am | 11 b/mi/mi.h | 16 - b/mi/miarc.c | 205 +++++++++++++++ b/mi/midash.c | 1 b/mi/mifillarc.c | 5 b/mi/mifillarc.h | 9 b/mi/mifpoly.h | 42 --- b/mi/mipointer.c | 14 + b/mi/mipoly.c | 619 +++++++++++++++++++++++++++++++++++++++++++++++- b/mi/mipoly.h | 20 - b/mi/miwideline.c | 526 ++++++++++++++++++++++++++++++++++++++++ b/mi/miwideline.h | 26 -- fb/fbstipple.c | 264 -------------------- fb/fbtile.c | 163 ------------ mi/micursor.c | 68 ----- mi/mifpolycon.c | 249 ------------------- mi/mipolycon.c | 235 ------------------ mi/mipolygen.c | 213 ---------------- mi/mipolyutil.c | 369 ---------------------------- mi/mispans.c | 526 ---------------------------------------- mi/mispans.h | 87 ------ 39 files changed, 1593 insertions(+), 3576 deletions(-) - ajax From ajax at redhat.com Wed Oct 8 06:57:43 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:43 +0200 Subject: [PATCH 01/21] mi: Unexport wide line details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-2-git-send-email-ajax@redhat.com> XAA wanted these, once upon a time, but that's gone now. Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 2 +- mi/miwideline.c | 8 ++++---- mi/miwideline.h | 25 ------------------------- 4 files changed, 5 insertions(+), 31 deletions(-) diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index d9a4478..c2a1942 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -217,7 +217,6 @@ cat > sdksyms.c << EOF #include "micoord.h" #include "mifillarc.h" #include "mispans.h" -#include "miwideline.h" #include "mistruct.h" #include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 0cef779..526f4bb 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 + mispans.h mistruct.h mifpoly.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/miwideline.c b/mi/miwideline.c index 29ba12c..295a05a 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -273,7 +273,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 +325,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 +865,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 +886,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; diff --git a/mi/miwideline.h b/mi/miwideline.h index 1105411..a9f2740 100644 --- a/mi/miwideline.h +++ b/mi/miwideline.h @@ -92,28 +92,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); -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:44 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:44 +0200 Subject: [PATCH 02/21] mi: Unexport polygon edge table implementation details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-3-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mipoly.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/mi/mipoly.h b/mi/mipoly.h index e37fb48..02fcfc8 100644 --- a/mi/mipoly.h +++ b/mi/mipoly.h @@ -174,20 +174,17 @@ typedef struct _ScanLineListBlock { /* mipolyutil.c */ -extern _X_EXPORT Bool miCreateETandAET(int /*count */ , - DDXPointPtr /*pts */ , - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs */ , - ScanLineListBlock * /*pSLLBlock */ - ); +extern Bool miCreateETandAET(int /*count */ , + DDXPointPtr /*pts */ , + EdgeTable * /*ET*/, + EdgeTableEntry * /*AET*/, + EdgeTableEntry * /*pETEs */ , + ScanLineListBlock * /*pSLLBlock */); -extern _X_EXPORT void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */ - ); +extern void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */); -extern _X_EXPORT void micomputeWAET(EdgeTableEntry * /*AET*/); +extern void micomputeWAET(EdgeTableEntry * /*AET*/); -extern _X_EXPORT int miInsertionSort(EdgeTableEntry * /*AET*/); +extern int miInsertionSort(EdgeTableEntry * /*AET*/); -extern _X_EXPORT void miFreeStorage(ScanLineListBlock * /*pSLLBlock */ - ); +extern void miFreeStorage(ScanLineListBlock * /*pSLLBlock */); -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:45 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:45 +0200 Subject: [PATCH 03/21] mi: Unexport span group implementation details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-4-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mispans.h | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index 526f4bb..b93a8f9 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 mistruct.h mifpoly.h mioverlay.h + mistruct.h mifpoly.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/mispans.h b/mi/mispans.h index f3148ff..7c3fcef 100644 --- a/mi/mispans.h +++ b/mi/mispans.h @@ -61,24 +61,20 @@ typedef struct { } SpanGroup; /* Initialize SpanGroup. MUST BE DONE before use. */ -extern _X_EXPORT void miInitSpanGroup(SpanGroup * /*spanGroup */ - ); +extern 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 */ - ); +extern 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 */ - ); +extern 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 */ - ); +extern void miFreeSpanGroup(SpanGroup * /*spanGroup */); /* Rops which must use span groups */ #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:46 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:46 +0200 Subject: [PATCH 04/21] mi: Unexport subpixel polygon implementation details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-5-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mifpoly.h | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index b93a8f9..b243029 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 \ - mistruct.h mifpoly.h mioverlay.h + mistruct.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/mifpoly.h b/mi/mifpoly.h index f853fb4..4b27d1c 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -89,14 +89,13 @@ typedef struct _SppArc { /* mifpolycon.c */ -extern _X_EXPORT void miFillSppPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - SppPointPtr /*ptsIn */ , - int /*xTrans */ , - int /*yTrans */ , - double /*xFtrans */ , - double /*yFtrans */ - ); +extern void miFillSppPoly(DrawablePtr /*dst */ , + GCPtr /*pgc */ , + int /*count */ , + SppPointPtr /*ptsIn */ , + int /*xTrans */ , + int /*yTrans */ , + double /*xFtrans */ , + double /*yFtrans */); #endif /* __MIFPOLY_H__ */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:47 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:47 +0200 Subject: [PATCH 05/21] mi: Unexport arc fill implementation details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-6-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mifillarc.c | 4 ++-- mi/mifillarc.h | 9 --------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index b243029..4466f69 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -2,7 +2,7 @@ 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 \ + migc.h mipointrst.h mizerarc.h micoord.h \ mistruct.h mioverlay.h endif diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 08484d7..9a5e785 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -51,7 +51,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 +277,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; diff --git a/mi/mifillarc.h b/mi/mifillarc.h index 1478d18..61ab253 100644 --- a/mi/mifillarc.h +++ b/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__ */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:48 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:48 +0200 Subject: [PATCH 06/21] mi: Fold mispans.c into miwideline.c In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-7-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 2 - mi/mispans.c | 526 -------------------------------------------------- mi/mispans.h | 83 -------- mi/miwideline.c | 518 +++++++++++++++++++++++++++++++++++++++++++++++++ mi/miwideline.h | 1 - 6 files changed, 518 insertions(+), 613 deletions(-) delete mode 100644 mi/mispans.c delete mode 100644 mi/mispans.h diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index c2a1942..9c3c02f 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -216,7 +216,6 @@ cat > sdksyms.c << EOF #include "mizerarc.h" #include "micoord.h" #include "mifillarc.h" -#include "mispans.h" #include "mistruct.h" #include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 4466f69..149dc06 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -47,8 +47,6 @@ libmi_la_SOURCES = \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ - mispans.c \ - mispans.h \ misprite.c \ misprite.h \ mistruct.h \ diff --git a/mi/mispans.c b/mi/mispans.c deleted file mode 100644 index 11c8a43..0000000 --- a/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/mi/mispans.h b/mi/mispans.h deleted file mode 100644 index 7c3fcef..0000000 --- a/mi/mispans.h +++ /dev/null @@ -1,83 +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 void miInitSpanGroup(SpanGroup * /*spanGroup */); - -/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */ -extern void miAppendSpans(SpanGroup * /*spanGroup */ , - SpanGroup * /*otherGroup */ , - Spans * /*spans */); - -/* Paint a span group, insuring that each pixel is painted at most once */ -extern 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 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/mi/miwideline.c b/mi/miwideline.c index 295a05a..452d74f 100644 --- a/mi/miwideline.c +++ b/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) { diff --git a/mi/miwideline.h b/mi/miwideline.h index a9f2740..88bc3d6 100644 --- a/mi/miwideline.h +++ b/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 */ /* -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:49 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:49 +0200 Subject: [PATCH 07/21] mi: Fold mifpolycon.c into miarc.c In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-8-git-send-email-ajax@redhat.com> Also put mifpoly.h on a diet, and stop including it from places that don't need it. Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 1 - mi/miarc.c | 205 +++++++++++++++++++++++++++++++++++++++++ mi/midash.c | 1 - mi/mifillarc.c | 1 - mi/mifpoly.h | 41 --------- mi/mifpolycon.c | 249 -------------------------------------------------- 7 files changed, 205 insertions(+), 294 deletions(-) delete mode 100644 mi/mifpolycon.c diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index 9c3c02f..2305073 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -217,7 +217,6 @@ cat > sdksyms.c << EOF #include "micoord.h" #include "mifillarc.h" #include "mistruct.h" -#include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 149dc06..d9139a3 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -24,7 +24,6 @@ libmi_la_SOURCES = \ mifillarc.c \ mifillarc.h \ mifillrct.c \ - mifpolycon.c \ mifpoly.h \ migc.c \ migc.h \ diff --git a/mi/miarc.c b/mi/miarc.c index e55108a..7bbe5b3 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -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); @@ -1110,6 +1126,195 @@ miWideArc(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) { diff --git a/mi/midash.c b/mi/midash.c index 78cbaf2..50b0fbe 100644 --- a/mi/midash.c +++ b/mi/midash.c @@ -49,7 +49,6 @@ SOFTWARE. #include "regionstr.h" #include "mistruct.h" -#include "mifpoly.h" void miStepDash(int dist, /* distance to step */ diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 9a5e785..246d70f 100644 --- a/mi/mifillarc.c +++ b/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" diff --git a/mi/mifpoly.h b/mi/mifpoly.h index 4b27d1c..9304c6f 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -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,27 +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 void miFillSppPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - SppPointPtr /*ptsIn */ , - int /*xTrans */ , - int /*yTrans */ , - double /*xFtrans */ , - double /*yFtrans */); - #endif /* __MIFPOLY_H__ */ diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c deleted file mode 100644 index b133731..0000000 --- a/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; -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:50 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:50 +0200 Subject: [PATCH 08/21] mi: Fold mipoly{con,gen}.c into mipoly.c In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-9-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 - mi/mi.h | 16 --- mi/mipoly.c | 334 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- mi/mipolycon.c | 235 ---------------------------------------- mi/mipolygen.c | 213 ------------------------------------ 5 files changed, 329 insertions(+), 471 deletions(-) delete mode 100644 mi/mipolycon.c delete mode 100644 mi/mipolygen.c diff --git a/mi/Makefile.am b/mi/Makefile.am index d9139a3..44e4f20 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -36,8 +36,6 @@ libmi_la_SOURCES = \ mipointrst.h \ mipoly.c \ mipoly.h \ - mipolycon.c \ - mipolygen.c \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ diff --git a/mi/mi.h b/mi/mi.h index d5a5ba3..7051b43 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -298,22 +298,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 */ , diff --git a/mi/mipoly.c b/mi/mipoly.c index 07d9818..3d49789 100644 --- a/mi/mipoly.c +++ b/mi/mipoly.c @@ -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,337 @@ SOFTWARE. #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" +#include "miscanfill.h" +#include "mipoly.h" #include "regionstr.h" +/* 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/mi/mipolycon.c b/mi/mipolycon.c deleted file mode 100644 index e831633..0000000 --- a/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/mi/mipolygen.c b/mi/mipolygen.c deleted file mode 100644 index 2031b42..0000000 --- a/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; -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:51 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:51 +0200 Subject: [PATCH 09/21] mi: Fold mipolyutil.c into mipoly.c In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-10-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 1 - mi/mipoly.c | 285 +++++++++++++++++++++++++++++++++++++++++++ mi/mipoly.h | 17 --- mi/mipolyutil.c | 369 -------------------------------------------------------- 4 files changed, 285 insertions(+), 387 deletions(-) delete mode 100644 mi/mipolyutil.c diff --git a/mi/Makefile.am b/mi/Makefile.am index 44e4f20..ce416c4 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -40,7 +40,6 @@ libmi_la_SOURCES = \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ - mipolyutil.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ diff --git a/mi/mipoly.c b/mi/mipoly.c index 3d49789..0ed2edb 100644 --- a/mi/mipoly.c +++ b/mi/mipoly.c @@ -61,6 +61,291 @@ SOFTWARE. #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) diff --git a/mi/mipoly.h b/mi/mipoly.h index 02fcfc8..fc5a5cf 100644 --- a/mi/mipoly.h +++ b/mi/mipoly.h @@ -171,20 +171,3 @@ typedef struct _ScanLineListBlock { pAET = pAET->next; \ } \ } - -/* mipolyutil.c */ - -extern Bool miCreateETandAET(int /*count */ , - DDXPointPtr /*pts */ , - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs */ , - ScanLineListBlock * /*pSLLBlock */); - -extern void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */); - -extern void micomputeWAET(EdgeTableEntry * /*AET*/); - -extern int miInsertionSort(EdgeTableEntry * /*AET*/); - -extern void miFreeStorage(ScanLineListBlock * /*pSLLBlock */); diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c deleted file mode 100644 index 5e6301d..0000000 --- a/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; - } -} -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:52 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:52 +0200 Subject: [PATCH 10/21] mi: Fold micursor.c into mipointer.c In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-11-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/Makefile.am | 1 - mi/micursor.c | 68 ---------------------------------------------------------- mi/mipointer.c | 14 ++++++++++++ 3 files changed, 14 insertions(+), 69 deletions(-) delete mode 100644 mi/micursor.c diff --git a/mi/Makefile.am b/mi/Makefile.am index ce416c4..110c3f5 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -16,7 +16,6 @@ libmi_la_SOURCES = \ micmap.h \ micoord.h \ micopy.c \ - micursor.c \ midash.c \ midispcur.c \ mieq.c \ diff --git a/mi/micursor.c b/mi/micursor.c deleted file mode 100644 index 13ce776..0000000 --- a/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/mi/mipointer.c b/mi/mipointer.c index 6fa416d..9805425 100644 --- a/mi/mipointer.c +++ b/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 -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:53 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:53 +0200 Subject: [PATCH 11/21] fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-12-git-send-email-ajax@redhat.com> gcc doesn't appear to be smart enough to fold away the indirection here, even if you make fbLaneTable const. Signed-off-by: Adam Jackson --- fb/fbbltone.c | 32 +++++++++++++++----------------- fb/wfbrename.h | 5 ----- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/fb/fbbltone.c b/fb/fbbltone.c index bfcb5a2..d2f0416 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -81,7 +81,7 @@ #endif #if FB_SHIFT == 6 -CARD8 fb8Lane[256] = { +static const 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, @@ -107,40 +107,32 @@ CARD8 fb8Lane[256] = { 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, }; -CARD8 fb16Lane[256] = { +static const CARD8 fb16Lane[256] = { 0x00, 0x03, 0x0c, 0x0f, 0x30, 0x33, 0x3c, 0x3f, 0xc0, 0xc3, 0xcc, 0xcf, 0xf0, 0xf3, 0xfc, 0xff, }; -CARD8 fb32Lane[16] = { +static const CARD8 fb32Lane[16] = { 0x00, 0x0f, 0xf0, 0xff, }; #endif #if FB_SHIFT == 5 -CARD8 fb8Lane[16] = { +static const CARD8 fb8Lane[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; -CARD8 fb16Lane[16] = { +static const CARD8 fb16Lane[16] = { 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -CARD8 fb32Lane[16] = { +static const 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 +161,7 @@ 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; + const CARD8 *fbLane; int startbyte, endbyte; if (dstBpp == 24) { @@ -236,8 +228,14 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ if (pixelsPerDst <= 8) fbBits = fbStippleTable[pixelsPerDst]; fbLane = 0; - if (transparent && fgand == 0 && dstBpp >= 8) - fbLane = fbLaneTable[dstBpp]; + if (transparent && fgand == 0) { + if (dstBpp == 8) + fbLane = fb8Lane; + if (dstBpp == 16) + fbLane = fb16Lane; + if (dstBpp == 32) + fbLane = fb32Lane; + } /* * Compute total number of destination words written, but diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 54d00d0..0752cc7 100644 --- a/fb/wfbrename.h +++ b/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 @@ -85,9 +82,7 @@ #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 -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:54 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:54 +0200 Subject: [PATCH 12/21] fb: FB_SHIFT is 5 (and FB_UNIT is 32) In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-13-git-send-email-ajax@redhat.com> 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. Signed-off-by: Adam Jackson --- fb/fb.h | 173 +----------------------------------- fb/fbbits.c | 12 --- fb/fbblt.c | 271 +-------------------------------------------------------- fb/fbbltone.c | 114 +----------------------- fb/fbglyph.c | 4 - fb/fbpict.c | 8 -- fb/fbrop.h | 4 - fb/fbstipple.c | 23 +---- fb/fbutil.c | 123 -------------------------- 9 files changed, 9 insertions(+), 723 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 9057767..690bd43 100644 --- a/fb/fb.h +++ b/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) diff --git a/fb/fbbits.c b/fb/fbbits.c index ac44f3e..d7d089c 100644 --- a/fb/fbbits.c +++ b/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/fb/fbblt.c b/fb/fbblt.c index c615106..b412365 100644 --- a/fb/fbblt.c +++ b/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/fb/fbbltone.c b/fb/fbbltone.c index d2f0416..3042c4b 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -67,59 +67,9 @@ #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 -static const 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, -}; - -static const CARD8 fb16Lane[256] = { - 0x00, 0x03, 0x0c, 0x0f, - 0x30, 0x33, 0x3c, 0x3f, - 0xc0, 0xc3, 0xcc, 0xcf, - 0xf0, 0xf3, 0xfc, 0xff, -}; - -static const CARD8 fb32Lane[16] = { - 0x00, 0x0f, 0xf0, 0xff, -}; -#endif -#if FB_SHIFT == 5 static const CARD8 fb8Lane[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; @@ -131,7 +81,6 @@ static const CARD8 fb16Lane[16] = { static const CARD8 fb32Lane[16] = { 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -#endif void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ @@ -285,12 +234,7 @@ 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (fbLane) { fbTransparentSpan(dst, mask & startmask, fgxor, 1); } @@ -312,12 +256,7 @@ 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); @@ -367,12 +306,7 @@ 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (fbLane) { fbTransparentSpan(dst, mask & endmask, fgxor, 1); } @@ -410,47 +344,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)) @@ -476,7 +369,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/fb/fbglyph.c b/fb/fbglyph.c index 4f2904c..8484782 100644 --- a/fb/fbglyph.c +++ b/fb/fbglyph.c @@ -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 diff --git a/fb/fbpict.c b/fb/fbpict.c index 21baf89..8ef3277 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -309,17 +309,9 @@ 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 diff --git a/fb/fbrop.h b/fb/fbrop.h index 4362adb..b995f23 100644 --- a/fb/fbrop.h +++ b/fb/fbrop.h @@ -95,10 +95,6 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; * 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]; diff --git a/fb/fbstipple.c b/fb/fbstipple.c index f6c84a2..9a877c1 100644 --- a/fb/fbstipple.c +++ b/fb/fbstipple.c @@ -38,18 +38,8 @@ #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 @@ -64,12 +54,6 @@ fbTransparentSpan(FbBits * dst, FbBits stip, FbBits fgxor, int n) 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); } @@ -142,12 +126,7 @@ fbEvenStipple(FbBits * dst, 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; /* * Rotate into position and compute reduced rop values */ diff --git a/fb/fbutil.c b/fb/fbutil.c index 2ca80d1..9d66c2a 100644 --- a/fb/fbutil.c +++ b/fb/fbutil.c @@ -174,24 +174,6 @@ const FbMergeRopRec FbMergeRopBits[16] = { 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), @@ -252,112 +234,7 @@ const FbBits fbStipple2Bits[4] = { 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, -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:55 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:55 +0200 Subject: [PATCH 13/21] fb: Remove even/odd stipple slow-pathing In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-14-git-send-email-ajax@redhat.com> 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. Signed-off-by: Adam Jackson --- fb/Makefile.am | 1 - fb/fb.h | 58 -------------- fb/fbbltone.c | 85 ++++---------------- fb/fbfill.c | 46 ++++++++++- fb/fbgc.c | 83 -------------------- fb/fbstipple.c | 243 --------------------------------------------------------- fb/wfbrename.h | 4 - 7 files changed, 60 insertions(+), 460 deletions(-) delete mode 100644 fb/fbstipple.c diff --git a/fb/Makefile.am b/fb/Makefile.am index 752eabe..ff6dc3a 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -44,7 +44,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbstipple.c \ fbtile.c \ fbtrap.c \ fbutil.c \ diff --git a/fb/fb.h b/fb/fb.h index 690bd43..627d46d 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -452,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; @@ -545,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 @@ -1338,58 +1332,6 @@ fbSolid24(FbBits * dst, 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 */ diff --git a/fb/fbbltone.c b/fb/fbbltone.c index 3042c4b..bd3229a 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -62,26 +62,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 LaneCases(a) LaneCases16(0,a) - -static const CARD8 fb8Lane[16] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -}; - -static const CARD8 fb16Lane[16] = { - 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const CARD8 fb32Lane[16] = { - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ @@ -110,7 +90,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 */ - const CARD8 *fbLane; int startbyte, endbyte; if (dstBpp == 24) { @@ -176,15 +155,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ fbBits = 0; /* unused */ if (pixelsPerDst <= 8) fbBits = fbStippleTable[pixelsPerDst]; - fbLane = 0; - if (transparent && fgand == 0) { - if (dstBpp == 8) - fbLane = fb8Lane; - if (dstBpp == 16) - fbLane = fb16Lane; - if (dstBpp == 32) - fbLane = fb32Lane; - } /* * Compute total number of destination words written, but @@ -235,15 +205,10 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ */ if (startmask) { 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); - } + if (mask || !transparent) + FbDoLeftMaskByteStippleRRop(dst, mask, + fgand, fgxor, bgand, bgxor, + startbyte, startmask); bits = FbStipLeft(bits, pixelsPerDst); dst++; n--; @@ -263,29 +228,15 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ } } 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) @@ -307,15 +258,9 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ LoadBits; } 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); - } + if (mask || !transparent) + FbDoRightMaskByteStippleRRop(dst, mask, fgand, fgxor, + bgand, bgxor, endbyte, endmask); } dst += dstStride; src += srcStride; diff --git a/fb/fbfill.c b/fb/fbfill.c index de9d6b3..ad09671 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -26,6 +26,50 @@ #include "fb.h" +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 +141,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/fb/fbgc.c b/fb/fbgc.c index f4d7f3a..21c9b03 100644 --- a/fb/fbgc.c +++ b/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) { @@ -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/fb/fbstipple.c b/fb/fbstipple.c deleted file mode 100644 index 9a877c1..0000000 --- a/fb/fbstipple.c +++ /dev/null @@ -1,243 +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 LaneCases(a) LaneCases16(0,a) - -/* - * 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); - 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; - 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/fb/wfbrename.h b/fb/wfbrename.h index 0752cc7..4a3a94b 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -58,7 +58,6 @@ #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 -#define fbEvenStipple wfbEvenStipple #define fbEvenTile wfbEvenTile #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill @@ -85,7 +84,6 @@ #define fbLaneTable wfbLaneTable #define fbMapWindow wfbMapWindow #define FbMergeRopBits wFbMergeRopBits -#define fbOddStipple wfbOddStipple #define fbOddTile wfbOddTile #define fbOver wfbOver #define fbOver24 wfbOver24 @@ -143,7 +141,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbStipple wfbStipple #define fbStipple1Bits wfbStipple1Bits #define fbStipple24Bits wfbStipple24Bits #define fbStipple2Bits wfbStipple2Bits @@ -151,7 +148,6 @@ #define fbStipple8Bits wfbStipple8Bits #define fbStippleTable wfbStippleTable #define fbTile wfbTile -#define fbTransparentSpan wfbTransparentSpan #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:56 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:56 +0200 Subject: [PATCH 14/21] fb: Move fbStipple*Bits near their only consumer In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-15-git-send-email-ajax@redhat.com> And remove fbStippleTable since gcc can't figure that out itself. Signed-off-by: Adam Jackson --- fb/fbbltone.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- fb/fbrop.h | 6 --- fb/fbutil.c | 107 ------------------------------------------------------ fb/wfbrename.h | 6 --- 4 files changed, 111 insertions(+), 121 deletions(-) diff --git a/fb/fbbltone.c b/fb/fbbltone.c index bd3229a..d5806e5 100644 --- a/fb/fbbltone.c +++ b/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" @@ -153,8 +248,22 @@ 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]; + 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 diff --git a/fb/fbrop.h b/fb/fbrop.h index b995f23..872ae52 100644 --- a/fb/fbrop.h +++ b/fb/fbrop.h @@ -95,12 +95,6 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; * Stippling operations; */ -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/fb/fbutil.c b/fb/fbutil.c index 9d66c2a..078fc42 100644 --- a/fb/fbutil.c +++ b/fb/fbutil.c @@ -139,110 +139,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)) - -#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), -}; - -const FbBits *const fbStippleTable[] = { - 0, - fbStipple1Bits, - fbStipple2Bits, - 0, - fbStipple4Bits, - 0, - 0, - 0, - fbStipple8Bits, -}; diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 4a3a94b..498b372 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -141,12 +141,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbStipple1Bits wfbStipple1Bits -#define fbStipple24Bits wfbStipple24Bits -#define fbStipple2Bits wfbStipple2Bits -#define fbStipple4Bits wfbStipple4Bits -#define fbStipple8Bits wfbStipple8Bits -#define fbStippleTable wfbStippleTable #define fbTile wfbTile #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:57 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:57 +0200 Subject: [PATCH 15/21] fb: Remove unused fbReduceRasterOp In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-16-git-send-email-ajax@redhat.com> Appears to have been cargo-culted in from cfb and then never used. Signed-off-by: Adam Jackson --- fb/fb.h | 3 --- fb/fbutil.c | 78 ---------------------------------------------------------- fb/wfbrename.h | 1 - 3 files changed, 82 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 627d46d..8ebfc0e 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1375,9 +1375,6 @@ fbTile(FbBits * dst, */ 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; diff --git a/fb/fbutil.c b/fb/fbutil.c index 078fc42..c1d5923 100644 --- a/fb/fbutil.c +++ b/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 diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 498b372..ed27c29 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -127,7 +127,6 @@ #define fbQueryBestSize wfbQueryBestSize #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont -#define fbReduceRasterOp wfbReduceRasterOp #define fbReplicatePixel wfbReplicatePixel #define fbResolveColor wfbResolveColor #define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:58 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:58 +0200 Subject: [PATCH 16/21] fb: Remove even/odd tile slow-pathing In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-17-git-send-email-ajax@redhat.com> Again, clearly meant to be a fast path, but this turns out not to be the case. Signed-off-by: Adam Jackson --- fb/Makefile.am | 1 - fb/fb.h | 39 -------------- fb/fbfill.c | 38 ++++++++++++++ fb/fbtile.c | 163 --------------------------------------------------------- fb/wfbrename.h | 3 -- 5 files changed, 38 insertions(+), 206 deletions(-) delete mode 100644 fb/fbtile.c diff --git a/fb/Makefile.am b/fb/Makefile.am index ff6dc3a..65b5d94 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -44,7 +44,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbtile.c \ fbtrap.c \ fbutil.c \ fbwindow.c diff --git a/fb/fb.h b/fb/fb.h index 8ebfc0e..63130f2 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1332,45 +1332,6 @@ fbSolid24(FbBits * dst, int dstX, int width, int height, FbBits and, FbBits xor); /* - * 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); diff --git a/fb/fbfill.c b/fb/fbfill.c index ad09671..05d81ab 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -27,6 +27,44 @@ #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, diff --git a/fb/fbtile.c b/fb/fbtile.c deleted file mode 100644 index 785c5f0..0000000 --- a/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/fb/wfbrename.h b/fb/wfbrename.h index ed27c29..91f4ae1 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -58,7 +58,6 @@ #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 -#define fbEvenTile wfbEvenTile #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill #define fbFillRegionSolid wfbFillRegionSolid @@ -84,7 +83,6 @@ #define fbLaneTable wfbLaneTable #define fbMapWindow wfbMapWindow #define FbMergeRopBits wFbMergeRopBits -#define fbOddTile wfbOddTile #define fbOver wfbOver #define fbOver24 wfbOver24 #define fbOverlayCloseScreen wfbOverlayCloseScreen @@ -140,7 +138,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbTile wfbTile #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:57:59 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:57:59 +0200 Subject: [PATCH 17/21] fb: Hide glyph implementation details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-18-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- fb/fb.h | 10 ---------- fb/fbglyph.c | 4 ++-- fb/fbpict.c | 2 +- fb/fbpict.h | 4 ---- fb/wfbrename.h | 1 - 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 63130f2..7a25f7e 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -750,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); @@ -1045,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, diff --git a/fb/fbglyph.c b/fb/fbglyph.c index 8484782..2f3bb8a 100644 --- a/fb/fbglyph.c +++ b/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; @@ -116,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/fb/fbpict.c b/fb/fbpict.c index 8ef3277..d610e7d 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -82,7 +82,7 @@ fbDestroyGlyphCache(void) } } -void +static void fbUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr pGlyph) { diff --git a/fb/fbpict.h b/fb/fbpict.h index 8b0f59f..5cb8663 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -72,10 +72,6 @@ fbTriangles(CARD8 op, 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, PicturePtr pDst, diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 91f4ae1..4595188 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -74,7 +74,6 @@ #define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 #define fbGlyph8 wfbGlyph8 -#define fbGlyphIn wfbGlyphIn #define fbHasVisualTypes wfbHasVisualTypes #define fbImageGlyphBlt wfbImageGlyphBlt #define fbIn wfbIn -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:58:01 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:58:01 +0200 Subject: [PATCH 19/21] fb: Hide Bresenham line details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-20-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- fb/fb.h | 22 ++++------------------ fb/fbseg.c | 22 +++++----------------- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index f4d85f0..3839d78 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1268,34 +1268,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 */ diff --git a/fb/fbseg.c b/fb/fbseg.c index 1848387..36b17e3 100644 --- a/fb/fbseg.c +++ b/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, @@ -103,7 +103,7 @@ fbBresSolid(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -176,7 +176,7 @@ fbBresDash(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresFill(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -216,7 +216,7 @@ fbSetFg(DrawablePtr pDrawable, GCPtr pGC, Pixel fg) } } -void +static void fbBresFillDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -434,7 +434,7 @@ fbBresDash24RRop(DrawablePtr pDrawable, * based on the contents of the specified GC. */ -FbBres * +static FbBres * fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); @@ -494,18 +494,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) } 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, int x1, int y1, int x2, int y2, Bool drawLast, int *dashOffset) -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:58:03 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:58:03 +0200 Subject: [PATCH 21/21] fb: Hide fbPush{Pattern,Fill} In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-22-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- fb/fb.h | 14 -------------- fb/fbpush.c | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 88276ec..7df13c7 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1151,20 +1151,6 @@ fbPolyPoint(DrawablePtr pDrawable, /* * 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 diff --git a/fb/fbpush.c b/fb/fbpush.c index f0a861c..1d1bcfd 100644 --- a/fb/fbpush.c +++ b/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, -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:58:00 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:58:00 +0200 Subject: [PATCH 18/21] fb: Hide some zero-width line details In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-19-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- fb/fb.h | 9 --------- fb/fbline.c | 4 ++-- fb/wfbrename.h | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 7a25f7e..f4d85f0 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1098,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); diff --git a/fb/fbline.c b/fb/fbline.c index 80dc89d..3e582e6 100644 --- a/fb/fbline.c +++ b/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/fb/wfbrename.h b/fb/wfbrename.h index 4595188..5170e53 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -144,7 +144,5 @@ #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 -- 1.9.3 From ajax at redhat.com Wed Oct 8 06:58:02 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 15:58:02 +0200 Subject: [PATCH 20/21] fb: Hide fbDots In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <1412776683-29739-21-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- fb/fb.h | 10 ---------- fb/fbpoint.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 3839d78..88276ec 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1145,16 +1145,6 @@ 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); diff --git a/fb/fbpoint.c b/fb/fbpoint.c index d5129d7..be7c801 100644 --- a/fb/fbpoint.c +++ b/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, -- 1.9.3 From keithp at keithp.com Wed Oct 8 08:03:21 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 08 Oct 2014 17:03:21 +0200 Subject: [00/21] fb/mi diet and microtuning In-Reply-To: <1412776683-29739-1-git-send-email-ajax@redhat.com> References: <1412776683-29739-1-git-send-email-ajax@redhat.com> Message-ID: <86zjd6fvt2.fsf@hiro.keithp.com> Adam Jackson writes: > Most of this is just removing driver-visible entrypoints from the ABI, > moving implementations closer to their consumers, and marking things static > where appropriate. > > 13 and 15 are a bit more interesting, removing "fast paths" that actually > end up being pessimizations. Both of those were only interesting for 8bpp, or for 16bpp when the 64-bit paths worked. With 32bpp, both are useless. These all seem like fine plans to me. Acked-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From ajax at redhat.com Wed Oct 8 08:04:25 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:25 +0200 Subject: [PATCH 01/37] kdrive: Remove vestigial reference to fbInitValidateTree In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-2-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/kdrive/src/kdrive.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 5dbff3f..dddbe6e 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -909,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 -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:26 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:26 +0200 Subject: [PATCH 02/37] xquartz: Remove useless DRIWindowExposures In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-3-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/xquartz/xpr/dri.c | 21 --------------------- hw/xquartz/xpr/dri.h | 4 ---- 2 files changed, 25 deletions(-) diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c index 0f19047..565d94f 100644 --- a/hw/xquartz/xpr/dri.c +++ b/hw/xquartz/xpr/dri.c @@ -138,9 +138,6 @@ DRIFinishScreenInit(ScreenPtr pScreen) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); /* Wrap DRI support */ - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = DRICopyWindow; @@ -577,24 +574,6 @@ DRIDrawablePrivDelete(void *pResource, XID id) } 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) { ScreenPtr pScreen = pWin->drawable.pScreen; diff --git a/hw/xquartz/xpr/dri.h b/hw/xquartz/xpr/dri.h index 4476b06..a4400a2 100644 --- a/hw/xquartz/xpr/dri.h +++ b/hw/xquartz/xpr/dri.h @@ -51,7 +51,6 @@ typedef void (*ClipNotifyPtr)(WindowPtr, int, int); * overridden by the driver in its [driver]DRIScreenInit function. */ typedef struct { - WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; ClipNotifyProcPtr ClipNotify; } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; @@ -109,9 +108,6 @@ 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); extern void -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:28 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:28 +0200 Subject: [PATCH 04/37] dix: Drop the third argument from WindowExposuresProcPtr In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-5-git-send-email-ajax@redhat.com> 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 nothing, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Signed-off-by: Adam Jackson --- dix/window.c | 2 +- fb/fboverlay.c | 5 ++--- fb/fboverlay.h | 4 +--- hw/dmx/dmxwindow.c | 4 ++-- hw/dmx/dmxwindow.h | 3 +-- hw/kdrive/ephyr/ephyr.c | 2 +- hw/kdrive/src/kxv.c | 6 +++--- hw/xfree86/common/xf86xv.c | 6 +++--- hw/xfree86/dri/dri.c | 4 ++-- hw/xfree86/dri/dri.h | 3 +-- hw/xnest/Window.c | 4 ++-- hw/xnest/XNWindow.h | 3 +-- include/scrnintstr.h | 3 +-- mi/mi.h | 4 +--- mi/miexpose.c | 15 +++------------ mi/mioverlay.c | 30 ++++++++---------------------- mi/miwindow.c | 4 ++-- 17 files changed, 35 insertions(+), 67 deletions(-) diff --git a/dix/window.c b/dix/window.c index f4acdc8..52e69ef 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2601,7 +2601,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); } diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 935bf1b..6a5f0f8 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -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/fb/fboverlay.h b/fb/fboverlay.h index 57c9873..47727e4 100644 --- a/fb/fboverlay.h +++ b/fb/fboverlay.h @@ -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/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index 1c23527..c753735 100644 --- a/hw/dmx/dmxwindow.c +++ b/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/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h index c6b2efe..dda6538 100644 --- a/hw/dmx/dmxwindow.h +++ b/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/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 85d4193..8b88f3e 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -878,7 +878,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 */ diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index f979e1f..163d5c1 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -86,7 +86,7 @@ static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr, /* ScreenRec fields */ 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); @@ -822,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); @@ -834,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 */ diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 0e67690..5ef5de1 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -84,7 +84,7 @@ static int xf86XVQueryImageAttributes(XvPortPtr, XvImagePtr, /* 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); @@ -1048,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); @@ -1059,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 */ diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 3f2f6a9..5077c7c 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1828,7 +1828,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); @@ -1846,7 +1846,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; diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h index dec6885..1ce0970 100644 --- a/hw/xfree86/dri/dri.h +++ b/hw/xfree86/dri/dri.h @@ -280,8 +280,7 @@ 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); diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index fc87e82..8d9c672 100644 --- a/hw/xnest/Window.c +++ b/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/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h index 02b0f3f..6320ede 100644 --- a/hw/xnest/XNWindow.h +++ b/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/include/scrnintstr.h b/include/scrnintstr.h index 6955e77..7331ec1 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -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 */ , diff --git a/mi/mi.h b/mi/mi.h index d5a5ba3..4b5e862 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -247,9 +247,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 */ , diff --git a/mi/miexpose.c b/mi/miexpose.c index 198c433..23987fa 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -421,12 +421,11 @@ 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)) || (exposures && !RegionNil(exposures))) { RegionRec expRec; int clientInterested; @@ -435,14 +434,6 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) */ 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)) { /* @@ -474,7 +465,7 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) if (exposures == &expRec) { RegionUninit(exposures); } - else if (exposures && exposures != prgn && exposures != other_exposed) + else if (exposures && exposures != prgn) RegionDestroy(exposures); if (prgn) RegionEmpty(prgn); diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 7f502fa..f894e2b 100644 --- a/mi/mioverlay.c +++ b/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,26 +979,16 @@ 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)) || (exposures && !RegionNil(exposures))) { 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)) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -1035,7 +1024,7 @@ miOverlayWindowExposures(WindowPtr pWin, if (exposures == &expRec) { RegionUninit(exposures); } - else if (exposures && exposures != prgn && exposures != other_exposed) + else if (exposures && exposures != prgn) RegionDestroy(exposures); if (prgn) RegionEmpty(prgn); @@ -1592,7 +1581,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 +1624,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); } /****************************************************************/ diff --git a/mi/miwindow.c b/mi/miwindow.c index 82c3513..ba4c9ed 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:27 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:27 +0200 Subject: [PATCH 03/37] rootless: remove redundant RootlessShapedWindowIn In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-4-git-send-email-ajax@redhat.com> 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 --- miext/rootless/rootlessValTree.c | 65 ++-------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index 730d291..c7c2c99 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:29 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:29 +0200 Subject: [PATCH 05/37] mi: Deobfuscate miWindowExposures In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-6-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/miexpose.c | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index 23987fa..de0e148 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -425,17 +425,11 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; - if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) { + if (prgn && !RegionNil(prgn)) { RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = + int clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask; - 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 @@ -444,34 +438,21 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn) */ 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) - RegionDestroy(exposures); - if (prgn) - RegionEmpty(prgn); + RegionEmpty(prgn); } - else if (exposures && exposures != prgn) - RegionDestroy(exposures); } #ifdef ROOTLESS -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:31 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:31 +0200 Subject: [PATCH 07/37] mi: Simplify composite border clip redirection interface In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-8-git-send-email-ajax@redhat.com> 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 --- composite/compext.c | 3 --- mi/mi.h | 11 ----------- mi/mivaltree.c | 52 +++++++++++++++++++--------------------------------- 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/composite/compext.c b/composite/compext.c index cadedbd..fcfc349 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -594,9 +594,6 @@ CompositeExtensionInit(void) return; CompositeReqCode = (CARD8) extEntry->base; - miRegisterRedirectBorderClipProc(compSetRedirectBorderClip, - compGetRedirectBorderClip); - /* Initialization succeeded */ noCompositeExtension = FALSE; } diff --git a/mi/mi.h b/mi/mi.h index 4b5e862..a4a01b8 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -425,17 +425,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 */ diff --git a/mi/mivaltree.c b/mi/mivaltree.c index c1cc431..8e4e9a9 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -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++; } -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:30 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:30 +0200 Subject: [PATCH 06/37] mi: Deobfuscate miOverlayWindowExposures In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-7-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mioverlay.c | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/mi/mioverlay.c b/mi/mioverlay.c index f894e2b..2ad6bc0 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -983,28 +983,19 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) { RegionPtr exposures = prgn; - if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures))) { + if (prgn && !RegionNil(prgn)) { RegionRec expRec; - int clientInterested; - - clientInterested = (pWin->eventMask | wOtherEventMasks(pWin)) & - ExposureMask; - 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 */ @@ -1016,21 +1007,14 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn) 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) - RegionDestroy(exposures); - if (prgn) - RegionEmpty(prgn); + RegionEmpty(prgn); } - else if (exposures && exposures != prgn) - RegionDestroy(exposures); } typedef struct { -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:33 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:33 +0200 Subject: [PATCH 09/37] mi: Move pScreen->SendGraphicsExpose up to dix In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-10-git-send-email-ajax@redhat.com> No DDX is overriding this and it's fairly absurd to expose it as a screen operation anyway. Signed-off-by: Adam Jackson --- Xext/panoramiXprocs.c | 10 ++++------ dix/dispatch.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++---- include/dix.h | 6 ++++++ include/scrnintstr.h | 7 ------- mi/mi.h | 7 ------- mi/miexpose.c | 47 ---------------------------------------------- mi/miscrinit.c | 1 - 7 files changed, 58 insertions(+), 72 deletions(-) diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 83a2e08..aa3859f 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -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); } diff --git a/dix/dispatch.c b/dix/dispatch.c index f7a08f8..74abecd 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -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); } diff --git a/include/dix.h b/include/dix.h index 61ecc8d..116da2e 100644 --- a/include/dix.h +++ b/include/dix.h @@ -254,6 +254,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 */ , diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 7331ec1..269ff5a 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -252,12 +252,6 @@ 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); @@ -540,7 +534,6 @@ typedef struct _Screen { /* Region procedures */ BitmapToRegionProcPtr BitmapToRegion; - SendGraphicsExposeProcPtr SendGraphicsExpose; /* os layer procedures */ diff --git a/mi/mi.h b/mi/mi.h index 700bb11..8cb3ce7 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -232,13 +232,6 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , int /*dsty */ ); -extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ , - RegionPtr /*pRgn */ , - XID /*drawable */ , - int /*major */ , - int /*minor */ - ); - extern _X_EXPORT void miSendExposures(WindowPtr /*pWin */ , RegionPtr /*pRgn */ , int /*dx */ , diff --git a/mi/miexpose.c b/mi/miexpose.c index 7a1c172..555f3b2 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -306,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) { diff --git a/mi/miscrinit.c b/mi/miscrinit.c index 00c15f7..ec4d108 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -259,7 +259,6 @@ 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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:32 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:32 +0200 Subject: [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-9-git-send-email-ajax@redhat.com> This existed to be passed to the bs recovery routine; since we back all planes, we don't care. Signed-off-by: Adam Jackson --- fb/fbcopy.c | 2 +- glamor/glamor_copy.c | 3 +-- hw/dmx/dmxgcops.c | 8 ++++---- mi/mi.h | 3 +-- mi/mibitblt.c | 5 ++--- mi/micopy.c | 3 +-- mi/miexpose.c | 8 +------- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/fb/fbcopy.c b/fb/fbcopy.c index 541ef71..5bbabc3 100644 --- a/fb/fbcopy.c +++ b/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/glamor/glamor_copy.c b/glamor/glamor_copy.c index 6f422d4..3320935 100644 --- a/glamor/glamor_copy.c +++ b/glamor/glamor_copy.c @@ -677,8 +677,7 @@ glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, { if ((bitplane & FbFullMask(src->depth)) == 0) return miHandleExposures(src, dst, gc, - srcx, srcy, width, height, dstx, dsty, - bitplane); + srcx, srcy, width, height, dstx, dsty); return miDoCopy(src, dst, gc, srcx, srcy, width, height, dstx, dsty, glamor_copy, bitplane, NULL); diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c index aa7c8eb..0ebd69a 100644 --- a/hw/dmx/dmxgcops.c +++ b/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/mi/mi.h b/mi/mi.h index a4a01b8..700bb11 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -229,8 +229,7 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , int /*width */ , int /*height */ , int /*dstx */ , - int /*dsty */ , - unsigned long /*plane */ + int /*dsty */ ); extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ , diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 3ed4ed1..08bd1c5 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -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); @@ -579,7 +578,7 @@ miCopyPlane(DrawablePtr pSrcDrawable, } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane); + width, height, dstx, dsty); RegionDestroy(prgnSrc); return prgnExposed; } diff --git a/mi/micopy.c b/mi/micopy.c index 3079511..a52b0a7 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -304,8 +304,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/mi/miexpose.c b/mi/miexpose.c index de0e148..7a1c172 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:34 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:34 +0200 Subject: [PATCH 10/37] dix: Remove DIXsaveUnder bit from the Window In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-11-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 1 - include/windowstr.h | 1 - 2 files changed, 2 deletions(-) diff --git a/dix/window.c b/dix/window.c index 52e69ef..f227e4c 100644 --- a/dix/window.c +++ b/dix/window.c @@ -362,7 +362,6 @@ SetWindowToDefaults(WindowPtr pWin) pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; pWin->backStorage = (void *) NULL; pWin->mapped = FALSE; /* off */ diff --git a/include/windowstr.h b/include/windowstr.h index 6b79bbd..81f5f8c 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -151,7 +151,6 @@ typedef struct _Window { unsigned cursorIsNone:1; /* else real cursor (might inherit) */ unsigned backingStore:2; unsigned saveUnder:1; - unsigned DIXsaveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; unsigned overrideRedirect:1; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:35 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:35 +0200 Subject: [PATCH 11/37] dix: Lower backStorage to a bit instead of a pointer In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-12-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- composite/compinit.c | 4 ++-- dix/window.c | 2 +- include/windowstr.h | 2 +- mi/miexpose.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composite/compinit.c b/composite/compinit.c index 48e938f..111c16e 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -119,12 +119,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; } } diff --git a/dix/window.c b/dix/window.c index f227e4c..e1645c3 100644 --- a/dix/window.c +++ b/dix/window.c @@ -362,7 +362,7 @@ SetWindowToDefaults(WindowPtr pWin) pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->backStorage = (void *) NULL; + pWin->backStorage = 0; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ diff --git a/include/windowstr.h b/include/windowstr.h index 81f5f8c..740f4a6 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -144,12 +144,12 @@ 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 bitGravity:4; unsigned winGravity:4; diff --git a/mi/miexpose.c b/mi/miexpose.c index 555f3b2..de8ee6c 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -143,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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:36 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:36 +0200 Subject: [PATCH 12/37] dix: Remove an empty if In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-13-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dix/window.c b/dix/window.c index e1645c3..e49670a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2806,8 +2806,6 @@ UnmapSubwindows(WindowPtr pWin) pChild->mapped = FALSE; if (pChild->realized) UnrealizeTree(pChild, FALSE); - if (wasViewable) { - } } } if (wasViewable) { -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:38 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:38 +0200 Subject: [PATCH 14/37] dix: Remove an obfuscatory macro In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-15-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dix/window.c b/dix/window.c index 295038a..7a2866a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1812,8 +1812,6 @@ 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 @@ -2091,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)) -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:37 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:37 +0200 Subject: [PATCH 13/37] dix: Remove some pointless casting of NULL In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-14-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/dix/window.c b/dix/window.c index e49670a..295038a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -357,8 +357,8 @@ 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; @@ -1550,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; } @@ -1847,7 +1847,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) @@ -1953,7 +1953,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; @@ -2644,8 +2644,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) RealizeTree(pWin); if (pWin->viewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, - (WindowPtr - *) NULL); + NULL); } } } @@ -2655,8 +2654,7 @@ 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) { @@ -2815,8 +2813,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 */ @@ -2875,7 +2872,7 @@ HandleSaveSet(ClientPtr client) } free(client->saveSet); client->numSaved = 0; - client->saveSet = (SaveSetElt *) NULL; + client->saveSet = NULL; } /** @@ -3591,7 +3588,7 @@ SetRootClip(ScreenPtr pScreen, Bool enable) if (pWin->firstChild) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild, pWin->firstChild, - (WindowPtr *) NULL); + NULL); } else { (*pScreen->MarkWindow) (pWin); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:39 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:39 +0200 Subject: [PATCH 15/37] mi: miSlideAndSizeWindow -> miResizeWindow In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-16-git-send-email-ajax@redhat.com> Make the function name match the screen slot name. Signed-off-by: Adam Jackson --- mi/mi.h | 12 ++++++------ mi/miscrinit.c | 2 +- mi/miwindow.c | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mi/mi.h b/mi/mi.h index 8cb3ce7..5a455c9 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -470,12 +470,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 */ diff --git a/mi/miscrinit.c b/mi/miscrinit.c index ec4d108..327bd15 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -264,7 +264,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */ 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/mi/miwindow.c b/mi/miwindow.c index ba4c9ed..cfe085a 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -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); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:40 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:40 +0200 Subject: [PATCH 16/37] fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-17-git-send-email-ajax@redhat.com> Make the function names match the screen slot name. Signed-off-by: Adam Jackson --- fb/fb.h | 4 ++-- fb/fbscreen.c | 4 ++-- fb/fbwindow.c | 4 ++-- fb/wfbrename.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 9057767..d176bb3 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1621,13 +1621,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/fb/fbscreen.c b/fb/fbscreen.c index 0d4d87f..71bcc5d 100644 --- a/fb/fbscreen.c +++ b/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/fb/fbwindow.c b/fb/fbwindow.c index c90175f..7a5fac8 100644 --- a/fb/fbwindow.c +++ b/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/fb/wfbrename.h b/fb/wfbrename.h index 54d00d0..749c6d0 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -88,7 +88,6 @@ #define fbInstallColormap wfbInstallColormap #define fbLaneTable wfbLaneTable #define fbListInstalledColormaps wfbListInstalledColormaps -#define fbMapWindow wfbMapWindow #define FbMergeRopBits wFbMergeRopBits #define fbOddStipple wfbOddStipple #define fbOddTile wfbOddTile @@ -134,6 +133,7 @@ #define fbQueryBestSize wfbQueryBestSize #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont +#define fbRealizeWindow wfbRealizeWindow #define fbReduceRasterOp wfbReduceRasterOp #define fbReplicatePixel wfbReplicatePixel #define fbResolveColor wfbResolveColor @@ -160,7 +160,7 @@ #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -#define fbUnmapWindow wfbUnmapWindow +#define fbUnrealizeWindow wfbUnrealizeWindow #define fbUnrealizeFont wfbUnrealizeFont #define fbValidateGC wfbValidateGC #define fbWinPrivateKeyRec wfbWinPrivateKeyRec -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:41 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:41 +0200 Subject: [PATCH 17/37] misc: Fold together some redundant conditionals In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-18-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 39 ++++++++++++++++++--------------------- mi/mioverlay.c | 4 ---- mi/miwindow.c | 32 +++++++++++++++----------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/dix/window.c b/dix/window.c index 7a2866a..99024de 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2059,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(); @@ -2576,10 +2576,9 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); - } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, - VTMap); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, + VTMap); } WindowsRestructured(); } @@ -2657,10 +2656,10 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) 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(); } } @@ -2754,9 +2753,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(); @@ -2824,9 +2823,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(); @@ -3592,15 +3592,12 @@ SetRootClip(ScreenPtr pScreen, Bool enable) 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/mi/mioverlay.c b/mi/mioverlay.c index 2ad6bc0..eb8dda1 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -1464,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, diff --git a/mi/miwindow.c b/mi/miwindow.c index cfe085a..0cf5046 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -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(); @@ -607,11 +607,12 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, 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(); @@ -663,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) @@ -725,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(); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:42 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:42 +0200 Subject: [PATCH 18/37] dix: Add 'paintable' bit to the window state In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-19-git-send-email-ajax@redhat.com> A paintable window is a window whose pixels are (potentially) modifiable by rendering commands. Right now this is effectively a shadow of the viewable bit, but set by DDX instead of DIX. Later in this series it will also indicate a window with allocated backing store. Signed-off-by: Adam Jackson --- dix/window.c | 1 + fb/fbwindow.c | 2 ++ hw/dmx/dmxwindow.c | 5 +++++ hw/xnest/Window.c | 2 ++ include/windowstr.h | 1 + 5 files changed, 11 insertions(+) diff --git a/dix/window.c b/dix/window.c index 99024de..39cb6f7 100644 --- a/dix/window.c +++ b/dix/window.c @@ -367,6 +367,7 @@ SetWindowToDefaults(WindowPtr pWin) pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ pWin->viewable = FALSE; + pWin->paintable = FALSE; pWin->visibility = VisibilityNotViewable; pWin->overrideRedirect = FALSE; pWin->saveUnder = FALSE; diff --git a/fb/fbwindow.c b/fb/fbwindow.c index 7a5fac8..8ac6aba 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -48,6 +48,7 @@ fbDestroyWindow(WindowPtr pWin) Bool fbRealizeWindow(WindowPtr pWindow) { + pWindow->paintable = (pWindow->drawable.class == InputOutput); return TRUE; } @@ -60,6 +61,7 @@ fbPositionWindow(WindowPtr pWin, int x, int y) Bool fbUnrealizeWindow(WindowPtr pWindow) { + pWindow->paintable = FALSE; return TRUE; } diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index c753735..5eb4ee9 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -622,6 +622,9 @@ dmxRealizeWindow(WindowPtr pWindow) ret = pScreen->RealizeWindow(pWindow); #endif + /* tell DIX this window is paintable */ + pWindow->paintable = (pWindow->drawable.class == InputOutput); + /* Determine if the window is completely off the visible portion of the screen */ pWinPriv->offscreen = DMX_WINDOW_OFFSCREEN(pWindow); @@ -662,6 +665,8 @@ dmxUnrealizeWindow(WindowPtr pWindow) ret = pScreen->UnrealizeWindow(pWindow); #endif + pWindow->paintable = FALSE; + if (pWinPriv->window) { /* Unrealize window on back-end server */ XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window); diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 8d9c672..ccdc3e3 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -352,6 +352,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask) Bool xnestRealizeWindow(WindowPtr pWin) { + pWin->paintable = (pWin->drawable.class == InputOutput); xnestConfigureWindow(pWin, CWStackingOrder); xnestShapeWindow(pWin); XMapWindow(xnestDisplay, xnestWindow(pWin)); @@ -362,6 +363,7 @@ xnestRealizeWindow(WindowPtr pWin) Bool xnestUnrealizeWindow(WindowPtr pWin) { + pWin->paintable = FALSE; XUnmapWindow(xnestDisplay, xnestWindow(pWin)); return True; diff --git a/include/windowstr.h b/include/windowstr.h index 740f4a6..6443ead 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -158,6 +158,7 @@ typedef struct _Window { unsigned mapped:1; unsigned realized:1; /* ancestors are all mapped */ unsigned viewable:1; /* realized && InputOutput */ + unsigned paintable:1; unsigned dontPropagate:3; /* index into DontPropagateMasks */ unsigned forcedBS:1; /* system-supplied backingStore */ unsigned redirectDraw:2; /* COMPOSITE rendering redirect */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:43 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:43 +0200 Subject: [PATCH 19/37] dix: Update border state based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-20-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index 39cb6f7..551e1a1 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1466,7 +1466,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) for the tile to be rotated, and the correct function selected. */ if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) - && pWin->viewable && HasBorder(pWin)) { + && pWin->paintable && HasBorder(pWin)) { RegionRec exposed; RegionNull(&exposed); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:44 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:44 +0200 Subject: [PATCH 20/37] dix: ReflectStackChange based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-21-git-send-email-ajax@redhat.com> Imagine an unmapped-but-backed window with children; stack changes among those children should be reflected in clip list updates. Signed-off-by: Adam Jackson --- dix/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/window.c b/dix/window.c index 551e1a1..d358960 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2040,7 +2040,7 @@ ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) { /* Note that pSib might be NULL */ - Bool WasViewable = (Bool) pWin->viewable; + Bool WasPaintable = (Bool) pWin->paintable; Bool anyMarked; WindowPtr pFirstChange; WindowPtr pLayerWin; @@ -2052,7 +2052,7 @@ ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) pFirstChange = MoveWindowInStack(pWin, pSib); - if (WasViewable) { + if (WasPaintable) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pFirstChange, &pLayerWin); if (pLayerWin != pWin) -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:46 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:46 +0200 Subject: [PATCH 22/37] dix: MapWindow based on paintable as well In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-23-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/window.c b/dix/window.c index f3b6d2e..b0c2d9f 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2568,7 +2568,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (SubStrSend(pWin, pParent)) DeliverMapNotify(pWin); - if (!pParent->realized) + if (!pParent->realized && !pParent->paintable) return Success; RealizeTree(pWin); if (pWin->viewable) { @@ -2637,7 +2637,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) if (!pFirstMapped) pFirstMapped = pWin; - if (pParent->realized) { + if (pParent->realized || pParent->paintable) { RealizeTree(pWin); if (pWin->viewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:47 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:47 +0200 Subject: [PATCH 23/37] mi: Mark overlapped windows based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-24-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/miwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mi/miwindow.c b/mi/miwindow.c index 0cf5046..5c41dcb 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -151,7 +151,7 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) */ pChild = pWin; while (1) { - if (pChild->viewable) { + if (pChild->paintable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) @@ -175,7 +175,7 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) box = RegionExtents(&pWin->borderSize); pLast = pChild->parent->lastChild; while (1) { - if (pChild->viewable) { + if (pChild->paintable) { if (RegionBroken(&pChild->winSize)) SetWinSize(pChild); if (RegionBroken(&pChild->borderSize)) -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:45 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:45 +0200 Subject: [PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-22-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- dix/window.c | 57 ++++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/dix/window.c b/dix/window.c index d358960..f3b6d2e 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2734,7 +2734,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) { WindowPtr pParent; Bool wasRealized = (Bool) pWin->realized; - Bool wasViewable = (Bool) pWin->viewable; + Bool wasPaintable = pWin->paintable; ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pLayerWin = pWin; @@ -2742,7 +2742,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) return Success; if (SubStrSend(pWin, pParent)) DeliverUnmapNotify(pWin, fromConfigure); - if (wasViewable && !fromConfigure) { + if (wasPaintable && !fromConfigure) { pWin->valdata = UnmapValData; (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin); (*pScreen->MarkWindow) (pLayerWin->parent); @@ -2750,13 +2750,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) pWin->mapped = FALSE; if (wasRealized) UnrealizeTree(pWin, fromConfigure); - if (wasViewable) { - if (!fromConfigure) { - (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures) (pLayerWin->parent); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); - } + if (wasPaintable && !fromConfigure) { + (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); + (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } if (wasRealized && !fromConfigure) { WindowsRestructured(); @@ -2776,7 +2774,7 @@ UnmapSubwindows(WindowPtr pWin) { WindowPtr pChild, pHead; Bool wasRealized = (Bool) pWin->realized; - Bool wasViewable = (Bool) pWin->viewable; + Bool wasPaintable = pWin->paintable; Bool anyMarked = FALSE; Mask parentNotify; WindowPtr pLayerWin = NULL; @@ -2787,7 +2785,7 @@ UnmapSubwindows(WindowPtr pWin) parentNotify = SubSend(pWin); pHead = RealChildHead(pWin); - if (wasViewable) + if (wasPaintable) pLayerWin = (*pScreen->GetLayerWindow) (pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) { @@ -2803,31 +2801,28 @@ UnmapSubwindows(WindowPtr pWin) UnrealizeTree(pChild, FALSE); } } - if (wasViewable) { - if (anyMarked) { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow) (pWin); - else { - WindowPtr ptmp; + if (wasPaintable && anyMarked) { + if (pLayerWin->parent == pWin) + (*pScreen->MarkWindow) (pWin); + else { + WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); - (*pScreen->MarkWindow) (pLayerWin->parent); + (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); + (*pScreen->MarkWindow) (pLayerWin->parent); - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; + /* Windows between pWin and pLayerWin may not have been marked */ + ptmp = pWin; - while (ptmp != pLayerWin->parent) { - (*pScreen->MarkWindow) (ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; + while (ptmp != pLayerWin->parent) { + (*pScreen->MarkWindow) (ptmp); + ptmp = ptmp->parent; } - (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures) (pLayerWin->parent); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, - VTUnmap); + pHead = pWin->firstChild; } + (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); + (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap); } if (wasRealized) { WindowsRestructured(); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:48 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:48 +0200 Subject: [PATCH 24/37] mi: Mark/validate windows in MoveWindow based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-25-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/miwindow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mi/miwindow.c b/mi/miwindow.c index 5c41dcb..5d54ae2 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -242,7 +242,7 @@ void miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) { WindowPtr pParent; - Bool WasViewable = (Bool) (pWin->viewable); + Bool WasPaintable = pWin->paintable; short bw; RegionPtr oldRegion = NULL; DDXPointRec oldpt; @@ -259,7 +259,7 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; - if (WasViewable) { + if (WasPaintable) { oldRegion = RegionCreate(NullBox, 1); RegionCopy(oldRegion, &pWin->borderClip); anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); @@ -278,7 +278,7 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); - if (WasViewable) { + if (WasPaintable) { if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, windowToValidate, NULL); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:49 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:49 +0200 Subject: [PATCH 25/37] mi: Mark/validate based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-26-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/miwindow.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mi/miwindow.c b/mi/miwindow.c index 5d54ae2..0b4b055 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -341,7 +341,7 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib) { WindowPtr pParent; - Bool WasViewable = (Bool) (pWin->viewable); + Bool WasPaintable = pWin->paintable; unsigned short width = pWin->drawable.width, height = pWin->drawable.height; short oldx = pWin->drawable.x, oldy = pWin->drawable.y; int bw = wBorderWidth(pWin); @@ -371,7 +371,7 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, pScreen = pWin->drawable.pScreen; newx = pParent->drawable.x + x + bw; newy = pParent->drawable.y + y + bw; - if (WasViewable) { + if (WasPaintable) { anyMarked = FALSE; /* * save the visible region of the window @@ -446,7 +446,7 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, pFirstChange = MoveWindowInStack(pWin, pSib); - if (WasViewable) { + if (WasPaintable) { pRegion = RegionCreate(NullBox, 1); if (pLayerWin == pWin) @@ -472,7 +472,7 @@ miResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, GravityTranslate(x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); - if (WasViewable) { + if (WasPaintable) { /* avoid the border */ if (HasBorder(pWin)) { int offx, offy, dx, dy; @@ -634,13 +634,13 @@ miGetLayerWindow(WindowPtr pWin) void miSetShape(WindowPtr pWin, int kind) { - Bool WasViewable = (Bool) (pWin->viewable); + Bool WasPaintable = pWin->paintable; ScreenPtr pScreen = pWin->drawable.pScreen; Bool anyMarked = FALSE; WindowPtr pLayerWin; if (kind != ShapeInput) { - if (WasViewable) { + if (WasPaintable) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); if (pWin->valdata) { @@ -661,7 +661,7 @@ miSetShape(WindowPtr pWin, int kind) ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - if (WasViewable) { + if (WasPaintable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, NULL); if (anyMarked) { @@ -687,7 +687,7 @@ miChangeBorderWidth(WindowPtr pWin, unsigned int width) int oldwidth; Bool anyMarked = FALSE; ScreenPtr pScreen; - Bool WasViewable = (Bool) (pWin->viewable); + Bool WasPaintable = pWin->paintable; Bool HadBorder; WindowPtr pLayerWin; @@ -696,13 +696,13 @@ miChangeBorderWidth(WindowPtr pWin, unsigned int width) return; HadBorder = HasBorder(pWin); pScreen = pWin->drawable.pScreen; - if (WasViewable && width < oldwidth) + if (WasPaintable && width < oldwidth) anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); pWin->borderWidth = width; SetBorderSize(pWin); - if (WasViewable) { + if (WasPaintable) { if (width > oldwidth) { anyMarked = (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:50 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:50 +0200 Subject: [PATCH 26/37] mi: miValidateTree based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-27-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mivaltree.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 8e4e9a9..95153d6 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -564,7 +564,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ ScreenPtr pScreen; WindowPtr pWin; Bool overlap; - int viewvals; + int paintables = 0; Bool forward; pScreen = pParent->drawable.pScreen; @@ -581,7 +581,6 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ * children in their new configuration. */ RegionNull(&totalClip); - viewvals = 0; if (RegionBroken(&pParent->clipList) && !RegionBroken(&pParent->borderClip)) { kind = VTBroken; /* @@ -593,12 +592,12 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ RegionIntersect(&totalClip, &totalClip, &pParent->winSize); for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib) { - if (pWin->viewable && !TreatAsTransparent(pWin)) + if (pWin->paintable && !TreatAsTransparent(pWin)) RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } for (pWin = pChild; pWin; pWin = pWin->nextSib) - if (pWin->valdata && pWin->viewable) - viewvals++; + if (pWin->valdata && pWin->paintable) + paintables++; RegionEmpty(&pParent->clipList); } @@ -610,8 +609,8 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ for (pWin = pChild; pWin; pWin = pWin->nextSib) { if (pWin->valdata) { RegionAppend(&totalClip, getBorderClip(pWin)); - if (pWin->viewable) - viewvals++; + if (pWin->paintable) + paintables++; } } } @@ -621,8 +620,8 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ while (1) { if (pWin->valdata) { RegionAppend(&totalClip, getBorderClip(pWin)); - if (pWin->viewable) - viewvals++; + if (pWin->paintable) + paintables++; } if (pWin == pChild) break; @@ -642,7 +641,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ overlap = TRUE; if (kind != VTStack) { RegionUnion(&totalClip, &totalClip, &pParent->clipList); - if (viewvals > 1) { + if (paintables > 1) { /* * precompute childUnion to discover whether any of them * overlap. This seems redundant, but performance studies @@ -653,14 +652,14 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ RegionNull(&childUnion); if (forward) { for (pWin = pChild; pWin; pWin = pWin->nextSib) - if (pWin->valdata && pWin->viewable && + if (pWin->valdata && pWin->paintable && !TreatAsTransparent(pWin)) RegionAppend(&childUnion, &pWin->borderSize); } else { pWin = pParent->lastChild; while (1) { - if (pWin->valdata && pWin->viewable && + if (pWin->valdata && pWin->paintable && !TreatAsTransparent(pWin)) RegionAppend(&childUnion, &pWin->borderSize); if (pWin == pChild) @@ -675,7 +674,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ } for (pWin = pChild; pWin != NullWindow; pWin = pWin->nextSib) { - if (pWin->viewable) { + if (pWin->paintable) { if (pWin->valdata) { RegionIntersect(&childClip, &totalClip, &pWin->borderSize); miComputeClips(pWin, pScreen, &childClip, kind, &exposed); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:52 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:52 +0200 Subject: [PATCH 28/37] mi: miComputeClips based on paintable not viewable In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-29-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mivaltree.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 94f88fe..b963740 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -181,7 +181,7 @@ miShapedWindowIn(RegionPtr universe, RegionPtr bounding, *----------------------------------------------------------------------- * miComputeClips -- * Recompute the clipList, borderClip, exposed and borderExposed - * regions for pParent and its children. Only viewable windows are + * regions for pParent and its children. Only paintable windows are * taken into account. * * Results: @@ -295,14 +295,13 @@ miComputeClips(WindowPtr pParent, (oldVis == VisibilityUnobscured))) { pChild = pParent; while (1) { - if (pChild->viewable) { + if (pChild->paintable) { if (pChild->visibility != VisibilityFullyObscured) { RegionTranslate(&pChild->borderClip, dx, dy); RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pChild, dx, dy); - } if (pChild->valdata) { RegionNull(&pChild->valdata->after.borderExposed); @@ -401,22 +400,22 @@ miComputeClips(WindowPtr pParent, ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) { for (; pChild; pChild = pChild->nextSib) { - if (pChild->viewable && !TreatAsTransparent(pChild)) + if (pChild->paintable && !TreatAsTransparent(pChild)) RegionAppend(&childUnion, &pChild->borderSize); } } else { for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { - if (pChild->viewable && !TreatAsTransparent(pChild)) + if (pChild->paintable && !TreatAsTransparent(pChild)) RegionAppend(&childUnion, &pChild->borderSize); } } RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; pChild = pChild->nextSib) { - if (pChild->viewable) { + if (pChild->paintable) { /* - * If the child is viewable, we want to remove its extents + * If the child is paintable, we want to remove its extents * from the current universe, but we only re-clip it if * it's been marked. */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:51 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:51 +0200 Subject: [PATCH 27/37] mi: Only compute visibility events for viewable windows In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-28-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mivaltree.c | 62 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 95153d6..94f88fe 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -240,40 +240,42 @@ miComputeClips(WindowPtr pParent, } #endif - oldVis = pParent->visibility; - switch (RegionContainsRect(universe, &borderSize)) { - case rgnIN: - newVis = VisibilityUnobscured; - break; - case rgnPART: - newVis = VisibilityPartiallyObscured; - { - RegionPtr pBounding; - - if ((pBounding = wBoundingShape(pParent))) { - switch (miShapedWindowIn(universe, pBounding, - &borderSize, - pParent->drawable.x, - pParent->drawable.y)) { - case rgnIN: - newVis = VisibilityUnobscured; - break; - case rgnOUT: - newVis = VisibilityFullyObscured; - break; + oldVis = newVis = pParent->visibility; + if (pParent->viewable) { + switch (RegionContainsRect(universe, &borderSize)) { + case rgnIN: + newVis = VisibilityUnobscured; + break; + case rgnPART: + newVis = VisibilityPartiallyObscured; + { + RegionPtr pBounding; + + if ((pBounding = wBoundingShape(pParent))) { + switch (miShapedWindowIn(universe, pBounding, + &borderSize, + pParent->drawable.x, + pParent->drawable.y)) { + case rgnIN: + newVis = VisibilityUnobscured; + break; + case rgnOUT: + newVis = VisibilityFullyObscured; + break; + } } } + break; + default: + newVis = VisibilityFullyObscured; + break; } - break; - default: - newVis = VisibilityFullyObscured; - break; + pParent->visibility = newVis; + if (oldVis != newVis && + ((pParent-> + eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) + SendVisibilityNotify(pParent); } - pParent->visibility = newVis; - if (oldVis != newVis && - ((pParent-> - eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) - SendVisibilityNotify(pParent); dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:53 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:53 +0200 Subject: [PATCH 29/37] mi: Shortcut miDoCopy based on paintable not realized In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-30-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/micopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/micopy.c b/mi/micopy.c index a52b0a7..8ae0aa7 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -155,7 +155,7 @@ miDoCopy(DrawablePtr pSrcDrawable, /* Short cut for unmapped windows */ if (pDstDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) pDstDrawable)->realized) { + !((WindowPtr) pDstDrawable)->paintable) { return NULL; } -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:54 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:54 +0200 Subject: [PATCH 30/37] mi: Shortcut miCopyArea based on paintable not realized In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-31-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- mi/mibitblt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 08bd1c5..391fb01 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -96,9 +96,9 @@ miCopyArea(DrawablePtr pSrcDrawable, srcx = xIn + pSrcDrawable->x; srcy = yIn + pSrcDrawable->y; - /* If the destination isn't realized, this is easy */ + /* If the destination isn't paintable, this is easy */ if (pDstDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) pDstDrawable)->realized) + !((WindowPtr) pDstDrawable)->paintable) return NULL; /* clip the source */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:55 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:55 +0200 Subject: [PATCH 31/37] mi: Suppress exposure generation for backed windows In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-32-git-send-email-ajax@redhat.com> Note that on the initial bs allocation this bit isn't set yet, so we'll generate an initial exposure and bg paint, which is correct. Signed-off-by: Adam Jackson --- mi/mivaltree.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index b963740..760ee3a 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -451,13 +451,16 @@ miComputeClips(WindowPtr pParent, * new, just as for the border. */ - if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - RegionCopy(&pParent->valdata->after.exposed, universe); - } - else if (newVis != VisibilityFullyObscured && - newVis != VisibilityNotViewable) { - RegionSubtract(&pParent->valdata->after.exposed, - universe, &pParent->clipList); + if (!pParent->backStorage) { + if (oldVis == VisibilityFullyObscured || + oldVis == VisibilityNotViewable) { + RegionCopy(&pParent->valdata->after.exposed, universe); + } + else if (newVis != VisibilityFullyObscured && + newVis != VisibilityNotViewable) { + RegionSubtract(&pParent->valdata->after.exposed, + universe, &pParent->clipList); + } } /* HACK ALERT - copying contents of regions, instead of regions */ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:56 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:56 +0200 Subject: [PATCH 32/37] mi: Treat paintable-but-not-mapped windows as transparent too In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-33-git-send-email-ajax@redhat.com> It's okay to remove the ifdef here; the bits are defined in the Window struct regardless, and if composite isn't built they'll just never be set to Manual. Signed-off-by: Adam Jackson --- mi/mivaltree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 760ee3a..1492ad0 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -164,14 +164,16 @@ miShapedWindowIn(RegionPtr universe, RegionPtr bounding, /* * Manual redirected windows are treated as transparent; they do not obscure - * siblings or parent windows + * siblings or parent windows. Likewise windows that are paintable but not + * mapped. */ -#ifdef COMPOSITE -#define TreatAsTransparent(w) ((w)->redirectDraw == RedirectDrawManual) -#else -#define TreatAsTransparent(w) FALSE -#endif +static Bool +TreatAsTransparent(WindowPtr w) +{ + return (w->redirectDraw == RedirectDrawManual) || + (w->paintable && !w->mapped); +} #define HasParentRelativeBorder(w) (!(w)->borderIsPixel && \ HasBorder(w) && \ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:57 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:57 +0200 Subject: [PATCH 33/37] composite: Factor out backing store transition In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-34-git-send-email-ajax@redhat.com> No functional change. Signed-off-by: Adam Jackson --- composite/compinit.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/composite/compinit.c b/composite/compinit.c index 111c16e..7daf171 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -104,6 +104,20 @@ compInstallColormap(ColormapPtr pColormap) pScreen->InstallColormap = compInstallColormap; } +static void +compCheckBackingStore(WindowPtr pWin) +{ + if (pWin->backingStore != NotUseful && !pWin->backStorage) { + compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); + pWin->backStorage = TRUE; + } + else if (pWin->backingStore == NotUseful && pWin->backStorage) { + compUnredirectWindow(serverClient, pWin, + CompositeRedirectAutomatic); + pWin->backStorage = FALSE; + } +} + /* Fake backing store via automatic redirection */ static Bool compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) @@ -116,17 +130,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) ret = pScreen->ChangeWindowAttributes(pWin, mask); if (ret && (mask & CWBackingStore) && - pScreen->backingStoreSupport != NotUseful) { - if (pWin->backingStore != NotUseful && !pWin->backStorage) { - compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = TRUE; - } - else if (pWin->backingStore == NotUseful && pWin->backStorage) { - compUnredirectWindow(serverClient, pWin, - CompositeRedirectAutomatic); - pWin->backStorage = FALSE; - } - } + pScreen->backingStoreSupport != NotUseful) + compCheckBackingStore(pWin); pScreen->ChangeWindowAttributes = compChangeWindowAttributes; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:58 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:58 +0200 Subject: [PATCH 34/37] composite: Keep the window pixmap at unmap for backing store Always In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-35-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- composite/compwindow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/composite/compwindow.c b/composite/compwindow.c index 9a6b2da..efb9c9e 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -150,8 +150,10 @@ compCheckRedirect(WindowPtr pWin) CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen); Bool should; - should = pWin->realized && (pWin->drawable.class != InputOnly) && - (cw != NULL) && (pWin->parent != NULL); + should = (pWin->realized || pWin->backingStore == Always) && + (pWin->drawable.class != InputOnly) && + (cw != NULL) && + (pWin->parent != NULL); /* Never redirect the overlay window */ if (cs->pOverlayWin != NULL) { -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:59 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:59 +0200 Subject: [PATCH 35/37] composite: Always try to realize bs for bs-always windows In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-36-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- composite/compinit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composite/compinit.c b/composite/compinit.c index 7daf171..954abd3 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -107,11 +107,15 @@ compInstallColormap(ColormapPtr pColormap) static void compCheckBackingStore(WindowPtr pWin) { - if (pWin->backingStore != NotUseful && !pWin->backStorage) { + Bool should = + (pWin->backingStore == Always) || + (pWin->backingStore == WhenMapped && pWin->viewable); + + if (should && !pWin->backStorage) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = TRUE; } - else if (pWin->backingStore == NotUseful && pWin->backStorage) { + else if (!should && pWin->backStorage) { compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = FALSE; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:05:00 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:05:00 +0200 Subject: [PATCH 36/37] composite: Treat bs-Always windows as viewable when marking In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-37-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- composite/compalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index dfbff06..cbb9539 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -106,7 +106,7 @@ compMarkWindows(WindowPtr pWin, WindowPtr *ppLayerWin) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pLayerWin = pWin; - if (!pWin->viewable) + if (!pWin->viewable && pWin->backingStore != Always) return FALSE; (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:05:01 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:05:01 +0200 Subject: [PATCH 37/37] composite: Update paintable state when bs'ing windows In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412780701-8818-38-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- composite/compinit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/composite/compinit.c b/composite/compinit.c index 954abd3..be05aec 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -105,6 +105,12 @@ compInstallColormap(ColormapPtr pColormap) } static void +compCheckPaintable(WindowPtr pWin) +{ + pWin->paintable = pWin->viewable || pWin->backingStore == Always; +} + +static void compCheckBackingStore(WindowPtr pWin) { Bool should = @@ -112,10 +118,12 @@ compCheckBackingStore(WindowPtr pWin) (pWin->backingStore == WhenMapped && pWin->viewable); if (should && !pWin->backStorage) { + compCheckPaintable(pWin); compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = TRUE; } else if (!should && pWin->backStorage) { + compCheckPaintable(pWin); compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = FALSE; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:04:24 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:04:24 +0200 Subject: [PATCH 00/37] Implement backing store's Always mode Message-ID: <1412780701-8818-1-git-send-email-ajax@redhat.com> The charm, and the danger, in working on enterprise operating systems is you get held accountable for your work. Once upon a time I reimplemented backing store in terms of Composite's automatic redirection. I still think that was a good idea, and it does work pretty well, but it turns out there are customers with apps that rely on promises the old implementation made. Probably the biggest issue with the new code is we don't really honor the Always mode any differently from the WhenMapped mode, because Composite doesn't allocate a window pixmap for windows that are redirected but not realized [1]. In other words, if you create a window, set it to Always, and draw to it without mapping it, your rendering will be thrown away; if you then try to blit from that window to a realized window, you will instead get a background tile and a GraphicsExpose instead of your app's actual content [2]. Making composite allocate the window pixmap even for unrealized windows is pretty straightforward, but not sufficient to make things actually work. The old BS code would intercept rendering to backed windows and direct it to pixmaps. The new code just draws to the window as if it were mapped, but since it's not, the clip list ends up being empty. This series attempts to detangle the mess. 1-16 are basically a resend of a previous series [3]. 18 introduces a new window state bit called "paintable". 19 through 32 port the output bits of mi and dix to inspect paintable instead of viewable. 33 through 37 change the bs implementation in composite to realize bs in more situations. I'm not in any way convinced this is correct yet, in fact I'm pretty sure it's not. And there's some work that would be nice to follow this with [4]. But it's close enough that I'd like to get some more eyes on it. [1] - Careful readers will note this means we also don't honor the spirit of the law for WhenMapped. [2] - Hilariously, if your app was correctly written to expect the GraphicsExpose, interpret it as the server losing the backing store bits, and repaint them to regenerate the content, you will be punished for your good faith with an infinite loop: the repaint to the unmapped window will have no effect, you'll redo the blit, you'll get another GraphicsExpose... [3] - Excluding the "can't happen" bit, which I'm not entirely sure I was correct about, that series would be: http://lists.freedesktop.org/archives/xorg-devel/2014-September/043960.html [4] - In particular, fixing the WhenMapped implementation to not really mean WhenRealized, and lazily redirecting the window based on whether it's actually clipped. - ajax From ajax at redhat.com Wed Oct 8 08:18:32 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:18:32 +0200 Subject: [PATCH] xinerama: Fix access mode in GetImage's drawable lookup Message-ID: <1412781512-9719-1-git-send-email-ajax@redhat.com> Signed-off-by: Adam Jackson --- Xext/panoramiXprocs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index d84684e..3ab8d33 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -1910,7 +1910,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; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:20:33 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:20:33 +0200 Subject: [PATCH 1/2] render: Always store client clip as a region Message-ID: <1412781634-9770-1-git-send-email-ajax@redhat.com> 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 --- fb/fbpict.c | 2 +- render/mipict.c | 34 +++++++--------------------------- render/mirect.c | 2 +- render/picture.c | 1 - render/picturestr.h | 3 +-- xfixes/region.c | 14 +++----------- 6 files changed, 13 insertions(+), 43 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index d610e7d..e726691 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -318,7 +318,7 @@ create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) * 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/render/mipict.c b/render/mipict.c index 3959fc4..a725104 100644 --- a/render/mipict.c +++ b/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/render/mirect.c b/render/mirect.c index 4e76972..a36d1d6 100644 --- a/render/mirect.c +++ b/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/render/picture.c b/render/picture.c index 0978d3f..1d9972c 100644 --- a/render/picture.c +++ b/render/picture.c @@ -729,7 +729,6 @@ SetPictureToDefaults(PicturePtr pPicture) pPicture->polyEdge = PolyEdgeSharp; pPicture->polyMode = PolyModePrecise; pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; pPicture->componentAlpha = FALSE; pPicture->repeatType = RepeatNone; diff --git a/render/picturestr.h b/render/picturestr.h index ff88c10..a6cbed8 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -131,7 +131,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; @@ -144,7 +143,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - void *clientClip; + RegionPtr clientClip; unsigned long serialNumber; diff --git a/xfixes/region.c b/xfixes/region.c index 23320ce..5a8cdae 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -272,20 +272,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)) -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:20:34 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:20:34 +0200 Subject: [PATCH 2/2] dix: Always store GC client clip as a region In-Reply-To: <1412781634-9770-1-git-send-email-ajax@redhat.com> References: <1412781634-9770-1-git-send-email-ajax@redhat.com> Message-ID: <1412781634-9770-2-git-send-email-ajax@redhat.com> Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a GC with no client clip. Signed-off-by: Adam Jackson --- dix/gc.c | 3 +-- exa/exa_accel.c | 20 ++++++++--------- exa/exa_priv.h | 7 +++--- exa/exa_unaccel.c | 11 +++++----- hw/dmx/dmxgc.c | 12 ++--------- hw/kdrive/src/kxv.c | 2 +- hw/xfree86/common/xf86xv.c | 2 +- hw/xnest/GC.c | 54 +++++++++------------------------------------- hw/xnest/XNGC.h | 1 - include/gcstruct.h | 5 ++--- mi/micopy.c | 5 ++--- mi/miexpose.c | 2 +- mi/migc.c | 45 +++++++++----------------------------- mi/mioverlay.c | 2 +- xfixes/region.c | 13 +++-------- 15 files changed, 51 insertions(+), 133 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index 88d6501..d10b7d6 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -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; @@ -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/exa/exa_accel.c b/exa/exa_accel.c index 9c742bd..35c050e 100644 --- a/exa/exa_accel.c +++ b/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 clientClip); 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 clientClip) { 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; + clientClip) ? 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 clientClip) { 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, clientClip); 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; + clientClip) ? NULL : pRegion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 88bfd37..ca4db72 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -455,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 @@ -470,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/exa/exa_unaccel.c b/exa/exa_unaccel.c index b0c6344..73eada9 100644 --- a/exa/exa_unaccel.c +++ b/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/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 7b9aa75..6dc6ecf 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -361,13 +361,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)); @@ -386,11 +383,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/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 57f977d..9a1724b 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -480,7 +480,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 */ diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index ffb0928..3785366 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -600,7 +600,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 */ diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index 0ec60fc..281c3a8 100644 --- a/hw/xnest/GC.c +++ b/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,32 @@ 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); - + RegionDestroy(pGC->clientClip); 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: - RegionDestroy(pGC->clientClip); - break; - } -} - -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/hw/xnest/XNGC.h b/hw/xnest/XNGC.h index e2f10fb..974173e 100644 --- a/hw/xnest/XNGC.h +++ b/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/include/gcstruct.h b/include/gcstruct.h index 67e1061..aa2064c 100644 --- a/include/gcstruct.h +++ b/include/gcstruct.h @@ -254,13 +254,12 @@ 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 int unused:15; /* see comment above */ unsigned int planemask; unsigned int fgPixel; unsigned int bgPixel; @@ -273,7 +272,7 @@ typedef struct _GC { DDXPointRec patOrg; /* origin for (tile, stipple) */ DDXPointRec clipOrg; struct _Font *font; - void *clientClip; + RegionPtr clientClip; unsigned int stateChanges; /* masked with GC_ */ unsigned int serialNumber; const GCFuncs *funcs; diff --git a/mi/micopy.c b/mi/micopy.c index 3079511..bc0a702 100644 --- a/mi/micopy.c +++ b/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 { diff --git a/mi/miexpose.c b/mi/miexpose.c index 5d127e1..ecbcd84 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -236,7 +236,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); /* diff --git a/mi/migc.c b/mi/migc.c index 9bbe884..8fdd481 100644 --- a/mi/migc.c +++ b/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/mi/mioverlay.c b/mi/mioverlay.c index 7f502fa..08e1474 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -1701,7 +1701,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/xfixes/region.c b/xfixes/region.c index 5a8cdae..a9f9ac2 100644 --- a/xfixes/region.c +++ b/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)) -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:38:55 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:38:55 +0200 Subject: [PATCH 0/4] Finish killing VidMemInfo Message-ID: <1412782739-9960-1-git-send-email-ajax@redhat.com> This finishes the job from: http://lists.freedesktop.org/archives/xorg-devel/2014-July/043343.html OpenBSD retains its special case for privsep setup, but otherwise this is the same as before. b/configure.ac | 9 - b/hw/xfree86/common/compiler.h | 35 +----- b/hw/xfree86/os-support/Makefile.am | 2 b/hw/xfree86/os-support/bsd/Makefile.am | 2 b/hw/xfree86/os-support/bsd/alpha_video.c | 152 ---------------------------- b/hw/xfree86/os-support/bsd/arm_video.c | 59 ---------- b/hw/xfree86/os-support/bsd/bsd_ev56.c | 23 +--- b/hw/xfree86/os-support/bsd/i386_video.c | 5 b/hw/xfree86/os-support/bsd/ppc_video.c | 9 - b/hw/xfree86/os-support/bus/Makefile.am | 4 b/hw/xfree86/os-support/bus/Pci.c | 13 -- b/hw/xfree86/os-support/bus/Pci.h | 10 - b/hw/xfree86/os-support/hurd/Makefile.am | 1 b/hw/xfree86/os-support/hurd/hurd_video.c | 11 -- b/hw/xfree86/os-support/linux/Makefile.am | 1 b/hw/xfree86/os-support/linux/lnx_agp.c | 1 b/hw/xfree86/os-support/linux/lnx_ev56.c | 22 +--- b/hw/xfree86/os-support/linux/lnx_video.c | 38 ------- b/hw/xfree86/os-support/shared/agp_noop.c | 1 b/hw/xfree86/os-support/solaris/Makefile.am | 1 b/hw/xfree86/os-support/solaris/sun_vid.c | 11 -- b/hw/xfree86/os-support/stub/Makefile.am | 4 b/hw/xfree86/os-support/xf86_OSproc.h | 3 hw/xfree86/os-support/bsd/sparc64_video.c | 45 -------- hw/xfree86/os-support/bus/bsd_pci.c | 55 ---------- hw/xfree86/os-support/shared/vidmem.c | 54 --------- hw/xfree86/os-support/stub/stub_video.c | 13 -- hw/xfree86/os-support/xf86OSpriv.h | 41 ------- 28 files changed, 31 insertions(+), 594 deletions(-) - ajax From ajax at redhat.com Wed Oct 8 08:38:56 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:38:56 +0200 Subject: [PATCH 1/4] xfree86: Remove no-op /dev/mem checks from xf86OSInitVidMem In-Reply-To: <1412782739-9960-1-git-send-email-ajax@redhat.com> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> Message-ID: <1412782739-9960-2-git-send-email-ajax@redhat.com> pciaccess doesn't end up using the fd being inspected here, so there's not really any point. Signed-off-by: Adam Jackson --- hw/xfree86/os-support/bsd/alpha_video.c | 122 -------------------------------- hw/xfree86/os-support/bsd/arm_video.c | 52 -------------- hw/xfree86/os-support/hurd/hurd_video.c | 4 -- 3 files changed, 178 deletions(-) diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index 236def6..fd8f823 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/hw/xfree86/os-support/bsd/alpha_video.c @@ -45,131 +45,9 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -#ifndef __NetBSD__ -extern unsigned long dense_base(void); -#else /* __NetBSD__ */ -static struct alpha_bus_window *abw; -static int abw_count = -1; - -static void -init_abw(void) -{ - if (abw_count < 0) { - abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw); - if (abw_count <= 0) - FatalError("init_abw: alpha_bus_getwindows failed\n"); - } -} - -static unsigned long -dense_base(void) -{ - if (abw_count < 0) - init_abw(); - - /* XXX check abst_flags for ABST_DENSE just to be safe? */ - xf86Msg(X_INFO, "dense base = %#lx\n", abw[0].abw_abst.abst_sys_start); /* XXXX */ - return abw[0].abw_abst.abst_sys_start; -} - -#endif /* __NetBSD__ */ - -#define BUS_BASE dense_base() - -/***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -#ifdef __OpenBSD__ -#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ - "\tin /etc/sysctl.conf and reboot your machine\n" \ - "\trefer to xf86(4) for details" -#endif - -static int devMemFd = -1; - -#ifdef HAS_APERTURE_DRV -#define DEV_APERTURE "/dev/xf86" -#endif - -/* - * Check if /dev/mem can be mmap'd. If it can't print a warning when - * "warn" is TRUE. - */ -static void -checkDevMem(Bool warn) -{ - static Bool devMemChecked = FALSE; - int fd; - void *base; - - if (devMemChecked) - return; - devMemChecked = TRUE; - -#ifdef HAS_APERTURE_DRV - /* Try the aperture driver first */ - if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { - /* Try to map a page at the VGA address */ - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); - - if (base != MAP_FAILED) { - munmap((caddr_t) base, 4096); - devMemFd = fd; - xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", - DEV_APERTURE); - return; - } - else { - if (warn) { - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", - DEV_APERTURE, strerror(errno)); - } - } - } -#endif - if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { - /* Try to map a page at the VGA address */ - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); - - if (base != MAP_FAILED) { - munmap((caddr_t) base, 4096); - devMemFd = fd; - return; - } - else { - if (warn) { - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", - DEV_MEM, strerror(errno)); - } - } - } - if (warn) { -#ifndef HAS_APERTURE_DRV - xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n", - DEV_MEM, strerror(errno)); -#else -#ifndef __OpenBSD__ - xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" - "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); -#else /* __OpenBSD__ */ - xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" - "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno), - SYSCTL_MSG); -#endif /* __OpenBSD__ */ -#endif - xf86ErrorF("\tlinear framebuffer access unavailable\n"); - } - return; -} - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - checkDevMem(TRUE); - pVidMem->initialised = TRUE; } diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c index 3a639b8..fea8528 100644 --- a/hw/xfree86/os-support/bsd/arm_video.c +++ b/hw/xfree86/os-support/bsd/arm_video.c @@ -72,61 +72,9 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -#define BUS_BASE 0L -#define BUS_BASE_BWX 0L - -/***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -static int devMemFd = -1; - -/* - * Check if /dev/mem can be mmap'd. If it can't print a warning when - * "warn" is TRUE. - */ -static void -checkDevMem(Bool warn) -{ - static Bool devMemChecked = FALSE; - int fd; - void *base; - - if (devMemChecked) - return; - devMemChecked = TRUE; - - if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { - /* Try to map a page at the VGA address */ - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); - - if (base != MAP_FAILED) { - munmap((caddr_t) base, 4096); - devMemFd = fd; - return; - } - else { - /* This should not happen */ - if (warn) { - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", - DEV_MEM, strerror(errno)); - } - return; - } - } - if (warn) { - xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n", - DEV_MEM, strerror(errno)); - } - return; -} - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { - checkDevMem(TRUE); - pVidMem->initialised = TRUE; } diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 2a96393..1e7d604 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -40,10 +40,6 @@ #include "xf86OSpriv.h" /************************************************************************** - * Video Memory Mapping section - ***************************************************************************/ - -/************************************************************************** * I/O Permissions section ***************************************************************************/ -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:38:57 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:38:57 +0200 Subject: [PATCH 2/4] xfree86: Remove implicit xf86EnableIO from BSD for PowerPC In-Reply-To: <1412782739-9960-1-git-send-email-ajax@redhat.com> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> Message-ID: <1412782739-9960-3-git-send-email-ajax@redhat.com> This shouldn't be necessary, we're doing this already at the DDX level when it's needed (and, more importantly, not when it's not). Signed-off-by: Adam Jackson --- hw/xfree86/os-support/bsd/ppc_video.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index b1cf7eb..f017376 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_video.c @@ -51,7 +51,6 @@ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; - xf86EnableIO(); } volatile unsigned char *ioBase = MAP_FAILED; -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:38:58 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:38:58 +0200 Subject: [PATCH 3/4] xfree86: Remove xf86InitVidMem from most platforms In-Reply-To: <1412782739-9960-1-git-send-email-ajax@redhat.com> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> Message-ID: <1412782739-9960-4-git-send-email-ajax@redhat.com> OpenBSD/i386 is the only platform where this has a side effect anymore. Signed-off-by: Adam Jackson --- configure.ac | 9 +---- hw/xfree86/os-support/Makefile.am | 2 +- hw/xfree86/os-support/bsd/Makefile.am | 2 -- hw/xfree86/os-support/bsd/alpha_video.c | 7 ---- hw/xfree86/os-support/bsd/arm_video.c | 7 ---- hw/xfree86/os-support/bsd/bsd_ev56.c | 1 - hw/xfree86/os-support/bsd/i386_video.c | 5 +-- hw/xfree86/os-support/bsd/ppc_video.c | 8 ----- hw/xfree86/os-support/bsd/sparc64_video.c | 45 ------------------------- hw/xfree86/os-support/bus/Makefile.am | 4 --- hw/xfree86/os-support/bus/Pci.c | 13 +++----- hw/xfree86/os-support/bus/Pci.h | 10 ------ hw/xfree86/os-support/bus/bsd_pci.c | 55 ------------------------------- hw/xfree86/os-support/hurd/Makefile.am | 1 - hw/xfree86/os-support/hurd/hurd_video.c | 7 ---- hw/xfree86/os-support/linux/Makefile.am | 1 - hw/xfree86/os-support/linux/lnx_agp.c | 1 - hw/xfree86/os-support/linux/lnx_video.c | 11 ------- hw/xfree86/os-support/shared/agp_noop.c | 1 - hw/xfree86/os-support/shared/vidmem.c | 54 ------------------------------ hw/xfree86/os-support/solaris/Makefile.am | 1 - hw/xfree86/os-support/solaris/sun_vid.c | 11 ------- hw/xfree86/os-support/stub/Makefile.am | 4 +-- hw/xfree86/os-support/stub/stub_video.c | 13 -------- hw/xfree86/os-support/xf86OSpriv.h | 41 ----------------------- hw/xfree86/os-support/xf86_OSproc.h | 3 -- 26 files changed, 9 insertions(+), 308 deletions(-) delete mode 100644 hw/xfree86/os-support/bsd/sparc64_video.c delete mode 100644 hw/xfree86/os-support/bus/bsd_pci.c delete mode 100644 hw/xfree86/os-support/shared/vidmem.c delete mode 100644 hw/xfree86/os-support/stub/stub_video.c delete mode 100644 hw/xfree86/os-support/xf86OSpriv.h diff --git a/configure.ac b/configure.ac index 30c0c5c..b06dc08 100644 --- a/configure.ac +++ b/configure.ac @@ -326,7 +326,7 @@ case $host_cpu in ;; sparc*) SPARC64_VIDEO=yes - BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" + BSD_ARCH_SOURCES="ioperm_noop.c" GLX_ARCH_DEFINES="-D__GLX_ALIGN64" ;; x86_64*|amd64*) @@ -1878,7 +1878,6 @@ if test "x$XORG" = xyes; then dnl =================================================================== dnl ================= beginning of PCI configuration ================== dnl =================================================================== - xorg_bus_bsdpci=no xorg_bus_sparc=no AC_MSG_CHECKING([whether to build Xorg PCI functions]) @@ -1890,11 +1889,6 @@ if test "x$XORG" = xyes; then AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation]) AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) - case $host_os in - gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*) - xorg_bus_bsdpci="yes" - ;; - esac case $host_cpu in sparc*) xorg_bus_sparc="yes" @@ -2098,7 +2092,6 @@ if test "x$XORG" = xyes; then fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes]) -AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am index a0140a1..146610e 100644 --- a/hw/xfree86/os-support/Makefile.am +++ b/hw/xfree86/os-support/Makefile.am @@ -3,7 +3,7 @@ DIST_SUBDIRS = bsd bus misc linux solaris stub hurd sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h -EXTRA_DIST = int10Defines.h xf86OSpriv.h +EXTRA_DIST = int10Defines.h # to get the grouping semantics right, you have to glom these three together # as one library, otherwise libtool will actively defeat your attempts to diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index b01ea5b..33e013c 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -45,7 +45,6 @@ endif if SPARC64_VIDEO # Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO. ARCH_SOURCES = \ - sparc64_video.c \ $(srcdir)/../shared/ioperm_noop.c endif @@ -57,7 +56,6 @@ AM_CPPFLAGS = $(XORG_INCS) libbsd_la_SOURCES = \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c \ bsd_init.c \ bsd_bell.c \ diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index fd8f823..b98c585 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/hw/xfree86/os-support/bsd/alpha_video.c @@ -37,7 +37,6 @@ #endif #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED @@ -45,12 +44,6 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) extern int ioperm(unsigned long from, unsigned long num, int on); diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c index fea8528..da69437 100644 --- a/hw/xfree86/os-support/bsd/arm_video.c +++ b/hw/xfree86/os-support/bsd/arm_video.c @@ -64,7 +64,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED @@ -72,12 +71,6 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} - #ifdef USE_DEV_IO static int IoFd = -1; diff --git a/hw/xfree86/os-support/bsd/bsd_ev56.c b/hw/xfree86/os-support/bsd/bsd_ev56.c index 9588349..8a00273 100644 --- a/hw/xfree86/os-support/bsd/bsd_ev56.c +++ b/hw/xfree86/os-support/bsd/bsd_ev56.c @@ -11,7 +11,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #include diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index 6c3bbcb..0372f30 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_video.c @@ -35,7 +35,6 @@ #include #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #if defined(__NetBSD__) && !defined(MAP_FILE) #define MAP_FLAGS MAP_SHARED @@ -150,13 +149,11 @@ checkDevMem(Bool warn) } void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) +xf86InitVidMem(void) { checkDevMem(TRUE); pci_system_init_dev_mem(devMemFd); - - pVidMem->initialised = TRUE; } #ifdef USE_I386_IOPL diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index f017376..2308b03 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_video.c @@ -32,8 +32,6 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" - #include "bus/Pci.h" /***************************************************************************/ @@ -47,12 +45,6 @@ Bool xf86EnableIO(void); void xf86DisableIO(void); -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} - volatile unsigned char *ioBase = MAP_FAILED; Bool diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c deleted file mode 100644 index 5bed017..0000000 --- a/hw/xfree86/os-support/bsd/sparc64_video.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 1992 by Rich Murphey - * 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 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 - * 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 - * 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" -#include "xf86OSpriv.h" - -/***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index eebb3ae..754e280 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -6,10 +6,6 @@ if XORG_BUS_PCI PCI_SOURCES += Pci.c Pci.h endif -if XORG_BUS_BSDPCI -PCI_SOURCES += bsd_pci.c -endif - if XORG_BUS_SPARC PLATFORM_SOURCES = Sbus.c sdk_HEADERS += xf86Sbus.h diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index 52d142f..05a1e62 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -129,12 +129,9 @@ Bool xf86scanpci(void) { - Bool success = FALSE; - - success = (pci_system_init() == 0); - - /* choose correct platform/OS specific PCI init routine */ - osPciInit(); - - return success; +#if defined(__OpenBSD__) && (defined(__i386__) || defined(__amd64__)) + extern void xf86InitVidMem(void); + xf86InitVidMem(); +#endif + return pci_system_init() == 0; } diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 776bb63..f8855f6 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -135,14 +135,4 @@ #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u) -#if defined(linux) -#define osPciInit(x) do {} while (0) -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__OpenBSD__) || defined(__NetBSD__) || \ - defined(__DragonFly__) || defined(__sun) || defined(__GNU__) -extern void osPciInit(void); -#else -#error No PCI support available for this architecture/OS combination -#endif - #endif /* _PCI_H */ diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c deleted file mode 100644 index 7a5dbbb..0000000 --- a/hw/xfree86/os-support/bus/bsd_pci.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright ? 2007 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 - * - */ - -/** - * @file bsd_pci.c - * - * This is a trivial implementation of the remaining PCI support hooks in the - * X Server that is unaware of domains. - * - * Most of even this should go away once drivers are converted and the - * old interfaces are confirmed to all be obsolete. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "compiler.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "Pci.h" - -#include "pciaccess.h" - -void -osPciInit(void) -{ - xf86InitVidMem(); -} diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am index 3866054..0962f04 100644 --- a/hw/xfree86/os-support/hurd/Makefile.am +++ b/hw/xfree86/os-support/hurd/Makefile.am @@ -4,7 +4,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c \ hurd_video.c \ $(srcdir)/../shared/VTsw_noop.c \ $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 1e7d604..4b6c931 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -37,7 +37,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" /************************************************************************** * I/O Permissions section @@ -76,9 +75,3 @@ xf86DisableIO() ioperm(0, 0x10000, 0); return; } - -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index 50fcd1f..503f3f2 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -27,7 +27,6 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c \ lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index e1fa3f8..8a3467f 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/hw/xfree86/os-support/linux/lnx_agp.c @@ -15,7 +15,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #if defined(linux) #include diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index c09d719..423a99a 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -37,7 +37,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" static Bool ExtendedEnabled = FALSE; @@ -66,16 +65,6 @@ extern int iopl(int __level); #endif /***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} - -/***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c index da486c0..84ce62c 100644 --- a/hw/xfree86/os-support/shared/agp_noop.c +++ b/hw/xfree86/os-support/shared/agp_noop.c @@ -38,7 +38,6 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" Bool xf86GARTCloseScreen(int screenNum) diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c deleted file mode 100644 index a6bf677..0000000 --- a/hw/xfree86/os-support/shared/vidmem.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1993-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "input.h" -#include "scrnintstr.h" - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "xf86OSpriv.h" - -/* - * This file contains the common part of the video memory mapping functions - */ - -static VidMemInfo vidMemInfo = { FALSE, }; - -void -xf86InitVidMem(void) -{ - if (!vidMemInfo.initialised) { - memset(&vidMemInfo, 0, sizeof(VidMemInfo)); - xf86OSInitVidMem(&vidMemInfo); - } -} diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index 6cda4b3..7c295f6 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -22,7 +22,6 @@ libsolaris_la_SOURCES = sun_init.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/vidmem.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c index 25f7618..6710a54 100644 --- a/hw/xfree86/os-support/solaris/sun_vid.c +++ b/hw/xfree86/os-support/solaris/sun_vid.c @@ -56,20 +56,9 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" -#include "xf86OSpriv.h" #include /***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -_X_HIDDEN void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; -} - -/***************************************************************************/ /* I/O Permissions section */ /***************************************************************************/ diff --git a/hw/xfree86/os-support/stub/Makefile.am b/hw/xfree86/os-support/stub/Makefile.am index 19468c6..3337fe8 100644 --- a/hw/xfree86/os-support/stub/Makefile.am +++ b/hw/xfree86/os-support/stub/Makefile.am @@ -10,9 +10,7 @@ libstub_la_SOURCES = \ $(srcdir)/../shared/ioperm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/pm_noop.c \ - $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ stub_bell.c \ - stub_init.c \ - stub_video.c + stub_init.c diff --git a/hw/xfree86/os-support/stub/stub_video.c b/hw/xfree86/os-support/stub/stub_video.c deleted file mode 100644 index 9771fcf..0000000 --- a/hw/xfree86/os-support/stub/stub_video.c +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86_OSlib.h" -#include "xf86OSpriv.h" - -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->initialised = TRUE; - return; -} diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h deleted file mode 100644 index ce1ec33..0000000 --- a/hw/xfree86/os-support/xf86OSpriv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1999-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 - -#ifndef _XF86OSPRIV_H -#define _XF86OSPRIV_H - -typedef struct { - Bool initialised; -} VidMemInfo, *VidMemInfoPtr; - -void xf86OSInitVidMem(VidMemInfoPtr); - -#endif /* _XF86OSPRIV_H */ diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 822bab2..350b11e 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -186,9 +186,6 @@ extern _X_EXPORT void xf86VTRequest(int sig); extern _X_EXPORT int xf86ProcessArgument(int, char **, int); extern _X_EXPORT void xf86UseMsg(void); extern _X_EXPORT PMClose xf86OSPMOpen(void); - -extern _X_EXPORT void xf86InitVidMem(void); - #endif /* XF86_OS_PRIVS */ #ifdef XSERVER_PLATFORM_BUS -- 1.9.3 From ajax at redhat.com Wed Oct 8 08:38:59 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 8 Oct 2014 17:38:59 +0200 Subject: [PATCH 4/4] xfree86: Convert xf86{Read, Write}Mmio{8, 16, 32} on alpha to functions In-Reply-To: <1412782739-9960-1-git-send-email-ajax@redhat.com> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> Message-ID: <1412782739-9960-5-git-send-email-ajax@redhat.com> ... instead of function pointers. Since the sparse mapping support is gone these never vary anymore. Signed-off-by: Adam Jackson --- hw/xfree86/common/compiler.h | 35 ++++++++++----------------------- hw/xfree86/os-support/bsd/alpha_video.c | 23 ---------------------- hw/xfree86/os-support/bsd/bsd_ev56.c | 22 ++++++--------------- hw/xfree86/os-support/linux/lnx_ev56.c | 22 ++++++--------------- hw/xfree86/os-support/linux/lnx_video.c | 27 ------------------------- 5 files changed, 22 insertions(+), 107 deletions(-) diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 5325129..93052a0 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1034,36 +1034,21 @@ inl(unsigned short port) #ifdef __alpha__ /* entry points for Mmio memory access routines */ -extern _X_EXPORT int (*xf86ReadMmio8) (void *, unsigned long); -extern _X_EXPORT int (*xf86ReadMmio16) (void *, unsigned long); - -#ifndef STANDALONE_MMIO -extern _X_EXPORT int (*xf86ReadMmio32) (void *, unsigned long); -#else -/* Some DRI 3D drivers need MMIO_IN32. */ -static __inline__ int -xf86ReadMmio32(void *Base, unsigned long Offset) -{ - mem_barrier(); - return *(volatile unsigned int *) ((unsigned long) Base + (Offset)); -} -#endif -extern _X_EXPORT void (*xf86WriteMmio8) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmio16) (int, void *, unsigned long); -extern _X_EXPORT void (*xf86WriteMmio32) (int, void *, unsigned long); +extern _X_EXPORT int xf86ReadMmio8 (void *, unsigned long); +extern _X_EXPORT int xf86ReadMmio16 (void *, unsigned long); +extern _X_EXPORT int xf86ReadMmio32 (void *, unsigned long); +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 xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); /* Some macros to hide the system dependencies for MMIO accesses */ /* Changed to kill noise generated by gcc's -Wcast-align */ -#define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) -#define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) -#ifndef STANDALONE_MMIO -#define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) -#else +#define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) +#define MMIO_IN16(base, offset) xf86ReadMmio16(base, offset) #define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) -#endif #define MMIO_OUT32(base, offset, val) \ do { \ @@ -1072,9 +1057,9 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); } while (0) #define MMIO_OUT8(base, offset, val) \ - (*xf86WriteMmio8)((CARD8)(val), base, offset) + xf86WriteMmio8((CARD8)(val), base, offset) #define MMIO_OUT16(base, offset, val) \ - (*xf86WriteMmio16)((CARD16)(val), base, offset) + xf86WriteMmio16((CARD16)(val), base, offset) #elif defined(__powerpc__) || defined(__sparc__) /* diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index b98c585..84c68f6 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/hw/xfree86/os-support/bsd/alpha_video.c @@ -80,26 +80,3 @@ xf86DisableIO() } #endif /* USE_ALPHA_PIO */ - -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 - writeDense8(int Value, void *Base, register unsigned long Offset); -extern void - writeDense16(int Value, void *Base, register unsigned long Offset); -extern void - writeDense32(int Value, void *Base, register unsigned long Offset); - -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; -int (*xf86ReadMmio8) (void *Base, unsigned long Offset) - = readDense8; -int (*xf86ReadMmio16) (void *Base, unsigned long Offset) - = readDense16; -int (*xf86ReadMmio32) (void *Base, unsigned long Offset) - = readDense32; diff --git a/hw/xfree86/os-support/bsd/bsd_ev56.c b/hw/xfree86/os-support/bsd/bsd_ev56.c index 8a00273..f843687 100644 --- a/hw/xfree86/os-support/bsd/bsd_ev56.c +++ b/hw/xfree86/os-support/bsd/bsd_ev56.c @@ -21,53 +21,43 @@ */ __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 - writeDense8(int Value, void *Base, register unsigned long Offset); -void - writeDense16(int Value, void *Base, register unsigned long Offset); -void - writeDense32(int Value, void *Base, register unsigned long Offset); - int -readDense8(void *Base, register unsigned long Offset) +xf86ReadMmio8(void *Base, register unsigned long Offset) { mem_barrier(); return (alpha_ldbu((void *) ((unsigned long) Base + (Offset)))); } int -readDense16(void *Base, register unsigned long Offset) +xf86ReadMmio16(void *Base, register unsigned long Offset) { mem_barrier(); return (alpha_ldwu((void *) ((unsigned long) Base + (Offset)))); } int -readDense32(void *Base, register unsigned long Offset) +xf86ReadMmio32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void -writeDense8(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDense16(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDense32(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c b/hw/xfree86/os-support/linux/lnx_ev56.c index 4e886b6..ef4bb30 100644 --- a/hw/xfree86/os-support/linux/lnx_ev56.c +++ b/hw/xfree86/os-support/linux/lnx_ev56.c @@ -6,53 +6,43 @@ #include "xf86.h" #include "compiler.h" -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 - writeDense8(int Value, void *Base, register unsigned long Offset); -void - writeDense16(int Value, void *Base, register unsigned long Offset); -void - writeDense32(int Value, void *Base, register unsigned long Offset); - int -readDense8(void *Base, register unsigned long Offset) +xf86ReadMmio8(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD8 *) ((unsigned long) Base + (Offset)); } int -readDense16(void *Base, register unsigned long Offset) +xf86ReadMmio16(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD16 *) ((unsigned long) Base + (Offset)); } int -readDense32(void *Base, register unsigned long Offset) +xf86ReadMmio32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void -writeDense8(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense16(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense32(int Value, void *Base, register unsigned long Offset) +xf86WriteMmio32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 423a99a..e0df9d6 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -155,30 +155,3 @@ xf86DisableIO(void) ExtendedEnabled = FALSE; } - -#if defined (__alpha__) - -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 - writeDense8(int Value, void *Base, register unsigned long Offset); -extern void - writeDense16(int Value, void *Base, register unsigned long Offset); -extern void - writeDense32(int Value, void *Base, register unsigned long Offset); - -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; -int (*xf86ReadMmio8) (void *Base, unsigned long Offset) - = readDense8; -int (*xf86ReadMmio16) (void *Base, unsigned long Offset) - = readDense16; -int (*xf86ReadMmio32) (void *Base, unsigned long Offset) - = readDense32; - -#endif /* __alpha__ */ -- 1.9.3 From keithp at keithp.com Wed Oct 8 08:46:58 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 08 Oct 2014 17:46:58 +0200 Subject: [PATCH 4/4] modesetting: Add support for rendering using glamor. In-Reply-To: <1412758705-444-4-git-send-email-eric@anholt.net> References: <1412758705-444-1-git-send-email-eric@anholt.net> <1412758705-444-4-git-send-email-eric@anholt.net> Message-ID: <864mvezhql.fsf@hiro.keithp.com> Eric Anholt writes: > By default modesetting now tries to enable X acceleration using > glamor, but falls back to normal shadowfb if GL fails to initialize. For the series: Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From jon.turney at dronecode.org.uk Wed Oct 8 09:27:34 2014 From: jon.turney at dronecode.org.uk (Jon TURNEY) Date: Wed, 08 Oct 2014 17:27:34 +0100 Subject: [PATCH 1/7] xwin: Remove native GDI engine In-Reply-To: <1412770639-5577-2-git-send-email-ajax@redhat.com> References: <1412770639-5577-1-git-send-email-ajax@redhat.com> <1412770639-5577-2-git-send-email-ajax@redhat.com> Message-ID: <543565F6.8070209@dronecode.org.uk> On 08/10/2014 13:17, Adam Jackson wrote: > 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. Thanks for doing this. Getting rid of these has been on my todo list for a while. I think the DirectDraw2 engine hasn't been useful for about a decade, so I'll make a patch to remove that as well. [1/7] & [2/7] Reviewed-by: Jon TURNEY > diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c > index 6732dcb..fa9cb5f 100644 > --- a/hw/xwin/wincreatewnd.c > +++ b/hw/xwin/wincreatewnd.c > @@ -110,20 +110,9 @@ 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); > + break; The switch has been removed, so break is no longer needed. Please squash the attached patch into this one. -------------- next part -------------- From d8be6054b7cae890e224e352340a5613c18d569f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 8 Oct 2014 17:21:01 +0100 Subject: [PATCH] Compilation fix for remove native GDI engine --- hw/xwin/wincreatewnd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c index fa9cb5f..b420aae 100644 --- a/hw/xwin/wincreatewnd.c +++ b/hw/xwin/wincreatewnd.c @@ -110,9 +110,8 @@ winCreateBoundingWindowFullScreen(ScreenPtr pScreen) GetModuleHandle(NULL), /* Instance handle */ pScreenPriv); /* ScreenPrivates */ - /* Hide the window */ + /* Show the window */ ShowWindow(*phwnd, SW_SHOWNORMAL); - break; /* Send first paint message */ UpdateWindow(*phwnd); -- 2.1.1 From thellstrom at vmware.com Wed Oct 8 11:06:06 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Wed, 8 Oct 2014 20:06:06 +0200 Subject: [PATCH] Back off if we detect a vmmouse kernel driver v3 In-Reply-To: <20141007150108.GA4462@syeh-linux> References: <1412594233-2636-1-git-send-email-thellstrom@vmware.com> <20141006145903.GA14150@syeh-linux> <5432FBD4.1070502@vmware.com> <20141007150108.GA4462@syeh-linux> Message-ID: <54357D0E.1020508@vmware.com> On 10/07/2014 05:01 PM, Sinclair Yeh wrote: > Reviewed-by: Sinclair Yeh Thanks for the review. Pushed. /Thomas > > On Mon, Oct 06, 2014 at 10:30:12PM +0200, Thomas Hellstrom wrote: >> On 10/06/2014 04:59 PM, Sinclair Yeh wrote: >>> On Mon, Oct 06, 2014 at 01:17:13PM +0200, Thomas Hellstrom wrote: >>>> If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg >>>> evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect >>>> utility doesn't detect a vmmouse if a kernel driver is active. >>>> >>>> v2: Change the vmmouse kernel device name, fix comment. >>>> v3: Fix up libudev error handling. >>>> >>>> Signed-off-by: Thomas Hellstrom >>>> --- >>>> configure.ac | 14 +++++++ >>>> tools/Makefile.am | 7 +++- >>>> tools/vmmouse_detect.c | 5 +++ >>>> tools/vmmouse_udev.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ >>>> 4 files changed, 129 insertions(+), 2 deletions(-) >>>> create mode 100644 tools/vmmouse_udev.c >>>> >>>> diff --git a/configure.ac b/configure.ac >>>> index ad05504..1197555 100644 >>>> --- a/configure.ac >>>> +++ b/configure.ac >>>> @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) >>>> XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) >>>> >>>> # Checks for pkg-config packages >>>> +libudev_check=yes >>>> +AC_ARG_WITH([libudev], >>>> + [AS_HELP_STRING([--without-libudev], >>>> + [Use to build without libudev on linux])], >>>> + [if test x$withval = xno; then libudev_check=no; fi] >>>> + []) >>>> + >>>> +if test x`uname` = xLinux -a $libudev_check = yes; then >>>> + PKG_CHECK_MODULES(LIBUDEV, [libudev], >>>> + [AC_DEFINE([HAVE_LIBUDEV], 1, >>>> + [Has libudev installed])], >>>> + []); >>>> +fi >>>> + >>>> PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES) >>>> >>>> PKG_CHECK_EXISTS([xorg-server >= 1.1.0], >>>> diff --git a/tools/Makefile.am b/tools/Makefile.am >>>> index 8ae5516..a1396ba 100644 >>>> --- a/tools/Makefile.am >>>> +++ b/tools/Makefile.am >>>> @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME at _detect >>>> >>>> AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS) >>>> >>>> - at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c >>>> - at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la >>>> + at DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c >>>> + at DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib at DRIVER_NAME@.la \ >>>> + @LIBUDEV_LIBS@ >>>> + at DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@ >>>> + >>>> >>>> calloutsdir=$(HAL_CALLOUTS_DIR) >>>> callouts_SCRIPTS = hal-probe-vmmouse >>>> diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c >>>> index 7939ff8..b743b2d 100644 >>>> --- a/tools/vmmouse_detect.c >>>> +++ b/tools/vmmouse_detect.c >>>> @@ -34,6 +34,8 @@ >>>> #include >>>> #include "vmmouse_client.h" >>>> >>>> +extern int vmmouse_uses_kernel_driver(void); >>>> + >>>> void >>>> segvCB(int sig) >>>> { >>>> @@ -46,6 +48,9 @@ segvCB(int sig) >>>> int >>>> main(void) >>>> { >>>> + if (vmmouse_uses_kernel_driver()) >>>> + return 1; >>>> + >>>> /* >>>> * If the vmmouse test is not run in a VMware virtual machine, it >>>> * will segfault instead of successfully accessing the port. >>>> diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c >>>> new file mode 100644 >>>> index 0000000..4e51dd6 >>>> --- /dev/null >>>> +++ b/tools/vmmouse_udev.c >>>> @@ -0,0 +1,105 @@ >>>> +/* >>>> + * Copyright 2014 by VMware, 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_CONFIG_H >>>> +#include "config.h" >>>> +#endif >>>> + >>>> +#ifdef HAVE_LIBUDEV >>>> +#include >>>> +#include >>>> +#include >>>> + >>>> +#define KERNEL_DEVNAME "VirtualPS/2 VMware VMMouse" >>>> + >>>> +/** >>>> + * vmmouse_uses_kernel_driver - Check whether there's an active >>>> + * vmmouse driver in the kernel. >>>> + * >>>> + * Returns 0 if there was no kernel driver found. >>>> + * Returns non-zero on error or if there was an active driver found. >>>> + * >>>> + * Scans the input subsystem for devices matching KERNEL_DEVNAME. These >>>> + * devices are assumed to be active vmmouse drivers. >>>> + */ >>>> +int vmmouse_uses_kernel_driver(void) >>>> +{ >>>> + struct udev *udev; >>>> + struct udev_enumerate *enumerate; >>>> + struct udev_list_entry *devices, *dev_list_entry; >>>> + struct udev_device *dev; >>>> + >>>> + udev = udev_new(); >>>> + if (!udev) >>>> + return 1; >>>> + >>>> + /* >>>> + * Udev error return codes that are not caught immediately are >>>> + * typically caught in the input argument check in the udev >>>> + * function calls following the failing call! >>>> + */ >>>> + enumerate = udev_enumerate_new(udev); >>>> + if (udev_enumerate_add_match_subsystem(enumerate, "input")) >>>> + goto out_err; >>>> + if (udev_enumerate_scan_devices(enumerate)) >>>> + goto out_err; >>>> + >>>> + devices = udev_enumerate_get_list_entry(enumerate); >>>> + udev_list_entry_foreach(dev_list_entry, devices) { >>>> + const char *path, *name; >>>> + >>>> + path = udev_list_entry_get_name(dev_list_entry); >>>> + dev = udev_device_new_from_syspath(udev, path); >>>> + if (!dev) >>>> + goto out_err; >>>> + name = udev_device_get_sysattr_value(dev, "name"); >>>> + if (name && !strcasecmp(name, KERNEL_DEVNAME)) >>>> + goto out_found; >>>> + >>>> + udev_device_unref(dev); >>>> + } >>>> + >>>> + out_not_found: >>>> + udev_enumerate_unref(enumerate); >>>> + udev_unref(udev); >>>> + >>>> + return 0; >>>> + >>>> + out_found: >>>> + udev_device_unref(dev); >>>> + out_err: >>>> + udev_enumerate_unref(enumerate); >>>> + udev_unref(udev); >>> If there's an error, would it make sense to let the vmmouse driver try >>> to drive it, e.g. return 0? >> If udev errors, and we enable the user-space vmmouse driver, it might >> clash with a kernel driver which is a bad situation. If we instead back >> off, the mouse will be treated as a normal ps/2 mouse. We'll lose the >> VMMouse features, but the mouse will still work. >> >>> It seems to me that the failure case should return the same value as >>> the case when udev is not enabled. >> The --without-libudev option is intended for the situation where the >> distro maintainer knows for sure that there will be no kernel vmmouse >> driver enabled and where he doesn't want to or can't introduce a libudev >> dependency. In that situation, we always enable the vmmouse. >> >>> I'm not sure how udev is used in vmmouse driver, so maybe it'll run >>> into the same failure on its side. In that case the code looks okay >>> to me. >> The vmmouse driver itself doesn't use libudev, so the errors are treated >> the way they are only because of the above considerations. >> >>> Sinclair >>> >>> >> Thanks, >> Thomas >> >> >> >>>> + >>>> + return 1; >>>> +} >>>> +#else >>>> +int vmmouse_uses_kernel_driver(void) >>>> +{ >>>> + return 0; >>>> +} >>>> +#endif >>>> -- >>>> 1.8.3.2 >>>> From thellstrom at vmware.com Wed Oct 8 11:16:05 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Wed, 8 Oct 2014 20:16:05 +0200 Subject: [PATCH] vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h In-Reply-To: <1412674321-9709-1-git-send-email-sndirsch@suse.de> References: <1412674321-9709-1-git-send-email-sndirsch@suse.de> Message-ID: <54357F65.1080802@vmware.com> On 10/07/2014 11:32 AM, Stefan Dirsch wrote: > xf86_OSproc.h cannot be included without first including xorg-server.h. > > Without this the build fails on systems with the latest glibc, > throwing this error: > > In file included from /usr/include/string.h:634:0, > from /usr/include/xorg/os.h:53, > from /usr/include/xorg/misc.h:115, > from /usr/include/xorg/window.h:50, > from /usr/include/xorg/globals.h:7, > from /usr/include/xorg/opaque.h:34, > from /usr/include/xorg/xf86_OSproc.h:127, > from vmmouse_client.h:42, > from vmmouse_client.c:38: > /usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__' > strndup(const char *str, size_t n); > > This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h), > causing os.h to redefine it. > > Signed-off-by: Stefan Dirsch Thanks. compile-tested and pushed. /Thomas > --- > shared/vmmouse_client.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/shared/vmmouse_client.h b/shared/vmmouse_client.h > index b01bf08..1de51e5 100644 > --- a/shared/vmmouse_client.h > +++ b/shared/vmmouse_client.h > @@ -39,6 +39,7 @@ > #ifndef _VMMOUSE_CLIENT_H_ > #define _VMMOUSE_CLIENT_H_ > > +#include "xorg-server.h" > #include "xf86_OSproc.h" > > /* From jcristau at debian.org Wed Oct 8 16:47:53 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 01:47:53 +0200 Subject: [PATCH 06/37] mi: Deobfuscate miOverlayWindowExposures In-Reply-To: <1412780701-8818-7-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-7-git-send-email-ajax@redhat.com> Message-ID: <20141008234753.GP3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:30 +0200, Adam Jackson wrote: > Signed-off-by: Adam Jackson > --- > mi/mioverlay.c | 40 ++++++++++++---------------------------- > 1 file changed, 12 insertions(+), 28 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From jcristau at debian.org Wed Oct 8 16:50:51 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 01:50:51 +0200 Subject: [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: <1412780701-8818-9-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-9-git-send-email-ajax@redhat.com> Message-ID: <20141008235051.GQ3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:32 +0200, Adam Jackson wrote: > This existed to be passed to the bs recovery routine; since we back all > planes, we don't care. > > Signed-off-by: Adam Jackson > --- > fb/fbcopy.c | 2 +- > glamor/glamor_copy.c | 3 +-- > hw/dmx/dmxgcops.c | 8 ++++---- > mi/mi.h | 3 +-- > mi/mibitblt.c | 5 ++--- > mi/micopy.c | 3 +-- > mi/miexpose.c | 8 +------- > 7 files changed, 11 insertions(+), 21 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From jcristau at debian.org Wed Oct 8 16:54:22 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 01:54:22 +0200 Subject: [PATCH 09/37] mi: Move pScreen->SendGraphicsExpose up to dix In-Reply-To: <1412780701-8818-10-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-10-git-send-email-ajax@redhat.com> Message-ID: <20141008235422.GR3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:33 +0200, Adam Jackson wrote: > No DDX is overriding this and it's fairly absurd to expose it as a > screen operation anyway. > > Signed-off-by: Adam Jackson > --- > Xext/panoramiXprocs.c | 10 ++++------ > dix/dispatch.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++---- > include/dix.h | 6 ++++++ > include/scrnintstr.h | 7 ------- > mi/mi.h | 7 ------- > mi/miexpose.c | 47 ---------------------------------------------- > mi/miscrinit.c | 1 - > 7 files changed, 58 insertions(+), 72 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From jcristau at debian.org Wed Oct 8 16:36:16 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 01:36:16 +0200 Subject: [PATCH 04/37] dix: Drop the third argument from WindowExposuresProcPtr In-Reply-To: <1412780701-8818-5-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-5-git-send-email-ajax@redhat.com> Message-ID: <20141008233616.GN3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:28 +0200, Adam Jackson wrote: > 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 nothing, we can > nuke it. > > mi{,Overlay}WindowExposures get slightly simpler here, and will get even > simpler in just a moment. > > Signed-off-by: Adam Jackson Reviewed-by: Julien Cristau Cheers, Julien From jcristau at debian.org Wed Oct 8 16:36:35 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 01:36:35 +0200 Subject: [PATCH 05/37] mi: Deobfuscate miWindowExposures In-Reply-To: <1412780701-8818-6-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-6-git-send-email-ajax@redhat.com> Message-ID: <20141008233635.GO3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:29 +0200, Adam Jackson wrote: > Signed-off-by: Adam Jackson > --- > mi/miexpose.c | 41 +++++++++++------------------------------ > 1 file changed, 11 insertions(+), 30 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From jcristau at debian.org Wed Oct 8 17:04:12 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 02:04:12 +0200 Subject: [PATCH 17/37] misc: Fold together some redundant conditionals In-Reply-To: <1412780701-8818-18-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-18-git-send-email-ajax@redhat.com> Message-ID: <20141009000412.GS3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:04:41 +0200, Adam Jackson wrote: > Signed-off-by: Adam Jackson > --- > dix/window.c | 39 ++++++++++++++++++--------------------- > mi/mioverlay.c | 4 ---- > mi/miwindow.c | 32 +++++++++++++++----------------- > 3 files changed, 33 insertions(+), 42 deletions(-) > > diff --git a/dix/window.c b/dix/window.c > index 7a2866a..99024de 100644 > --- a/dix/window.c > +++ b/dix/window.c > @@ -2059,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(); seems weird to use pScreen in most places but pWin->drawable.pScreen in the conditional... Either way, Reviewed-by: Julien Cristau for 10-17. Cheers, Julien From ajax at nwnk.net Thu Oct 9 00:36:36 2014 From: ajax at nwnk.net (Adam Jackson) Date: Thu, 09 Oct 2014 09:36:36 +0200 Subject: [PULL] xwin engine removal Message-ID: <1412840196.26586.34.camel@dmt> Merged Jon's fixup: http://lists.freedesktop.org/archives/xorg-devel/2014-October/044245.html Otherwise this is just the two engine removal patches without deleting the mi span blit stuff. --- The following changes since commit 95a5b92e37f73f497d547fd91c543c16d2cc73de: xfree86: Remove remaining return FALSE from configServerFlags (2014-10-02 10:26:53 -0700) are available in the git repository at: ssh://people.freedesktop.org/~ajax/xserver.git xwin for you to fetch changes up to c79f824bf6617816aaf10393beec8dddfa591f7b: xwin: Remove primary DirectDraw engine (2014-10-09 09:28:04 +0200) ---------------------------------------------------------------- Adam Jackson (2): xwin: Remove native GDI engine (v2) xwin: Remove primary DirectDraw engine configure.ac | 2 - hw/xwin/InitOutput.c | 6 - hw/xwin/Makefile.am | 21 -- hw/xwin/man/XWin.man | 4 - hw/xwin/win.h | 182 ----------- hw/xwin/winclip.c | 42 --- hw/xwin/wincreatewnd.c | 22 +- hw/xwin/winengine.c | 23 -- hw/xwin/winfillsp.c | 842 ------------------------------------------------- hw/xwin/winfont.c | 82 ----- hw/xwin/wingc.c | 235 -------------- hw/xwin/wingetsp.c | 171 ---------- hw/xwin/winmisc.c | 63 ---- hw/xwin/winnativegdi.c | 491 ---------------------------- hw/xwin/winpfbdd.c | 620 ------------------------------------ hw/xwin/winpixmap.c | 223 ------------- hw/xwin/winpolyline.c | 53 ---- hw/xwin/winrop.c | 142 --------- hw/xwin/winscrinit.c | 139 -------- hw/xwin/winsetsp.c | 175 ---------- hw/xwin/winwindow.c | 219 ------------- hw/xwin/winwndproc.c | 12 +- 22 files changed, 4 insertions(+), 3765 deletions(-) delete mode 100644 hw/xwin/winclip.c delete mode 100644 hw/xwin/winfillsp.c delete mode 100644 hw/xwin/winfont.c delete mode 100644 hw/xwin/wingc.c delete mode 100644 hw/xwin/wingetsp.c delete mode 100644 hw/xwin/winnativegdi.c delete mode 100644 hw/xwin/winpfbdd.c delete mode 100644 hw/xwin/winpixmap.c delete mode 100644 hw/xwin/winpolyline.c delete mode 100644 hw/xwin/winrop.c delete mode 100644 hw/xwin/winsetsp.c - ajax From ajax at redhat.com Thu Oct 9 00:58:06 2014 From: ajax at redhat.com (Adam Jackson) Date: Thu, 9 Oct 2014 09:58:06 +0200 Subject: [PATCH] mi: Mark the span blit routines as _X_COLD Message-ID: <1412841486-32402-1-git-send-email-ajax@redhat.com> 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 --- mi/mibitblt.c | 13 ++++++------- mi/mifillrct.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 3ed4ed1..c2516b0 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -72,7 +72,7 @@ extern int ffs(int); * 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, @@ -262,8 +262,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) { @@ -369,7 +368,7 @@ miGetPlane(DrawablePtr pDraw, int planeNum, /* number of the bitPlane */ * 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) { @@ -511,7 +510,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, * build a source clip * Use the bitmap we've built up as a Stipple for the destination */ -RegionPtr +_X_COLD RegionPtr miCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, @@ -600,7 +599,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) { @@ -690,7 +689,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/mi/mifillrct.c b/mi/mifillrct.c index 79c4057..faf6049 100644 --- a/mi/mifillrct.c +++ b/mi/mifillrct.c @@ -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 */ ) -- 1.9.3 From keithp at keithp.com Thu Oct 9 01:30:03 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 9 Oct 2014 10:30:03 +0200 Subject: [PATCH] Use unique display name for each xi2 test program [v3] In-Reply-To: <542DEB16.3040503@oracle.com> References: <542DEB16.3040503@oracle.com> Message-ID: <1412843403-1697-1-git-send-email-keithp@keithp.com> From: Alan Coopersmith 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 Signed-off-by: Keith Packard --- configure.ac | 4 +++- include/dix-config.h.in | 7 +++++++ test/xi2/protocol-common.c | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 30c0c5c..c697188 100644 --- a/configure.ac +++ b/configure.ac @@ -217,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]) diff --git a/include/dix-config.h.in b/include/dix-config.h.in index f170c1c..1aa77a5 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -72,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 @@ -100,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 diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index 64a5777..9265ba3 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" @@ -139,6 +140,17 @@ init_devices(void) 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); AllocDevicePair(&client, "Virtual core", &local_devices.vcp, &local_devices.vck, -- 2.1.1 From ajax at nwnk.net Thu Oct 9 02:04:57 2014 From: ajax at nwnk.net (Adam Jackson) Date: Thu, 09 Oct 2014 11:04:57 +0200 Subject: [PULL] Dead code cleanup Message-ID: <1412845497.32702.10.camel@dmt> The following changes since commit 95a5b92e37f73f497d547fd91c543c16d2cc73de: xfree86: Remove remaining return FALSE from configServerFlags (2014-10-02 10:26:53 -0700) are available in the git repository at: ssh://people.freedesktop.org/~ajax/xserver.git dead-code for you to fetch changes up to 7ebf480f5eb75e06271ec924769e51bdcbbdc69c: xfree86: Remove some can't-happen printf from xf86CreateRootWindow (2014-10-08 10:10:39 +0200) ---------------------------------------------------------------- Adam Jackson (5): exa, kdrive: Remove redundant BitsPerPixel macros input: Remove unused SetKeySymsMap loader: Remove some baklava code vfb: Don't reimplement micmap so much xfree86: Remove some can't-happen printf from xf86CreateRootWindow dix/devices.c | 57 ---------------------- exa/exa_priv.h | 12 ----- hw/kdrive/src/kdrive.h | 13 ----- hw/vfb/InitOutput.c | 55 ++------------------- hw/xfree86/common/xf86Init.c | 15 ------ hw/xfree86/loader/loadmod.c | 113 ++++++++++++++++++------------------------- include/input.h | 3 -- 7 files changed, 51 insertions(+), 217 deletions(-) - ajax From ajax at nwnk.net Thu Oct 9 02:24:59 2014 From: ajax at nwnk.net (Adam Jackson) Date: Thu, 09 Oct 2014 11:24:59 +0200 Subject: [PULL] mi cleanups Message-ID: <1412846699.32702.12.camel@dmt> The following changes since commit 95a5b92e37f73f497d547fd91c543c16d2cc73de: xfree86: Remove remaining return FALSE from configServerFlags (2014-10-02 10:26:53 -0700) are available in the git repository at: ssh://people.freedesktop.org/~ajax/xserver.git mi-cleanup for you to fetch changes up to 5ecd7866f7587d620f000e802a262c7cd4b9df33: misc: Fold together some redundant conditionals (2014-10-09 11:19:06 +0200) ---------------------------------------------------------------- Adam Jackson (17): kdrive: Remove vestigial reference to fbInitValidateTree xquartz: Remove useless DRIWindowExposures rootless: remove redundant RootlessShapedWindowIn dix: Drop the third argument from WindowExposuresProcPtr mi: Deobfuscate miWindowExposures mi: Deobfuscate miOverlayWindowExposures mi: Simplify composite border clip redirection interface mi: Drop plane argument from miHandleExposures mi: Move pScreen->SendGraphicsExpose up to dix dix: Remove DIXsaveUnder bit from the Window dix: Lower backStorage to a bit instead of a pointer dix: Remove an empty if dix: Remove some pointless casting of NULL dix: Remove an obfuscatory macro mi: miSlideAndSizeWindow -> miResizeWindow fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window misc: Fold together some redundant conditionals Xext/panoramiXprocs.c | 10 ++-- composite/compext.c | 3 -- composite/compinit.c | 4 +- dix/dispatch.c | 52 +++++++++++++++++-- dix/window.c | 73 +++++++++++--------------- fb/fb.h | 4 +- fb/fbcopy.c | 2 +- fb/fboverlay.c | 5 +- fb/fboverlay.h | 4 +- fb/fbscreen.c | 4 +- fb/fbwindow.c | 4 +- fb/wfbrename.h | 4 +- glamor/glamor_copy.c | 3 +- hw/dmx/dmxgcops.c | 8 +-- hw/dmx/dmxwindow.c | 4 +- hw/dmx/dmxwindow.h | 3 +- hw/kdrive/ephyr/ephyr.c | 2 +- hw/kdrive/src/kdrive.c | 4 -- hw/kdrive/src/kxv.c | 6 +-- hw/xfree86/common/xf86xv.c | 6 +-- hw/xfree86/dri/dri.c | 4 +- hw/xfree86/dri/dri.h | 3 +- hw/xnest/Window.c | 4 +- hw/xnest/XNWindow.h | 3 +- hw/xquartz/xpr/dri.c | 21 -------- hw/xquartz/xpr/dri.h | 4 -- include/dix.h | 6 +++ include/scrnintstr.h | 10 +--- include/windowstr.h | 3 +- mi/mi.h | 37 +++---------- mi/mibitblt.c | 5 +- mi/micopy.c | 3 +- mi/miexpose.c | 109 +++++---------------------------------- mi/mioverlay.c | 70 +++++++------------------ mi/miscrinit.c | 3 +- mi/mivaltree.c | 52 +++++++------------ mi/miwindow.c | 41 +++++++-------- miext/rootless/rootlessValTree.c | 65 ++--------------------- 38 files changed, 211 insertions(+), 437 deletions(-) - ajax From keithp at keithp.com Thu Oct 9 05:02:32 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 9 Oct 2014 14:02:32 +0200 Subject: [PATCH] Use linux 3.17 memfd_create syscall when available Message-ID: <1412856152-21532-1-git-send-email-keithp@keithp.com> Linux 3.17 introduces a new anonymous memory allocation that returns a file descriptor which we can pass around. Use this in preference to creating a file in the filesystem where available. Signed-off-by: Keith Packard --- configure.ac | 6 ++++++ src/xshmfence_alloc.c | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index ddf63dc..84b49de 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,12 @@ AC_SUBST([XPROTO_CFLAGS]) CFLAGS="$CFLAGS $XPROTO_CFLAGS" +AC_CHECK_FUNCS(memfd_create) + +AC_CHECK_DECLS([__NR_memfd_create], [], [], [[#include ]]) + +AC_CHECK_HEADERS([sys/memfd.h], [AC_DEFINE([HAVE_MEMFD_H], 1, [Has sys/memfd.h header])]) + AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]), [SYMBOL_VISIBILITY=$enableval], [SYMBOL_VISIBILITY=auto]) diff --git a/src/xshmfence_alloc.c b/src/xshmfence_alloc.c index 58416cd..afa6b16 100644 --- a/src/xshmfence_alloc.c +++ b/src/xshmfence_alloc.c @@ -26,6 +26,34 @@ #include "xshmfenceint.h" +#if !HAVE_MEMFD_CREATE +#if HAVE_DECL___NR_MEMFD_CREATE +#include +static int memfd_create(const char *name, + unsigned int flags) +{ + return syscall(__NR_memfd_create, name, flags); +} +#define HAVE_MEMFD_CREATE 1 +#endif +#endif + +#if HAVE_MEMFD_CREATE + +/* Get defines for the memfd_create syscall, using the + * header if available, or just defining the constants otherwise + */ + +#if HAVE_MEMFD_H +#include +#else +/* flags for memfd_create(2) (unsigned int) */ +#define MFD_CLOEXEC 0x0001U +#define MFD_ALLOW_SEALING 0x0002U +#endif + +#endif + /** * xshmfence_alloc_shm: * @@ -41,16 +69,22 @@ xshmfence_alloc_shm(void) char template[] = SHMDIR "/shmfd-XXXXXX"; int fd; -#ifdef O_TMPFILE - fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); +#if HAVE_DECL___NR_MEMFD_CREATE + fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING); if (fd < 0) #endif - { - fd = mkstemp(template); - if (fd < 0) - return fd; - unlink(template); - } + { +#ifdef O_TMPFILE + fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); + if (fd < 0) +#endif + { + fd = mkstemp(template); + if (fd < 0) + return fd; + unlink(template); + } + } if (ftruncate(fd, sizeof (struct xshmfence)) < 0) { close(fd); return -1; -- 2.1.1 From keithp at keithp.com Thu Oct 9 05:10:04 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 09 Oct 2014 14:10:04 +0200 Subject: [PATCH] Use linux 3.17 memfd_create syscall when available In-Reply-To: <1412856152-21532-1-git-send-email-keithp@keithp.com> References: <1412856152-21532-1-git-send-email-keithp@keithp.com> Message-ID: <86vbnttper.fsf@hiro.keithp.com> Keith Packard writes: > +#if HAVE_DECL___NR_MEMFD_CREATE Oops. I've fixed this locally to use #if HAVE_MEMFD_CREATE > + fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING); > if (fd < 0) > #endif -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 9 05:19:10 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 09 Oct 2014 14:19:10 +0200 Subject: [PATCH] Use unique display name for each xi2 test program [v3] In-Reply-To: <1412843403-1697-1-git-send-email-keithp@keithp.com> References: <542DEB16.3040503@oracle.com> <1412843403-1697-1-git-send-email-keithp@keithp.com> Message-ID: <86siixtozl.fsf@hiro.keithp.com> Keith Packard writes: > v3: use program_invocation_short_name on Linux Merged both of these patches after lunch-time review by Adam: 95a5b92..da88772 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From jcristau at debian.org Thu Oct 9 05:22:42 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 14:22:42 +0200 Subject: [PATCH] xinerama: Fix access mode in GetImage's drawable lookup In-Reply-To: <1412781512-9719-1-git-send-email-ajax@redhat.com> References: <1412781512-9719-1-git-send-email-ajax@redhat.com> Message-ID: <20141009122242.GT3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:18:32 +0200, Adam Jackson wrote: > Signed-off-by: Adam Jackson > --- > Xext/panoramiXprocs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Julien Cristau Cheers, Julien From keithp at keithp.com Thu Oct 9 05:24:11 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 09 Oct 2014 14:24:11 +0200 Subject: [PATCH 4/4] modesetting: Add support for rendering using glamor. In-Reply-To: <864mvezhql.fsf@hiro.keithp.com> References: <1412758705-444-1-git-send-email-eric@anholt.net> <1412758705-444-4-git-send-email-eric@anholt.net> <864mvezhql.fsf@hiro.keithp.com> Message-ID: <86ppe1tor8.fsf@hiro.keithp.com> Keith Packard writes: > Eric Anholt writes: > >> By default modesetting now tries to enable X acceleration using >> glamor, but falls back to normal shadowfb if GL fails to initialize. > > For the series: > > Reviewed-by: Keith Packard Merged. da88772..f12e7f4 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From jcristau at debian.org Thu Oct 9 05:27:59 2014 From: jcristau at debian.org (Julien Cristau) Date: Thu, 9 Oct 2014 14:27:59 +0200 Subject: [PATCH 1/4] xfree86: Remove no-op /dev/mem checks from xf86OSInitVidMem In-Reply-To: <1412782739-9960-2-git-send-email-ajax@redhat.com> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> <1412782739-9960-2-git-send-email-ajax@redhat.com> Message-ID: <20141009122759.GU3591@betterave.cristau.org> On Wed, Oct 8, 2014 at 17:38:56 +0200, Adam Jackson wrote: > pciaccess doesn't end up using the fd being inspected here, so there's > not really any point. > > Signed-off-by: Adam Jackson > --- > hw/xfree86/os-support/bsd/alpha_video.c | 122 -------------------------------- > hw/xfree86/os-support/bsd/arm_video.c | 52 -------------- > hw/xfree86/os-support/hurd/hurd_video.c | 4 -- > 3 files changed, 178 deletions(-) > Reviewed-by: Julien Cristau Cheers, Julien From alan.coopersmith at oracle.com Thu Oct 9 05:39:46 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 09 Oct 2014 14:39:46 +0200 Subject: [PATCH 12/37] dix: Remove an empty if In-Reply-To: <1412780701-8818-13-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-13-git-send-email-ajax@redhat.com> Message-ID: <54368212.8090703@oracle.com> On 10/ 8/14 05:04 PM, Adam Jackson wrote: > Signed-off-by: Adam Jackson > --- > dix/window.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/dix/window.c b/dix/window.c > index e1645c3..e49670a 100644 > --- a/dix/window.c > +++ b/dix/window.c > @@ -2806,8 +2806,6 @@ UnmapSubwindows(WindowPtr pWin) > pChild->mapped = FALSE; > if (pChild->realized) > UnrealizeTree(pChild, FALSE); > - if (wasViewable) { > - } > } > } > if (wasViewable) { > Seems to have been missed when removing the #ifdef DO_SAVE_UNDERS code that used to be in the if body. Reviewed-by: Alan Coopersmith -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From alan.coopersmith at oracle.com Thu Oct 9 05:42:08 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 9 Oct 2014 05:42:08 -0700 Subject: [PATCH 1/2] Allocate enough room for both reset & flags attributes Message-ID: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> 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 --- glx/glxdri2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c756bf5..5a8966f 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -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 = -- 1.7.9.2 From alan.coopersmith at oracle.com Thu Oct 9 05:42:09 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 9 Oct 2014 05:42:09 -0700 Subject: [PATCH 2/2] If fork fails in System(), don't fallthrough to exec() In-Reply-To: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> References: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <1412858529-18856-2-git-send-email-alan.coopersmith@oracle.com> 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 --- os/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/utils.c b/os/utils.c index 80415c4..75769f1 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1373,6 +1373,7 @@ System(const char *command) switch (pid = fork()) { case -1: /* error */ p = -1; + break; case 0: /* child */ if (setgid(getgid()) == -1) _exit(127); -- 1.7.9.2 From alan.coopersmith at oracle.com Thu Oct 9 05:47:45 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 09 Oct 2014 14:47:45 +0200 Subject: [PATCH 17/37] misc: Fold together some redundant conditionals In-Reply-To: <1412780701-8818-18-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-18-git-send-email-ajax@redhat.com> Message-ID: <543683F1.8070106@oracle.com> On 10/ 8/14 05:04 PM, Adam Jackson wrote: > @@ -2576,10 +2576,9 @@ MapWindow(WindowPtr pWin, ClientPtr client) > if (anyMarked) { > (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); > (*pScreen->HandleExposures) (pLayerWin->parent); > - } > - if (anyMarked && pScreen->PostValidateTree) > - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, > - VTMap); > + if (pScreen->PostValidateTree) > + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, > + VTMap); > } > WindowsRestructured(); > } Am I missing something or did you lose the closing } for the if (anyMarked) body in this hunk? -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From keithp at keithp.com Thu Oct 9 06:07:34 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 09 Oct 2014 15:07:34 +0200 Subject: [PULL] mi cleanups In-Reply-To: <1412846699.32702.12.camel@dmt> References: <1412846699.32702.12.camel@dmt> Message-ID: <86mw95tmqx.fsf@hiro.keithp.com> Adam Jackson writes: > Adam Jackson (17): > kdrive: Remove vestigial reference to fbInitValidateTree > xquartz: Remove useless DRIWindowExposures > rootless: remove redundant RootlessShapedWindowIn > dix: Drop the third argument from WindowExposuresProcPtr > mi: Deobfuscate miWindowExposures > mi: Deobfuscate miOverlayWindowExposures > mi: Simplify composite border clip redirection interface > mi: Drop plane argument from miHandleExposures > mi: Move pScreen->SendGraphicsExpose up to dix > dix: Remove DIXsaveUnder bit from the Window > dix: Lower backStorage to a bit instead of a pointer > dix: Remove an empty if > dix: Remove some pointless casting of NULL > dix: Remove an obfuscatory macro > mi: miSlideAndSizeWindow -> miResizeWindow > fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}Window > misc: Fold together some redundant conditionals Merged. f12e7f4..6622f0c master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 9 06:11:16 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 09 Oct 2014 15:11:16 +0200 Subject: [PULL] Dead code cleanup In-Reply-To: <1412845497.32702.10.camel@dmt> References: <1412845497.32702.10.camel@dmt> Message-ID: <86k349tmkr.fsf@hiro.keithp.com> Adam Jackson writes: > Adam Jackson (5): > exa, kdrive: Remove redundant BitsPerPixel macros > input: Remove unused SetKeySymsMap > loader: Remove some baklava code > vfb: Don't reimplement micmap so much > xfree86: Remove some can't-happen printf from xf86CreateRootWindow Merged. 6622f0c..d634ecd master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From ajax at redhat.com Thu Oct 9 06:25:43 2014 From: ajax at redhat.com (Adam Jackson) Date: Thu, 09 Oct 2014 15:25:43 +0200 Subject: [PATCH 17/37] misc: Fold together some redundant conditionals In-Reply-To: <543683F1.8070106@oracle.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-18-git-send-email-ajax@redhat.com> <543683F1.8070106@oracle.com> Message-ID: <1412861143.32702.13.camel@dmt> On Thu, 2014-10-09 at 14:47 +0200, Alan Coopersmith wrote: > On 10/ 8/14 05:04 PM, Adam Jackson wrote: > > @@ -2576,10 +2576,9 @@ MapWindow(WindowPtr pWin, ClientPtr client) > > if (anyMarked) { > > (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); > > (*pScreen->HandleExposures) (pLayerWin->parent); > > - } > > - if (anyMarked && pScreen->PostValidateTree) > > - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, > > - VTMap); > > + if (pScreen->PostValidateTree) > > + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, > > + VTMap); > > } > > WindowsRestructured(); > > } > > Am I missing something or did you lose the closing } for the if (anyMarked) body > in this hunk? I did. Not at all sure how. Fixed in the corresponding pull request. - ajax From matthieu at herrb.eu Thu Oct 9 06:25:30 2014 From: matthieu at herrb.eu (Matthieu Herrb) Date: Thu, 9 Oct 2014 15:25:30 +0200 Subject: [PATCH 2/2] If fork fails in System(), don't fallthrough to exec() In-Reply-To: <1412858529-18856-2-git-send-email-alan.coopersmith@oracle.com> References: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> <1412858529-18856-2-git-send-email-alan.coopersmith@oracle.com> Message-ID: <20141009132530.GA9140@nebraska.herrb.net> On Thu, Oct 09, 2014 at 05:42:09AM -0700, Alan Coopersmith wrote: > 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 > --- > os/utils.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/os/utils.c b/os/utils.c > index 80415c4..75769f1 100644 > --- a/os/utils.c > +++ b/os/utils.c > @@ -1373,6 +1373,7 @@ System(const char *command) > switch (pid = fork()) { > case -1: /* error */ > p = -1; > + break; > case 0: /* child */ > if (setgid(getgid()) == -1) > _exit(127); > -- > 1.7.9.2 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel -- Matthieu Herrb From ajax at redhat.com Thu Oct 9 06:53:14 2014 From: ajax at redhat.com (Adam Jackson) Date: Thu, 09 Oct 2014 15:53:14 +0200 Subject: [PULL] mi/fb diet Message-ID: <1412862794.32702.15.camel@dmt> The following changes since commit d634ecdf82f244ff8ce75d351fc175792d254e5c: Merge remote-tracking branch 'ajax/dead-code' (2014-10-09 15:08:31 +0200) are available in the git repository at: ssh://people.freedesktop.org/~ajax/xserver.git mi-fb-diet for you to fetch changes up to a98efe576b1dc05d3f3567c0a210f461fe0f39f4: fb: Hide fbPush{Pattern,Fill} (2014-10-09 15:48:48 +0200) ---------------------------------------------------------------- Adam Jackson (21): mi: Unexport wide line details mi: Unexport polygon edge table implementation details mi: Unexport span group implementation details mi: Unexport subpixel polygon implementation details mi: Unexport arc fill implementation details mi: Fold mispans.c into miwideline.c mi: Fold mifpolycon.c into miarc.c mi: Fold mipoly{con,gen}.c into mipoly.c mi: Fold mipolyutil.c into mipoly.c mi: Fold micursor.c into mipointer.c fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane fb: FB_SHIFT is 5 (and FB_UNIT is 32) fb: Remove even/odd stipple slow-pathing fb: Move fbStipple*Bits near their only consumer fb: Remove unused fbReduceRasterOp fb: Remove even/odd tile slow-pathing fb: Hide glyph implementation details fb: Hide some zero-width line details fb: Hide Bresenham line details fb: Hide fbDots fb: Hide fbPush{Pattern,Fill} fb/Makefile.am | 2 - fb/fb.h | 338 +-------------------------- fb/fbbits.c | 12 - fb/fbblt.c | 271 +--------------------- fb/fbbltone.c | 314 +++++++++++-------------- fb/fbfill.c | 84 ++++++- fb/fbgc.c | 83 ------- fb/fbglyph.c | 8 +- fb/fbline.c | 4 +- fb/fbpict.c | 10 +- fb/fbpict.h | 4 - fb/fbpoint.c | 2 +- fb/fbpush.c | 4 +- fb/fbrop.h | 10 - fb/fbseg.c | 22 +- fb/fbstipple.c | 264 --------------------- fb/fbtile.c | 163 ------------- fb/fbutil.c | 308 ------------------------- fb/wfbrename.h | 23 -- hw/xfree86/sdksyms.sh | 3 - mi/Makefile.am | 11 +- mi/mi.h | 16 -- mi/miarc.c | 205 +++++++++++++++++ mi/micursor.c | 68 ------ mi/midash.c | 1 - mi/mifillarc.c | 5 +- mi/mifillarc.h | 9 - mi/mifpoly.h | 42 ---- mi/mifpolycon.c | 249 -------------------- mi/mipointer.c | 14 ++ mi/mipoly.c | 619 +++++++++++++++++++++++++++++++++++++++++++++++++- mi/mipoly.h | 20 -- mi/mipolycon.c | 235 ------------------- mi/mipolygen.c | 213 ----------------- mi/mipolyutil.c | 369 ------------------------------ mi/mispans.c | 526 ------------------------------------------ mi/mispans.h | 87 ------- mi/miwideline.c | 526 +++++++++++++++++++++++++++++++++++++++++- mi/miwideline.h | 26 --- 39 files changed, 1593 insertions(+), 3577 deletions(-) delete mode 100644 fb/fbstipple.c delete mode 100644 fb/fbtile.c delete mode 100644 mi/micursor.c delete mode 100644 mi/mifpolycon.c delete mode 100644 mi/mipolycon.c delete mode 100644 mi/mipolygen.c delete mode 100644 mi/mipolyutil.c delete mode 100644 mi/mispans.c delete mode 100644 mi/mispans.h - ajax From pomidorabelisima at gmail.com Thu Oct 9 10:24:27 2014 From: pomidorabelisima at gmail.com (poma) Date: Thu, 09 Oct 2014 19:24:27 +0200 Subject: modesetting-glamor Message-ID: <5436C4CB.30005@gmail.com> modesetting-vulgaris (II) modesetting(0): ShadowFB: preferred YES, enabled YES (II) Loading sub module "shadow" (II) LoadModule: "shadow" (II) Loading /usr/lib64/xorg/modules/libshadow.so (II) Module shadow: vendor="X.Org Foundation" git clone -b modesetting-glamor git://people.freedesktop.org/~anholt/xserver (II) Loading sub module "glamoregl" (II) LoadModule: "glamoregl" (II) Loading /usr/lib64/xorg/modules/libglamoregl.so (II) Module glamoregl: vendor="X.Org Foundation" (II) glamor: OpenGL accelerated X.org driver based. (II) glamor: EGL version 1.4 (DRI2): (II) modeset(0): glamor initialized Man, this works OK. de Goede, when will we see it in the Rawhide? poma From pomidorabelisima at gmail.com Thu Oct 9 18:52:17 2014 From: pomidorabelisima at gmail.com (poma) Date: Fri, 10 Oct 2014 03:52:17 +0200 Subject: modesetting-glamor In-Reply-To: <5436C4CB.30005@gmail.com> References: <5436C4CB.30005@gmail.com> Message-ID: <54373BD1.8020306@gmail.com> On 09.10.2014 19:24, poma wrote: > > modesetting-vulgaris > > (II) modesetting(0): ShadowFB: preferred YES, enabled YES > (II) Loading sub module "shadow" > (II) LoadModule: "shadow" > (II) Loading /usr/lib64/xorg/modules/libshadow.so > (II) Module shadow: vendor="X.Org Foundation" > > > git clone -b modesetting-glamor git://people.freedesktop.org/~anholt/xserver > > (II) Loading sub module "glamoregl" > (II) LoadModule: "glamoregl" > (II) Loading /usr/lib64/xorg/modules/libglamoregl.so > (II) Module glamoregl: vendor="X.Org Foundation" > (II) glamor: OpenGL accelerated X.org driver based. > (II) glamor: EGL version 1.4 (DRI2): > (II) modeset(0): glamor initialized > besides udl (II) Loading sub module "glamoregl" (II) LoadModule: "glamoregl" (II) Loading /usr/lib64/xorg/modules/libglamoregl.so (II) Module glamoregl: vendor="X.Org Foundation" (II) glamor: OpenGL accelerated X.org driver based. (II) glamor: EGL version 1.4 (DRI2): EGL_MESA_drm_image required. (EE) modeset(0): glamor initialization failed (II) modeset(0): ShadowFB: preferred NO, enabled NO poma From ajax at nwnk.net Fri Oct 10 01:12:14 2014 From: ajax at nwnk.net (Adam Jackson) Date: Fri, 10 Oct 2014 10:12:14 +0200 Subject: [PATCH 00/37] Implement backing store's Always mode In-Reply-To: <1412780701-8818-1-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> Message-ID: <1412928734.14471.9.camel@dmt> On Wed, 2014-10-08 at 17:04 +0200, Adam Jackson wrote: > I'm not in any way convinced this is correct yet, in fact I'm pretty sure > it's not. And there's some work that would be nice to follow this with [4]. > But it's close enough that I'd like to get some more eyes on it. I may have been too modest here. A backport of this series to 1.13 appears to be correct enough for the customer app that provoked this work. Admittedly, all they're doing is creating an unmapped Always window, drawing into it, and blitting out from it, which means they're not relying on child clipping of that window to be correct. Outside of that the only things I might expect to be broken would be DRI or Present kinds of things that assume they're only looking at realized windows. - ajax From eric at anholt.net Fri Oct 10 02:09:37 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 10 Oct 2014 11:09:37 +0200 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. Message-ID: <1412932180-829-1-git-send-email-eric@anholt.net> 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 --- 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 ++++++++++ hw/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 ++ hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h | 157 +++++++++++++ hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h | 1 + 10 files changed, 973 insertions(+) create mode 100644 hw/xfree86/dri2/pci_ids/i810_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/i915_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/i965_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/pci_id_driver_map.h create mode 100644 hw/xfree86/dri2/pci_ids/r200_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/r300_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/r600_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/radeon_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h diff --git a/hw/xfree86/dri2/pci_ids/i810_pci_ids.h b/hw/xfree86/dri2/pci_ids/i810_pci_ids.h new file mode 100644 index 0000000..7f68192 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/i915_pci_ids.h b/hw/xfree86/dri2/pci_ids/i915_pci_ids.h new file mode 100644 index 0000000..7d51975 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h new file mode 100644 index 0000000..2e04301 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h new file mode 100644 index 0000000..8a97c6f --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/r200_pci_ids.h b/hw/xfree86/dri2/pci_ids/r200_pci_ids.h new file mode 100644 index 0000000..f857ca7 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/r300_pci_ids.h b/hw/xfree86/dri2/pci_ids/r300_pci_ids.h new file mode 100644 index 0000000..791026a --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/r600_pci_ids.h b/hw/xfree86/dri2/pci_ids/r600_pci_ids.h new file mode 100644 index 0000000..533c9f3 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h b/hw/xfree86/dri2/pci_ids/radeon_pci_ids.h new file mode 100644 index 0000000..a9efc76 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h b/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h new file mode 100644 index 0000000..571e863 --- /dev/null +++ b/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/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h b/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h new file mode 100644 index 0000000..124d75b --- /dev/null +++ b/hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h @@ -0,0 +1 @@ +CHIPSET(0x0405, SVGAII, SVGAII) -- 2.1.1 From eric at anholt.net Fri Oct 10 02:09:40 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 10 Oct 2014 11:09:40 +0200 Subject: [PATCH 4/4] modesetting: Add support for DRI2 with glamor. In-Reply-To: <1412932180-829-1-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> Message-ID: <1412932180-829-4-git-send-email-eric@anholt.net> This is derived from the intel driver DRI2 code, with swapchain dropped, functions renamed, and pageflipping shared code moved to a pageflip.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). Signed-off-by: Eric Anholt --- hw/xfree86/drivers/modesetting/Makefile.am | 6 +- hw/xfree86/drivers/modesetting/dri2.c | 1122 ++++++++++++++++++++++ hw/xfree86/drivers/modesetting/driver.c | 26 +- hw/xfree86/drivers/modesetting/driver.h | 70 ++ hw/xfree86/drivers/modesetting/drmmode_display.c | 5 + hw/xfree86/drivers/modesetting/drmmode_display.h | 26 + hw/xfree86/drivers/modesetting/pageflip.c | 678 +++++++++++++ 7 files changed, 1931 insertions(+), 2 deletions(-) create mode 100644 hw/xfree86/drivers/modesetting/dri2.c create mode 100644 hw/xfree86/drivers/modesetting/pageflip.c diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am index e6834e2..63fdd8f 100644 --- a/hw/xfree86/drivers/modesetting/Makefile.am +++ b/hw/xfree86/drivers/modesetting/Makefile.am @@ -30,6 +30,7 @@ AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(top_srcdir)/glamor \ -I$(srcdir)/../../ddc \ + -I$(srcdir)/../../dri2 \ -I$(srcdir)/../../i2c \ -I$(srcdir)/../../modes \ -I$(srcdir)/../../parser \ @@ -42,10 +43,13 @@ 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 + drmmode_display.h \ + pageflip.c \ + $(NULL) drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = modesetting.man diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c new file mode 100644 index 0000000..33be405 --- /dev/null +++ b/hw/xfree86/drivers/modesetting/dri2.c @@ -0,0 +1,1122 @@ +/* + * Copyright ? 2013 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_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include "list.h" +#include "xf86.h" +#include "driver.h" +#include "dri2.h" + +#ifdef GLAMOR +#define GLAMOR_FOR_XORG 1 +#include "glamor.h" + +enum ms_dri2_frame_event_type { + DRI2_SWAP, + DRI2_FLIP, + DRI2_WAITMSC, +}; + +typedef struct ms_dri2_frame_event { + ScreenPtr screen; + + DrawablePtr drawable; + ClientPtr client; + enum ms_dri2_frame_event_type type; + int frame; + int pipe; + + 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_fallback_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_exchange_pixmap_buffers(PixmapPtr front, PixmapPtr back, + uint32_t *front_name, uint32_t *back_name) +{ + uint32_t tmp_name; + + glamor_egl_exchange_buffers(front, back); + + tmp_name = *front_name; + *front_name = *back_name; + *back_name = tmp_name; +} + +static void +ms_dri2_exchange_buffers(modesettingPtr ms, + DRI2BufferPtr front, DRI2BufferPtr back) +{ + RegionRec region; + ms_dri2_buffer_private_ptr front_priv, back_priv; + DrawablePtr drawable; + front_priv = front->driverPrivate; + back_priv = back->driverPrivate; + + /* Swap pixmap bos */ + ms_exchange_pixmap_buffers(front_priv->pixmap, back_priv->pixmap, + &front->name, &back->name); + + /* Post damage on the front buffer so that listeners, such + * as DisplayLink know take a copy and shove it over the USB. + * also for sw cursors. + */ + drawable = &front_priv->pixmap->drawable; + region.extents.x1 = region.extents.y1 = 0; + region.extents.x2 = drawable->width; + region.extents.y2 = drawable->height; + region.data = NULL; + DamageRegionAppend(drawable, ®ion); + DamageRegionProcessPending(drawable); +} + +static void +ms_dri2_flip_handler(uint64_t msc, + uint64_t usec, + void *data) +{ + ms_dri2_frame_event_ptr flip_info = data; + ScreenPtr screen = flip_info->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + uint32_t frame = msc; + uint32_t tv_sec = usec / 1000000; + uint32_t tv_usec = usec % 1000000; + + switch (flip_info->type) { + case DRI2_SWAP: + if (!flip_info->drawable) + break; + + /* Check for too small vblank count of pageflip completion, + * taking wraparound into account. This usually means some + * defective kms pageflip completion, causing wrong (msc, ust) + * return values and possible visual corruption. + */ + if ((frame < flip_info->frame) && (flip_info->frame - frame < 5)) { + static int limit = 5; + + /* XXX we are currently hitting this path with older + * kernels, so make it quieter. + */ + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s: Pageflip completion has impossible msc %d < " + "target_msc %d\n", + __func__, frame, flip_info->frame); + limit--; + } + + /* All-0 values signal timestamping failure. */ + frame = tv_sec = tv_usec = 0; + } + + DRI2SwapComplete(flip_info->client, flip_info->drawable, + frame, tv_sec, tv_usec, + DRI2_FLIP_COMPLETE, + flip_info->client ? flip_info->event_complete : NULL, + flip_info->event_data); + break; + + default: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s: unknown flip event (type %d) received\n", __func__, + flip_info->type); + break; + } + + ms_dri2_del_frame_event(flip_info); +} + +static void +ms_dri2_flip_abort(void *data) +{ + ms_dri2_frame_event_ptr flip_info = data; + + ms_dri2_del_frame_event(flip_info); +} + +/** + * Called either from ScheduleSwap when we just need to present the + * backbuffer at the next vblank, or from the vblank event handler if + * ScheduleSwap needed to wait for a later vblank before we could + * swap. + * + * When this call is done, there will be a flip request outstanding to + * the hardware which will start getting scanned out on the next + * vblank. + */ +static Bool +ms_dri2_do_pageflip(DrawablePtr draw, ms_dri2_frame_event_ptr info) +{ + ScreenPtr screen = draw->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + ms_dri2_buffer_private_ptr back_priv = info->back->driverPrivate; + + if (!ms_do_pageflip(back_priv->pixmap, info->pipe, FALSE, info, + ms_dri2_flip_handler, ms_dri2_flip_abort)) { + return FALSE; + } + + /* Flip the front and back pointers. Now we have: + * front: backbuffer with flip scheduled to screen + * back: old front buffer still being scanned out + * triple: idle + */ + ms_dri2_exchange_buffers(ms, info->front, info->back); + DRI2SwapComplete(info->client, draw, 0, 0, 0, + DRI2_EXCHANGE_COMPLETE, + info->event_complete, + info->event_data); + + /* Try to create a third screen-size pixmap, to avoid stalling on + * the GPU. + * + * For a vblank-synchronized pageflip, there's a period when the + * pageflip is queued but the old front buffer is still being + * scanned out. To avoid blocking rendering to the backbuffer for + * the next frame (which the kernel would do so as to keep the WIP + * new frame from appearing on screen), we make a third + * screen-sized buffer and make *that* the new back. + */ + if (ms->drmmode.triple_buffer_pixmap == NULL) { + ms->drmmode.triple_buffer_pixmap = + screen->CreatePixmap(screen, + back_priv->pixmap->drawable.width, + back_priv->pixmap->drawable.height, + back_priv->pixmap->drawable.depth, + 0); + if (ms->drmmode.triple_buffer_pixmap) { + uint32_t size; + uint16_t pitch; + ms->drmmode.triple_buffer_name = + glamor_name_from_pixmap(ms->drmmode.triple_buffer_pixmap, + &pitch, &size); + + assert(pitch == info->back->pitch); + } + } + + if (ms->drmmode.triple_buffer_pixmap) { + /* Exchange the triple buffer pixmap in. Now we have: + * front: backbuffer with flip scheduled to screen + * back: idle + * triple: old front buffer still being scanned out + */ + ms_exchange_pixmap_buffers(back_priv->pixmap, + ms->drmmode.triple_buffer_pixmap, + &info->back->name, + &ms->drmmode.triple_buffer_name); + } + + return TRUE; +} + +static Bool +can_exchange(DrawablePtr drawable, DRI2BufferPtr front, DRI2BufferPtr back) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(drawable->pScreen); + modesettingPtr ms = modesettingPTR(scrn); + ms_dri2_buffer_private_ptr front_priv = front->driverPrivate; + ms_dri2_buffer_private_ptr back_priv = back->driverPrivate; + PixmapPtr front_pixmap = front_priv->pixmap; + PixmapPtr back_pixmap = back_priv->pixmap; + + if (!scrn->vtSema) + return FALSE; + + if (ms_dri2_crtc_covering_drawable(drawable) == NULL) + return FALSE; + + if (!DRI2CanFlip(drawable)) + return FALSE; + + if (ms->drmmode.shadow_enable) + return FALSE; + + if (front_pixmap->drawable.width != back_pixmap->drawable.width) + return FALSE; + + if (front_pixmap->drawable.height != back_pixmap->drawable.height) + return FALSE; + + /* XXX should we be checking depth instead of bpp? */ +#if 0 + if (front_pixmap->drawable.depth != back_pixmap->drawable.depth) + return FALSE; +#else + if (front_pixmap->drawable.bitsPerPixel != back_pixmap->drawable.bitsPerPixel) + return FALSE; +#endif + + return TRUE; +} + +static void +ms_dri2_vblank_handler(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + uint64_t msc, + uint64_t usec, + void *data) +{ + ms_dri2_frame_event_ptr swap_info = data; + DrawablePtr drawable = swap_info->drawable; + uint32_t tv_sec = usec / 1000000; + uint32_t tv_usec = usec % 1000000; + + if (!drawable) { + ms_dri2_del_frame_event(swap_info); + return; + } + + switch (swap_info->type) { + case DRI2_FLIP: + if (can_exchange(drawable, swap_info->front, swap_info->back) && + ms_dri2_do_pageflip(drawable, swap_info)) { + return; + } + + /* else fall through to exchange/blit */ + case DRI2_SWAP: { + ms_dri2_fallback_blit_swap(drawable, swap_info->front, swap_info->back); + DRI2SwapComplete(swap_info->client, drawable, msc, tv_sec, tv_usec, + DRI2_BLIT_COMPLETE, + swap_info->client ? swap_info->event_complete : NULL, + swap_info->event_data); + break; + } + case DRI2_WAITMSC: + if (swap_info->client) + DRI2WaitMSCComplete(swap_info->client, drawable, + msc, tv_sec, tv_usec); + break; + default: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s: unknown vblank event (type %d) received\n", __func__, + swap_info->type); + break; + } + + ms_dri2_del_frame_event(swap_info); +} + +static void +ms_dri2_vblank_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data) +{ + ms_dri2_frame_event_ptr swap_info = data; + + ms_dri2_del_frame_event(swap_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); + int pipe = crtc ? ms_crtc_pipe(crtc) : -1; + CARD64 current_msc, current_ust, request_msc; + uint32_t seq; + + /* Drawable not visible, return immediately */ + if (pipe == -1) + goto out_complete; + + 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 = DRI2_WAITMSC; + + 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_vblank_handler, + ms_dri2_vblank_abort); + if (!seq) + goto out_free; + + if (current_msc >= target_msc) + target_msc = current_msc; + vbl.request.type = (DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_EVENT | + ms_vblank_pipe_select(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 | ms_vblank_pipe_select(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_vblank_handler, + ms_dri2_vblank_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. + * + * In the case of a blit (e.g. for a windowed swap) or buffer exchange, + * the vblank requested can simply be the last queued swap frame + the swap + * interval for the drawable. + * + * In the case of a page flip, we request an event for the last queued swap + * frame + swap interval - 1, since we'll need to queue the flip for the frame + * immediately following the received event. + * + * The client will be blocked if it tries to perform further GL commands + * after queueing a swap, though in the Intel case after queueing a flip, the + * client is free to queue more commands; they'll block in the kernel if + * they access buffers busy with the flip. + * + * 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); + int pipe = crtc ? ms_crtc_pipe(crtc) : -1; + int flip = 0; + ms_dri2_frame_event_ptr swap_info = NULL; + enum ms_dri2_frame_event_type swap_type = DRI2_SWAP; + uint64_t current_msc, current_ust; + uint64_t request_msc; + uint32_t seq; + + /* Drawable not displayed... just complete the swap */ + if (pipe == -1) + goto blit_fallback; + + swap_info = calloc(1, sizeof(*swap_info)); + if (!swap_info) + goto blit_fallback; + + swap_info->screen = screen; + swap_info->drawable = draw; + swap_info->client = client; + swap_info->event_complete = func; + swap_info->event_data = data; + swap_info->front = front; + swap_info->back = back; + swap_info->pipe = pipe; + + if (!ms_dri2_add_frame_event(swap_info)) { + free(swap_info); + swap_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); + + /* Flips need to be submitted one frame before */ + if (can_exchange(draw, front, back)) { + swap_type = DRI2_FLIP; + flip = 1; + } + + swap_info->type = swap_type; + + /* Correct target_msc by 'flip' if swap_type == DRI2_FLIP. + * Do it early, so handling of different timing constraints + * for divisor, remainder and msc vs. target_msc works. + */ + if (*target_msc > 0) + *target_msc -= flip; + + /* + * If divisor is zero, or current_msc is smaller than target_msc + * we just need to make sure target_msc passes before initiating + * the swap. + */ + if (divisor == 0 || current_msc < *target_msc) { + /* If we can, schedule the flip directly from here rather + * than waiting for an event from the kernel for the current + * (or a past) MSC. + */ + if (flip && divisor == 0 && current_msc >= *target_msc && + ms_dri2_do_pageflip(draw, swap_info)) + return TRUE; + + vbl.request.type = (DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_EVENT | + ms_vblank_pipe_select(pipe)); + + /* If non-pageflipping, but blitting/exchanging, we need to use + * DRM_VBLANK_NEXTONMISS to avoid unreliable timestamping later + * on. + */ + if (flip == 0) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; + + /* If target_msc already reached or passed, set it to + * current_msc to ensure we return a reasonable value back + * to the caller. This makes swap_interval logic more robust. + */ + if (current_msc >= *target_msc) + *target_msc = current_msc; + + seq = ms_drm_queue_alloc(crtc, swap_info, + ms_dri2_vblank_handler, + ms_dri2_vblank_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 + flip); + swap_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_EVENT | + ms_vblank_pipe_select(pipe)); + if (flip == 0) + vbl.request.type |= DRM_VBLANK_NEXTONMISS; + + 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 1 frame swap delay in pageflipping mode + * into account, as well as a potential DRM_VBLANK_NEXTONMISS delay + * if we are blitting/exchanging instead of flipping. + */ + if (request_msc <= current_msc) + request_msc += divisor; + + + seq = ms_drm_queue_alloc(crtc, swap_info, + ms_dri2_vblank_handler, ms_dri2_vblank_abort); + if (!seq) + goto blit_fallback; + + /* Account for 1 frame extra pageflip delay if flip > 0 */ + vbl.request.sequence = ms_crtc_msc_to_kernel_msc(crtc, request_msc) - flip; + vbl.request.signal = (unsigned long)seq; + + ret = drmWaitVBlank(ms->fd, &vbl); + if (ret) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "final get vblank counter failed: %s\n", + strerror(errno)); + goto blit_fallback; + } + + /* Adjust returned value for 1 fame pageflip offset of flip > 0 */ + *target_msc = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence + flip); + swap_info->frame = *target_msc; + + return TRUE; + + blit_fallback: + ms_dri2_fallback_blit_swap(draw, front, back); + DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); + if (swap_info) + ms_dri2_del_frame_event(swap_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 diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index c62147a..d0b9095 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -788,7 +788,9 @@ PreInit(ScrnInfoPtr pScrn, int flags) try_enable_glamor(pScrn); - if (!ms->glamor) { + if (ms->glamor) { + xf86LoadSubModule(pScrn, "dri2"); + } else { Bool prefer_shadow = TRUE; ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); @@ -1107,6 +1109,21 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); +#ifdef GLAMOR + if (ms->glamor) { + if (!ms_pageflip_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize pageflipping support.\n"); + return FALSE; + } + + if (!ms_dri2_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize the DRI2 extension.\n"); + } + } +#endif + return EnterVT(pScrn); } @@ -1172,6 +1189,13 @@ CloseScreen(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); +#ifdef GLAMOR + if (ms->glamor) { + ms_dri2_close_screen(pScreen); + ms_pageflip_close_screen(pScreen); + } +#endif + if (ms->damage) { DamageUnregister(ms->damage); DamageDestroy(ms->damage); diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 35f2419..c82c7de 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "drmmode_display.h" @@ -42,6 +43,36 @@ typedef struct { ScrnInfoPtr pScrn_2; } EntRec, *EntPtr; +typedef void (*ms_drm_handler_proc)(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + uint64_t seq, + uint64_t usec, + void *data); + +typedef void (*ms_drm_abort_proc)(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + void *data); + +typedef void (*ms_pageflip_handler_proc)(uint64_t frame, + uint64_t usec, + void *data); + +typedef void (*ms_pageflip_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; @@ -70,6 +101,15 @@ typedef struct _modesettingRec { drmmode_rec drmmode; + drmEventContext event_context; + + int flip_count; + uint64_t fe_msc; + uint64_t fe_usec; + void *pageflip_data; + ms_pageflip_handler_proc pageflip_handler; + ms_pageflip_abort_proc pageflip_abort; + DamagePtr damage; Bool dirty_enabled; @@ -78,3 +118,33 @@ typedef struct _modesettingRec { } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) + +Bool ms_do_pageflip(PixmapPtr new_front, + int ref_crtc_hw_id, + Bool async, + void *pageflip_data, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort); + +uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc, + void *data, + ms_drm_handler_proc handler, + ms_drm_abort_proc abort); + +int ms_crtc_pipe(xf86CrtcPtr randr_crtc); +xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); +xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, + xf86CrtcPtr desired, BoxPtr crtc_box_ret); +uint32_t ms_vblank_pipe_select(int pipe); + +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_pageflip_screen_init(ScreenPtr screen); +void ms_pageflip_close_screen(ScreenPtr screen); diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index d8d1b44..9500888 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1183,6 +1183,11 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocate new frame buffer %dx%d stride\n", width, height); + if (drmmode->triple_buffer_pixmap) { + screen->DestroyPixmap(drmmode->triple_buffer_pixmap); + drmmode->triple_buffer_pixmap = NULL; + } + old_width = scrn->virtualX; old_height = scrn->virtualY; old_pitch = drmmode->front_bo->pitch; diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index c7e7ef0..f7e3c6b 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -43,6 +43,7 @@ struct dumb_bo { typedef struct { int fd; unsigned fb_id; + unsigned old_fb_id; drmModeResPtr mode_res; drmModeFBPtr mode_fb; int cpp; @@ -58,6 +59,19 @@ typedef struct { 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; @@ -69,6 +83,18 @@ typedef struct { unsigned rotate_fb_id; uint16_t lut_r[256], lut_g[256], lut_b[256]; DamagePtr slave_damage; + + /** + * @{ 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 { diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c new file mode 100644 index 0000000..c126a5c --- /dev/null +++ b/hw/xfree86/drivers/modesetting/pageflip.c @@ -0,0 +1,678 @@ +/* + * 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 pageflip.c + * + * Support for tracking VBlank events, emitting requests for + * pageflips, and tracking the completion of pageflips. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#include +#include +#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); +} + +/* + * 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 (!crtc->enabled) + 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; + xf86CrtcPtr crtc; + + box.x1 = pDraw->x; + box.y1 = pDraw->y; + box.x2 = box.x1 + pDraw->width; + box.y2 = box.y1 + pDraw->height; + + crtc = ms_covering_crtc(pScrn, &box, NULL, &crtcbox); + + /* Make sure the CRTC is valid and this is the real front buffer */ + if (crtc != NULL && !crtc->rotatedData) + return crtc; + + return NULL; +} + +uint32_t +ms_vblank_pipe_select(int pipe) +{ + if (pipe > 1) + return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +int +ms_crtc_pipe(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc; + + if (crtc == NULL) + return 0; + + drmmode_crtc = crtc->driver_private; + + return drmmode_crtc->hw_id; +} + +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); + drmVBlank vbl; + int pipe = ms_crtc_pipe(crtc); + int ret; + + /* Get current count */ + vbl.request.type = DRM_VBLANK_RELATIVE | ms_vblank_pipe_select(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; + + ms_get_crtc_ust_msc(crtc, &ust, &msc); + 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); +} + +/* + * If there are any available, read drm_events + */ +static int +ms_read_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 0; + + return 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->scrn, q->crtc, q->data); + free(q); +} + +/* + * Abort by drm queue sequence number + */ +static void +ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq) +{ + struct ms_drm_queue *q, *tmp; + + xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) { + if (q->seq == seq) { + ms_drm_abort_one(q); + break; + } + } +} + +/** + * 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); + } +} + +/** + * Notify the page flip caller that the flip is complete + */ +static void +ms_pageflip_complete(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + /* Release framebuffer */ + drmModeRmFB(ms->fd, ms->drmmode.old_fb_id); + + if (!ms->pageflip_handler) + return; + + ms->pageflip_handler(ms->fe_msc, ms->fe_usec, ms->pageflip_data); +} + +/** + * Called after processing a pageflip complete event from DRM. + * + * Update the saved msc/ust values as needed, then check to see if the + * whole set of events are complete and notify the application at that + * point. + */ +static Bool +ms_handle_pageflip(struct ms_pageflip *flip, uint64_t msc, uint64_t usec) +{ + ScreenPtr screen = flip->screen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + + if (flip->crtc_for_msc_ust) { + /* Cache msc, ust for later delivery with a Present event or + * GLX reply. + */ + ms->fe_msc = msc; + ms->fe_usec = usec; + } + free(flip); + + ms->flip_count--; + + /* Tell the caller if this was the last DRM flip complete event expected. */ + return ms->flip_count == 0; +} + +/* + * Called from the DRM event queue when a single flip has completed + */ +static void +ms_pageflip_handler(ScrnInfoPtr scrn, xf86CrtcPtr crtc, + uint64_t msc, uint64_t usec, void *data) +{ + struct ms_pageflip *flip = data; + ScreenPtr screen = flip->screen; + + if (ms_handle_pageflip(flip, msc, usec)) + ms_pageflip_complete(screen); +} + +/* + * Called from the DRM queue abort code when a flip has been aborted + */ +static void +ms_pageflip_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data) +{ + struct ms_pageflip *flip = data; + modesettingPtr ms = modesettingPTR(scrn); + + if (ms_handle_pageflip(flip, 0, 0)) { + /* Release framebuffer */ + drmModeRmFB(ms->fd, ms->drmmode.old_fb_id); + + if (!ms->pageflip_abort) + return; + + ms->pageflip_abort(ms->pageflip_data); + } +} + +Bool +ms_do_pageflip(PixmapPtr new_front, + int ref_crtc_hw_id, + Bool async, + void *pageflip_data, + ms_pageflip_handler_proc pageflip_handler, + ms_pageflip_abort_proc pageflip_abort) +{ + ScreenPtr screen = new_front->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + modesettingPtr ms = modesettingPTR(scrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + uint16_t pitch; + struct ms_pageflip *flip; + uint32_t new_fb_id; + uint32_t flags; + uint32_t seq; + uint32_t size; + int i; + int fd; + struct dumb_bo *new_front_bo; + + glamor_block_handler(screen); + + /* Take a detour through a dmabuf fd to get a GEM handle for our + * new front, since there's no GL interface to get the GEM handle + * (just a dmabuf fd, or an old-style GEM name) + */ + fd = glamor_fd_from_pixmap(screen, new_front, &pitch, &size); + if (fd < 0) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to get fd for flip to new front.\n"); + return FALSE; + } + new_front_bo = dumb_get_bo_from_fd(ms->fd, fd, pitch, size); + close(fd); + if (!new_front_bo) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to open fd for new front.\n"); + return FALSE; + } + + /* + * Create a new handle for the back buffer + */ + if (drmModeAddFB(ms->fd, scrn->virtualX, scrn->virtualY, + scrn->depth, scrn->bitsPerPixel, pitch, + new_front_bo->handle, &new_fb_id)) + goto error_out; + + dumb_bo_destroy(ms->fd, new_front_bo); + + ms->pageflip_data = pageflip_data; + ms->pageflip_handler = pageflip_handler; + ms->pageflip_abort = pageflip_abort; + + /* + * Queue flips on all enabled CRTCs + * Note that if/when we get per-CRTC buffers, we'll have to update this. + * Right now it assumes a single shared fb across all CRTCs, with the + * kernel fixing up the offset of each CRTC as necessary. + * + * Also, flips queued on disabled or incorrectly configured displays + * may never complete; this is a configuration error. + */ + ms->fe_msc = 0; + ms->fe_usec = 0; + + flags = DRM_MODE_PAGE_FLIP_EVENT; + if (async) + flags |= DRM_MODE_PAGE_FLIP_ASYNC; + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + int this_fb_id; + + if (!config->crtc[i]->enabled) + continue; + + flip = calloc(1, sizeof(struct ms_pageflip)); + if (flip == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue: carrier alloc failed.\n"); + goto error_undo; + } + + /* Only the reference crtc will finally deliver its page flip + * completion event. All other crtc's events will be discarded. + */ + flip->crtc_for_msc_ust = (drmmode_crtc->hw_id == ref_crtc_hw_id); + flip->screen = screen; + + seq = ms_drm_queue_alloc(crtc, flip, + ms_pageflip_handler, ms_pageflip_abort); + if (!seq) { + free(flip); + goto error_undo; + } + + this_fb_id = new_fb_id; + if (drmmode_crtc->rotate_fb_id) + this_fb_id = drmmode_crtc->rotate_fb_id; + again: + if (drmModePageFlip(ms->fd, + drmmode_crtc->mode_crtc->crtc_id, + this_fb_id, + flags, (void *) (uintptr_t) seq)) { + int err = errno; + if (ms_read_drm_events(screen)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue retry\n"); + goto again; + } + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue failed: %s\n", strerror(err)); + ms_drm_abort_seq(scrn, seq); + goto error_undo; + } + ms->flip_count++; + } + + ms->drmmode.old_fb_id = ms->drmmode.fb_id; + ms->drmmode.fb_id = new_fb_id; + + if (!ms->flip_count) + ms_pageflip_complete(screen); + + return TRUE; + + error_undo: + drmModeRmFB(ms->fd, new_fb_id); + for (i = 0; i < config->num_crtc; i++) { + if (config->crtc[i]->enabled) { + ErrorF("XXX: crtc apply\n"); + /*ms_crtc_apply(config->crtc[i]);*/ + } + } + + error_out: + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", + strerror(errno)); + + ms->flip_count = 0; + return FALSE; +} + +/* + * 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(q->scrn, q->crtc, msc, + (uint64_t) sec * 1000000 + usec, q->data); + free(q); + break; + } + } +} + +Bool +ms_pageflip_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; + ms->flip_count = 0; + + /* 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_pageflip_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); +} -- 2.1.1 From eric at anholt.net Fri Oct 10 02:09:38 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 10 Oct 2014 11:09:38 +0200 Subject: [PATCH 2/4] dri2: Automatically fill in the driver name if the DDX doesn't provide it. In-Reply-To: <1412932180-829-1-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> Message-ID: <1412932180-829-2-git-send-email-eric@anholt.net> 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). Signed-off-by: Eric Anholt --- hw/xfree86/dri2/dri2.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 6459f11..5780b90 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -1410,6 +1410,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) { @@ -1525,6 +1578,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) if (!ds->driverNames) goto err_out; ds->driverNames[0] = info->driverName; + + if (info->driverName) { + ds->driverNames[0] = info->driverName; + } else { + ds->driverNames[0] = dri2_probe_driver_name(pScreen, info); + if (!ds->driverNames[0]) + return FALSE; + } } else { ds->numDrivers = info->numDrivers; -- 2.1.1 From eric at anholt.net Fri Oct 10 02:09:39 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 10 Oct 2014 11:09:39 +0200 Subject: [PATCH 3/4] modesetting: Export two functions I want to reuse from DRI2/Present. In-Reply-To: <1412932180-829-1-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> Message-ID: <1412932180-829-3-git-send-email-eric@anholt.net> 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 --- hw/xfree86/drivers/modesetting/drmmode_display.c | 8 ++++---- hw/xfree86/drivers/modesetting/drmmode_display.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index d959837..d8d1b44 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -116,7 +116,7 @@ dumb_bo_unmap(int fd, struct dumb_bo *bo) } #endif -static int +int dumb_bo_destroy(int fd, struct dumb_bo *bo) { struct drm_mode_destroy_dumb arg; @@ -137,8 +137,8 @@ dumb_bo_destroy(int fd, struct dumb_bo *bo) return 0; } -static struct dumb_bo * -dumb_get_bo_from_handle(int fd, int handle, int pitch, int size) +struct dumb_bo * +dumb_get_bo_from_fd(int fd, int handle, int pitch, int size) { struct dumb_bo *bo; int ret; @@ -164,7 +164,7 @@ drmmode_SetSlaveBO(PixmapPtr ppix, msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); ppriv->backing_bo = - dumb_get_bo_from_handle(drmmode->fd, fd_handle, pitch, size); + dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); if (!ppriv->backing_bo) return FALSE; diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index 438743b..c7e7ef0 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -121,6 +121,9 @@ 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); +struct dumb_bo *dumb_get_bo_from_fd(int drm_fd, int fd, int pitch, int size); +int dumb_bo_destroy(int fd, struct dumb_bo *bo); + #ifndef DRM_CAP_DUMB_PREFERRED_DEPTH #define DRM_CAP_DUMB_PREFERRED_DEPTH 3 -- 2.1.1 From eric at anholt.net Fri Oct 10 02:22:51 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 10 Oct 2014 11:22:51 +0200 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: <1412932180-829-1-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> Message-ID: <871tqgjn2s.fsf@eliezer.anholt.net> Eric Anholt writes: > This comes from Mesa commit acdcef6788beaa2a1532e13ff84c3e246b8025ed I forgot to mention, this series is on the modesetting-dri2 branch of my tree. I've done minor cleanups on 4/4 as I started looking into Present. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From william.leslie.ttg at gmail.com Fri Oct 10 02:55:57 2014 From: william.leslie.ttg at gmail.com (William ML Leslie) Date: Fri, 10 Oct 2014 20:55:57 +1100 Subject: [PATCH] Xephyr: option to disable grabbing the host In-Reply-To: <1400632132-402-1-git-send-email-william.leslie.ttg@gmail.com> References: <1400632132-402-1-git-send-email-william.leslie.ttg@gmail.com> Message-ID: Hi, is this patch ok? Just bumping it while it still applies cleanly. I know that it might be a bit of a silly feature, but it makes life a lot easier for me at least. On 21 May 2014 10:28, William ML Leslie wrote: > This patch makes it possible to use C-S key combinations > within Xephyr without losing access to the host window manager's > commands. > --- > hw/kdrive/ephyr/ephyr.c | 12 +++++++++--- > hw/kdrive/ephyr/ephyrinit.c | 6 ++++++ > hw/kdrive/ephyr/man/Xephyr.man | 3 +++ > 3 files changed, 18 insertions(+), 3 deletions(-) > > diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c > index def50d8..ee323b1 100644 > --- a/hw/kdrive/ephyr/ephyr.c > +++ b/hw/kdrive/ephyr/ephyr.c > @@ -68,6 +68,7 @@ typedef struct _EphyrInputPrivate { > > Bool EphyrWantGrayScale = 0; > Bool EphyrWantResize = 0; > +Bool EphyrWantNoHostGrab = 0; > > Bool > host_has_extension(xcb_extension_t *extension) > @@ -645,7 +646,11 @@ 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 > @@ -1080,12 +1085,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; > > diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c > index fac84cd..ad66bd8 100644 > --- a/hw/kdrive/ephyr/ephyrinit.c > +++ b/hw/kdrive/ephyr/ephyrinit.c > @@ -33,6 +33,7 @@ > extern Window EphyrPreExistingHostWin; > extern Bool EphyrWantGrayScale; > extern Bool EphyrWantResize; > +extern Bool EphyrWantNoHostGrab; > extern Bool kdHasPointer; > extern Bool kdHasKbd; > extern Bool ephyr_glamor; > @@ -149,6 +150,7 @@ 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"); > } > > @@ -323,6 +325,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); > } > diff --git a/hw/kdrive/ephyr/man/Xephyr.man b/hw/kdrive/ephyr/man/Xephyr.man > index f14f6c8..c043790 100644 > --- a/hw/kdrive/ephyr/man/Xephyr.man > +++ b/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. > -- > 1.7.10.4 > -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely MAY reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to DENY YOU THOSE RIGHTS would be illegal without prior contractual agreement. From markmarshall14 at gmail.com Fri Oct 10 03:54:09 2014 From: markmarshall14 at gmail.com (Mark Marshall) Date: Fri, 10 Oct 2014 12:54:09 +0200 Subject: [PATCH 2/4] dri2: Automatically fill in the driver name if the DDX doesn't provide it. In-Reply-To: <1412932180-829-2-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> <1412932180-829-2-git-send-email-eric@anholt.net> Message-ID: Just a minor thing On 10 October 2014 11:09, Eric Anholt wrote: > 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). > > Signed-off-by: Eric Anholt > --- > hw/xfree86/dri2/dri2.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > > diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c > index 6459f11..5780b90 100644 > --- a/hw/xfree86/dri2/dri2.c > +++ b/hw/xfree86/dri2/dri2.c > @@ -1410,6 +1410,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) > { > @@ -1525,6 +1578,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) > if (!ds->driverNames) > goto err_out; > ds->driverNames[0] = info->driverName; I assume that you'd want to drop the line above, as it done again in the added lines below? > + > + if (info->driverName) { > + ds->driverNames[0] = info->driverName; > + } else { > + ds->driverNames[0] = dri2_probe_driver_name(pScreen, info); > + if (!ds->driverNames[0]) > + return FALSE; > + } > } > else { > ds->numDrivers = info->numDrivers; > -- > 2.1.1 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel Regards, Mark Marshall From basteon at gmail.com Sat Oct 11 04:22:34 2014 From: basteon at gmail.com (basteon) Date: Sat, 11 Oct 2014 11:22:34 +0000 Subject: vesa and 2560x1440 Message-ID: hi all, I use Xorg version 1.16.0. This version supports such(2560x1440) dimentions with vesa driver? From mike at fireburn.co.uk Sat Oct 11 06:35:08 2014 From: mike at fireburn.co.uk (Mike Lothian) Date: Sat, 11 Oct 2014 14:35:08 +0100 Subject: [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: <1412780701-8818-9-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-9-git-send-email-ajax@redhat.com> Message-ID: Hi This stops xf86-video-intel working or compiling for me The below patch is a work around but I'm not quite sure what to check for to make it work with both old and new xservers Cheers Mike On 8 October 2014 16:04, Adam Jackson wrote: > This existed to be passed to the bs recovery routine; since we back all > planes, we don't care. > > Signed-off-by: Adam Jackson > --- > fb/fbcopy.c | 2 +- > glamor/glamor_copy.c | 3 +-- > hw/dmx/dmxgcops.c | 8 ++++---- > mi/mi.h | 3 +-- > mi/mibitblt.c | 5 ++--- > mi/micopy.c | 3 +-- > mi/miexpose.c | 8 +------- > 7 files changed, 11 insertions(+), 21 deletions(-) > > diff --git a/fb/fbcopy.c b/fb/fbcopy.c > index 541ef71..5bbabc3 100644 > --- a/fb/fbcopy.c > +++ b/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/glamor/glamor_copy.c b/glamor/glamor_copy.c > index 6f422d4..3320935 100644 > --- a/glamor/glamor_copy.c > +++ b/glamor/glamor_copy.c > @@ -677,8 +677,7 @@ glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, > { > if ((bitplane & FbFullMask(src->depth)) == 0) > return miHandleExposures(src, dst, gc, > - srcx, srcy, width, height, dstx, dsty, > - bitplane); > + srcx, srcy, width, height, dstx, dsty); > return miDoCopy(src, dst, gc, > srcx, srcy, width, height, > dstx, dsty, glamor_copy, bitplane, NULL); > diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c > index aa7c8eb..0ebd69a 100644 > --- a/hw/dmx/dmxgcops.c > +++ b/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/mi/mi.h b/mi/mi.h > index a4a01b8..700bb11 100644 > --- a/mi/mi.h > +++ b/mi/mi.h > @@ -229,8 +229,7 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , > int /*width */ , > int /*height */ , > int /*dstx */ , > - int /*dsty */ , > - unsigned long /*plane */ > + int /*dsty */ > ); > > extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ , > diff --git a/mi/mibitblt.c b/mi/mibitblt.c > index 3ed4ed1..08bd1c5 100644 > --- a/mi/mibitblt.c > +++ b/mi/mibitblt.c > @@ -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); > > @@ -579,7 +578,7 @@ miCopyPlane(DrawablePtr pSrcDrawable, > } > } > prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, > - width, height, dstx, dsty, bitPlane); > + width, height, dstx, dsty); > RegionDestroy(prgnSrc); > return prgnExposed; > } > diff --git a/mi/micopy.c b/mi/micopy.c > index 3079511..a52b0a7 100644 > --- a/mi/micopy.c > +++ b/mi/micopy.c > @@ -304,8 +304,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/mi/miexpose.c b/mi/miexpose.c > index de0e148..7a1c172 100644 > --- a/mi/miexpose.c > +++ b/mi/miexpose.c > @@ -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; > -- > 1.9.3 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-sna-Work-around-miHandleExposures-dropping-plane.patch Type: text/x-patch Size: 1343 bytes Desc: not available URL: From jon.turney at dronecode.org.uk Sat Oct 11 07:10:37 2014 From: jon.turney at dronecode.org.uk (Jon TURNEY) Date: Sat, 11 Oct 2014 15:10:37 +0100 Subject: [PULL] hw/xwin configure, build and warning fixes Message-ID: <20141011141025.GA7764@tambora> Hi Keith, Please consider pulling into master Thanks. The following changes since commit 61a292adf45405641de1c522a04c148e0a152acd: glx: check return from __glXGetAnswerBuffer (2014-10-09 15:30:52 +0200) are available in the git repository at: git://people.freedesktop.org/~jturney/xserver for you to fetch changes up to 7ea4a21feed5ac5e71cc6d8141c97d6362402c5d: configure.ac: Force --disable-libdrm on Cygwin (2014-10-09 16:49:29 +0100) ---------------------------------------------------------------- Jon TURNEY (13): hw/xwin: Fix compilation with -Werror=return-type hw/xwin: Fix compilation with -Werror=declaration-after-statement hw/xwin: Fix warnings in glx/glshim.c hw/xwin: Fix format warnings with debug printing of pointers on 64-bit hw/xwin: Fix warning in winXIconToHICON() hw/xwin: Fix const warning in winCheckDisplayNumber() hw/xwin: Fix const warnings in winprefsyacc.y hw/xwin: Fix const warning in winPrefsLoadPreferences() hw/xwin: Fix warning in yyerror() hw/xwin: Fix redundant declaration warning in winprefslex.l hw/xwin: Fix unused variable warning in winCreateMsgWindow() configure.ac: Avoid "Your OS is unknown" warning when configuring for Cygwin configure.ac: Force --disable-libdrm on Cygwin configure.ac | 7 +++++-- hw/xwin/InitOutput.c | 2 +- hw/xwin/glx/glshim.c | 3 +++ hw/xwin/winSetAppUserModelID.c | 2 +- hw/xwin/winclipboard/xevents.c | 3 ++- hw/xwin/windialogs.c | 4 ++-- hw/xwin/winmsgwindow.c | 5 ++--- hw/xwin/winmultiwindowicons.c | 4 ++-- hw/xwin/winmultiwindowshape.c | 2 +- hw/xwin/winmultiwindowwindow.c | 14 +++++++------- hw/xwin/winpixmap.c | 6 +++--- hw/xwin/winprefs.c | 2 +- hw/xwin/winprefslex.l | 2 -- hw/xwin/winprefsyacc.y | 11 +++++------ hw/xwin/winshadddnl.c | 2 +- hw/xwin/winwndproc.c | 2 +- 16 files changed, 37 insertions(+), 34 deletions(-) From mike at fireburn.co.uk Sat Oct 11 07:23:19 2014 From: mike at fireburn.co.uk (Mike Lothian) Date: Sat, 11 Oct 2014 15:23:19 +0100 Subject: [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-9-git-send-email-ajax@redhat.com> Message-ID: I think I've found the correct way to do it I've tested against xorg-server 1.16.1 and xorg-server from the latest git - I'm not sure if the formatting if correct or not but it compiles and runs on both Cheers Mike On 11 October 2014 14:35, Mike Lothian wrote: > Hi > > This stops xf86-video-intel working or compiling for me > > The below patch is a work around but I'm not quite sure what to check > for to make it work with both old and new xservers > > Cheers > > Mike > > On 8 October 2014 16:04, Adam Jackson wrote: >> This existed to be passed to the bs recovery routine; since we back all >> planes, we don't care. >> >> Signed-off-by: Adam Jackson >> --- >> fb/fbcopy.c | 2 +- >> glamor/glamor_copy.c | 3 +-- >> hw/dmx/dmxgcops.c | 8 ++++---- >> mi/mi.h | 3 +-- >> mi/mibitblt.c | 5 ++--- >> mi/micopy.c | 3 +-- >> mi/miexpose.c | 8 +------- >> 7 files changed, 11 insertions(+), 21 deletions(-) >> >> diff --git a/fb/fbcopy.c b/fb/fbcopy.c >> index 541ef71..5bbabc3 100644 >> --- a/fb/fbcopy.c >> +++ b/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/glamor/glamor_copy.c b/glamor/glamor_copy.c >> index 6f422d4..3320935 100644 >> --- a/glamor/glamor_copy.c >> +++ b/glamor/glamor_copy.c >> @@ -677,8 +677,7 @@ glamor_copy_plane(DrawablePtr src, DrawablePtr dst, GCPtr gc, >> { >> if ((bitplane & FbFullMask(src->depth)) == 0) >> return miHandleExposures(src, dst, gc, >> - srcx, srcy, width, height, dstx, dsty, >> - bitplane); >> + srcx, srcy, width, height, dstx, dsty); >> return miDoCopy(src, dst, gc, >> srcx, srcy, width, height, >> dstx, dsty, glamor_copy, bitplane, NULL); >> diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c >> index aa7c8eb..0ebd69a 100644 >> --- a/hw/dmx/dmxgcops.c >> +++ b/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/mi/mi.h b/mi/mi.h >> index a4a01b8..700bb11 100644 >> --- a/mi/mi.h >> +++ b/mi/mi.h >> @@ -229,8 +229,7 @@ extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ , >> int /*width */ , >> int /*height */ , >> int /*dstx */ , >> - int /*dsty */ , >> - unsigned long /*plane */ >> + int /*dsty */ >> ); >> >> extern _X_EXPORT void miSendGraphicsExpose(ClientPtr /*client */ , >> diff --git a/mi/mibitblt.c b/mi/mibitblt.c >> index 3ed4ed1..08bd1c5 100644 >> --- a/mi/mibitblt.c >> +++ b/mi/mibitblt.c >> @@ -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); >> >> @@ -579,7 +578,7 @@ miCopyPlane(DrawablePtr pSrcDrawable, >> } >> } >> prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, >> - width, height, dstx, dsty, bitPlane); >> + width, height, dstx, dsty); >> RegionDestroy(prgnSrc); >> return prgnExposed; >> } >> diff --git a/mi/micopy.c b/mi/micopy.c >> index 3079511..a52b0a7 100644 >> --- a/mi/micopy.c >> +++ b/mi/micopy.c >> @@ -304,8 +304,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/mi/miexpose.c b/mi/miexpose.c >> index de0e148..7a1c172 100644 >> --- a/mi/miexpose.c >> +++ b/mi/miexpose.c >> @@ -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; >> -- >> 1.9.3 >> >> _______________________________________________ >> xorg-devel at lists.x.org: X.Org development >> Archives: http://lists.x.org/archives/xorg-devel >> Info: http://lists.x.org/mailman/listinfo/xorg-devel -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-sna-miHandleExposures-no-longer-requires-plane-argum.patch Type: text/x-patch Size: 2155 bytes Desc: not available URL: From eric at anholt.net Sat Oct 11 21:33:26 2014 From: eric at anholt.net (Eric Anholt) Date: Sun, 12 Oct 2014 06:33:26 +0200 Subject: [PATCH] Xephyr: option to disable grabbing the host In-Reply-To: <1400632132-402-1-git-send-email-william.leslie.ttg@gmail.com> References: <1400632132-402-1-git-send-email-william.leslie.ttg@gmail.com> Message-ID: <878ukluctl.fsf@eliezer.anholt.net> William ML Leslie writes: > This patch makes it possible to use C-S key combinations > within Xephyr without losing access to the host window manager's > commands. Reviewed-by: Eric Anholt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From eric at anholt.net Sat Oct 11 22:58:07 2014 From: eric at anholt.net (Eric Anholt) Date: Sun, 12 Oct 2014 07:58:07 +0200 Subject: [PATCH 2/4] dri2: Automatically fill in the driver name if the DDX doesn't provide it. In-Reply-To: References: <1412932180-829-1-git-send-email-eric@anholt.net> <1412932180-829-2-git-send-email-eric@anholt.net> Message-ID: <87wq85u8wg.fsf@eliezer.anholt.net> Mark Marshall writes: > Just a minor thing > > On 10 October 2014 11:09, Eric Anholt wrote: >> 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). >> >> Signed-off-by: Eric Anholt >> --- >> Bool >> DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) >> { >> @@ -1525,6 +1578,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) >> if (!ds->driverNames) >> goto err_out; >> ds->driverNames[0] = info->driverName; > > I assume that you'd want to drop the line above, as it done again in > the added lines below? Fixed, thanks! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From ajax at redhat.com Sun Oct 12 06:39:10 2014 From: ajax at redhat.com (Adam Jackson) Date: Sun, 12 Oct 2014 15:39:10 +0200 Subject: [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-9-git-send-email-ajax@redhat.com> Message-ID: <1413121150.11177.0.camel@dmt> On Sat, 2014-10-11 at 14:35 +0100, Mike Lothian wrote: > Hi > > This stops xf86-video-intel working or compiling for me > > The below patch is a work around but I'm not quite sure what to check > for to make it work with both old and new xservers Intel will need to be fixed, yeah. Preferably by not forking fb, which is, you know, insane. - ajax From ajax at nwnk.net Sun Oct 12 06:43:20 2014 From: ajax at nwnk.net (Adam Jackson) Date: Sun, 12 Oct 2014 15:43:20 +0200 Subject: vesa and 2560x1440 In-Reply-To: References: Message-ID: <1413121400.11177.4.camel@dmt> On Sat, 2014-10-11 at 11:22 +0000, basteon wrote: > hi all, > I use Xorg version 1.16.0. > This version supports such(2560x1440) dimentions with vesa driver? It's not a function of the X server version. It's (partially) a function of the vesa driver version; before vesa 2.3.0 the driver would reject modes wider than 2048 even if the firmware claimed to support them. 2.3.0 and later don't have that bug. But the vesa driver can only support modes that the video BIOS actually advertises, which varies per card. If your VBIOS doesn't support that size, consider using something better than vesa. Which is actually pretty good advice in any case. - ajax From dmitry.torokhov at gmail.com Fri Oct 10 11:36:32 2014 From: dmitry.torokhov at gmail.com (Dmitry Torokhov) Date: Fri, 10 Oct 2014 11:36:32 -0700 Subject: config: revert quirk for the Evoluent Vertical Mouse In-Reply-To: <20141010181211.GA11474@dtor-glaptop> References: <20140515025439.GA11354@yabbi.redhat.com> <20141010181211.GA11474@dtor-glaptop> Message-ID: <20141010183632.GC32974@dtor-ws> On Friday, October 10, 2014 11:12:11 AM Dmitry Torokhov wrote: > On Thu, May 15, 2014 at 12:54:40PM +1000, Peter Hutterer wrote: > > This quick makes the mouse behaviour more obvious (LMR buttons generate > > LMR > > > > events) but goes against the manufacturer's intended defaults: > > Top button - left click. > > Wheel button - .middle click (e.g., for pan and rotate in CAD > > programs). > > Middle button - right click. > > Bottom button - back. > > Thumb button - forward. > > > > from http://www.evoluent.com/vm3.html > > For what it worth I think the current mapping is correct. Manufacturer's > recommendations are geared towards Windows set up where middle click is not > normally used, whereas in Linux it is extremely useful. FWIW here is what the hardware reports for version 4 of the mouse: topmost on right size - BTN_LEFT middle on the right side - BTN_MIDDLE wheel click - BTN_EXTRA lowest on the right side - BTN_RIGHT top on the left side - BTN_SIDE bottom on the left side - BTN_FORWARD so it seems that manufacturer itself decided to change the default mapping in newer version. Thanks. -- Dmitry From dmitry.torokhov at gmail.com Fri Oct 10 11:12:11 2014 From: dmitry.torokhov at gmail.com (Dmitry Torokhov) Date: Fri, 10 Oct 2014 11:12:11 -0700 Subject: config: revert quirk for the Evoluent Vertical Mouse In-Reply-To: <20140515025439.GA11354@yabbi.redhat.com> References: <20140515025439.GA11354@yabbi.redhat.com> Message-ID: <20141010181211.GA11474@dtor-glaptop> On Thu, May 15, 2014 at 12:54:40PM +1000, Peter Hutterer wrote: > This quick makes the mouse behaviour more obvious (LMR buttons generate LMR > events) but goes against the manufacturer's intended defaults: > > Top button - left click. > Wheel button - .middle click (e.g., for pan and rotate in CAD programs). > Middle button - right click. > Bottom button - back. > Thumb button - forward. > > from http://www.evoluent.com/vm3.html For what it worth I think the current mapping is correct. Manufacturer's recommendations are geared towards Windows set up where middle click is not normally used, whereas in Linux it is extremely useful. > > Signed-off-by: Peter Hutterer > > --- > config/10-quirks.conf | 16 -------------- > 1 file changed, 16 deletions(-) > > diff --git a/config/10-quirks.conf b/config/10-quirks.conf > index c9b823c..47907d8 100644 > --- a/config/10-quirks.conf > +++ b/config/10-quirks.conf > @@ -19,22 +19,6 @@ Section "InputClass" > Option "IgnoreRelativeAxes" "off" > EndSection > > -# https://bugzilla.redhat.com/show_bug.cgi?id=612140 > -# please make Evoluent VerticalMouse 3 work out of the box > -# Button mapping on this mouse is quirky > -Section "InputClass" > - Identifier "Evoluent VerticalMouse 3" > - MatchProduct "Evoluent VerticalMouse 3" > - # Sets following configuration: > - # top button: left > - # middle button: middle > - # bottom button: right > - # wheel click: middle > - # thumb button: 8 (back) > - Option "ButtonMapping" "1 2 2 4 5 6 7 3 8" > -EndSection > - > - > # https://bugs.freedesktop.org/show_bug.cgi?id=55867 > # Bug 55867 - Doesn't know how to tag XI_TRACKBALL > Section "InputClass" Thanks. -- Dmitry From axel.davy at ens.fr Sat Oct 11 04:18:19 2014 From: axel.davy at ens.fr (Axel Davy) Date: Sat, 11 Oct 2014 13:18:19 +0200 Subject: [PATCH] Correct present_notify_msc vblank target Message-ID: <1413026299-31539-1-git-send-email-axel.davy@ens.fr> When using present_notify_msc with current or past msc, we except it to respond right away. It was not the case since it was waiting next vblank. Signed-off-by: Axel Davy --- present/present.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/present/present.c b/present/present.c index 47566c7..413a22f 100644 --- a/present/present.c +++ b/present/present.c @@ -756,7 +756,7 @@ present_pixmap(WindowPtr window, } } else { target_msc = crtc_msc; - if (!(options & PresentOptionAsync)) + if (pixmap && !(options & PresentOptionAsync)) target_msc++; } } -- 2.1.0 From remi at gentoo.org Sun Oct 12 08:39:29 2014 From: remi at gentoo.org (=?windows-1252?Q?R=E9mi_Cardona?=) Date: Sun, 12 Oct 2014 17:39:29 +0200 Subject: [Intel-gfx] [PATCH 08/37] mi: Drop plane argument from miHandleExposures In-Reply-To: References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-9-git-send-email-ajax@redhat.com> Message-ID: <543AA0B1.1030508@gentoo.org> Le 11/10/2014 16:23, Mike Lothian a ?crit : > I think I've found the correct way to do it > > I've tested against xorg-server 1.16.1 and xorg-server from the latest > git - I'm not sure if the formatting if correct or not but it compiles > and runs on both What about 'src/compat-api.h'? This looks like the correct place for it and it could be shared with all other drivers that had this file put in their repo a while back. Cheers, R?mi From basteon at gmail.com Mon Oct 13 02:37:55 2014 From: basteon at gmail.com (basteon) Date: Mon, 13 Oct 2014 09:37:55 +0000 Subject: vesa and 2560x1440 In-Reply-To: <1413121400.11177.4.camel@dmt> References: <1413121400.11177.4.camel@dmt> Message-ID: hello, I use 2.3.3 vesa xorg driver. But with radeon kernel driver I got black screen and nothing more. Just after I make modprobe -av radeon I use GIGABYTE GA-E350N board with AMD Radeon HD 6310. On 10/12/14, Adam Jackson wrote: > On Sat, 2014-10-11 at 11:22 +0000, basteon wrote: >> hi all, >> I use Xorg version 1.16.0. >> This version supports such(2560x1440) dimentions with vesa driver? > > It's not a function of the X server version. It's (partially) a > function of the vesa driver version; before vesa 2.3.0 the driver would > reject modes wider than 2048 even if the firmware claimed to support > them. 2.3.0 and later don't have that bug. > > But the vesa driver can only support modes that the video BIOS actually > advertises, which varies per card. If your VBIOS doesn't support that > size, consider using something better than vesa. Which is actually > pretty good advice in any case. > > - ajax > > From hramrach at gmail.com Mon Oct 13 04:07:06 2014 From: hramrach at gmail.com (Michal Suchanek) Date: Mon, 13 Oct 2014 13:07:06 +0200 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> Message-ID: Hello, On 13 October 2014 11:37, basteon wrote: > hello, > I use 2.3.3 vesa xorg driver. > But with radeon kernel driver I got black screen and nothing more. > Just after I make modprobe -av radeon > I use GIGABYTE GA-E350N board with AMD Radeon HD 6310. Can you connect over SSH or serial console and collect the kernel messages after you insert the radeon module? The onboard 6310 card should work except it's hell slow. I used to run a system with one some years ago. What connection do you use to connect the display? Some connections may not be able to use full resolution. Can you try using fbset or xrandr to switch to lower resolution once the module is inserted? Thanks Michal From sndirsch at suse.de Mon Oct 13 05:58:40 2014 From: sndirsch at suse.de (Stefan Dirsch) Date: Mon, 13 Oct 2014 14:58:40 +0200 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> Message-ID: <20141013125840.GA26489@suse.de> On Tue, Oct 07, 2014 at 11:56:55AM +0100, Daniel Stone wrote: > Hi, > > On 7 October 2014 10:54, Michel D?nzer wrote: > > On 07.10.2014 18:46, Daniel Martin wrote: > > On 7 October 2014 11:29, Stefan Dirsch wrote: > > Without this the build fails on systems with the latest glibc, > throwing this error: > [...] > > This is caused by HAVE_STRNDUP not being set (it is set from > xorg-server.h), > causing os.h to redefine it. > > > Have a look at this commit in xf86-video-intel: > ? ? ?http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/? > id=d209b03915e4d12ce445d72ac09bb4fe664ba664 > > With that HAVE_STRNDUP will be defined in config.h, > which looks like a better solution to me. > > > I disagree. xorg-server.h must be included before any other headers from > xorg/, so Stefan's patch is the proper solution. > > > Yes, absolutely. xorg-server.h does things like define _XSERVER64, which > changes the size of CARD32 and thus the entire server ABI. Not including > xorg-server.h first is terminally broken; this is just one symptom. > > Stefan: > Reviewed-by: Daniel Stone Thanks! Anybody, who would like to push it? CU, Stefan Public Key available ------------------------------------------------------ Stefan Dirsch (Res. & Dev.) SUSE LINUX Products GmbH Tel: 0911-740 53 0 Maxfeldstra?e 5 FAX: 0911-740 53 479 D-90409 N?rnberg http://www.suse.de Germany -------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer, HRB 16746 (AG N?rnberg) -------------------------------------------------------------- From mark.kettenis at xs4all.nl Mon Oct 13 06:37:39 2014 From: mark.kettenis at xs4all.nl (Mark Kettenis) Date: Mon, 13 Oct 2014 15:37:39 +0200 (CEST) Subject: [PATCH 0/4] Finish killing VidMemInfo In-Reply-To: <1412782739-9960-1-git-send-email-ajax@redhat.com> (message from Adam Jackson on Wed, 8 Oct 2014 17:38:55 +0200) References: <1412782739-9960-1-git-send-email-ajax@redhat.com> Message-ID: <201410131337.s9DDbcgS022820@glazunov.sibelius.xs4all.nl> > From: Adam Jackson > Date: Wed, 8 Oct 2014 17:38:55 +0200 > > This finishes the job from: > > http://lists.freedesktop.org/archives/xorg-devel/2014-July/043343.html > > OpenBSD retains its special case for privsep setup, but otherwise this is > the same as before. Please give me a chance to properly review and test this. Was travelling last week. > b/configure.ac | 9 - > b/hw/xfree86/common/compiler.h | 35 +----- > b/hw/xfree86/os-support/Makefile.am | 2 > b/hw/xfree86/os-support/bsd/Makefile.am | 2 > b/hw/xfree86/os-support/bsd/alpha_video.c | 152 ---------------------------- > b/hw/xfree86/os-support/bsd/arm_video.c | 59 ---------- > b/hw/xfree86/os-support/bsd/bsd_ev56.c | 23 +--- > b/hw/xfree86/os-support/bsd/i386_video.c | 5 > b/hw/xfree86/os-support/bsd/ppc_video.c | 9 - > b/hw/xfree86/os-support/bus/Makefile.am | 4 > b/hw/xfree86/os-support/bus/Pci.c | 13 -- > b/hw/xfree86/os-support/bus/Pci.h | 10 - > b/hw/xfree86/os-support/hurd/Makefile.am | 1 > b/hw/xfree86/os-support/hurd/hurd_video.c | 11 -- > b/hw/xfree86/os-support/linux/Makefile.am | 1 > b/hw/xfree86/os-support/linux/lnx_agp.c | 1 > b/hw/xfree86/os-support/linux/lnx_ev56.c | 22 +--- > b/hw/xfree86/os-support/linux/lnx_video.c | 38 ------- > b/hw/xfree86/os-support/shared/agp_noop.c | 1 > b/hw/xfree86/os-support/solaris/Makefile.am | 1 > b/hw/xfree86/os-support/solaris/sun_vid.c | 11 -- > b/hw/xfree86/os-support/stub/Makefile.am | 4 > b/hw/xfree86/os-support/xf86_OSproc.h | 3 > hw/xfree86/os-support/bsd/sparc64_video.c | 45 -------- > hw/xfree86/os-support/bus/bsd_pci.c | 55 ---------- > hw/xfree86/os-support/shared/vidmem.c | 54 --------- > hw/xfree86/os-support/stub/stub_video.c | 13 -- > hw/xfree86/os-support/xf86OSpriv.h | 41 ------- > 28 files changed, 31 insertions(+), 594 deletions(-) > > - ajax > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > From michel at daenzer.net Mon Oct 13 18:02:13 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Tue, 14 Oct 2014 10:02:13 +0900 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <20141013125840.GA26489@suse.de> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> <20141013125840.GA26489@suse.de> Message-ID: <543C7615.8010807@daenzer.net> On 13.10.2014 21:58, Stefan Dirsch wrote: > On Tue, Oct 07, 2014 at 11:56:55AM +0100, Daniel Stone wrote: >> Hi, >> >> On 7 October 2014 10:54, Michel D?nzer wrote: >> >> On 07.10.2014 18:46, Daniel Martin wrote: >> >> On 7 October 2014 11:29, Stefan Dirsch wrote: >> >> Without this the build fails on systems with the latest glibc, >> throwing this error: >> [...] >> >> This is caused by HAVE_STRNDUP not being set (it is set from >> xorg-server.h), >> causing os.h to redefine it. >> >> >> Have a look at this commit in xf86-video-intel: >> http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/? >> id=d209b03915e4d12ce445d72ac09bb4fe664ba664 >> >> With that HAVE_STRNDUP will be defined in config.h, >> which looks like a better solution to me. >> >> >> I disagree. xorg-server.h must be included before any other headers from >> xorg/, so Stefan's patch is the proper solution. >> >> >> Yes, absolutely. xorg-server.h does things like define _XSERVER64, which >> changes the size of CARD32 and thus the entire server ABI. Not including >> xorg-server.h first is terminally broken; this is just one symptom. >> >> Stefan: >> Reviewed-by: Daniel Stone > > Thanks! Anybody, who would like to push it? Thomas already pushed it. :) -- Earthling Michel D?nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From airlied at gmail.com Mon Oct 13 20:23:22 2014 From: airlied at gmail.com (Dave Airlie) Date: Tue, 14 Oct 2014 13:23:22 +1000 Subject: tile property contents Message-ID: Hi, So I've been hacking on mutter and the gnome pieces for tiling, and I've at least fixed mutter locally so maximise windows works and the heads are in the right order. Now I've strung all the pieces together using a single KMS property that X.org propogates, and mutter picks up and propagates over dbus as well, Currently I've ascii encoded the property into a blob, :::::::: I'm thinking of dropping the version field and just exposing TILE2 property if we need it later to add more values, The other fields: tileid: a group id assigned by the kernel to all tiles in the same group - unique per group flags: bit 0 : single monitor enclosure maxhtiles: total number of horiz tiles maxvtiles: total number of vert tiles h_tile_loc: horiz location of this output in tile group v_tile_loc: vert location of this output in tile group tile_w: width of this tile tile_h: height of this tile. Now we extract all of these from the DisplayID v1.3 block, and I'm wondering if maybe I shouldn't just export the whole DisplayID tiling info block instead, it however encodes a few other pieces of information, including bezel info, and some flags specifying behaviour in some cases. The former could be more suitable for cases where DisplayID isn't available (Dual DSI panels?) but I'm worried abuot exposing too little at this point making TILE useless when the next monitor comes out. I'm not sure any part of the stack should be extracting things and splitting them out, I'd like to just give the same tile property all the way through. Dave. From sndirsch at suse.de Mon Oct 13 20:25:56 2014 From: sndirsch at suse.de (Stefan Dirsch) Date: Tue, 14 Oct 2014 05:25:56 +0200 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <543C7615.8010807@daenzer.net> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> <20141013125840.GA26489@suse.de> <543C7615.8010807@daenzer.net> Message-ID: <20141014032556.GA31452@suse.de> On Tue, Oct 14, 2014 at 10:02:13AM +0900, Michel D?nzer wrote: > On 13.10.2014 21:58, Stefan Dirsch wrote: > >On Tue, Oct 07, 2014 at 11:56:55AM +0100, Daniel Stone wrote: > >>Hi, > >> > >>On 7 October 2014 10:54, Michel D?nzer wrote: > >> > >> On 07.10.2014 18:46, Daniel Martin wrote: > >> > >> On 7 October 2014 11:29, Stefan Dirsch wrote: > >> > >> Without this the build fails on systems with the latest glibc, > >> throwing this error: > >> [...] > >> > >> This is caused by HAVE_STRNDUP not being set (it is set from > >> xorg-server.h), > >> causing os.h to redefine it. > >> > >> > >> Have a look at this commit in xf86-video-intel: > >> http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/? > >> id=d209b03915e4d12ce445d72ac09bb4fe664ba664 > >> > >> With that HAVE_STRNDUP will be defined in config.h, > >> which looks like a better solution to me. > >> > >> > >> I disagree. xorg-server.h must be included before any other headers from > >> xorg/, so Stefan's patch is the proper solution. > >> > >> > >>Yes, absolutely. xorg-server.h does things like define _XSERVER64, which > >>changes the size of CARD32 and thus the entire server ABI. Not including > >>xorg-server.h first is terminally broken; this is just one symptom. > >> > >>Stefan: > >>Reviewed-by: Daniel Stone > > > >Thanks! Anybody, who would like to push it? > > Thomas already pushed it. :) Hmm. Then I don't see it. Latest commit in git I can see is from Sep 22nd. vmware/saa: Fix saa_check_poly_fill_rect_noreadback v2 Thanks, Stefan Public Key available ------------------------------------------------------ Stefan Dirsch (Res. & Dev.) SUSE LINUX Products GmbH Tel: 0911-740 53 0 Maxfeldstra?e 5 FAX: 0911-740 53 479 D-90409 N?rnberg http://www.suse.de Germany -------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer, HRB 16746 (AG N?rnberg) -------------------------------------------------------------- From michel at daenzer.net Mon Oct 13 20:37:35 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Tue, 14 Oct 2014 12:37:35 +0900 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <20141014032556.GA31452@suse.de> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> <20141013125840.GA26489@suse.de> <543C7615.8010807@daenzer.net> <20141014032556.GA31452@suse.de> Message-ID: <543C9A7F.7060700@daenzer.net> On 14.10.2014 12:25, Stefan Dirsch wrote: > On Tue, Oct 14, 2014 at 10:02:13AM +0900, Michel D?nzer wrote: >> On 13.10.2014 21:58, Stefan Dirsch wrote: >>> On Tue, Oct 07, 2014 at 11:56:55AM +0100, Daniel Stone wrote: >>>> Hi, >>>> >>>> On 7 October 2014 10:54, Michel D?nzer wrote: >>>> >>>> On 07.10.2014 18:46, Daniel Martin wrote: >>>> >>>> On 7 October 2014 11:29, Stefan Dirsch wrote: >>>> >>>> Without this the build fails on systems with the latest glibc, >>>> throwing this error: >>>> [...] >>>> >>>> This is caused by HAVE_STRNDUP not being set (it is set from >>>> xorg-server.h), >>>> causing os.h to redefine it. >>>> >>>> >>>> Have a look at this commit in xf86-video-intel: >>>> http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/? >>>> id=d209b03915e4d12ce445d72ac09bb4fe664ba664 >>>> >>>> With that HAVE_STRNDUP will be defined in config.h, >>>> which looks like a better solution to me. >>>> >>>> >>>> I disagree. xorg-server.h must be included before any other headers from >>>> xorg/, so Stefan's patch is the proper solution. >>>> >>>> >>>> Yes, absolutely. xorg-server.h does things like define _XSERVER64, which >>>> changes the size of CARD32 and thus the entire server ABI. Not including >>>> xorg-server.h first is terminally broken; this is just one symptom. >>>> >>>> Stefan: >>>> Reviewed-by: Daniel Stone >>> >>> Thanks! Anybody, who would like to push it? >> >> Thomas already pushed it. :) > > Hmm. Then I don't see it. Latest commit in git I can see is from Sep 22nd. > > vmware/saa: Fix saa_check_poly_fill_rect_noreadback v2 Ah, I thought this was about the -vmmouse patch. Sorry for the noise. :( -- Earthling Michel D?nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From thellstrom at vmware.com Tue Oct 14 00:25:39 2014 From: thellstrom at vmware.com (Thomas Hellstrom) Date: Tue, 14 Oct 2014 09:25:39 +0200 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <543C9A7F.7060700@daenzer.net> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> <20141013125840.GA26489@suse.de> <543C7615.8010807@daenzer.net> <20141014032556.GA31452@suse.de> <543C9A7F.7060700@daenzer.net> Message-ID: <543CCFF3.4090106@vmware.com> On 10/14/2014 05:37 AM, Michel D?nzer wrote: > On 14.10.2014 12:25, Stefan Dirsch wrote: >> On Tue, Oct 14, 2014 at 10:02:13AM +0900, Michel D?nzer wrote: >>> On 13.10.2014 21:58, Stefan Dirsch wrote: >>>> On Tue, Oct 07, 2014 at 11:56:55AM +0100, Daniel Stone wrote: >>>>> Hi, >>>>> >>>>> On 7 October 2014 10:54, Michel D?nzer wrote: >>>>> >>>>> On 07.10.2014 18:46, Daniel Martin wrote: >>>>> >>>>> On 7 October 2014 11:29, Stefan Dirsch >>>>> wrote: >>>>> >>>>> Without this the build fails on systems with the >>>>> latest glibc, >>>>> throwing this error: >>>>> [...] >>>>> >>>>> This is caused by HAVE_STRNDUP not being set (it is >>>>> set from >>>>> xorg-server.h), >>>>> causing os.h to redefine it. >>>>> >>>>> >>>>> Have a look at this commit in xf86-video-intel: >>>>> >>>>> https://urldefense.proofpoint.com/v1/url?u=http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=l5Ago9ekmVFZ3c4M6eauqrJWGwjf6fTb%2BP3CxbBFkVM%3D%0A&m=xI13rHs%2BLeuvv%2FqtZFARei8HUkkffhUHhhsWCS721DM%3D%0A&s=48be33ecca86cb741cedc5bcb504b7681cd4b992020571f5f47b932cd8018591 >>>>> id=d209b03915e4d12ce445d72ac09bb4fe664ba664 >>>>> >>>>> With that HAVE_STRNDUP will be defined in config.h, >>>>> which looks like a better solution to me. >>>>> >>>>> >>>>> I disagree. xorg-server.h must be included before any other >>>>> headers from >>>>> xorg/, so Stefan's patch is the proper solution. >>>>> >>>>> >>>>> Yes, absolutely. xorg-server.h does things like define _XSERVER64, >>>>> which >>>>> changes the size of CARD32 and thus the entire server ABI. Not >>>>> including >>>>> xorg-server.h first is terminally broken; this is just one symptom. >>>>> >>>>> Stefan: >>>>> Reviewed-by: Daniel Stone >>>> >>>> Thanks! Anybody, who would like to push it? >>> >>> Thomas already pushed it. :) >> >> Hmm. Then I don't see it. Latest commit in git I can see is from Sep >> 22nd. >> >> vmware/saa: Fix saa_check_poly_fill_rect_noreadback v2 > > Ah, I thought this was about the -vmmouse patch. Sorry for the noise. :( > > Hmm, I totally missed this patch was for the -vmware driver. Sorry for that. I need to give it a spin in our ancient-server-compilation-tool and if there's no problem I'll push it. Thanks, Thomas From thierry.reding at gmail.com Tue Oct 14 04:40:12 2014 From: thierry.reding at gmail.com (Thierry Reding) Date: Tue, 14 Oct 2014 13:40:12 +0200 Subject: tile property contents In-Reply-To: References: Message-ID: <20141014114011.GB5057@ulmo> On Tue, Oct 14, 2014 at 01:23:22PM +1000, Dave Airlie wrote: > Hi, > > So I've been hacking on mutter and the gnome pieces for tiling, and > I've at least fixed mutter locally so maximise windows works and the > heads are in the right order. > > Now I've strung all the pieces together using a single KMS property > that X.org propogates, and mutter picks up and propagates over dbus as > well, > > Currently I've ascii encoded the property into a blob, > > :::::::: > > I'm thinking of dropping the version field and just exposing TILE2 > property if we need it later to add more values, > > The other fields: > tileid: a group id assigned by the kernel to all tiles in the same > group - unique per group > flags: bit 0 : single monitor enclosure > maxhtiles: total number of horiz tiles > maxvtiles: total number of vert tiles > h_tile_loc: horiz location of this output in tile group > v_tile_loc: vert location of this output in tile group > tile_w: width of this tile > tile_h: height of this tile. > > Now we extract all of these from the DisplayID v1.3 block, and I'm > wondering if maybe I shouldn't just export the whole DisplayID tiling > info block instead, it however encodes a few other pieces of > information, including bezel info, and some flags specifying behaviour > in some cases. > > The former could be more suitable for cases where DisplayID isn't > available (Dual DSI panels?) but I'm worried abuot exposing too little > at this point making TILE useless when the next monitor comes out. I don't think this is a good fit to describe dual DSI panels in the first place. While one of the modes (left-right split) could probably be described using the above, the other mode (odd-even split) is more difficult. In the latter mode, one controller will provide the odd lines and the other controller will provide the even lines. Also exporting the details about tiling presumes that each of the tiles can work pretty much independently, too. That's not necessarily the case for dual DSI. For a symmetric left-right split configuration this may be somewhat true, at least for one of the halves. The second half can't operate standalone. For an odd-even split I don't think either half can be made to work standalone. I'm also not sure how left-right split configurations work in video mode. I can imagine that both are really needed for the panel to properly sync, since only the right half gets the HBLANK and VBLANK signals. One other thing that worries me about this is that we defer handling of these complex configurations to userspace. I suppose this is fine, and in fact the only way, if there is no knowledge about the tile layout in kernel space. But if we know precisely how these various tiles are connected, wouldn't we be better off abstracting this away within the kernel and expose a single connector that is the union of all the tiles? After all that's what the kernel is, an abstraction between hardware and userspace. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From crazycasta at gmail.com Tue Oct 14 09:41:03 2014 From: crazycasta at gmail.com (Alex Orange) Date: Tue, 14 Oct 2014 10:41:03 -0600 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. In-Reply-To: <5432A90F.40305@opentext.com> References: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> <5432A90F.40305@opentext.com> Message-ID: Please pardon my inexperience, is there any further action I need to/should take to get this patch committed? Alex On Mon, Oct 6, 2014 at 8:37 AM, Peter Harris wrote: > On 2014-10-03 17:41, Alex Orange wrote: > > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 > > > > Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said > > patch does indeed remove the problematic writes to bad memory, however > > it also introduces errors in the algoritm. This patch has the effect of > > reverting said patch and adding an if in the proper location to catch > > the out of bounds memory write without causing problems to the overall > > algorithm. > > > > Signed-off-by: Alex Orange > > Reviewed-by: Peter Harris > Tested-by: Peter Harris > > Peter Harris > -- > Open Text Connectivity Solutions Group > Peter Harris http://connectivity.opentext.com/ > Research and Development Phone: +1 905 762 6001 > pharris at opentext.com Toll Free: 1 877 359 4866 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From airlied at gmail.com Tue Oct 14 13:35:52 2014 From: airlied at gmail.com (Dave Airlie) Date: Wed, 15 Oct 2014 06:35:52 +1000 Subject: tile property contents In-Reply-To: <20141014114011.GB5057@ulmo> References: <20141014114011.GB5057@ulmo> Message-ID: On 14 October 2014 21:40, Thierry Reding wrote: > On Tue, Oct 14, 2014 at 01:23:22PM +1000, Dave Airlie wrote: >> Hi, >> >> So I've been hacking on mutter and the gnome pieces for tiling, and >> I've at least fixed mutter locally so maximise windows works and the >> heads are in the right order. >> >> Now I've strung all the pieces together using a single KMS property >> that X.org propogates, and mutter picks up and propagates over dbus as >> well, >> >> Currently I've ascii encoded the property into a blob, >> >> :::::::: >> >> I'm thinking of dropping the version field and just exposing TILE2 >> property if we need it later to add more values, >> >> The other fields: >> tileid: a group id assigned by the kernel to all tiles in the same >> group - unique per group >> flags: bit 0 : single monitor enclosure >> maxhtiles: total number of horiz tiles >> maxvtiles: total number of vert tiles >> h_tile_loc: horiz location of this output in tile group >> v_tile_loc: vert location of this output in tile group >> tile_w: width of this tile >> tile_h: height of this tile. >> >> Now we extract all of these from the DisplayID v1.3 block, and I'm >> wondering if maybe I shouldn't just export the whole DisplayID tiling >> info block instead, it however encodes a few other pieces of >> information, including bezel info, and some flags specifying behaviour >> in some cases. >> >> The former could be more suitable for cases where DisplayID isn't >> available (Dual DSI panels?) but I'm worried abuot exposing too little >> at this point making TILE useless when the next monitor comes out. > > I don't think this is a good fit to describe dual DSI panels in the > first place. While one of the modes (left-right split) could probably be > described using the above, the other mode (odd-even split) is more > difficult. In the latter mode, one controller will provide the odd lines > and the other controller will provide the even lines. Okay I'm happy with dual-DSI panels that you can hide those in the kernel, they don't seem hotpluggable, so if you have one in your device-tree, you can probably just never expose the second crtc/encoder in the mode groups, and keep them for the kernel to use as slaves for the panel. > One other thing that worries me about this is that we defer handling of > these complex configurations to userspace. I suppose this is fine, and > in fact the only way, if there is no knowledge about the tile layout in > kernel space. But if we know precisely how these various tiles are > connected, wouldn't we be better off abstracting this away within the > kernel and expose a single connector that is the union of all the tiles? > After all that's what the kernel is, an abstraction between hardware and > userspace. > We can't do that for the MST panels, because the abstractions is too leaky, stealing crtcs dynamically at runtime, is screwed up and getting pageflipping across crtcs without userspace knowing is also a large pit of fail. Dave. From thierry.reding at gmail.com Wed Oct 15 01:29:22 2014 From: thierry.reding at gmail.com (Thierry Reding) Date: Wed, 15 Oct 2014 10:29:22 +0200 Subject: tile property contents In-Reply-To: References: <20141014114011.GB5057@ulmo> Message-ID: <20141015082921.GD12807@ulmo> On Wed, Oct 15, 2014 at 06:35:52AM +1000, Dave Airlie wrote: > On 14 October 2014 21:40, Thierry Reding wrote: > > On Tue, Oct 14, 2014 at 01:23:22PM +1000, Dave Airlie wrote: > >> Hi, > >> > >> So I've been hacking on mutter and the gnome pieces for tiling, and > >> I've at least fixed mutter locally so maximise windows works and the > >> heads are in the right order. > >> > >> Now I've strung all the pieces together using a single KMS property > >> that X.org propogates, and mutter picks up and propagates over dbus as > >> well, > >> > >> Currently I've ascii encoded the property into a blob, > >> > >> :::::::: > >> > >> I'm thinking of dropping the version field and just exposing TILE2 > >> property if we need it later to add more values, > >> > >> The other fields: > >> tileid: a group id assigned by the kernel to all tiles in the same > >> group - unique per group > >> flags: bit 0 : single monitor enclosure > >> maxhtiles: total number of horiz tiles > >> maxvtiles: total number of vert tiles > >> h_tile_loc: horiz location of this output in tile group > >> v_tile_loc: vert location of this output in tile group > >> tile_w: width of this tile > >> tile_h: height of this tile. > >> > >> Now we extract all of these from the DisplayID v1.3 block, and I'm > >> wondering if maybe I shouldn't just export the whole DisplayID tiling > >> info block instead, it however encodes a few other pieces of > >> information, including bezel info, and some flags specifying behaviour > >> in some cases. > >> > >> The former could be more suitable for cases where DisplayID isn't > >> available (Dual DSI panels?) but I'm worried abuot exposing too little > >> at this point making TILE useless when the next monitor comes out. > > > > I don't think this is a good fit to describe dual DSI panels in the > > first place. While one of the modes (left-right split) could probably be > > described using the above, the other mode (odd-even split) is more > > difficult. In the latter mode, one controller will provide the odd lines > > and the other controller will provide the even lines. > > Okay I'm happy with dual-DSI panels that you can hide those in the > kernel, they don't seem hotpluggable, > > so if you have one in your device-tree, you can probably just never > expose the second crtc/encoder in the mode groups, > and keep them for the kernel to use as slaves for the panel. For reference: on Tegra a single CRTC sends pixel data to both DSI outputs. The DSI outputs can then be programmed to take only the pixels that they need to display. In the driver that I've submitted for review a couple of days ago this is done by enslaving the second DSI output so that it doesn't expose a regular DSI connector. The first DSI output is then "augmented" to support a maximum of 8 data lanes instead of only 4 data lanes. It'd be interesting to see if some of that can be extracted into common code, but for now I've opted to handle it all in the Tegra driver since it is the only implementation of this mode at this time. > > One other thing that worries me about this is that we defer handling of > > these complex configurations to userspace. I suppose this is fine, and > > in fact the only way, if there is no knowledge about the tile layout in > > kernel space. But if we know precisely how these various tiles are > > connected, wouldn't we be better off abstracting this away within the > > kernel and expose a single connector that is the union of all the tiles? > > After all that's what the kernel is, an abstraction between hardware and > > userspace. > > > > We can't do that for the MST panels, because the abstractions is too > leaky, stealing crtcs dynamically at runtime, is screwed up and > getting pageflipping across crtcs without userspace knowing is also a > large pit of fail. I see. That sounds like it can indeed not be reasonably hidden in the kernel. Or at least I wouldn't know how, so dealing with it in userspace seems like a better option. Just for my understanding, is it typical for each of these panels to be standalone (own housing, ...) or are there monitors that actually take two connectors and each of them drives a different part of the same panel? A quick search on the internet indicates that the former is more common (I haven't actually been able to find an example of the latter). Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From eric at anholt.net Wed Oct 15 02:01:06 2014 From: eric at anholt.net (Eric Anholt) Date: Wed, 15 Oct 2014 10:01:06 +0100 Subject: [PATCH 4/4 v3] modesetting: Add support for DRI2 with glamor. In-Reply-To: <1412932180-829-4-git-send-email-eric@anholt.net> References: <1412932180-829-4-git-send-email-eric@anholt.net> Message-ID: <1413363666-27458-1-git-send-email-eric@anholt.net> 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). Signed-off-by: Eric Anholt --- OK, since I wasn't going to get pageflipping actually working before the merge window (being on a single laptop during travel sucks), I've just ripped it out for now to get some thing that really works into this release hopefully. We can do pageflipping for the next one. This is on the modesetting-dri2-no-pageflip branch of my tree, along with the squashed in review comment fix for the previous patch. hw/xfree86/drivers/modesetting/Makefile.am | 6 +- hw/xfree86/drivers/modesetting/dri2.c | 863 +++++++++++++++++++++++ hw/xfree86/drivers/modesetting/driver.c | 27 +- hw/xfree86/drivers/modesetting/driver.h | 44 ++ hw/xfree86/drivers/modesetting/drmmode_display.c | 17 + hw/xfree86/drivers/modesetting/drmmode_display.h | 28 +- hw/xfree86/drivers/modesetting/vblank.c | 383 ++++++++++ 7 files changed, 1365 insertions(+), 3 deletions(-) create mode 100644 hw/xfree86/drivers/modesetting/dri2.c create mode 100644 hw/xfree86/drivers/modesetting/vblank.c diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am index e6834e2..5b08600 100644 --- a/hw/xfree86/drivers/modesetting/Makefile.am +++ b/hw/xfree86/drivers/modesetting/Makefile.am @@ -30,6 +30,7 @@ AM_CPPFLAGS = \ $(XORG_INCS) \ -I$(top_srcdir)/glamor \ -I$(srcdir)/../../ddc \ + -I$(srcdir)/../../dri2 \ -I$(srcdir)/../../i2c \ -I$(srcdir)/../../modes \ -I$(srcdir)/../../parser \ @@ -42,10 +43,13 @@ 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 + drmmode_display.h \ + vblank.c \ + $(NULL) drivermandir = $(DRIVER_MAN_DIR) driverman_PRE = modesetting.man diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c new file mode 100644 index 0000000..6c88060 --- /dev/null +++ b/hw/xfree86/drivers/modesetting/dri2.c @@ -0,0 +1,863 @@ +/* + * 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 +#define GLAMOR_FOR_XORG 1 +#include "glamor.h" + +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/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index c62147a..e0391db 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -788,7 +788,9 @@ PreInit(ScrnInfoPtr pScrn, int flags) try_enable_glamor(pScrn); - if (!ms->glamor) { + if (ms->glamor) { + xf86LoadSubModule(pScrn, "dri2"); + } else { Bool prefer_shadow = TRUE; ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); @@ -1107,6 +1109,21 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) 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->glamor) { + if (!ms_dri2_screen_init(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to initialize the DRI2 extension.\n"); + } + } +#endif + return EnterVT(pScrn); } @@ -1172,6 +1189,14 @@ CloseScreen(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); +#ifdef GLAMOR + if (ms->glamor) { + ms_dri2_close_screen(pScreen); + } +#endif + + ms_vblank_close_screen(pScreen); + if (ms->damage) { DamageUnregister(ms->damage); DamageDestroy(ms->damage); diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 35f2419..9eda1c4 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "drmmode_display.h" @@ -42,6 +43,26 @@ typedef struct { 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; @@ -70,6 +91,8 @@ typedef struct _modesettingRec { drmmode_rec drmmode; + drmEventContext event_context; + DamagePtr damage; Bool dirty_enabled; @@ -78,3 +101,24 @@ typedef struct _modesettingRec { } 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); + +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); diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index d8d1b44..ef9009e 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -582,6 +582,17 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .shadow_create = drmmode_shadow_create, }; +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) { @@ -596,6 +607,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) 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; } @@ -1183,6 +1195,11 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocate new frame buffer %dx%d stride\n", width, height); + if (drmmode->triple_buffer_pixmap) { + screen->DestroyPixmap(drmmode->triple_buffer_pixmap); + drmmode->triple_buffer_pixmap = NULL; + } + old_width = scrn->virtualX; old_height = scrn->virtualY; old_pitch = drmmode->front_bo->pitch; diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index c7e7ef0..987608c 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -43,6 +43,7 @@ struct dumb_bo { typedef struct { int fd; unsigned fb_id; + unsigned old_fb_id; drmModeResPtr mode_res; drmModeFBPtr mode_fb; int cpp; @@ -58,17 +59,42 @@ typedef struct { 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; - int hw_id; + uint32_t vblank_pipe; struct dumb_bo *cursor_bo; unsigned rotate_fb_id; uint16_t lut_r[256], lut_g[256], lut_b[256]; DamagePtr slave_damage; + + /** + * @{ 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 { diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c new file mode 100644 index 0000000..1c495cc --- /dev/null +++ b/hw/xfree86/drivers/modesetting/vblank.c @@ -0,0 +1,383 @@ +/* + * 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 pageflip.c + * + * Support for tracking VBlank events, emitting requests for + * pageflips, and tracking the completion of pageflips. + */ + +#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); +} + +/* + * 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 (!crtc->enabled) + 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; + xf86CrtcPtr crtc; + + box.x1 = pDraw->x; + box.y1 = pDraw->y; + box.x2 = box.x1 + pDraw->width; + box.y2 = box.y1 + pDraw->height; + + crtc = ms_covering_crtc(pScrn, &box, NULL, &crtcbox); + + /* Make sure the CRTC is valid and this is the real front buffer */ + if (crtc != NULL && !crtc->rotatedData) + return crtc; + + return NULL; +} + +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; + + ms_get_crtc_ust_msc(crtc, &ust, &msc); + 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); + } +} + +/* + * 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); +} -- 2.1.1 From daniel at fooishbar.org Wed Oct 15 03:04:38 2014 From: daniel at fooishbar.org (Daniel Stone) Date: Wed, 15 Oct 2014 12:04:38 +0200 Subject: tile property contents In-Reply-To: <20141015082921.GD12807@ulmo> References: <20141014114011.GB5057@ulmo> <20141015082921.GD12807@ulmo> Message-ID: Hi, On 15 October 2014 10:29, Thierry Reding wrote: > Just for my understanding, is it typical for each of these panels to be > standalone (own housing, ...) or are there monitors that actually take > two connectors and each of them drives a different part of the same > panel? A quick search on the internet indicates that the former is more > common (I haven't actually been able to find an example of the latter). > You're in luck, because people are actually just that insane: http://www.anandtech.com/show/8496/dell-previews-27inch-5k-ultrasharp-monitor-5120x2880 Two separate DP1.2 connectors, each using MST, for a 2x2 tile. Cheers, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From thierry.reding at gmail.com Wed Oct 15 04:07:28 2014 From: thierry.reding at gmail.com (Thierry Reding) Date: Wed, 15 Oct 2014 13:07:28 +0200 Subject: tile property contents In-Reply-To: References: <20141014114011.GB5057@ulmo> <20141015082921.GD12807@ulmo> Message-ID: <20141015110726.GA12196@ulmo> On Wed, Oct 15, 2014 at 12:04:38PM +0200, Daniel Stone wrote: > Hi, > > On 15 October 2014 10:29, Thierry Reding wrote: > > > Just for my understanding, is it typical for each of these panels to be > > standalone (own housing, ...) or are there monitors that actually take > > two connectors and each of them drives a different part of the same > > panel? A quick search on the internet indicates that the former is more > > common (I haven't actually been able to find an example of the latter). > > > > You're in luck, because people are actually just that insane: > http://www.anandtech.com/show/8496/dell-previews-27inch-5k-ultrasharp-monitor-5120x2880 > > Two separate DP1.2 connectors, each using MST, for a 2x2 tile. Oh my... Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From mark.kettenis at xs4all.nl Wed Oct 15 13:07:55 2014 From: mark.kettenis at xs4all.nl (Mark Kettenis) Date: Wed, 15 Oct 2014 22:07:55 +0200 (CEST) Subject: [PATCH 2/4] xfree86: Remove implicit xf86EnableIO from BSD for PowerPC In-Reply-To: <1412782739-9960-3-git-send-email-ajax@redhat.com> (message from Adam Jackson on Wed, 8 Oct 2014 17:38:57 +0200) References: <1412782739-9960-1-git-send-email-ajax@redhat.com> <1412782739-9960-3-git-send-email-ajax@redhat.com> Message-ID: <201410152007.s9FK7tSk015424@glazunov.sibelius.xs4all.nl> > From: Adam Jackson > Date: Wed, 8 Oct 2014 17:38:57 +0200 > > This shouldn't be necessary, we're doing this already at the DDX level > when it's needed (and, more importantly, not when it's not). > > Signed-off-by: Adam Jackson Tested (in 1.16.1) on a PowerMac G4 with an r128 on OpenBSD. Although I think that on OpenBSD we actually avoid accessing VGA registers. Reviewed-by: Mark Kettenis > --- > hw/xfree86/os-support/bsd/ppc_video.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c > index b1cf7eb..f017376 100644 > --- a/hw/xfree86/os-support/bsd/ppc_video.c > +++ b/hw/xfree86/os-support/bsd/ppc_video.c > @@ -51,7 +51,6 @@ void > xf86OSInitVidMem(VidMemInfoPtr pVidMem) > { > pVidMem->initialised = TRUE; > - xf86EnableIO(); > } > > volatile unsigned char *ioBase = MAP_FAILED; > -- > 1.9.3 From mark.kettenis at xs4all.nl Wed Oct 15 13:11:12 2014 From: mark.kettenis at xs4all.nl (Mark Kettenis) Date: Wed, 15 Oct 2014 22:11:12 +0200 (CEST) Subject: [PATCH 1/4] xfree86: Remove no-op /dev/mem checks from xf86OSInitVidMem In-Reply-To: <1412782739-9960-2-git-send-email-ajax@redhat.com> (message from Adam Jackson on Wed, 8 Oct 2014 17:38:56 +0200) References: <1412782739-9960-1-git-send-email-ajax@redhat.com> <1412782739-9960-2-git-send-email-ajax@redhat.com> Message-ID: <201410152011.s9FKBBYG029803@glazunov.sibelius.xs4all.nl> > From: Adam Jackson > Date: Wed, 8 Oct 2014 17:38:56 +0200 > > pciaccess doesn't end up using the fd being inspected here, so there's > not really any point. We currently don't actually support "legacy" PCI video drivers on OpenBSD/alpha and OpenBSD/arm. We can add the necessary bits back if we ever add it back (which isn't all that likely). Reviewed-by: Mark Kettenis > Signed-off-by: Adam Jackson > --- > hw/xfree86/os-support/bsd/alpha_video.c | 122 -------------------------------- > hw/xfree86/os-support/bsd/arm_video.c | 52 -------------- > hw/xfree86/os-support/hurd/hurd_video.c | 4 -- > 3 files changed, 178 deletions(-) > > diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c > index 236def6..fd8f823 100644 > --- a/hw/xfree86/os-support/bsd/alpha_video.c > +++ b/hw/xfree86/os-support/bsd/alpha_video.c > @@ -45,131 +45,9 @@ > #define MAP_FLAGS (MAP_FILE | MAP_SHARED) > #endif > > -#ifndef __NetBSD__ > -extern unsigned long dense_base(void); > -#else /* __NetBSD__ */ > -static struct alpha_bus_window *abw; > -static int abw_count = -1; > - > -static void > -init_abw(void) > -{ > - if (abw_count < 0) { > - abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw); > - if (abw_count <= 0) > - FatalError("init_abw: alpha_bus_getwindows failed\n"); > - } > -} > - > -static unsigned long > -dense_base(void) > -{ > - if (abw_count < 0) > - init_abw(); > - > - /* XXX check abst_flags for ABST_DENSE just to be safe? */ > - xf86Msg(X_INFO, "dense base = %#lx\n", abw[0].abw_abst.abst_sys_start); /* XXXX */ > - return abw[0].abw_abst.abst_sys_start; > -} > - > -#endif /* __NetBSD__ */ > - > -#define BUS_BASE dense_base() > - > -/***************************************************************************/ > -/* Video Memory Mapping section */ > -/***************************************************************************/ > - > -#ifdef __OpenBSD__ > -#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ > - "\tin /etc/sysctl.conf and reboot your machine\n" \ > - "\trefer to xf86(4) for details" > -#endif > - > -static int devMemFd = -1; > - > -#ifdef HAS_APERTURE_DRV > -#define DEV_APERTURE "/dev/xf86" > -#endif > - > -/* > - * Check if /dev/mem can be mmap'd. If it can't print a warning when > - * "warn" is TRUE. > - */ > -static void > -checkDevMem(Bool warn) > -{ > - static Bool devMemChecked = FALSE; > - int fd; > - void *base; > - > - if (devMemChecked) > - return; > - devMemChecked = TRUE; > - > -#ifdef HAS_APERTURE_DRV > - /* Try the aperture driver first */ > - if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { > - /* Try to map a page at the VGA address */ > - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, > - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); > - > - if (base != MAP_FAILED) { > - munmap((caddr_t) base, 4096); > - devMemFd = fd; > - xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", > - DEV_APERTURE); > - return; > - } > - else { > - if (warn) { > - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", > - DEV_APERTURE, strerror(errno)); > - } > - } > - } > -#endif > - if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { > - /* Try to map a page at the VGA address */ > - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, > - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); > - > - if (base != MAP_FAILED) { > - munmap((caddr_t) base, 4096); > - devMemFd = fd; > - return; > - } > - else { > - if (warn) { > - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", > - DEV_MEM, strerror(errno)); > - } > - } > - } > - if (warn) { > -#ifndef HAS_APERTURE_DRV > - xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n", > - DEV_MEM, strerror(errno)); > -#else > -#ifndef __OpenBSD__ > - xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" > - "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); > -#else /* __OpenBSD__ */ > - xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" > - "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno), > - SYSCTL_MSG); > -#endif /* __OpenBSD__ */ > -#endif > - xf86ErrorF("\tlinear framebuffer access unavailable\n"); > - } > - return; > -} > - > void > xf86OSInitVidMem(VidMemInfoPtr pVidMem) > { > - checkDevMem(TRUE); > - > pVidMem->initialised = TRUE; > } > > diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c > index 3a639b8..fea8528 100644 > --- a/hw/xfree86/os-support/bsd/arm_video.c > +++ b/hw/xfree86/os-support/bsd/arm_video.c > @@ -72,61 +72,9 @@ > #define MAP_FLAGS (MAP_FILE | MAP_SHARED) > #endif > > -#define BUS_BASE 0L > -#define BUS_BASE_BWX 0L > - > -/***************************************************************************/ > -/* Video Memory Mapping section */ > -/***************************************************************************/ > - > -static int devMemFd = -1; > - > -/* > - * Check if /dev/mem can be mmap'd. If it can't print a warning when > - * "warn" is TRUE. > - */ > -static void > -checkDevMem(Bool warn) > -{ > - static Bool devMemChecked = FALSE; > - int fd; > - void *base; > - > - if (devMemChecked) > - return; > - devMemChecked = TRUE; > - > - if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { > - /* Try to map a page at the VGA address */ > - base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, > - MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); > - > - if (base != MAP_FAILED) { > - munmap((caddr_t) base, 4096); > - devMemFd = fd; > - return; > - } > - else { > - /* This should not happen */ > - if (warn) { > - xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n", > - DEV_MEM, strerror(errno)); > - } > - return; > - } > - } > - if (warn) { > - xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n", > - DEV_MEM, strerror(errno)); > - } > - return; > -} > - > void > xf86OSInitVidMem(VidMemInfoPtr pVidMem) > { > - checkDevMem(TRUE); > - > pVidMem->initialised = TRUE; > } > > diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c > index 2a96393..1e7d604 100644 > --- a/hw/xfree86/os-support/hurd/hurd_video.c > +++ b/hw/xfree86/os-support/hurd/hurd_video.c > @@ -40,10 +40,6 @@ > #include "xf86OSpriv.h" > > /************************************************************************** > - * Video Memory Mapping section > - ***************************************************************************/ > - > -/************************************************************************** > * I/O Permissions section > ***************************************************************************/ > > -- > 1.9.3 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > From prushik at gmail.com Thu Oct 16 00:25:29 2014 From: prushik at gmail.com (Philip Rushik) Date: Thu, 16 Oct 2014 03:25:29 -0400 Subject: displaying an image on a window Message-ID: Hi I am currently writing a small test program to communicate with the X server without using either xlib or xcb. The reason for this is that it is part of my ongoing experiment in programming without a libc standard C library, which both libraries require. I do see that the more code I write, the more it naturally begins to look like XCB. So far I have been successful in opening a connection to the server, completing the X11 handshake, creating a GC, creating a window, and mapping the window to the screen. However, I can not seem to convince the X server to display an image. The method I am attempting to use is to create a GC, create a window, map the window, and then use the put_image request with the drawable set to the ID of the created window. The network traffic looks good to me on wireshark, but no image displays on the window. Does put image work with a window ID as a drawable? From what I understand of the X protocol, I believe it should, is that correct? If not, what steps need to be taken in order to display an image on a window in the simplest possible manner? Thanks! --Philip From prushik at gmail.com Thu Oct 16 00:56:01 2014 From: prushik at gmail.com (Philip Rushik) Date: Thu, 16 Oct 2014 03:56:01 -0400 Subject: displaying an image on a window In-Reply-To: References: Message-ID: On Thu, Oct 16, 2014 at 3:25 AM, Philip Rushik wrote: > Hi > I am currently writing a small test program to communicate with the X > server without using either xlib or xcb. The reason for this is that > it is part of my ongoing experiment in programming without a libc > standard C library, which both libraries require. I do see that the > more code I write, the more it naturally begins to look like XCB. > So far I have been successful in opening a connection to the server, > completing the X11 handshake, creating a GC, creating a window, and > mapping the window to the screen. > However, I can not seem to convince the X server to display an image. > The method I am attempting to use is to create a GC, create a window, > map the window, and then use the put_image request with the drawable > set to the ID of the created window. > The network traffic looks good to me on wireshark, but no image > displays on the window. > > Does put image work with a window ID as a drawable? From what I > understand of the X protocol, I believe it should, is that correct? > If not, what steps need to be taken in order to display an image on a > window in the simplest possible manner? > > Thanks! > --Philip Upon further investigation, I see that the server does actually respond with an error message. Specifically a MATCH error, however, it claims that the offending ID is the GC, not the window. I create the GC with the root window as drawable and a foreground of 0x00aa00ff (purple). How should a GC be set up for use in put image requests? From chris at chris-wilson.co.uk Thu Oct 16 06:09:08 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Thu, 16 Oct 2014 14:09:08 +0100 Subject: [PATCH] Xext/shm: Detach SHM segment after Pixmap is released Message-ID: <1413464948-24828-1-git-send-email-chris@chris-wilson.co.uk> The GPU may still have a reference to the SHM segment which would only be finally released when the Pixmap is destroy. So we can only detach the SHM segment (and thereby making the memory unaccessible) after the backend has had a chance to flush any remaining references. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85058 Signed-off-by: Chris Wilson --- Xext/shm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Xext/shm.c b/Xext/shm.c index 4dad8b6..b787918 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -248,21 +248,20 @@ ShmDestroyPixmap(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); + void *shmdesc = NULL; Bool ret; - if (pPixmap->refcnt == 1) { - ShmDescPtr shmdesc; - - shmdesc = (ShmDescPtr) dixLookupPrivate(&pPixmap->devPrivates, - shmPixmapPrivateKey); - if (shmdesc) - ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id); - } + if (pPixmap->refcnt == 1) + shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey); pScreen->DestroyPixmap = screen_priv->destroyPixmap; ret = (*pScreen->DestroyPixmap) (pPixmap); screen_priv->destroyPixmap = pScreen->DestroyPixmap; pScreen->DestroyPixmap = ShmDestroyPixmap; + + if (shmdesc) + ShmDetachSegment(shmdesc, pPixmap->drawable.id); + return ret; } -- 1.9.1 From chris at chris-wilson.co.uk Thu Oct 16 08:22:14 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Thu, 16 Oct 2014 16:22:14 +0100 Subject: [PATCH] Xext/shm: Detach SHM segment after Pixmap is released In-Reply-To: <1413464948-24828-1-git-send-email-chris@chris-wilson.co.uk> References: <1413464948-24828-1-git-send-email-chris@chris-wilson.co.uk> Message-ID: <20141016152214.GC18808@nuc-i3427.alporthouse.com> On Thu, Oct 16, 2014 at 02:09:08PM +0100, Chris Wilson wrote: > The GPU may still have a reference to the SHM segment which would only > be finally released when the Pixmap is destroy. So we can only detach > the SHM segment (and thereby making the memory unaccessible) after the > backend has had a chance to flush any remaining references. Reported-and-tested-by: gedgon at gmail.com > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85058 > Signed-off-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre From pharris at opentext.com Thu Oct 16 08:30:03 2014 From: pharris at opentext.com (Peter Harris) Date: Thu, 16 Oct 2014 11:30:03 -0400 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. In-Reply-To: References: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> <5432A90F.40305@opentext.com> Message-ID: <543FE47B.20606@opentext.com> On 2014-10-14 12:41, Alex Orange wrote: > Please pardon my inexperience, is there any further action I need > to/should take to get this patch committed? If you CC'd Keith Packard on your initial email, then no. We just wait for Keith to get back into patch vacuuming mode, which usually happens every couple of weeks. If you did not CC Keith Packard on your initial email, you can append my Reviewed-by: line to the commit message and send the patch directly to Keith Packard to get it into his patch queue. Patches sometimes get accidentally missed, so it's appropriate to comment or re-send every couple of weeks. See also http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches/ Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 17 05:55:56 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Fri, 17 Oct 2014 09:55:56 -0300 Subject: What's the right way to call xcb_connect_to_display_with_auth_info() given a Xauthority file? Message-ID: When I try to establish a XCB connection to a given display stored in a string e.g. dpy, I know I can do it in two different ways: 1. Simply call xcb_connect(dpy, NULL), or 2. Set environment variable DISPLAY to the value of dpy and call xcb_connect(NULL, NULL). However, if my X server requires a Xauthority file, I can only establish a XCB connection if I set environment XAUTHORITY to Xauthority file path and then call xcb_connect(dpy, NULL). I would like to establish this connection without having to set environment variable XAUTHORITY. I know there's a funcion in XCB API called xcb_connect_to_display_with_auth_info() which receives a xcb_auth_info_t struct, but I have absolutely no idea of how to build this struct given a Xauthority file path. How could I do it? Thanks in advance! -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajax at nwnk.net Fri Oct 17 07:00:08 2014 From: ajax at nwnk.net (Adam Jackson) Date: Fri, 17 Oct 2014 10:00:08 -0400 Subject: [PATCH 1/2] Allocate enough room for both reset & flags attributes In-Reply-To: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> References: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <1413554408.17629.2.camel@dmt> On Thu, 2014-10-09 at 05:42 -0700, Alan Coopersmith wrote: > 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 - ajax From ajax at nwnk.net Fri Oct 17 07:17:07 2014 From: ajax at nwnk.net (Adam Jackson) Date: Fri, 17 Oct 2014 10:17:07 -0400 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: <1412932180-829-1-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> Message-ID: <1413555427.17629.8.camel@dmt> On Fri, 2014-10-10 at 11:09 +0200, Eric Anholt wrote: > +CHIPSET(0xA011, IGD_GM, "Intel(R) IGD") > +CHIPSET(0xA001, IGD_G, "Intel(R) IGD") Can we not? Pineview, right? Or "Atom D4xx/D5xx/N4xx/N5xx", or whatever, but "IGD" is worse than useless. > +CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") Does this really not have a better name? Can I hope that it simply never shipped outside of an SDV? - ajax From ajax at nwnk.net Fri Oct 17 07:21:37 2014 From: ajax at nwnk.net (Adam Jackson) Date: Fri, 17 Oct 2014 10:21:37 -0400 Subject: displaying an image on a window In-Reply-To: References: Message-ID: <1413555697.17629.10.camel@dmt> On Thu, 2014-10-16 at 03:56 -0400, Philip Rushik wrote: > Upon further investigation, I see that the server does actually > respond with an error message. Specifically a MATCH error, however, it > claims that the offending ID is the GC, not the window. I create the > GC with the root window as drawable and a foreground of 0x00aa00ff > (purple). > > How should a GC be set up for use in put image requests? I mean, you could always single-step through ProcPutImage to be sure, but. I suspect that what's actually going wrong for you is that the depth of the _image_ doesn't match that of the gc/drawable. - ajax From ajax at nwnk.net Fri Oct 17 07:23:39 2014 From: ajax at nwnk.net (Adam Jackson) Date: Fri, 17 Oct 2014 10:23:39 -0400 Subject: [PATCH] Xext/shm: Detach SHM segment after Pixmap is released In-Reply-To: <20141016152214.GC18808@nuc-i3427.alporthouse.com> References: <1413464948-24828-1-git-send-email-chris@chris-wilson.co.uk> <20141016152214.GC18808@nuc-i3427.alporthouse.com> Message-ID: <1413555819.17629.11.camel@dmt> On Thu, 2014-10-16 at 16:22 +0100, Chris Wilson wrote: > On Thu, Oct 16, 2014 at 02:09:08PM +0100, Chris Wilson wrote: > > The GPU may still have a reference to the SHM segment which would only > > be finally released when the Pixmap is destroy. So we can only detach > > the SHM segment (and thereby making the memory unaccessible) after the > > backend has had a chance to flush any remaining references. > > Reported-and-tested-by: gedgon at gmail.com Reviewed-by: Adam Jackson - ajax From psychon at znc.in Fri Oct 17 07:31:55 2014 From: psychon at znc.in (Uli Schlachter) Date: Fri, 17 Oct 2014 16:31:55 +0200 Subject: What's the right way to call xcb_connect_to_display_with_auth_info() given a Xauthority file? In-Reply-To: References: Message-ID: <5441285B.50309@znc.in> Hi, Am 17.10.2014 um 14:55 schrieb La?rcio de Sousa: [...] > I would like to establish this connection without having to set environment > variable XAUTHORITY. I know there's a funcion in XCB API called > xcb_connect_to_display_with_auth_info() which receives a > xcb_auth_info_t struct, > but I have absolutely no idea of how to build this struct given a > Xauthority file path. > > How could I do it? > Thanks in advance! [...] I never used this myself, but you could just look into xcb's source code to figure out how xcb_connect() gets its auth info. xcb_connect() just calls xcb_connect_with_auth_info() with NULL for the auth information. This function then uses _xcb_get_auth_info() to get the xcb_auth_info_t structure: http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_util.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n521 The function _xcb_get_auth_info() does some dances to get a Xauth*, then copies some information from it into the xcb_auth_info_t and calls compute_auth(): http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_auth.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n344 This function mostly shuffles some bytes around (does anyone use XDM AUTH?, I guess the AUTH_MC1 case should suffice for 90% of people): http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_auth.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n187 Since you just have a Xauthority file path, you could use XauReadAuth() to read the FILE*. That gives you an Xauth* structure which you can hopefully use in the same way that libxcb uses it. Cheers, Uli -- "Are you preparing for another war, Plutarch?" I ask. "Oh, not now. Now we're in that sweet period where everyone agrees that our recent horrors should never be repeated," he says. "But collective thinking is usually short-lived. We're fickle, stupid beings with poor memories and a great gift for self-destruction. From eric at anholt.net Fri Oct 17 09:08:48 2014 From: eric at anholt.net (Eric Anholt) Date: Fri, 17 Oct 2014 17:08:48 +0100 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: <1413555427.17629.8.camel@dmt> References: <1412932180-829-1-git-send-email-eric@anholt.net> <1413555427.17629.8.camel@dmt> Message-ID: <87fvemllv3.fsf@eliezer.anholt.net> Adam Jackson writes: > On Fri, 2014-10-10 at 11:09 +0200, Eric Anholt wrote: > >> +CHIPSET(0xA011, IGD_GM, "Intel(R) IGD") >> +CHIPSET(0xA001, IGD_G, "Intel(R) IGD") > > Can we not? Pineview, right? Or "Atom D4xx/D5xx/N4xx/N5xx", or > whatever, but "IGD" is worse than useless. > >> +CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") > > Does this really not have a better name? Can I hope that it simply > never shipped outside of an SDV? Note that inside the X Server, these names aren't being used -- it's only in Mesa. Keeping the files unmodified from Mesa means easier syncing in the future, though. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From alexdeucher at gmail.com Fri Oct 17 09:55:28 2014 From: alexdeucher at gmail.com (Alex Deucher) Date: Fri, 17 Oct 2014 12:55:28 -0400 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: <87fvemllv3.fsf@eliezer.anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> <1413555427.17629.8.camel@dmt> <87fvemllv3.fsf@eliezer.anholt.net> Message-ID: On Fri, Oct 17, 2014 at 12:08 PM, Eric Anholt wrote: > Adam Jackson writes: > >> On Fri, 2014-10-10 at 11:09 +0200, Eric Anholt wrote: >> >>> +CHIPSET(0xA011, IGD_GM, "Intel(R) IGD") >>> +CHIPSET(0xA001, IGD_G, "Intel(R) IGD") >> >> Can we not? Pineview, right? Or "Atom D4xx/D5xx/N4xx/N5xx", or >> whatever, but "IGD" is worse than useless. >> >>> +CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") >> >> Does this really not have a better name? Can I hope that it simply >> never shipped outside of an SDV? > > Note that inside the X Server, these names aren't being used -- it's > only in Mesa. Keeping the files unmodified from Mesa means easier > syncing in the future, though. Maybe we can store these in a separate pacakge that can be shared between multiple components? These are already duplicated in libdrm_*, mesa, ddx, etc. and now the xserver. Alex From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 17 10:39:14 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Fri, 17 Oct 2014 14:39:14 -0300 Subject: What's the right way to call xcb_connect_to_display_with_auth_info() given a Xauthority file? In-Reply-To: <5441285B.50309@znc.in> References: <5441285B.50309@znc.in> Message-ID: Hmm... I've got it! Based on your feedback, I've written a small patch for xcb_{util,auth}.c introducing a new function xcb_connect_with_auth_file(). I'll submit it to Xcb mailing list. Thank you very much! 2014-10-17 11:31 GMT-03:00 Uli Schlachter : > Hi, > > Am 17.10.2014 um 14:55 schrieb La?rcio de Sousa: > [...] > > I would like to establish this connection without having to set > environment > > variable XAUTHORITY. I know there's a funcion in XCB API called > > xcb_connect_to_display_with_auth_info() which receives a > > xcb_auth_info_t struct, > > but I have absolutely no idea of how to build this struct given a > > Xauthority file path. > > > > How could I do it? > > Thanks in advance! > [...] > > I never used this myself, but you could just look into xcb's source code to > figure out how xcb_connect() gets its auth info. > > xcb_connect() just calls xcb_connect_with_auth_info() with NULL for the > auth > information. This function then uses _xcb_get_auth_info() to get the > xcb_auth_info_t structure: > > > http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_util.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n521 > > The function _xcb_get_auth_info() does some dances to get a Xauth*, then > copies > some information from it into the xcb_auth_info_t and calls compute_auth(): > > > http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_auth.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n344 > > This function mostly shuffles some bytes around (does anyone use XDM > AUTH?, I > guess the AUTH_MC1 case should suffice for 90% of people): > > > http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcb_auth.c?id=382d306d6c44a9ece5551c210a932773b5cb94a5#n187 > > Since you just have a Xauthority file path, you could use XauReadAuth() to > read > the FILE*. That gives you an Xauth* structure which you can hopefully use > in the > same way that libxcb uses it. > > Cheers, > Uli > -- > "Are you preparing for another war, Plutarch?" I ask. > "Oh, not now. Now we're in that sweet period where everyone agrees that our > recent horrors should never be repeated," he says. "But collective > thinking is > usually short-lived. We're fickle, stupid beings with poor memories and a > great > gift for self-destruction. > -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 17 11:39:17 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Fri, 17 Oct 2014 15:39:17 -0300 Subject: Translating XkbApplyMappingChange() et al. to xcb-xkb Message-ID: Hi there! I'm currently working on a full XCB backend for xf86-video-nested driver. I'm able to translate all Xlib-related code in file xlibclient.c to XCB, except some Xkb related parts which force me to maintain a minimal XCB-Xlib mix. I would like to translate some Xkb functions used in xf86-video-nested to xcb-xkb in order to get rid of Xlib stuff, namely: XkbGetKeyboard() XkbGetControls() XkbApplyMappingChange() XkbDDXChangeControls() XkbCopyDeviceKeymap() Is it currently possible to translate these functions to xcb-xkb? The relevant files in which these functions appear are the following: http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ran234 at gmail.com Fri Oct 17 12:41:22 2014 From: ran234 at gmail.com (Ran Benita) Date: Fri, 17 Oct 2014 22:41:22 +0300 Subject: Translating XkbApplyMappingChange() et al. to xcb-xkb In-Reply-To: References: Message-ID: <20141017194122.GA13757@ran> On Fri, Oct 17, 2014 at 03:39:17PM -0300, La?rcio de Sousa wrote: > Hi there! > > I'm currently working on a full XCB backend for xf86-video-nested driver. > I'm able to translate all Xlib-related code in file xlibclient.c to XCB, > except some Xkb related parts which force me to maintain a minimal XCB-Xlib > mix. I am sorry, I am not familiar with this code, but I can offer some pointers. > I would like to translate some Xkb functions used in xf86-video-nested to > xcb-xkb in order to get rid of Xlib stuff, namely: > > XkbGetKeyboard() > > XkbGetControls() You can do the equivalent of these calls using xcb-xkb. From my quick read it appears you use these calls to fill up the server's XKB data structures. I have done something similar, but instead filling somewhat equivalent structures in the libxkbcommon library (mostly like the XkbGetKeyboard function; we don't need most XKB controls. But the call is there). It's a lot of work, but maybe it can help: https://github.com/xkbcommon/libxkbcommon/blob/master/src/x11/keymap.c Note that XkbGetKeyboard translates to many protocol requests. > XkbApplyMappingChange() > > XkbDDXChangeControls() > > XkbCopyDeviceKeymap() These are internal server functions/API, no xlib ones. So I imagine you can keep them? Ran > Is it currently possible to translate these functions to xcb-xkb? The > relevant files in which these functions appear are the following: > > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c > -- > *La?rcio de Sousa* > *Orientador de Inform?tica* > *Escola Municipal "Professor Eul?lio Gruppi"* > *Rua Ismael da Silva Mello, 559, Mogi Moderno* > *Mogi das Cruzes - SPCEP 08717-390* > Telefone: (11) 4726-8313 > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From prushik at gmail.com Fri Oct 17 20:59:24 2014 From: prushik at gmail.com (Philip Rushik) Date: Fri, 17 Oct 2014 23:59:24 -0400 Subject: displaying an image on a window In-Reply-To: <1413555697.17629.10.camel@dmt> References: <1413555697.17629.10.camel@dmt> Message-ID: On Oct 17, 2014 10:21 AM, "Adam Jackson" wrote: > On Thu, 2014-10-16 at 03:56 -0400, Philip Rushik wrote: > > > Upon further investigation, I see that the server does actually > > respond with an error message. Specifically a MATCH error, however, it > > claims that the offending ID is the GC, not the window. I create the > > GC with the root window as drawable and a foreground of 0x00aa00ff > > (purple). > > > > How should a GC be set up for use in put image requests? > > I mean, you could always single-step through ProcPutImage to be sure, > but. I suspect that what's actually going wrong for you is that the > depth of the _image_ doesn't match that of the gc/drawable. > > - ajax > > Yes, you were correct, I had set the depth to one that didn't match the GC. Totally my fault. I can now display images correctly. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From basteon at gmail.com Fri Oct 17 22:51:18 2014 From: basteon at gmail.com (basteon) Date: Sat, 18 Oct 2014 05:51:18 +0000 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> Message-ID: hello, I made dmesg output from ssh connected from another host. here what modprobe -a radeon tells: [ 453.397377] [drm] Initialized drm 1.1.0 20060810 [ 453.493254] [drm] radeon defaulting to kernel modesetting. [ 453.493260] [drm] radeon kernel modesetting enabled. [ 453.493330] radeon 0000:00:01.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18 [ 453.493338] radeon 0000:00:01.0: setting latency timer to 64 [ 453.502985] [drm] initializing kernel modesetting (PALM 0x1002:0x9802). [ 453.503098] [drm] register mmio base: 0xFE000000 [ 453.503101] [drm] register mmio size: 262144 [ 453.503354] ATOM BIOS: AMD [ 453.503408] radeon 0000:00:01.0: VRAM: 384M 0x0000000000000000 - 0x0000000017FFFFFF (384M used) [ 453.503413] radeon 0000:00:01.0: GTT: 512M 0x0000000018000000 - 0x0000000037FFFFFF [ 453.503591] [drm] Detected VRAM RAM=384M, BAR=256M [ 453.503598] [drm] RAM width 16bits DDR [ 453.503786] [TTM] Zone kernel: Available graphics memory: 820394 kiB. [ 453.503797] [TTM] Initializing pool allocator. [ 453.503855] [drm] radeon: 384M of VRAM memory ready [ 453.503863] [drm] radeon: 512M of GTT memory ready. [ 453.503915] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). [ 453.503922] [drm] Driver supports precise vblank timestamp query. [ 453.504002] radeon 0000:00:01.0: irq 41 for MSI/MSI-X [ 453.504015] radeon 0000:00:01.0: radeon: using MSI. [ 453.504079] [drm] radeon: irq initialized. [ 453.504090] [drm] GART: num cpu pages 131072, num gpu pages 131072 [ 453.506960] [drm] Loading PALM Microcode [ 453.518644] r600_cp: Failed to load firmware "radeon/PALM_pfp.bin" [ 453.518717] [drm:evergreen_startup] *ERROR* Failed to load firmware! [ 453.518760] radeon 0000:00:01.0: disabling GPU acceleration [ 453.519866] radeon 0000:00:01.0: ffff88001cf0f800 unpin not necessary [ 453.519909] radeon 0000:00:01.0: ffff88001cf0f800 unpin not necessary [ 453.546855] [drm] Radeon Display Connectors [ 453.546861] [drm] Connector 0: [ 453.546864] [drm] HDMI-A [ 453.546867] [drm] HPD2 [ 453.546872] [drm] DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 0x644c 0x644c [ 453.546875] [drm] Encoders: [ 453.546878] [drm] DFP1: INTERNAL_UNIPHY [ 453.546882] [drm] Connector 1: [ 453.546884] [drm] VGA [ 453.546888] [drm] DDC: 0x64d8 0x64d8 0x64dc 0x64dc 0x64e0 0x64e0 0x64e4 0x64e4 [ 453.546891] [drm] Encoders: [ 453.546894] [drm] CRT1: INTERNAL_KLDSCP_DAC1 [ 453.602928] [drm] Internal thermal controller without fan control [ 453.603181] [drm] radeon: power management initialized [ 453.676637] [drm] fb mappable at 0xC0040000 [ 453.676640] [drm] vram apper at 0xC0000000 [ 453.676651] [drm] size 14745600 [ 453.676654] [drm] fb depth is 24 [ 453.676656] [drm] pitch is 10240 [ 453.676896] fb0: radeondrmfb frame buffer device [ 453.676899] drm: registered panic notifier [ 453.676909] [drm] Initialized radeon 2.8.0 20080528 for 0000:00:01.0 on minor 0 On 10/13/14, Michal Suchanek wrote: > Hello, > > On 13 October 2014 11:37, basteon wrote: >> hello, >> I use 2.3.3 vesa xorg driver. >> But with radeon kernel driver I got black screen and nothing more. >> Just after I make modprobe -av radeon >> I use GIGABYTE GA-E350N board with AMD Radeon HD 6310. > > Can you connect over SSH or serial console and collect the kernel > messages after you insert the radeon module? > > The onboard 6310 card should work except it's hell slow. I used to run > a system with one some years ago. > > What connection do you use to connect the display? Some connections > may not be able to use full resolution. Can you try using fbset or > xrandr to switch to lower resolution once the module is inserted? > > Thanks > > Michal > From basteon at gmail.com Fri Oct 17 23:26:13 2014 From: basteon at gmail.com (basteon) Date: Sat, 18 Oct 2014 06:26:13 +0000 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> Message-ID: And after I load the firmware, I got this. And anyway black screen. [ 208.761365] [drm] Initialized drm 1.1.0 20060810 [ 208.858346] [drm] radeon defaulting to kernel modesetting. [ 208.858352] [drm] radeon kernel modesetting enabled. [ 208.858423] radeon 0000:00:01.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18 [ 208.858431] radeon 0000:00:01.0: setting latency timer to 64 [ 208.867813] [drm] initializing kernel modesetting (PALM 0x1002:0x9802). [ 208.867907] [drm] register mmio base: 0xFE000000 [ 208.867910] [drm] register mmio size: 262144 [ 208.868214] ATOM BIOS: AMD [ 208.868265] radeon 0000:00:01.0: VRAM: 384M 0x0000000000000000 - 0x0000000017FFFFFF (384M used) [ 208.868271] radeon 0000:00:01.0: GTT: 512M 0x0000000018000000 - 0x0000000037FFFFFF [ 208.868446] [drm] Detected VRAM RAM=384M, BAR=256M [ 208.868453] [drm] RAM width 16bits DDR [ 208.868865] [TTM] Zone kernel: Available graphics memory: 820394 kiB. [ 208.868876] [TTM] Initializing pool allocator. [ 208.868938] [drm] radeon: 384M of VRAM memory ready [ 208.868988] [drm] radeon: 512M of GTT memory ready. [ 208.869047] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). [ 208.869054] [drm] Driver supports precise vblank timestamp query. [ 208.869131] radeon 0000:00:01.0: irq 40 for MSI/MSI-X [ 208.869145] radeon 0000:00:01.0: radeon: using MSI. [ 208.869210] [drm] radeon: irq initialized. [ 208.869220] [drm] GART: num cpu pages 131072, num gpu pages 131072 [ 208.873133] [drm] Loading PALM Microcode [ 208.905519] radeon 0000:00:01.0: WB enabled [ 208.922151] [drm] ring test succeeded in 1 usecs [ 208.922326] [drm] radeon: ib pool ready. [ 208.922445] [drm] ib test succeeded in 0 usecs [ 208.953333] [drm] Radeon Display Connectors [ 208.953339] [drm] Connector 0: [ 208.953342] [drm] HDMI-A [ 208.953345] [drm] HPD2 [ 208.953349] [drm] DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 0x644c 0x644c [ 208.953353] [drm] Encoders: [ 208.953356] [drm] DFP1: INTERNAL_UNIPHY [ 208.953359] [drm] Connector 1: [ 208.953362] [drm] VGA [ 208.953366] [drm] DDC: 0x64d8 0x64d8 0x64dc 0x64dc 0x64e0 0x64e0 0x64e4 0x64e4 [ 208.953369] [drm] Encoders: [ 208.953371] [drm] CRT1: INTERNAL_KLDSCP_DAC1 [ 209.009294] [drm] Internal thermal controller without fan control [ 209.009542] [drm] radeon: power management initialized [ 209.090148] [drm] fb mappable at 0xC0141000 [ 209.090152] [drm] vram apper at 0xC0000000 [ 209.090155] [drm] size 14745600 [ 209.090157] [drm] fb depth is 24 [ 209.090160] [drm] pitch is 10240 [ 209.090416] fb0: radeondrmfb frame buffer device [ 209.090419] drm: registered panic notifier [ 209.090429] [drm] Initialized radeon 2.8.0 20080528 for 0000:00:01.0 on minor 0 On 10/18/14, basteon wrote: > hello, > I made dmesg output from ssh connected from another host. > here what modprobe -a radeon tells: > [ 453.397377] [drm] Initialized drm 1.1.0 20060810 > [ 453.493254] [drm] radeon defaulting to kernel modesetting. > [ 453.493260] [drm] radeon kernel modesetting enabled. > [ 453.493330] radeon 0000:00:01.0: PCI INT A -> GSI 18 (level, low) -> IRQ > 18 > [ 453.493338] radeon 0000:00:01.0: setting latency timer to 64 > [ 453.502985] [drm] initializing kernel modesetting (PALM 0x1002:0x9802). > [ 453.503098] [drm] register mmio base: 0xFE000000 > [ 453.503101] [drm] register mmio size: 262144 > [ 453.503354] ATOM BIOS: AMD > [ 453.503408] radeon 0000:00:01.0: VRAM: 384M 0x0000000000000000 - > 0x0000000017FFFFFF (384M used) > [ 453.503413] radeon 0000:00:01.0: GTT: 512M 0x0000000018000000 - > 0x0000000037FFFFFF > [ 453.503591] [drm] Detected VRAM RAM=384M, BAR=256M > [ 453.503598] [drm] RAM width 16bits DDR > [ 453.503786] [TTM] Zone kernel: Available graphics memory: 820394 kiB. > [ 453.503797] [TTM] Initializing pool allocator. > [ 453.503855] [drm] radeon: 384M of VRAM memory ready > [ 453.503863] [drm] radeon: 512M of GTT memory ready. > [ 453.503915] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). > [ 453.503922] [drm] Driver supports precise vblank timestamp query. > [ 453.504002] radeon 0000:00:01.0: irq 41 for MSI/MSI-X > [ 453.504015] radeon 0000:00:01.0: radeon: using MSI. > [ 453.504079] [drm] radeon: irq initialized. > [ 453.504090] [drm] GART: num cpu pages 131072, num gpu pages 131072 > [ 453.506960] [drm] Loading PALM Microcode > [ 453.518644] r600_cp: Failed to load firmware "radeon/PALM_pfp.bin" > [ 453.518717] [drm:evergreen_startup] *ERROR* Failed to load firmware! > [ 453.518760] radeon 0000:00:01.0: disabling GPU acceleration > [ 453.519866] radeon 0000:00:01.0: ffff88001cf0f800 unpin not necessary > [ 453.519909] radeon 0000:00:01.0: ffff88001cf0f800 unpin not necessary > [ 453.546855] [drm] Radeon Display Connectors > [ 453.546861] [drm] Connector 0: > [ 453.546864] [drm] HDMI-A > [ 453.546867] [drm] HPD2 > [ 453.546872] [drm] DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 > 0x644c 0x644c > [ 453.546875] [drm] Encoders: > [ 453.546878] [drm] DFP1: INTERNAL_UNIPHY > [ 453.546882] [drm] Connector 1: > [ 453.546884] [drm] VGA > [ 453.546888] [drm] DDC: 0x64d8 0x64d8 0x64dc 0x64dc 0x64e0 0x64e0 > 0x64e4 0x64e4 > [ 453.546891] [drm] Encoders: > [ 453.546894] [drm] CRT1: INTERNAL_KLDSCP_DAC1 > [ 453.602928] [drm] Internal thermal controller without fan control > [ 453.603181] [drm] radeon: power management initialized > [ 453.676637] [drm] fb mappable at 0xC0040000 > [ 453.676640] [drm] vram apper at 0xC0000000 > [ 453.676651] [drm] size 14745600 > [ 453.676654] [drm] fb depth is 24 > [ 453.676656] [drm] pitch is 10240 > [ 453.676896] fb0: radeondrmfb frame buffer device > [ 453.676899] drm: registered panic notifier > [ 453.676909] [drm] Initialized radeon 2.8.0 20080528 for > 0000:00:01.0 on minor 0 > > > On 10/13/14, Michal Suchanek wrote: >> Hello, >> >> On 13 October 2014 11:37, basteon wrote: >>> hello, >>> I use 2.3.3 vesa xorg driver. >>> But with radeon kernel driver I got black screen and nothing more. >>> Just after I make modprobe -av radeon >>> I use GIGABYTE GA-E350N board with AMD Radeon HD 6310. >> >> Can you connect over SSH or serial console and collect the kernel >> messages after you insert the radeon module? >> >> The onboard 6310 card should work except it's hell slow. I used to run >> a system with one some years ago. >> >> What connection do you use to connect the display? Some connections >> may not be able to use full resolution. Can you try using fbset or >> xrandr to switch to lower resolution once the module is inserted? >> >> Thanks >> >> Michal >> > From hramrach at gmail.com Sat Oct 18 01:48:42 2014 From: hramrach at gmail.com (Michal Suchanek) Date: Sat, 18 Oct 2014 10:48:42 +0200 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> Message-ID: On 18 October 2014 08:26, basteon wrote: > On 10/18/14, basteon wrote: >> On 10/13/14, Michal Suchanek wrote: >>> Hello, >>> >>> On 13 October 2014 11:37, basteon wrote: >>>> hello, >>>> I use 2.3.3 vesa xorg driver. >>>> But with radeon kernel driver I got black screen and nothing more. >>>> Just after I make modprobe -av radeon >>>> I use GIGABYTE GA-E350N board with AMD Radeon HD 6310. >>> >>> Can you connect over SSH or serial console and collect the kernel >>> messages after you insert the radeon module? >>> >>> The onboard 6310 card should work except it's hell slow. I used to run >>> a system with one some years ago. >>> >>> What connection do you use to connect the display? Some connections >>> may not be able to use full resolution. Can you try using fbset or >>> xrandr to switch to lower resolution once the module is inserted? >>> >> [ 453.506960] [drm] Loading PALM Microcode >> [ 453.518644] r600_cp: Failed to load firmware "radeon/PALM_pfp.bin" >> [ 453.518717] [drm:evergreen_startup] *ERROR* Failed to load firmware! Yes, the graphics is not expected to work correctly without a firmware. That's a severe defect of the Radeon driver since the firmware is apparently buggy and/or the interface is not well understood and it fails miserably under some circumstances. It should however bring up a card correctly when it is in VGA text mode which is what the BIOS sets up on boot. > And after I load the firmware, I got this. > And anyway black screen. > [ 208.761365] [drm] Initialized drm 1.1.0 20060810 > [ 208.858346] [drm] radeon defaulting to kernel modesetting. > [ 208.858352] [drm] radeon kernel modesetting enabled. > [ 208.858423] radeon 0000:00:01.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18 > [ 208.858431] radeon 0000:00:01.0: setting latency timer to 64 > [ 208.867813] [drm] initializing kernel modesetting (PALM 0x1002:0x9802). > [ 208.867907] [drm] register mmio base: 0xFE000000 > [ 208.867910] [drm] register mmio size: 262144 > [ 208.868214] ATOM BIOS: AMD > [ 208.868265] radeon 0000:00:01.0: VRAM: 384M 0x0000000000000000 - > 0x0000000017FFFFFF (384M used) > [ 208.868271] radeon 0000:00:01.0: GTT: 512M 0x0000000018000000 - > 0x0000000037FFFFFF > [ 208.868446] [drm] Detected VRAM RAM=384M, BAR=256M > [ 208.868453] [drm] RAM width 16bits DDR > [ 208.868865] [TTM] Zone kernel: Available graphics memory: 820394 kiB. > [ 208.868876] [TTM] Initializing pool allocator. > [ 208.868938] [drm] radeon: 384M of VRAM memory ready > [ 208.868988] [drm] radeon: 512M of GTT memory ready. > [ 208.869047] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). > [ 208.869054] [drm] Driver supports precise vblank timestamp query. > [ 208.869131] radeon 0000:00:01.0: irq 40 for MSI/MSI-X > [ 208.869145] radeon 0000:00:01.0: radeon: using MSI. > [ 208.869210] [drm] radeon: irq initialized. > [ 208.869220] [drm] GART: num cpu pages 131072, num gpu pages 131072 > [ 208.873133] [drm] Loading PALM Microcode > [ 208.905519] radeon 0000:00:01.0: WB enabled > [ 208.922151] [drm] ring test succeeded in 1 usecs > [ 208.922326] [drm] radeon: ib pool ready. > [ 208.922445] [drm] ib test succeeded in 0 usecs > [ 208.953333] [drm] Radeon Display Connectors > [ 208.953339] [drm] Connector 0: > [ 208.953342] [drm] HDMI-A > [ 208.953345] [drm] HPD2 > [ 208.953349] [drm] DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 > 0x644c 0x644c > [ 208.953353] [drm] Encoders: > [ 208.953356] [drm] DFP1: INTERNAL_UNIPHY > [ 208.953359] [drm] Connector 1: > [ 208.953362] [drm] VGA > [ 208.953366] [drm] DDC: 0x64d8 0x64d8 0x64dc 0x64dc 0x64e0 0x64e0 > 0x64e4 0x64e4 > [ 208.953369] [drm] Encoders: > [ 208.953371] [drm] CRT1: INTERNAL_KLDSCP_DAC1 > [ 209.009294] [drm] Internal thermal controller without fan control > [ 209.009542] [drm] radeon: power management initialized > [ 209.090148] [drm] fb mappable at 0xC0141000 > [ 209.090152] [drm] vram apper at 0xC0000000 > [ 209.090155] [drm] size 14745600 > [ 209.090157] [drm] fb depth is 24 > [ 209.090160] [drm] pitch is 10240 This appears correct for a 2560 mode. The framebuffer should take up about 15M so even with as little as 384M graphics memory even triple buffering of the framebuffer should not pose a problem. Did you try setting the resolution lower in case the transmitter you are using cannot handle a mode this large? Thanks Michal From mat.jonczyk at o2.pl Sat Oct 18 06:49:42 2014 From: mat.jonczyk at o2.pl (=?UTF-8?B?TWF0ZXVzeiBKb8WEY3p5aw==?=) Date: Sat, 18 Oct 2014 15:49:42 +0200 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> Message-ID: <54426FF6.9030300@o2.pl> W dniu 18.10.2014 o 10:48, Michal Suchanek pisze: > Yes, the graphics is not expected to work correctly without a firmware. > > That's a severe defect of the Radeon driver since the firmware is > apparently buggy and/or the interface is not well understood and it > fails miserably under some circumstances. It should however bring up a > card correctly when it is in VGA text mode which is what the BIOS sets > up on boot. > AFAIK the best way to discuss this problem is on Bugzilla. Have You filed a bug there or found an existing one? Greetings, Mateusz From hramrach at gmail.com Sat Oct 18 07:41:26 2014 From: hramrach at gmail.com (Michal Suchanek) Date: Sat, 18 Oct 2014 16:41:26 +0200 Subject: vesa and 2560x1440 In-Reply-To: <54426FF6.9030300@o2.pl> References: <1413121400.11177.4.camel@dmt> <54426FF6.9030300@o2.pl> Message-ID: On 18 October 2014 15:49, Mateusz Jo?czyk wrote: > W dniu 18.10.2014 o 10:48, Michal Suchanek pisze: >> Yes, the graphics is not expected to work correctly without a firmware. >> >> That's a severe defect of the Radeon driver since the firmware is >> apparently buggy and/or the interface is not well understood and it >> fails miserably under some circumstances. It should however bring up a >> card correctly when it is in VGA text mode which is what the BIOS sets >> up on boot. >> > AFAIK the best way to discuss this problem is on Bugzilla. Have You filed a bug > there or found an existing one? Yes, years ago. Also discussed with the developers on IRC. I was told that it works and I am just unlucky if it does not work for me. So unlucky that 10 out of 10 cards fail. Also Debian is so unlucky that they had to implement a hack in initramfs to run exclusively in text mode way longer than convenient. Thanks Michal From basteon at gmail.com Sat Oct 18 20:49:15 2014 From: basteon at gmail.com (basteon) Date: Sun, 19 Oct 2014 03:49:15 +0000 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> <54426FF6.9030300@o2.pl> Message-ID: Bu I don't use /dev/fb0 when I do load my system. i.e. in initramfs I ddin't load radeon drivers. >Did you try setting the resolution lower in case the transmitter you >are using cannot handle a mode this large? where I should setting this? When I loads radeon driver I've disabled Xorg at all. On 10/18/14, Michal Suchanek wrote: > On 18 October 2014 15:49, Mateusz Jo?czyk wrote: >> W dniu 18.10.2014 o 10:48, Michal Suchanek pisze: >>> Yes, the graphics is not expected to work correctly without a firmware. >>> >>> That's a severe defect of the Radeon driver since the firmware is >>> apparently buggy and/or the interface is not well understood and it >>> fails miserably under some circumstances. It should however bring up a >>> card correctly when it is in VGA text mode which is what the BIOS sets >>> up on boot. >>> >> AFAIK the best way to discuss this problem is on Bugzilla. Have You filed >> a bug >> there or found an existing one? > > Yes, years ago. > > Also discussed with the developers on IRC. > > I was told that it works and I am just unlucky if it does not work for > me. So unlucky that 10 out of 10 cards fail. > > Also Debian is so unlucky that they had to implement a hack in > initramfs to run exclusively in text mode way longer than convenient. > > Thanks > > Michal > From matthieu at herrb.eu Sun Oct 19 02:22:06 2014 From: matthieu at herrb.eu (Matthieu Herrb) Date: Sun, 19 Oct 2014 11:22:06 +0200 Subject: [PATCH xcompmgr] man: note that -n is the default mode. Message-ID: <1413710526-32050-1-git-send-email-matthieu@herrb.eu> Signed-off-by: Matthieu Herrb --- xcompmgr.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git xcompmgr.1 xcompmgr.1 index a571541..523f60b 100644 --- xcompmgr.1 +++ xcompmgr.1 @@ -48,7 +48,7 @@ When \-c is specified, enables a smooth fade effect for transient windows like menus, and for all windows on hide and restore events. .TP .BI \-n -Simple client-side compositing. +Simple client-side compositing. This is the default mode. .TP .BI \-s Server-side compositing with hard-edged shadows. -- 1.9.3 From hramrach at gmail.com Sun Oct 19 03:41:12 2014 From: hramrach at gmail.com (Michal Suchanek) Date: Sun, 19 Oct 2014 12:41:12 +0200 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> <54426FF6.9030300@o2.pl> Message-ID: On 19 October 2014 05:49, basteon wrote: > Bu I don't use /dev/fb0 when I do load my system. > i.e. in initramfs I ddin't load radeon drivers. > >>Did you try setting the resolution lower in case the transmitter you >>are using cannot handle a mode this large? > where I should setting this? > When I loads radeon driver I've disabled Xorg at all. On 18 October 2014 07:51, basteon wrote: > hello, > I made dmesg output from ssh connected from another host. > ... > On 10/13/14, Michal Suchanek wrote: >> Hello, >> ... >> What connection do you use to connect the display? Some connections >> may not be able to use full resolution. Can you try using fbset or >> xrandr to switch to lower resolution once the module is inserted? From eric at anholt.net Sun Oct 19 13:01:14 2014 From: eric at anholt.net (Eric Anholt) Date: Sun, 19 Oct 2014 21:01:14 +0100 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: References: <1412932180-829-1-git-send-email-eric@anholt.net> <1413555427.17629.8.camel@dmt> <87fvemllv3.fsf@eliezer.anholt.net> Message-ID: <874muzbzhx.fsf@eliezer.anholt.net> Alex Deucher writes: > On Fri, Oct 17, 2014 at 12:08 PM, Eric Anholt wrote: >> Adam Jackson writes: >> >>> On Fri, 2014-10-10 at 11:09 +0200, Eric Anholt wrote: >>> >>>> +CHIPSET(0xA011, IGD_GM, "Intel(R) IGD") >>>> +CHIPSET(0xA001, IGD_G, "Intel(R) IGD") >>> >>> Can we not? Pineview, right? Or "Atom D4xx/D5xx/N4xx/N5xx", or >>> whatever, but "IGD" is worse than useless. >>> >>>> +CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device") >>> >>> Does this really not have a better name? Can I hope that it simply >>> never shipped outside of an SDV? >> >> Note that inside the X Server, these names aren't being used -- it's >> only in Mesa. Keeping the files unmodified from Mesa means easier >> syncing in the future, though. > > Maybe we can store these in a separate pacakge that can be shared > between multiple components? These are already duplicated in > libdrm_*, mesa, ddx, etc. and now the xserver. If I was putting effort into reducing PCI ID propagation, I'd be working on getting GLX to sit on top of EGL instead of rolling its own loader. I think ajax had stuff for this at one point? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From keithp at keithp.com Sun Oct 19 17:40:24 2014 From: keithp at keithp.com (Keith Packard) Date: Sun, 19 Oct 2014 17:40:24 -0700 Subject: [PATCH] XftDrawSrcPicture: Use XRenderCreateSolidFill when available Message-ID: <1413765624-15585-1-git-send-email-keithp@keithp.com> Instead of creating 1x1 pictures, use the solid pictures added in Render version 0.10 Signed-off-by: Keith Packard --- src/xftdpy.c | 4 ++++ src/xftdraw.c | 71 +++++++++++++++++++++++++++++++++++------------------------ src/xftint.h | 1 + 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/xftdpy.c b/src/xftdpy.c index c5b756e..62b1ccf 100644 --- a/src/xftdpy.c +++ b/src/xftdpy.c @@ -106,6 +106,10 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary) if (major < 0 || (major == 0 && minor <= 2)) info->use_free_glyphs = FcFalse; + info->hasSolid = FcFalse; + if (major > 0 || (major == 0 && minor >= 10)) + info->hasSolid = FcTrue; + pf.type = PictTypeDirect; pf.depth = 32; pf.direct.redMask = 0xff; diff --git a/src/xftdraw.c b/src/xftdraw.c index 186bcb8..dfa97fb 100644 --- a/src/xftdraw.c +++ b/src/xftdraw.c @@ -333,39 +333,52 @@ XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color) * Pick one to replace at random */ i = (unsigned int) rand () % XFT_NUM_SOLID_COLOR; - /* - * Recreate if it was for the wrong screen - */ - if (info->colors[i].screen != draw->screen && info->colors[i].pict) - { - XRenderFreePicture (dpy, info->colors[i].pict); - info->colors[i].pict = 0; - } - /* - * Create picture if necessary - */ - if (!info->colors[i].pict) - { - Pixmap pix; - XRenderPictureAttributes pa; - pix = XCreatePixmap (dpy, RootWindow (dpy, draw->screen), 1, 1, - info->solidFormat->depth); - pa.repeat = True; - info->colors[i].pict = XRenderCreatePicture (draw->dpy, - pix, - info->solidFormat, - CPRepeat, &pa); - XFreePixmap (dpy, pix); + if (info->hasSolid) { + /* + * Free any existing entry + */ + if (info->colors[i].pict) + XRenderFreePicture (dpy, info->colors[i].pict); + /* + * Create picture + */ + info->colors[i].pict = XRenderCreateSolidFill (draw->dpy, &color->color); + } else { + if (info->colors[i].screen != draw->screen && info->colors[i].pict) + { + XRenderFreePicture (dpy, info->colors[i].pict); + info->colors[i].pict = 0; + } + /* + * Create picture if necessary + */ + if (!info->colors[i].pict) + { + Pixmap pix; + XRenderPictureAttributes pa; + + pix = XCreatePixmap (dpy, RootWindow (dpy, draw->screen), 1, 1, + info->solidFormat->depth); + pa.repeat = True; + info->colors[i].pict = XRenderCreatePicture (draw->dpy, + pix, + info->solidFormat, + CPRepeat, &pa); + XFreePixmap (dpy, pix); + } + /* + * Set to the new color + */ + info->colors[i].color = color->color; + info->colors[i].screen = draw->screen; + XRenderFillRectangle (dpy, PictOpSrc, + info->colors[i].pict, + &color->color, 0, 0, 1, 1); } - /* - * Set to the new color - */ info->colors[i].color = color->color; info->colors[i].screen = draw->screen; - XRenderFillRectangle (dpy, PictOpSrc, - info->colors[i].pict, - &color->color, 0, 0, 1, 1); + return info->colors[i].pict; } diff --git a/src/xftint.h b/src/xftint.h index 1658977..c06ac3c 100644 --- a/src/xftint.h +++ b/src/xftint.h @@ -245,6 +245,7 @@ typedef struct _XftDisplayInfo { XExtCodes *codes; FcPattern *defaults; FcBool hasRender; + FcBool hasSolid; XftFont *fonts; XRenderPictFormat *solidFormat; unsigned long glyph_memory; -- 2.1.1 From chris at chris-wilson.co.uk Mon Oct 20 00:02:23 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Mon, 20 Oct 2014 08:02:23 +0100 Subject: [PATCH] dri2: Only invalidate our tree upon Pixmap changes Message-ID: <1413788543-25289-1-git-send-email-chris@chris-wilson.co.uk> 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 invalidate at all. Signed-off-by: Chris Wilson --- hw/xfree86/dri2/dri2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 140c833..028cfae 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -1393,13 +1393,15 @@ DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPix) DrawablePtr pDraw = (DrawablePtr) pWin; ScreenPtr pScreen = pDraw->pScreen; DRI2ScreenPtr ds = DRI2GetScreen(pScreen); + PixmapPtr pOld = pScreen->GetWindowPixmap(pWin); pScreen->SetWindowPixmap = ds->SetWindowPixmap; (*pScreen->SetWindowPixmap) (pWin, pPix); ds->SetWindowPixmap = pScreen->SetWindowPixmap; pScreen->SetWindowPixmap = DRI2SetWindowPixmap; - DRI2InvalidateDrawableAll(pDraw); + if (pPix != pOld) + DRI2InvalidateDrawableAll(pDraw); } #define MAX_PRIME DRI2DriverPrimeMask -- 2.1.1 From laerciosousa at sme-mogidascruzes.sp.gov.br Mon Oct 20 05:19:37 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Mon, 20 Oct 2014 10:19:37 -0200 Subject: [PATCH libXau] XauGet*AuthByAddr: add new variants which allow passing an explicit authorization file path. Message-ID: <1413807577-3715-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> It will allow extending functions like Xlib's XOpenDislay() or XCB's xcb_connect() to allow passing an explicit authorization file path (they already allow passing an explicit display number). This can be useful in exceptional cases where XAUTHORITY environment variable is not set at the time a X11 client is launched. Currently, a X11 client that needs to connect to a display with a given authorization file needs to set XAUTHORITY itself (if not yet set) before connecting. Signed-off-by: La?rcio de Sousa --- AuGetAddr.c | 38 ++++++++++++++++++++++++++++-- AuGetBest.c | 36 +++++++++++++++++++++++++++-- include/X11/Xauth.h | 45 ++++++++++++++++++++++++++++++++++++ man/Xau.man | 20 ++++++++++++++-- man/XauGetAuthByAddrWithFile.man | 1 + man/XauGetBestAuthByAddrWithFile.man | 1 + 6 files changed, 135 insertions(+), 6 deletions(-) create mode 100644 man/XauGetAuthByAddrWithFile.man create mode 100644 man/XauGetBestAuthByAddrWithFile.man diff --git a/AuGetAddr.c b/AuGetAddr.c index 6f5fe16..3aeffa4 100644 --- a/AuGetAddr.c +++ b/AuGetAddr.c @@ -33,7 +33,8 @@ in this Software without prior written authorization from The Open Group. #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0) Xauth * -XauGetAuthByAddr ( +XauGetAuthByAddrWithFile ( +_Xconst char* auth_file, #if NeedWidePrototypes unsigned int family, unsigned int address_length, @@ -59,7 +60,7 @@ _Xconst char* name) char *auth_name; Xauth *entry; - auth_name = XauFileName (); + auth_name = auth_file ? auth_file : XauFileName (); if (!auth_name) return NULL; if (access (auth_name, R_OK) != 0) /* checks REAL id */ @@ -100,3 +101,36 @@ _Xconst char* name) (void) fclose (auth_file); return entry; } + +Xauth * +XauGetAuthByAddr ( +#if NeedWidePrototypes +unsigned int family, +unsigned int address_length, +#else +unsigned short family, +unsigned short address_length, +#endif +_Xconst char* address, +#if NeedWidePrototypes +unsigned int number_length, +#else +unsigned short number_length, +#endif +_Xconst char* number, +#if NeedWidePrototypes +unsigned int name_length, +#else +unsigned short name_length, +#endif +_Xconst char* name) +{ + XauGetAuthByAddrWithFile (NULL, + family, + address_length, + address, + number_length, + number, + name_length, + name); +} diff --git a/AuGetBest.c b/AuGetBest.c index 5556559..73ee907 100644 --- a/AuGetBest.c +++ b/AuGetBest.c @@ -41,7 +41,8 @@ in this Software without prior written authorization from The Open Group. #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0) Xauth * -XauGetBestAuthByAddr ( +XauGetBestAuthByAddrWithFile ( + _Xconst char* auth_file, #if NeedWidePrototypes unsigned int family, unsigned int address_length, @@ -71,7 +72,7 @@ XauGetBestAuthByAddr ( unsigned short fully_qual_address_length; #endif - auth_name = XauFileName (); + auth_name = auth_file ? auth_file : XauFileName (); if (!auth_name) return NULL; if (access (auth_name, R_OK) != 0) /* checks REAL id */ @@ -161,3 +162,34 @@ XauGetBestAuthByAddr ( (void) fclose (auth_file); return best; } + +Xauth * +XauGetBestAuthByAddr ( +#if NeedWidePrototypes + unsigned int family, + unsigned int address_length, +#else + unsigned short family, + unsigned short address_length, +#endif + _Xconst char* address, +#if NeedWidePrototypes + unsigned int number_length, +#else + unsigned short number_length, +#endif + _Xconst char* number, + int types_length, + char** types, + _Xconst int* type_lengths) +{ + XauGetBestAuthByAddrWithFile (NULL, + family, + address_length, + address, + number_length, + number, + types_length, + types, + type_lengths); +} diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h index a707bed..c5765ff 100644 --- a/include/X11/Xauth.h +++ b/include/X11/Xauth.h @@ -112,6 +112,30 @@ unsigned short /* name_length */, _Xconst char* /* name */ ); +Xauth *XauGetAuthByAddrWithFile( +_Xconst char* /* auth_file */, +#if NeedWidePrototypes +unsigned int /* family */, +unsigned int /* address_length */, +#else +unsigned short /* family */, +unsigned short /* address_length */, +#endif +_Xconst char* /* address */, +#if NeedWidePrototypes +unsigned int /* number_length */, +#else +unsigned short /* number_length */, +#endif +_Xconst char* /* number */, +#if NeedWidePrototypes +unsigned int /* name_length */, +#else +unsigned short /* name_length */, +#endif +_Xconst char* /* name */ +); + Xauth *XauGetBestAuthByAddr( #if NeedWidePrototypes unsigned int /* family */, @@ -132,6 +156,27 @@ char** /* type_names */, _Xconst int* /* type_lengths */ ); +Xauth *XauGetBestAuthByAddrWithFile( +_Xconst char* /* auth_file */, +#if NeedWidePrototypes +unsigned int /* family */, +unsigned int /* address_length */, +#else +unsigned short /* family */, +unsigned short /* address_length */, +#endif +_Xconst char* /* address */, +#if NeedWidePrototypes +unsigned int /* number_length */, +#else +unsigned short /* number_length */, +#endif +_Xconst char* /* number */, +int /* types_length */, +char** /* type_names */, +_Xconst int* /* type_lengths */ +); + void XauDisposeAuth( Xauth* /* auth */ ); diff --git a/man/Xau.man b/man/Xau.man index d1b6603..e7060c7 100644 --- a/man/Xau.man +++ b/man/Xau.man @@ -56,11 +56,23 @@ Xauth *XauGetAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short \fInumber_length\fP\^, const char *\fInumber\fP\^, unsigned short \fIname_length\fP\^, const char *\fIname\fP\^); .HP +Xauth *XauGetAuthByAddrWithFile (const char* \fIauth_file\fP\^, +unsigned short \fIfamily\fP\^, unsigned short \fIaddress_length\fP\^, +const char *\fIaddress\fP\^, unsigned short \fInumber_length\fP\^, +const char *\fInumber\fP\^, unsigned short \fIname_length\fP\^, +const char *\fIname\fP\^); +.HP Xauth *XauGetBestAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short \fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short \fInumber_length\fP\^, const char *\fInumber\fP\^, int \fItypes_length\fP\^, char **\fItypes\fR\^, const int *\fItype_lengths\fR\^); .HP +Xauth *XauGetBestAuthByAddrWithFile (const char* \fIauth_file\fP\^, +unsigned short \fIfamily\fP\^, unsigned short \fIaddress_length\fP\^, +const char *\fIaddress\fP\^, unsigned short \fInumber_length\fP\^, +const char *\fInumber\fP\^, int \fItypes_length\fP\^, char **\fItypes\fR\^, +const int *\fItype_lengths\fR\^); +.HP int XauLockAuth (const char *\fIfile_name\fP\^, int \fIretries\fP\^, int \fItimeout\fP\^, long \fIdead\fP\^); .HP @@ -85,7 +97,9 @@ returns 1 on success, 0 on failure. .PP \fBXauGetAuthByAddr\fP searches for an entry which matches the given network address/display number pair. The entry is \fBnot\fP statically allocated -and should be freed by calling \fIXauDisposeAuth\fP. +and should be freed by calling \fIXauDisposeAuth\fP. It gets authorization +file path by calling \fIXauFileName\fP, but its corresponding function +\fBXauGetAuthByAddrWithFile\fP allows passing an explicit one. .PP \fBXauGetBestAuthByAddr\fP is similar to \fBXauGetAuthByAddr\fP, except that a list of acceptable authentication methods is specified. Xau will @@ -94,7 +108,9 @@ most secure authentication method). The \fItypes\fP argument is an array of strings, one string for each authentication method. \fItypes_length\fP specifies how many elements are in the \fItypes\fP array. \fItypes_lengths\fP is an array of integers representing the length -of each string. +of each string. It gets authorization file path by calling \fIXauFileName\fP, +but its corresponding function \fBXauGetBestAuthByAddrWithFile\fP allows +passing an explicit one. .PP \fBXauLockAuth\fP does the work necessary to synchronously update an authorization file. First it makes two file names, one with ``-c'' appended diff --git a/man/XauGetAuthByAddrWithFile.man b/man/XauGetAuthByAddrWithFile.man new file mode 100644 index 0000000..df111d6 --- /dev/null +++ b/man/XauGetAuthByAddrWithFile.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xau.__libmansuffix__ diff --git a/man/XauGetBestAuthByAddrWithFile.man b/man/XauGetBestAuthByAddrWithFile.man new file mode 100644 index 0000000..df111d6 --- /dev/null +++ b/man/XauGetBestAuthByAddrWithFile.man @@ -0,0 +1 @@ +.so man__libmansuffix__/Xau.__libmansuffix__ -- 1.8.4.5 From ajax at nwnk.net Mon Oct 20 12:53:00 2014 From: ajax at nwnk.net (Adam Jackson) Date: Mon, 20 Oct 2014 15:53:00 -0400 Subject: [PATCH] XftDrawSrcPicture: Use XRenderCreateSolidFill when available In-Reply-To: <1413765624-15585-1-git-send-email-keithp@keithp.com> References: <1413765624-15585-1-git-send-email-keithp@keithp.com> Message-ID: <1413834780.14199.4.camel@dmt> On Sun, 2014-10-19 at 17:40 -0700, Keith Packard wrote: > Instead of creating 1x1 pictures, use the solid pictures added in > Render version 0.10 Reviewed-by: Adam Jackson - ajax From ajax at nwnk.net Mon Oct 20 13:06:23 2014 From: ajax at nwnk.net (Adam Jackson) Date: Mon, 20 Oct 2014 16:06:23 -0400 Subject: [PATCH 1/4] dri2: Import a copy of Mesa's PCI ID -> driver name mappings. In-Reply-To: <874muzbzhx.fsf@eliezer.anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> <1413555427.17629.8.camel@dmt> <87fvemllv3.fsf@eliezer.anholt.net> <874muzbzhx.fsf@eliezer.anholt.net> Message-ID: <1413835583.14199.16.camel@dmt> On Sun, 2014-10-19 at 21:01 +0100, Eric Anholt wrote: > If I was putting effort into reducing PCI ID propagation, I'd be working > on getting GLX to sit on top of EGL instead of rolling its own loader. > I think ajax had stuff for this at one point? I started sketching it out back around the direct dispatch conversion. It's... somewhat involved. You need to port all the dri2 features to their corresponding EGL APIs, and then you still end up with some stuff you have to handwave (like converting EGLConfigs into glx fbconfigs) or just fail to implement (like accumulation buffers). My actual plan for getting that going was to get GLX-on-GLX working in Xnest first, since at the point where that's at feature parity we know xserver is ready and we just need to find all the corresponding EGL bits. My todo list there reads "pbuffers, tfp, copy_sub_buffer, swap interval, arb_create_context". Probably not going to happen for 1.17. As far as the actual patch, whatever. Let's get it working and then worry about cleaning it up. Series is: Reviewed-by: Adam Jackson - ajax From pharris at opentext.com Mon Oct 20 16:23:34 2014 From: pharris at opentext.com (Peter Harris) Date: Mon, 20 Oct 2014 19:23:34 -0400 Subject: [PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable In-Reply-To: <1412780701-8818-22-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-22-git-send-email-ajax@redhat.com> Message-ID: <54459976.1000201@opentext.com> It's possible I missed a patch or resolved a conflict incorrectly, but I'm getting crashes after this patch series. Reproducible by running twm and opening/closing the root window popup menu. On 2014-10-08 11:04, Adam Jackson wrote: > @@ -2742,7 +2742,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) > return Success; > if (SubStrSend(pWin, pParent)) > DeliverUnmapNotify(pWin, fromConfigure); > - if (wasViewable && !fromConfigure) { > + if (wasPaintable && !fromConfigure) { > pWin->valdata = UnmapValData; UnmapValData is a special not-pointer that is only valid if !pWin->paintable (or !pWin->viewable before this patch series). If Composite resets pWin->paintable on this window, miComputeClips will dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; causing everything to explode. > (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin); > (*pScreen->MarkWindow) (pLayerWin->parent); > @@ -2750,13 +2750,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) > pWin->mapped = FALSE; > if (wasRealized) > UnrealizeTree(pWin, fromConfigure); > - if (wasViewable) { > - if (!fromConfigure) { > - (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); > - (*pScreen->HandleExposures) (pLayerWin->parent); > - if (pScreen->PostValidateTree) > - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); > - } > + if (wasPaintable && !fromConfigure) { An extra block here + if (pWin->paintable) { + pWin->valdata = NULL; + pScreen->MarkWindow(pWin); + } appears to fix the crash. I haven't considered the equivalent for UnmapSubwindows yet. Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From alan.coopersmith at oracle.com Mon Oct 20 17:44:43 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Mon, 20 Oct 2014 17:44:43 -0700 Subject: [PATCH xcompmgr] man: note that -n is the default mode. In-Reply-To: <1413710526-32050-1-git-send-email-matthieu@herrb.eu> References: <1413710526-32050-1-git-send-email-matthieu@herrb.eu> Message-ID: <5445AC7B.60800@oracle.com> On 10/19/14 02:22 AM, Matthieu Herrb wrote: > Signed-off-by: Matthieu Herrb > --- > xcompmgr.1 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git xcompmgr.1 xcompmgr.1 > index a571541..523f60b 100644 > --- xcompmgr.1 > +++ xcompmgr.1 > @@ -48,7 +48,7 @@ When \-c is specified, enables a smooth fade effect for transient windows like > menus, and for all windows on hide and restore events. > .TP > .BI \-n > -Simple client-side compositing. > +Simple client-side compositing. This is the default mode. > .TP > .BI \-s > Server-side compositing with hard-edged shadows. > Reviewed-by: Alan Coopersmith -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From smout.jan at gmail.com Tue Oct 21 03:49:44 2014 From: smout.jan at gmail.com (Jan Smout) Date: Tue, 21 Oct 2014 12:49:44 +0200 Subject: [PATCH libX11] xcb_io: Fix Xlib 32-bit request number issues In-Reply-To: <867g0pu4p4.fsf@hiro.keithp.com> References: <1411585990-6423-1-git-send-email-jnsptrsn1@gmail.com> <867g0pu4p4.fsf@hiro.keithp.com> Message-ID: Keith, we are approaching the one year anniversary of this bug already. Maybe it is time to finish the patch and leave the issue behind? fyi, I have been running my application with the first version of Jonas's patch for 65 days straight now without a glitch (it used to crash in less than 20 hours). I also intend to restart this long duration test once the final patch will be released On 27 September 2014 05:23, Keith Packard wrote: > Matt Turner writes: > > > On Fri, Sep 26, 2014 at 3:40 AM, Jan Smout wrote: > >> Keith Packard doesn't seem very responsive (as in 'completely ignoring > the > >> subject') > > > > Perhaps you should try Ccing him? (now Cc'd) > > The problem is that reviewing this patch is *really hard*. The last > time, I think I spent a solid couple of days thinking about this and > making sure I'd caught all of the cases. I'm still not sure it's right, > but I guess it's probably better than what we have? > > -- > keith.packard at intel.com > -- Life is complex, it has a real part and an imaginary part. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.turney at dronecode.org.uk Tue Oct 21 07:03:55 2014 From: jon.turney at dronecode.org.uk (Jon TURNEY) Date: Tue, 21 Oct 2014 15:03:55 +0100 Subject: [PATCH] os: -displayfd should check ports up to 65535 Message-ID: <1413900235-7060-1-git-send-email-jon.turney@dronecode.org.uk> -displayfd should check ports up to 65535 Noticed during https://cygwin.com/ml/cygwin-xfree/2014-07/msg00024.html Signed-off-by: Jon TURNEY --- os/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/connection.c b/os/connection.c index f915e12..d53bd34 100644 --- a/os/connection.c +++ b/os/connection.c @@ -421,7 +421,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; -- 2.1.1 From jon.turney at dronecode.org.uk Tue Oct 21 07:04:51 2014 From: jon.turney at dronecode.org.uk (Jon TURNEY) Date: Tue, 21 Oct 2014 15:04:51 +0100 Subject: [PATCH] xdmcp: Simplify format specifier in XdmcpFatal() for vpnprintf() Message-ID: <1413900291-5688-1-git-send-email-jon.turney@dronecode.org.uk> XdmcpFatal uses the format specifier %*.*s, which vpnprintf() doesn't understand, which causes a backtrace, which prevents the reason for the XDMCP failure being logged. See: https://bugs.freedesktop.org/show_bug.cgi?id=66862 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758574 Signed-off-by: Jon TURNEY --- os/xdmcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/os/xdmcp.c b/os/xdmcp.c index 99616d9..c5204ad 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -1409,8 +1409,11 @@ recv_alive_msg(unsigned length) static void XdmcpFatal(const char *type, ARRAY8Ptr status) { - FatalError("XDMCP fatal error: %s %*.*s\n", type, - status->length, status->length, status->data); + char *text = malloc(status->length + 1); + strncpy(text, status->data, status->length); + text[status->length] = 0; + FatalError("XDMCP fatal error: %s %s\n", type, text); + free(text); } static void -- 2.1.1 From colin.harrison at virgin.net Tue Oct 21 07:25:37 2014 From: colin.harrison at virgin.net (Colin Harrison) Date: Tue, 21 Oct 2014 15:25:37 +0100 Subject: [PATCH] xdmcp: Simplify format specifier in XdmcpFatal() for vpnprintf() Message-ID: <001001cfed3a$e3bb4220$ab31c660$@virgin.net> Hi, There are instances of this format also in os/access.c (not that I ever get sight of them!) Probably best fixed in vpnprintf() but your xdmcp patch fixes the most seen instance (for me). Thanks, Colin Harrison From ajax at redhat.com Tue Oct 21 08:47:56 2014 From: ajax at redhat.com (Adam Jackson) Date: Tue, 21 Oct 2014 11:47:56 -0400 Subject: [PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable In-Reply-To: <54459976.1000201@opentext.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-22-git-send-email-ajax@redhat.com> <54459976.1000201@opentext.com> Message-ID: <1413906476.14199.29.camel@dmt> On Mon, 2014-10-20 at 19:23 -0400, Peter Harris wrote: > It's possible I missed a patch or resolved a conflict incorrectly, but > I'm getting crashes after this patch series. > > Reproducible by running twm and opening/closing the root window popup menu. > > On 2014-10-08 11:04, Adam Jackson wrote: > > @@ -2742,7 +2742,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) > > return Success; > > if (SubStrSend(pWin, pParent)) > > DeliverUnmapNotify(pWin, fromConfigure); > > - if (wasViewable && !fromConfigure) { > > + if (wasPaintable && !fromConfigure) { > > pWin->valdata = UnmapValData; > > UnmapValData is a special not-pointer that is only valid if > !pWin->paintable (or !pWin->viewable before this patch series). If > Composite resets pWin->paintable on this window, miComputeClips will dx > = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; causing > everything to explode. I kind of hate UnmapValData for being out-of-band like that. Seems like maybe it'd be cleaner to pass along a VTKind? I also wish mioverlay had any sort of documentation or internal commentary. > > @@ -2750,13 +2750,11 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) > > pWin->mapped = FALSE; > > if (wasRealized) > > UnrealizeTree(pWin, fromConfigure); > > - if (wasViewable) { > > - if (!fromConfigure) { > > - (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); > > - (*pScreen->HandleExposures) (pLayerWin->parent); > > - if (pScreen->PostValidateTree) > > - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); > > - } > > + if (wasPaintable && !fromConfigure) { > > An extra block here > > + if (pWin->paintable) { > + pWin->valdata = NULL; > + pScreen->MarkWindow(pWin); > + } > > appears to fix the crash. I haven't considered the equivalent for > UnmapSubwindows yet. Hmm yeah okay. I'll work that in somehow. - ajax From pharris at opentext.com Tue Oct 21 09:18:08 2014 From: pharris at opentext.com (Peter Harris) Date: Tue, 21 Oct 2014 12:18:08 -0400 Subject: [PATCH 00/37] Implement backing store's Always mode In-Reply-To: <1412928734.14471.9.camel@dmt> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412928734.14471.9.camel@dmt> Message-ID: <54468740.6010703@opentext.com> On 2014-10-10 04:12, Adam Jackson wrote: > On Wed, 2014-10-08 at 17:04 +0200, Adam Jackson wrote: > >> I'm not in any way convinced this is correct yet, in fact I'm pretty sure >> it's not. And there's some work that would be nice to follow this with [4]. >> But it's close enough that I'd like to get some more eyes on it. > > I may have been too modest here. A backport of this series to 1.13 > appears to be correct enough for the customer app that provoked this > work. Works for me, too, after the UnmapWindow/UnmapSubwindows fix. And I get to drop a rather ugly local patch that sprinkles "&& pWin->backingStore != Always" all over the place. For the series, Reviewed-by: Peter Harris Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From ajax at nwnk.net Tue Oct 21 10:30:28 2014 From: ajax at nwnk.net (Adam Jackson) Date: Tue, 21 Oct 2014 13:30:28 -0400 Subject: [PATCH] os: -displayfd should check ports up to 65535 In-Reply-To: <1413900235-7060-1-git-send-email-jon.turney@dronecode.org.uk> References: <1413900235-7060-1-git-send-email-jon.turney@dronecode.org.uk> Message-ID: <1413912628.14199.43.camel@dmt> On Tue, 2014-10-21 at 15:03 +0100, Jon TURNEY wrote: > -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 - ajax From cynthia_115 at 163.com Tue Oct 21 02:30:54 2014 From: cynthia_115 at 163.com (cynthia) Date: Tue, 21 Oct 2014 17:30:54 +0800 (CST) Subject: a question about Xspice Message-ID: <55833e4c.dca8.149320b7e03.Coremail.cynthia_115@163.com> HI All, I am trying to build Xspice which is included in guest QXL driver, but one question confuses me a lot. As the Xspice's description in Readme, i get that Xspice is a X server and spice server in one, running in guest os, but our team has developed a set of windows virtual desktop in which the spiceserver is deployed in HOST os linked with QEMU, and i think that is coordinated with the spice protocol., So, could anyone explain it for me if spiceserver is deployed in guest os or host os? I will be very very appreciated~ Best Regards Cynthia -------------- next part -------------- An HTML attachment was scrubbed... URL: From aritger at nvidia.com Tue Oct 21 23:34:40 2014 From: aritger at nvidia.com (Andy Ritger) Date: Tue, 21 Oct 2014 23:34:40 -0700 Subject: tile property contents In-Reply-To: References: Message-ID: <20141022063440.GD26807@parker.nvidia.com> I assume the TILE property described below would be per-connector? It looks like this would handle the DP MST tiled display case. At the risk of trying to solve too much at once: There are also configurations where users configure multiple heads to drive power walls that they want to be treated as one logical monitor, similar to the DP MST tiled display case. Normally, those powerwall configurations don't have any layout information from the monitors themselves, and the layout is configured by the user. Would it be appropriate for users to be able to set the TILE property in that sort of scenario? For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc should be expressed in pixels rather than tiles? Sometimes, the tiles in those powerwalls may not all have the same resolution, or may be configured with overlap. I suppose that would make the TILE configuration specific to the current modetimings on each tile... Thanks, - Andy On Tue, Oct 14, 2014 at 01:23:22PM +1000, Dave Airlie wrote: > Hi, > > So I've been hacking on mutter and the gnome pieces for tiling, and > I've at least fixed mutter locally so maximise windows works and the > heads are in the right order. > > Now I've strung all the pieces together using a single KMS property > that X.org propogates, and mutter picks up and propagates over dbus as > well, > > Currently I've ascii encoded the property into a blob, > > :::::::: > > I'm thinking of dropping the version field and just exposing TILE2 > property if we need it later to add more values, > > The other fields: > tileid: a group id assigned by the kernel to all tiles in the same > group - unique per group > flags: bit 0 : single monitor enclosure > maxhtiles: total number of horiz tiles > maxvtiles: total number of vert tiles > h_tile_loc: horiz location of this output in tile group > v_tile_loc: vert location of this output in tile group > tile_w: width of this tile > tile_h: height of this tile. > > Now we extract all of these from the DisplayID v1.3 block, and I'm > wondering if maybe I shouldn't just export the whole DisplayID tiling > info block instead, it however encodes a few other pieces of > information, including bezel info, and some flags specifying behaviour > in some cases. > > The former could be more suitable for cases where DisplayID isn't > available (Dual DSI panels?) but I'm worried abuot exposing too little > at this point making TILE useless when the next monitor comes out. > > I'm not sure any part of the stack should be extracting things and > splitting them out, I'd like to just give the same tile property all > the way through. > > Dave. > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From yogishk at nvidia.com Wed Oct 22 00:25:28 2014 From: yogishk at nvidia.com (Yogish Kulkarni) Date: Wed, 22 Oct 2014 12:55:28 +0530 Subject: [PATCH xfree86] Skip SetCursor when vtSema is FALSE. Message-ID: <1413962728-16125-1-git-send-email-yogishk@nvidia.com> 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 --- hw/xfree86/ramdac/xf86Cursor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 4a4def5..98edb88 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -333,8 +333,10 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, ScreenPriv->HotX = pCurs->bits->xhot; ScreenPriv->HotY = pCurs->bits->yhot; - if (!infoPtr->pScrn->vtSema) + if (!infoPtr->pScrn->vtSema) { ScreenPriv->SavedCursor = pCurs; + return; + } if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || -- 1.8.1.5 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- From basteon at gmail.com Wed Oct 22 02:47:15 2014 From: basteon at gmail.com (basteon) Date: Wed, 22 Oct 2014 09:47:15 +0000 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> <54426FF6.9030300@o2.pl> Message-ID: I use Xorg configuration: Section "Monitor" Modeline "2560x1440_60" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync +vsync HorizSync 89.40 VertRefresh 60.00 Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Monitor Model" EndSection There I setting up 2560x1440 resolution and not enywere else. On 10/19/14, Michal Suchanek wrote: > On 19 October 2014 05:49, basteon wrote: >> Bu I don't use /dev/fb0 when I do load my system. >> i.e. in initramfs I ddin't load radeon drivers. >> >>>Did you try setting the resolution lower in case the transmitter you >>>are using cannot handle a mode this large? >> where I should setting this? >> When I loads radeon driver I've disabled Xorg at all. > > > > On 18 October 2014 07:51, basteon wrote: >> hello, >> I made dmesg output from ssh connected from another host. >> > ... >> On 10/13/14, Michal Suchanek wrote: >>> Hello, >>> > ... >>> What connection do you use to connect the display? Some connections >>> may not be able to use full resolution. Can you try using fbset or >>> xrandr to switch to lower resolution once the module is inserted? > From ajax at redhat.com Wed Oct 22 10:19:18 2014 From: ajax at redhat.com (Adam Jackson) Date: Wed, 22 Oct 2014 13:19:18 -0400 Subject: [PATCH] composite: Wrap GetSpans Message-ID: <1413998358-4186-1-git-send-email-ajax@redhat.com> 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 --- composite/compinit.c | 19 +++++++++++++++++++ composite/compint.h | 1 + 2 files changed, 20 insertions(+) diff --git a/composite/compinit.c b/composite/compinit.c index be05aec..1a7f8a4 100644 --- a/composite/compinit.c +++ b/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); @@ -168,6 +169,21 @@ compGetImage(DrawablePtr pDrawable, } 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, int width, int height, unsigned int subWindowMode) @@ -449,6 +465,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/composite/compint.h b/composite/compint.h index 56b76c5..f06b846 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -168,6 +168,7 @@ typedef struct _CompScreen { CompOverlayClientPtr pOverlayClients; GetImageProcPtr GetImage; + GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; } CompScreenRec, *CompScreenPtr; -- 1.9.3 From alexdeucher at gmail.com Wed Oct 22 10:41:20 2014 From: alexdeucher at gmail.com (Alex Deucher) Date: Wed, 22 Oct 2014 13:41:20 -0400 Subject: vesa and 2560x1440 In-Reply-To: References: <1413121400.11177.4.camel@dmt> <54426FF6.9030300@o2.pl> Message-ID: On Wed, Oct 22, 2014 at 5:47 AM, basteon wrote: > I use Xorg configuration: > > Section "Monitor" > Modeline "2560x1440_60" 241.50 2560 2608 2640 2720 1440 > 1443 1448 1481 +hsync +vsync > HorizSync 89.40 > VertRefresh 60.00 > Identifier "Monitor0" > VendorName "Monitor Vendor" > ModelName "Monitor Model" > EndSection > > There I setting up 2560x1440 resolution and not enywere else. It would be easier to track this in a bug report (https://bugs.freedesktop.org). Please provide the output of xrandr --verbose. Do other modes besides 2560x1440 work? Are you trying to force that mode? It could be that your board is only wired up for single link TMDS while that mode requires dual link. Alex > > On 10/19/14, Michal Suchanek wrote: >> On 19 October 2014 05:49, basteon wrote: >>> Bu I don't use /dev/fb0 when I do load my system. >>> i.e. in initramfs I ddin't load radeon drivers. >>> >>>>Did you try setting the resolution lower in case the transmitter you >>>>are using cannot handle a mode this large? >>> where I should setting this? >>> When I loads radeon driver I've disabled Xorg at all. >> >> >> >> On 18 October 2014 07:51, basteon wrote: >>> hello, >>> I made dmesg output from ssh connected from another host. >>> >> ... >>> On 10/13/14, Michal Suchanek wrote: >>>> Hello, >>>> >> ... >>>> What connection do you use to connect the display? Some connections >>>> may not be able to use full resolution. Can you try using fbset or >>>> xrandr to switch to lower resolution once the module is inserted? >> > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From keithp at keithp.com Wed Oct 22 12:56:08 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 12:56:08 -0700 Subject: [PATCH] XftDrawSrcPicture: Use XRenderCreateSolidFill when available In-Reply-To: <1413834780.14199.4.camel@dmt> References: <1413765624-15585-1-git-send-email-keithp@keithp.com> <1413834780.14199.4.camel@dmt> Message-ID: <86bnp33mlj.fsf@hiro.keithp.com> Adam Jackson writes: > On Sun, 2014-10-19 at 17:40 -0700, Keith Packard wrote: >> Instead of creating 1x1 pictures, use the solid pictures added in >> Render version 0.10 > > Reviewed-by: Adam Jackson Merged. 214f9b5..e8a8322 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Wed Oct 22 13:37:08 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 13:37:08 -0700 Subject: [PATCH] composite: Wrap GetSpans In-Reply-To: <1413998358-4186-1-git-send-email-ajax@redhat.com> References: <1413998358-4186-1-git-send-email-ajax@redhat.com> Message-ID: <861tpz3kp7.fsf@hiro.keithp.com> Adam Jackson writes: > 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. In the core server code, GetSpans is only used for miCopyArea, miCopyPlane, miGetImage and miPushPixels. miPushPixels isn't relevant as it is only ever used to read from pixmaps. The others are already covered by the existing SourceValidate and GetImage wrappers. Per our IRC discussion, fixing automatic compositing to correctly capture IncludeInferiors rendering would require that we draw to the per-window pixmaps for any inferior redirected window. Nacked-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Wed Oct 22 14:17:38 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 14:17:38 -0700 Subject: [PATCH] Xephyr: option to disable grabbing the host In-Reply-To: <878ukluctl.fsf@eliezer.anholt.net> References: <1400632132-402-1-git-send-email-william.leslie.ttg@gmail.com> <878ukluctl.fsf@eliezer.anholt.net> Message-ID: <86y4s72499.fsf@hiro.keithp.com> Eric Anholt writes: > William ML Leslie writes: > >> This patch makes it possible to use C-S key combinations >> within Xephyr without losing access to the host window manager's >> commands. > > Reviewed-by: Eric Anholt Merged. 61a292a..942e18e master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Wed Oct 22 14:48:10 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 14:48:10 -0700 Subject: [PATCH] dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings Message-ID: <1414014490-3332-1-git-send-email-keithp@keithp.com> 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 Cc: Peter Hutterer --- dix/getevents.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index ffa89fa..dd96265 100644 --- a/dix/getevents.c +++ b/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); } -- 2.1.1 From keithp at keithp.com Wed Oct 22 14:48:37 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 14:48:37 -0700 Subject: [PATCH 1/2] os: Eliminate uninitialized value warnings from access.c Message-ID: <1414014518-3461-1-git-send-email-keithp@keithp.com> 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 --- os/access.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/os/access.c b/os/access.c index 125f35f..fe01420 100644 --- a/os/access.c +++ b/os/access.c @@ -835,7 +835,7 @@ ResetHosts(const char *display) } saddr; #endif int family = 0; - void *addr; + void *addr = NULL; int len; siTypesInitialize(); @@ -928,8 +928,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); } } @@ -1359,7 +1359,7 @@ 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 */ @@ -1386,12 +1386,12 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) } for (host = validhosts; host; host = host->next) { if (host->family == FamilyServerInterpreted) { - if (siAddrMatch(family, addr, len, host, client)) { + if (addr && siAddrMatch(family, addr, len, host, client)) { return 0; } } else { - if (addrEqual(family, addr, len, host)) + if (addr && addrEqual(family, addr, len, host)) return 0; } @@ -1648,7 +1648,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; @@ -1659,7 +1659,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; -- 2.1.1 From keithp at keithp.com Wed Oct 22 14:48:38 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 22 Oct 2014 14:48:38 -0700 Subject: [PATCH 2/2] xkb: Initialize 'bad' Atom in _XkbSetNamesCheck In-Reply-To: <1414014518-3461-1-git-send-email-keithp@keithp.com> References: <1414014518-3461-1-git-send-email-keithp@keithp.com> Message-ID: <1414014518-3461-2-git-send-email-keithp@keithp.com> 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 --- xkb/xkb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index dc570f0..fdc5923 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -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; -- 2.1.1 From aritger at nvidia.com Wed Oct 22 16:03:21 2014 From: aritger at nvidia.com (Andy Ritger) Date: Wed, 22 Oct 2014 16:03:21 -0700 Subject: tile property contents In-Reply-To: References: <20141022063440.GD26807@parker.nvidia.com> Message-ID: <20141022230321.GH30256@parker.nvidia.com> On Wed, Oct 22, 2014 at 11:20:09PM +0200, Daniel Vetter wrote: > On Wed, Oct 22, 2014 at 8:34 AM, Andy Ritger wrote: > > I assume the TILE property described below would be per-connector? > > > > It looks like this would handle the DP MST tiled display case. > > > > At the risk of trying to solve too much at once: > > > > There are also configurations where users configure multiple heads to > > drive power walls that they want to be treated as one logical monitor, > > similar to the DP MST tiled display case. Normally, those powerwall > > configurations don't have any layout information from the monitors > > themselves, and the layout is configured by the user. > > > > Would it be appropriate for users to be able to set the TILE property > > in that sort of scenario? > > > > For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc > > should be expressed in pixels rather than tiles? Sometimes, the tiles > > in those powerwalls may not all have the same resolution, or may be > > configured with overlap. I suppose that would make the TILE configuration > > specific to the current modetimings on each tile... > > Why can't users just set that mode? Sure, users can set the mode, but: * Part of what the TILE property conveys is how monitors should be grouped for purposes of window maximization. Users don't have a great way to express that today, that I'm aware of. * Users might configure the mode they want, but then gnome-settings-daemon may come along later and decide it knows better than the user how things should be configured. One scenario where this comes up is: (a) user meticulously configures his power wall (b) user hotplugs another monitor I've definitely seen cases where window managers will try to be clever in response to a hotplug, and clobber the user's current configuration. If the TILE property conveyed how some set of monitors was supposed to be grouped, that would hopefully give window managers additional information, such that they would know to keep that group intact. > And if this is about the initial configuration problem then we (at > intel) are working on some way to load a dt blob as a firmware image > which would contain the entire kms state, and which we'd apply in an > atomic modeset at driver load. Everyone else (boot splash, X, ...) > will then just inherit that config. That should give you even > flicker-free screen walls if you want to ;-) Neat :) > Cheers, Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch From daniel at ffwll.ch Wed Oct 22 14:20:09 2014 From: daniel at ffwll.ch (Daniel Vetter) Date: Wed, 22 Oct 2014 23:20:09 +0200 Subject: tile property contents In-Reply-To: <20141022063440.GD26807@parker.nvidia.com> References: <20141022063440.GD26807@parker.nvidia.com> Message-ID: On Wed, Oct 22, 2014 at 8:34 AM, Andy Ritger wrote: > I assume the TILE property described below would be per-connector? > > It looks like this would handle the DP MST tiled display case. > > At the risk of trying to solve too much at once: > > There are also configurations where users configure multiple heads to > drive power walls that they want to be treated as one logical monitor, > similar to the DP MST tiled display case. Normally, those powerwall > configurations don't have any layout information from the monitors > themselves, and the layout is configured by the user. > > Would it be appropriate for users to be able to set the TILE property > in that sort of scenario? > > For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc > should be expressed in pixels rather than tiles? Sometimes, the tiles > in those powerwalls may not all have the same resolution, or may be > configured with overlap. I suppose that would make the TILE configuration > specific to the current modetimings on each tile... Why can't users just set that mode? And if this is about the initial configuration problem then we (at intel) are working on some way to load a dt blob as a firmware image which would contain the entire kms state, and which we'd apply in an atomic modeset at driver load. Everyone else (boot splash, X, ...) will then just inherit that config. That should give you even flicker-free screen walls if you want to ;-) Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From daniel at ffwll.ch Thu Oct 23 00:58:40 2014 From: daniel at ffwll.ch (Daniel Vetter) Date: Thu, 23 Oct 2014 09:58:40 +0200 Subject: tile property contents In-Reply-To: <20141022230321.GH30256@parker.nvidia.com> References: <20141022063440.GD26807@parker.nvidia.com> <20141022230321.GH30256@parker.nvidia.com> Message-ID: <20141023075840.GZ26941@phenom.ffwll.local> On Wed, Oct 22, 2014 at 04:03:21PM -0700, Andy Ritger wrote: > On Wed, Oct 22, 2014 at 11:20:09PM +0200, Daniel Vetter wrote: > > On Wed, Oct 22, 2014 at 8:34 AM, Andy Ritger wrote: > > > I assume the TILE property described below would be per-connector? > > > > > > It looks like this would handle the DP MST tiled display case. > > > > > > At the risk of trying to solve too much at once: > > > > > > There are also configurations where users configure multiple heads to > > > drive power walls that they want to be treated as one logical monitor, > > > similar to the DP MST tiled display case. Normally, those powerwall > > > configurations don't have any layout information from the monitors > > > themselves, and the layout is configured by the user. > > > > > > Would it be appropriate for users to be able to set the TILE property > > > in that sort of scenario? > > > > > > For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc > > > should be expressed in pixels rather than tiles? Sometimes, the tiles > > > in those powerwalls may not all have the same resolution, or may be > > > configured with overlap. I suppose that would make the TILE configuration > > > specific to the current modetimings on each tile... > > > > Why can't users just set that mode? > > Sure, users can set the mode, but: > > * Part of what the TILE property conveys is how monitors should be grouped > for purposes of window maximization. Users don't have a great way to > express that today, that I'm aware of. My understanding for why we want the TILE property is to avoid to duplicate displayId parsing over every bit of userspace (and the fbcon stuff in the kernel) interested in it. Imo the proper way for userspace is to always just inherit whatever modeset config is already there. > * Users might configure the mode they want, but then gnome-settings-daemon > may come along later and decide it knows better than the user how things > should be configured. One scenario where this comes up is: > (a) user meticulously configures his power wall > (b) user hotplugs another monitor > I've definitely seen cases where window managers will try to be clever > in response to a hotplug, and clobber the user's current configuration. > If the TILE property conveyed how some set of monitors was supposed > to be grouped, that would hopefully give window managers additional > information, such that they would know to keep that group intact. Well, imnsho gnome display control center is a bit too opiniated about automatic modeset changes. If their assumption is that they always know perfectly what the user wants upon hotplug I really don't want to work around this in the kernel. Since for everything else than a laptop + beamer gnome panel always pisses me off ;-) I think gnome should just ask the user what it wants if there's more than 2 physical displays (treating a tiled 4k screen as one ofc), since there's really no way at all to tell. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From hdegoede at redhat.com Thu Oct 23 02:23:02 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Thu, 23 Oct 2014 11:23:02 +0200 Subject: [PATCH:font/util] Update map-JISX0201.1976-0 to current version from Unicode Consortium In-Reply-To: <1409018798-18750-1-git-send-email-alan.coopersmith@oracle.com> References: <1409018798-18750-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <5448C8F6.5090803@redhat.com> Hi, On 08/26/2014 04:06 AM, Alan Coopersmith wrote: > New version is exactly as downloaded on August 25, 2014 from > ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT > > Does not change mappings, only changes comments (including license notice). > > Reported-by: AGinsberg on #xorg-devel irc > Signed-off-by: Alan Coopersmith Looks good: Acked-by: Hans de Goede Regards, Hans > --- > COPYING | 2 +- > map-JISX0201.1976-0 | 42 ++++++++++++++++++++++++++---------------- > 2 files changed, 27 insertions(+), 17 deletions(-) > > diff --git a/COPYING b/COPYING > index 0ff9042..8febe74 100644 > --- a/COPYING > +++ b/COPYING > @@ -103,7 +103,7 @@ from the copyright holders. > > ------------------------------------------------------------------------ > > -Copyright (c) 1991-2003 Unicode, Inc. All Rights reserved. > +Copyright (c) 1991-2011 Unicode, Inc. All Rights reserved. > > This file is provided as-is by Unicode, Inc. (The Unicode Consortium). > No claims are made as to fitness for any particular purpose. No > diff --git a/map-JISX0201.1976-0 b/map-JISX0201.1976-0 > index 87e9e94..ca18c42 100644 > --- a/map-JISX0201.1976-0 > +++ b/map-JISX0201.1976-0 > @@ -1,13 +1,11 @@ > # > # Name: JIS X 0201 (1976) to Unicode 1.1 Table > # Unicode version: 1.1 > -# Table version: 0.9 > +# Table version: 1.0 > # Table format: Format A > -# Date: 8 March 1994 > -# Authors: Glenn Adams > -# John H. Jenkins > +# Date: 2011 October 14 > # > -# Copyright (c) 1991-1994 Unicode, Inc. All Rights reserved. > +# Copyright (c) 1994-2011 Unicode, Inc. All Rights reserved. > # > # This file is provided as-is by Unicode, Inc. (The Unicode Consortium). > # No claims are made as to fitness for any particular purpose. No > @@ -17,17 +15,22 @@ > # remedy for any claim will be exchange of defective media within 90 > # days of receipt. > # > -# Recipient is granted the right to make copies in any form for > -# internal distribution and to freely use the information supplied > -# in the creation of products supporting Unicode. Unicode, Inc. > -# specifically excludes the right to re-distribute this file directly > -# to third parties or other organizations whether for profit or not. > +# Unicode, Inc. hereby grants the right to freely use the information > +# supplied in this file in the creation of products supporting the > +# Unicode Standard, and to make copies of this file in any form for > +# internal or external distribution as long as this notice remains > +# attached. > # > # General notes: > # > -# This table contains the data the Unicode Consortium has on how > -# single-byte JIS X 0201 characters map into Unicode 1.1 > -# (ISO/IEC 10646:1-1993 UCS-2). > +# > +# This table contains one set of mappings from JIS X 0201 into Unicode. > +# Note that these data are *possible* mappings only and may not be the > +# same as those used by actual products, nor may they be the best suited > +# for all uses. For more information on the mappings between various code > +# pages incorporating the repertoire of JIS X 0201 and Unicode, consult the > +# VENDORS mapping data. > +# > # > # Format: Three tab-separated columns > # Column #1 is the shift JIS code (in hex as 0xXX) > @@ -36,11 +39,18 @@ > # > # The entries are in JIS order > # > -# These mappings are provisional, pending definition of > -# official mappings by Japanese standards bodies. > +# Revision History: > +# > +# [v1.0, 2011 October 14] > +# Updated terms of use to current wording. > +# Updated contact information. > +# No changes to the mapping data. > # > -# Any comments or problems, contact > +# [v0.9, 8 March 1994] > +# First release. > # > +# Use the Unicode reporting form > +# for any questions or comments or to report errors in the data. > # > 0x20 0x0020 # SPACE > 0x21 0x0021 # EXCLAMATION MARK > From hdegoede at redhat.com Thu Oct 23 02:23:44 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Thu, 23 Oct 2014 11:23:44 +0200 Subject: [PATCH:libxtrans 1/7] Update docs to note that TransName is now const char * In-Reply-To: <1409016084-18480-1-git-send-email-alan.coopersmith@oracle.com> References: <1409016084-18480-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <5448C920.6010706@redhat.com> Hi, On 08/26/2014 03:21 AM, Alan Coopersmith wrote: > Missed when the code was updated in commit eb9a8904fbef61a57ff0. > > Signed-off-by: Alan Coopersmith Looks good, series is: Acked-by: Hans de Goede Regards, Hans > --- > doc/xtrans.xml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/doc/xtrans.xml b/doc/xtrans.xml > index 59daa3f..d89c247 100644 > --- a/doc/xtrans.xml > +++ b/doc/xtrans.xml > @@ -187,7 +187,7 @@ points for a single transport. This record is defined as: > > typedef struct _Xtransport { > > - char *TransName; > + const char *TransName; > int flags; > > XtransConnInfo (*OpenCOTSClient)( > From hdegoede at redhat.com Thu Oct 23 02:26:54 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Thu, 23 Oct 2014 11:26:54 +0200 Subject: [PATCH libXau] XauGet*AuthByAddr: add new variants which allow passing an explicit authorization file path. In-Reply-To: <1413807577-3715-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1413807577-3715-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <5448C9DE.1010606@redhat.com> Hi, On 10/20/2014 02:19 PM, La?rcio de Sousa wrote: > It will allow extending functions like Xlib's XOpenDislay() or XCB's xcb_connect() > to allow passing an explicit authorization file path (they already allow passing > an explicit display number). This can be useful in exceptional cases where > XAUTHORITY environment variable is not set at the time a X11 client is launched. > Currently, a X11 client that needs to connect to a display with a given > authorization file needs to set XAUTHORITY itself (if not yet set) before connecting. > > Signed-off-by: La?rcio de Sousa Code looks good to me and is: Acked-by: Hans de Goede I think this should get a second look by someone more familiar with the Xau code though, so I'll leave merging this up to someone else. Regards, Hans > --- > AuGetAddr.c | 38 ++++++++++++++++++++++++++++-- > AuGetBest.c | 36 +++++++++++++++++++++++++++-- > include/X11/Xauth.h | 45 ++++++++++++++++++++++++++++++++++++ > man/Xau.man | 20 ++++++++++++++-- > man/XauGetAuthByAddrWithFile.man | 1 + > man/XauGetBestAuthByAddrWithFile.man | 1 + > 6 files changed, 135 insertions(+), 6 deletions(-) > create mode 100644 man/XauGetAuthByAddrWithFile.man > create mode 100644 man/XauGetBestAuthByAddrWithFile.man > > diff --git a/AuGetAddr.c b/AuGetAddr.c > index 6f5fe16..3aeffa4 100644 > --- a/AuGetAddr.c > +++ b/AuGetAddr.c > @@ -33,7 +33,8 @@ in this Software without prior written authorization from The Open Group. > #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0) > > Xauth * > -XauGetAuthByAddr ( > +XauGetAuthByAddrWithFile ( > +_Xconst char* auth_file, > #if NeedWidePrototypes > unsigned int family, > unsigned int address_length, > @@ -59,7 +60,7 @@ _Xconst char* name) > char *auth_name; > Xauth *entry; > > - auth_name = XauFileName (); > + auth_name = auth_file ? auth_file : XauFileName (); > if (!auth_name) > return NULL; > if (access (auth_name, R_OK) != 0) /* checks REAL id */ > @@ -100,3 +101,36 @@ _Xconst char* name) > (void) fclose (auth_file); > return entry; > } > + > +Xauth * > +XauGetAuthByAddr ( > +#if NeedWidePrototypes > +unsigned int family, > +unsigned int address_length, > +#else > +unsigned short family, > +unsigned short address_length, > +#endif > +_Xconst char* address, > +#if NeedWidePrototypes > +unsigned int number_length, > +#else > +unsigned short number_length, > +#endif > +_Xconst char* number, > +#if NeedWidePrototypes > +unsigned int name_length, > +#else > +unsigned short name_length, > +#endif > +_Xconst char* name) > +{ > + XauGetAuthByAddrWithFile (NULL, > + family, > + address_length, > + address, > + number_length, > + number, > + name_length, > + name); > +} > diff --git a/AuGetBest.c b/AuGetBest.c > index 5556559..73ee907 100644 > --- a/AuGetBest.c > +++ b/AuGetBest.c > @@ -41,7 +41,8 @@ in this Software without prior written authorization from The Open Group. > #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0) > > Xauth * > -XauGetBestAuthByAddr ( > +XauGetBestAuthByAddrWithFile ( > + _Xconst char* auth_file, > #if NeedWidePrototypes > unsigned int family, > unsigned int address_length, > @@ -71,7 +72,7 @@ XauGetBestAuthByAddr ( > unsigned short fully_qual_address_length; > #endif > > - auth_name = XauFileName (); > + auth_name = auth_file ? auth_file : XauFileName (); > if (!auth_name) > return NULL; > if (access (auth_name, R_OK) != 0) /* checks REAL id */ > @@ -161,3 +162,34 @@ XauGetBestAuthByAddr ( > (void) fclose (auth_file); > return best; > } > + > +Xauth * > +XauGetBestAuthByAddr ( > +#if NeedWidePrototypes > + unsigned int family, > + unsigned int address_length, > +#else > + unsigned short family, > + unsigned short address_length, > +#endif > + _Xconst char* address, > +#if NeedWidePrototypes > + unsigned int number_length, > +#else > + unsigned short number_length, > +#endif > + _Xconst char* number, > + int types_length, > + char** types, > + _Xconst int* type_lengths) > +{ > + XauGetBestAuthByAddrWithFile (NULL, > + family, > + address_length, > + address, > + number_length, > + number, > + types_length, > + types, > + type_lengths); > +} > diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h > index a707bed..c5765ff 100644 > --- a/include/X11/Xauth.h > +++ b/include/X11/Xauth.h > @@ -112,6 +112,30 @@ unsigned short /* name_length */, > _Xconst char* /* name */ > ); > > +Xauth *XauGetAuthByAddrWithFile( > +_Xconst char* /* auth_file */, > +#if NeedWidePrototypes > +unsigned int /* family */, > +unsigned int /* address_length */, > +#else > +unsigned short /* family */, > +unsigned short /* address_length */, > +#endif > +_Xconst char* /* address */, > +#if NeedWidePrototypes > +unsigned int /* number_length */, > +#else > +unsigned short /* number_length */, > +#endif > +_Xconst char* /* number */, > +#if NeedWidePrototypes > +unsigned int /* name_length */, > +#else > +unsigned short /* name_length */, > +#endif > +_Xconst char* /* name */ > +); > + > Xauth *XauGetBestAuthByAddr( > #if NeedWidePrototypes > unsigned int /* family */, > @@ -132,6 +156,27 @@ char** /* type_names */, > _Xconst int* /* type_lengths */ > ); > > +Xauth *XauGetBestAuthByAddrWithFile( > +_Xconst char* /* auth_file */, > +#if NeedWidePrototypes > +unsigned int /* family */, > +unsigned int /* address_length */, > +#else > +unsigned short /* family */, > +unsigned short /* address_length */, > +#endif > +_Xconst char* /* address */, > +#if NeedWidePrototypes > +unsigned int /* number_length */, > +#else > +unsigned short /* number_length */, > +#endif > +_Xconst char* /* number */, > +int /* types_length */, > +char** /* type_names */, > +_Xconst int* /* type_lengths */ > +); > + > void XauDisposeAuth( > Xauth* /* auth */ > ); > diff --git a/man/Xau.man b/man/Xau.man > index d1b6603..e7060c7 100644 > --- a/man/Xau.man > +++ b/man/Xau.man > @@ -56,11 +56,23 @@ Xauth *XauGetAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short > \fInumber_length\fP\^, const char *\fInumber\fP\^, unsigned short > \fIname_length\fP\^, const char *\fIname\fP\^); > .HP > +Xauth *XauGetAuthByAddrWithFile (const char* \fIauth_file\fP\^, > +unsigned short \fIfamily\fP\^, unsigned short \fIaddress_length\fP\^, > +const char *\fIaddress\fP\^, unsigned short \fInumber_length\fP\^, > +const char *\fInumber\fP\^, unsigned short \fIname_length\fP\^, > +const char *\fIname\fP\^); > +.HP > Xauth *XauGetBestAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short > \fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short > \fInumber_length\fP\^, const char *\fInumber\fP\^, int \fItypes_length\fP\^, > char **\fItypes\fR\^, const int *\fItype_lengths\fR\^); > .HP > +Xauth *XauGetBestAuthByAddrWithFile (const char* \fIauth_file\fP\^, > +unsigned short \fIfamily\fP\^, unsigned short \fIaddress_length\fP\^, > +const char *\fIaddress\fP\^, unsigned short \fInumber_length\fP\^, > +const char *\fInumber\fP\^, int \fItypes_length\fP\^, char **\fItypes\fR\^, > +const int *\fItype_lengths\fR\^); > +.HP > int XauLockAuth (const char *\fIfile_name\fP\^, int \fIretries\fP\^, int > \fItimeout\fP\^, long \fIdead\fP\^); > .HP > @@ -85,7 +97,9 @@ returns 1 on success, 0 on failure. > .PP > \fBXauGetAuthByAddr\fP searches for an entry which matches the given network > address/display number pair. The entry is \fBnot\fP statically allocated > -and should be freed by calling \fIXauDisposeAuth\fP. > +and should be freed by calling \fIXauDisposeAuth\fP. It gets authorization > +file path by calling \fIXauFileName\fP, but its corresponding function > +\fBXauGetAuthByAddrWithFile\fP allows passing an explicit one. > .PP > \fBXauGetBestAuthByAddr\fP is similar to \fBXauGetAuthByAddr\fP, except > that a list of acceptable authentication methods is specified. Xau will > @@ -94,7 +108,9 @@ most secure authentication method). The \fItypes\fP argument is an array of > strings, one string for each authentication method. \fItypes_length\fP > specifies how many elements are in the \fItypes\fP array. > \fItypes_lengths\fP is an array of integers representing the length > -of each string. > +of each string. It gets authorization file path by calling \fIXauFileName\fP, > +but its corresponding function \fBXauGetBestAuthByAddrWithFile\fP allows > +passing an explicit one. > .PP > \fBXauLockAuth\fP does the work necessary to synchronously update an > authorization file. First it makes two file names, one with ``-c'' appended > diff --git a/man/XauGetAuthByAddrWithFile.man b/man/XauGetAuthByAddrWithFile.man > new file mode 100644 > index 0000000..df111d6 > --- /dev/null > +++ b/man/XauGetAuthByAddrWithFile.man > @@ -0,0 +1 @@ > +.so man__libmansuffix__/Xau.__libmansuffix__ > diff --git a/man/XauGetBestAuthByAddrWithFile.man b/man/XauGetBestAuthByAddrWithFile.man > new file mode 100644 > index 0000000..df111d6 > --- /dev/null > +++ b/man/XauGetBestAuthByAddrWithFile.man > @@ -0,0 +1 @@ > +.so man__libmansuffix__/Xau.__libmansuffix__ > From hdegoede at redhat.com Thu Oct 23 05:02:52 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Thu, 23 Oct 2014 14:02:52 +0200 Subject: [PATCH font/encodings] jisx0201.1976-0.enc: Add undefined mapping for 0x7f - 0xa0 range Message-ID: <1414065772-28709-1-git-send-email-hdegoede@redhat.com> From: Akira TAGOH The jisx0201 encoding has a hole in it in the 0x7f - 0xa0 range, see: http://en.wikipedia.org/wiki/JIS_X_0201 The document for the format of the encoding files says: "Codes not listed are assumed to map through the identity (i.e. to the same numerical value). In order to override this default mapping, you may specify a range of codes to be undefined by using an `UNDEFINE' line" jisx0201.1976-0.enc was not doing this, causing all the codes on the range to be mapped 1:1. This specifically is causing problems for ttmkfdir, which checks that a font covers (most of) an encoding before adding a line for that encoding to fonts.scale, and the hole not properly being undefined causes this check to fail for atleast the Sazanami fonts. Cc: Akira TAGOH BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1009350 Signed-off-by: Hans de Goede --- large/jisx0201.1976-0.enc | 1 + 1 file changed, 1 insertion(+) diff --git a/large/jisx0201.1976-0.enc b/large/jisx0201.1976-0.enc index 915d50c..328bc7a 100644 --- a/large/jisx0201.1976-0.enc +++ b/large/jisx0201.1976-0.enc @@ -68,6 +68,7 @@ ENDMAPPING STARTMAPPING unicode 0x5C 0x00A5 # YEN SIGN 0x7E 0x203E # OVERLINE +UNDEFINE 0x7F 0xA0 0x00A1 0x00DF 0xFF61 ENDMAPPING STARTMAPPING cmap 1 1 -- 2.1.0 From carlosg at gnome.org Thu Oct 23 06:44:11 2014 From: carlosg at gnome.org (Carlos Garnacho) Date: Thu, 23 Oct 2014 15:44:11 +0200 Subject: [PATCH xwayland 0/4] Implement wl_touch Message-ID: <1414071855-13558-1-git-send-email-carlosg@gnome.org> Hi!, Here's a few patches that add touch event support to xwayland. It has still a FIXME around device range/resolution if a non-identity matrix applies, which I'm a bit unsure how to handle. But this makes things work for the most common cases, which is an improvement to the status quo. Cheers, Carlos hw/xwayland/xwayland-input.c | 298 ++++++++++++++++++++++++++++++++++++++++--- hw/xwayland/xwayland.c | 6 +- hw/xwayland/xwayland.h | 13 ++ 3 files changed, 298 insertions(+), 19 deletions(-) From carlosg at gnome.org Thu Oct 23 06:44:12 2014 From: carlosg at gnome.org (Carlos Garnacho) Date: Thu, 23 Oct 2014 15:44:12 +0200 Subject: [PATCH 1/4] xwayland: Add xwl_touch struct In-Reply-To: <1414071855-13558-1-git-send-email-carlosg@gnome.org> References: <1414071855-13558-1-git-send-email-carlosg@gnome.org> Message-ID: <1414071855-13558-2-git-send-email-carlosg@gnome.org> This struct holds information about each individual, ongoing touchpoint. A list of these is held by the xwl_seat. Signed-off-by: Carlos Garnacho --- hw/xwayland/xwayland-input.c | 10 ++++++++++ hw/xwayland/xwayland.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index b8c543c..b661921 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -576,11 +576,21 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); wl_array_init(&xwl_seat->keys); + + xorg_list_init(&xwl_seat->touches); } void xwl_seat_destroy(struct xwl_seat *xwl_seat) { + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); + } + RemoveDevice(xwl_seat->pointer, FALSE); RemoveDevice(xwl_seat->keyboard, FALSE); wl_seat_destroy(xwl_seat->seat); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index bfffa71..3920e01 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -107,6 +107,13 @@ struct xwl_window { #define MODIFIER_META 0x01 +struct xwl_touch { + struct xwl_window *window; + int32_t id; + int x, y; + struct xorg_list link_touch; +}; + struct xwl_seat { DeviceIntPtr pointer; DeviceIntPtr keyboard; @@ -122,6 +129,8 @@ struct xwl_seat { struct xorg_list link; CursorPtr x_cursor; + struct xorg_list touches; + wl_fixed_t horizontal_scroll; wl_fixed_t vertical_scroll; uint32_t scroll_time; -- 2.1.0 From carlosg at gnome.org Thu Oct 23 06:44:14 2014 From: carlosg at gnome.org (Carlos Garnacho) Date: Thu, 23 Oct 2014 15:44:14 +0200 Subject: [PATCH 3/4] xwayland: Remove related touchpoints when unrealizing windows In-Reply-To: <1414071855-13558-1-git-send-email-carlosg@gnome.org> References: <1414071855-13558-1-git-send-email-carlosg@gnome.org> Message-ID: <1414071855-13558-4-git-send-email-carlosg@gnome.org> These sequences are forgotten to all purposes. Signed-off-by: Carlos Garnacho --- hw/xwayland/xwayland-input.c | 14 ++++++++++++++ hw/xwayland/xwayland.c | 6 +++--- hw/xwayland/xwayland.h | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 0aead8f..4f39032 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -870,6 +870,20 @@ xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y) } void +xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) +{ + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + if (xwl_touch->window->window == window) { + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); + } + } +} + +void InitInput(int argc, char *argv[]) { ScreenPtr pScreen = screenInfo.screens[0]; diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 9132969..f532ebc 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -287,10 +287,10 @@ xwl_unrealize_window(WindowPtr window) xwl_screen = xwl_screen_get(screen); xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { - if (!xwl_seat->focus_window) - continue; - if (xwl_seat->focus_window->window == window) + if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) xwl_seat->focus_window = NULL; + + xwl_seat_clear_touch(xwl_seat, window); } screen->UnrealizeWindow = xwl_screen->UnrealizeWindow; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 537cfbc..5a82103 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -162,6 +162,8 @@ void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); void xwl_seat_destroy(struct xwl_seat *xwl_seat); +void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window); + Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, -- 2.1.0 From carlosg at gnome.org Thu Oct 23 06:44:13 2014 From: carlosg at gnome.org (Carlos Garnacho) Date: Thu, 23 Oct 2014 15:44:13 +0200 Subject: [PATCH 2/4] xwayland: Implement the wl_touch interface In-Reply-To: <1414071855-13558-1-git-send-email-carlosg@gnome.org> References: <1414071855-13558-1-git-send-email-carlosg@gnome.org> Message-ID: <1414071855-13558-3-git-send-email-carlosg@gnome.org> A DeviceIntPtr with touch valuators is also created in order to deliver the translated touch events. The lifetime of xwl_touch structs is tied to the wayland ones, finishing in either wl_touch.up() or wl_touch.cancel() Signed-off-by: Carlos Garnacho --- hw/xwayland/xwayland-input.c | 206 ++++++++++++++++++++++++++++++++++++++++++- hw/xwayland/xwayland.h | 2 + 2 files changed, 205 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index b661921..0aead8f 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -139,6 +139,61 @@ xwl_keyboard_proc(DeviceIntPtr device, int what) return BadMatch; } +static int +xwl_touch_proc(DeviceIntPtr device, int what) +{ +#define NTOUCHPOINTS 20 +#define NBUTTONS 1 +#define NAXES 2 + struct xwl_seat *xwl_seat = device->public.devicePrivate; + Atom btn_labels[NBUTTONS] = { 0 }; + Atom axes_labels[NAXES] = { 0 }; + BYTE map[NBUTTONS + 1] = { 0 }; + + switch (what) { + case DEVICE_INIT: + device->public.on = FALSE; + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y); + + if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, + GetMotionHistorySize(), Absolute)) + return BadValue; + + if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) + return BadValue; + + if (!InitTouchClassDeviceStruct(device, NTOUCHPOINTS, + XIDirectTouch, NAXES)) + return BadValue; + + /* Valuators */ + /* FIXME: devices might be mapped to a single wl_output */ + InitValuatorAxisStruct(device, 0, axes_labels[0], + 0, xwl_seat->xwl_screen->width, + 10000, 0, 10000, Absolute); + InitValuatorAxisStruct(device, 1, axes_labels[1], + 0, xwl_seat->xwl_screen->height, + 10000, 0, 10000, Absolute); + return Success; + + case DEVICE_ON: + device->public.on = TRUE; + return Success; + + case DEVICE_OFF: + case DEVICE_CLOSE: + device->public.on = FALSE; + return Success; + } + + return BadMatch; +#undef NAXES +#undef NBUTTONS +#undef NTOUCHPOINTS +} + static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, @@ -471,6 +526,129 @@ static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_modifiers, }; +static struct xwl_touch * +xwl_seat_lookup_touch(struct xwl_seat *xwl_seat, int32_t id) +{ + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + if (xwl_touch->id == id) + return xwl_touch; + } + + return NULL; +} + +static void +xwl_touch_send_event(struct xwl_touch *xwl_touch, + struct xwl_seat *xwl_seat, int type) +{ + int32_t dx, dy; + ValuatorMask mask; + + dx = xwl_touch->window->window->drawable.x; + dy = xwl_touch->window->window->drawable.y; + + valuator_mask_zero(&mask); + valuator_mask_set(&mask, 0, dx + xwl_touch->x); + valuator_mask_set(&mask, 1, dy + xwl_touch->y); + QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask); +} + +static void +touch_handle_down(void *data, struct wl_touch *wl_touch, + uint32_t serial, uint32_t time, + struct wl_surface *surface, + int32_t id, wl_fixed_t sx_w, wl_fixed_t sy_w) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_touch *xwl_touch; + + if (surface == NULL) + return; + + xwl_touch = calloc(sizeof *xwl_touch, 1); + if (xwl_touch == NULL) { + ErrorF("touch_handle_down ENOMEM"); + return; + } + + xwl_touch->window = wl_surface_get_user_data(surface); + xwl_touch->id = id; + xwl_touch->x = wl_fixed_to_int(sx_w); + xwl_touch->y = wl_fixed_to_int(sy_w); + xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); + + xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); +} + +static void +touch_handle_up(void *data, struct wl_touch *wl_touch, + uint32_t serial, uint32_t time, int32_t id) +{ + struct xwl_touch *xwl_touch; + struct xwl_seat *xwl_seat = data; + + xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); + + if (!xwl_touch) + return; + + xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); +} + +static void +touch_handle_motion(void *data, struct wl_touch *wl_touch, + uint32_t time, int32_t id, + wl_fixed_t sx_w, wl_fixed_t sy_w) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_touch *xwl_touch; + + xwl_touch = xwl_seat_lookup_touch(xwl_seat, id); + + if (!xwl_touch) + return; + + xwl_touch->x = wl_fixed_to_int(sx_w); + xwl_touch->y = wl_fixed_to_int(sy_w); + xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); +} + +static void +touch_handle_frame(void *data, struct wl_touch *wl_touch) +{ +} + +static void +touch_handle_cancel(void *data, struct wl_touch *wl_touch) +{ + struct xwl_seat *xwl_seat = data; + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + /* We can't properly notify of cancellation to the X client + * once it thinks it has the ownership, send at least a + * TouchEnd event. + */ + xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd); + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); + } +} + +static const struct wl_touch_listener touch_listener = { + touch_handle_down, + touch_handle_up, + touch_handle_motion, + touch_handle_frame, + touch_handle_cancel +}; + static DeviceIntPtr add_device(struct xwl_seat *xwl_seat, const char *driver, DeviceProc device_proc) @@ -539,8 +717,26 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, DisableDevice(xwl_seat->keyboard, TRUE); } + if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) { + xwl_seat->wl_touch = wl_seat_get_touch(seat); + wl_touch_add_listener(xwl_seat->wl_touch, + &touch_listener, xwl_seat); + + if (xwl_seat->touch) + EnableDevice(xwl_seat->touch, TRUE); + else { + xwl_seat->touch = + add_device(xwl_seat, "xwayland-touch", xwl_touch_proc); + } + } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) { + wl_touch_release(xwl_seat->wl_touch); + xwl_seat->wl_touch = NULL; + + if (xwl_seat->touch) + DisableDevice(xwl_seat->touch, TRUE); + } + xwl_seat->xwl_screen->expecting_event--; - /* FIXME: Touch ... */ } static void @@ -591,8 +787,12 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) free(xwl_touch); } - RemoveDevice(xwl_seat->pointer, FALSE); - RemoveDevice(xwl_seat->keyboard, FALSE); + if (xwl_seat->pointer) + RemoveDevice(xwl_seat->pointer, FALSE); + if (xwl_seat->keyboard) + RemoveDevice(xwl_seat->keyboard, FALSE); + if (xwl_seat->touch) + RemoveDevice(xwl_seat->touch, FALSE); wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); wl_array_release(&xwl_seat->keys); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 3920e01..537cfbc 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -117,10 +117,12 @@ struct xwl_touch { struct xwl_seat { DeviceIntPtr pointer; DeviceIntPtr keyboard; + DeviceIntPtr touch; struct xwl_screen *xwl_screen; struct wl_seat *seat; struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; + struct wl_touch *wl_touch; struct wl_array keys; struct wl_surface *cursor; struct xwl_window *focus_window; -- 2.1.0 From carlosg at gnome.org Thu Oct 23 06:44:15 2014 From: carlosg at gnome.org (Carlos Garnacho) Date: Thu, 23 Oct 2014 15:44:15 +0200 Subject: [PATCH 4/4] xwayland: Make the XYToWindowProc implementation aware of touchpoints In-Reply-To: <1414071855-13558-1-git-send-email-carlosg@gnome.org> References: <1414071855-13558-1-git-send-email-carlosg@gnome.org> Message-ID: <1414071855-13558-5-git-send-email-carlosg@gnome.org> For these, we must first lookup the DIX sequence from the Sprite, we can then lookup the DDX ID/xwl_touch from xwayland's touch device. Signed-off-by: Carlos Garnacho --- hw/xwayland/xwayland-input.c | 68 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 4f39032..2d3192f 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -838,29 +838,71 @@ DDXRingBell(int volume, int pitch, int duration) { } -static WindowPtr -xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y) +static int32_t +lookup_sprite_touch_client_id (SpritePtr sprite) { - struct xwl_seat *xwl_seat = NULL; DeviceIntPtr device; + int i; for (device = inputInfo.devices; device; device = device->next) { - if (device->deviceProc == xwl_pointer_proc && - device->spriteInfo->sprite == sprite) { - xwl_seat = device->public.devicePrivate; - break; + if (!device->touch) + continue; + + for (i = 0; i < device->touch->num_touches; i++) { + TouchPointInfoPtr ti = device->touch->touches + i; + + if (sprite == &ti->sprite) + return ti->client_id; } } - if (xwl_seat == NULL) { - /* XTEST device */ - sprite->spriteTraceGood = 1; - return sprite->spriteTrace[0]; + return 0; +} + +static struct xwl_touch * +xwl_touch_lookup_from_client_id (struct xwl_seat *xwl_seat, int32_t client_id) +{ + DeviceIntPtr touch = xwl_seat->touch; + int i; + + for (i = 0; i < touch->last.num_touches; i++) { + DDXTouchPointInfoPtr ddx_ti = touch->last.touches + i; + + if (ddx_ti->client_id == client_id) + return xwl_seat_lookup_touch(xwl_seat, ddx_ti->ddx_id); + } + + return NULL; +} + +static WindowPtr +xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y) +{ + struct xwl_screen *xwl_screen; + struct xwl_seat *xwl_seat = NULL; + struct xwl_window *xwl_window = NULL; + struct xwl_touch *xwl_touch; + int32_t client_id; + + xwl_screen = xwl_screen_get(screen); + + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + if (xwl_seat->pointer->spriteInfo->sprite == sprite) { + xwl_window = xwl_seat->focus_window; + } else if ((client_id = lookup_sprite_touch_client_id (sprite)) != 0) { + xwl_touch = xwl_touch_lookup_from_client_id (xwl_seat, client_id); + + if (xwl_touch) + xwl_window = xwl_touch->window; + } + + if (xwl_window) + break; } - if (xwl_seat->focus_window) { + if (xwl_window) { sprite->spriteTraceGood = 2; - sprite->spriteTrace[1] = xwl_seat->focus_window->window; + sprite->spriteTrace[1] = xwl_window->window; return miSpriteTrace(sprite, x, y); } else { -- 2.1.0 From ajax at redhat.com Thu Oct 23 10:41:49 2014 From: ajax at redhat.com (Adam Jackson) Date: Thu, 23 Oct 2014 13:41:49 -0400 Subject: [PATCH] composite: Wrap GetSpans In-Reply-To: <861tpz3kp7.fsf@hiro.keithp.com> References: <1413998358-4186-1-git-send-email-ajax@redhat.com> <861tpz3kp7.fsf@hiro.keithp.com> Message-ID: <1414086109.23167.2.camel@redhat.com> On Wed, 2014-10-22 at 13:37 -0700, Keith Packard wrote: > Adam Jackson writes: > > > 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. > > In the core server code, GetSpans is only used for miCopyArea, > miCopyPlane, miGetImage and miPushPixels. miPushPixels isn't relevant as > it is only ever used to read from pixmaps. The others are already > covered by the existing SourceValidate and GetImage wrappers. I'm not sure this is true? ProcCopyArea doesn't call SourceValidate. fbCopyArea does (by way of miDoCopy), but miCopyArea does not, in fact there's no calls to SourceValidate in mibitblt at all. So if you found yourself on the span routines and wanted to take a screenshot, GetImage would work (because composite wraps it) but CopyArea to a shm pixmap would not, the child-to-parent paint wouldn't get triggered and you'd get stale contents. If we fixed mibitblt (and fbGetImage) to call SourceValidate, then I think we could remove misprite's GetImage and GetSpans wrappers, since SourceValidate would be sufficient. And I think we could remove compGetImage too for the same reason. I guess we could argue about whether to do the SourceValidate at the top in dix or at the bottom in mi/fb/etc. Obviously this wouldn't address the other direction of rendering with IncludeInferiors to a redirected child, but it'd still be bugfix by deletion. - ajax From keithp at keithp.com Thu Oct 23 14:30:43 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 14:30:43 -0700 Subject: [PATCH] xinerama: Fix access mode in GetImage's drawable lookup In-Reply-To: <20141009122242.GT3591@betterave.cristau.org> References: <1412781512-9719-1-git-send-email-ajax@redhat.com> <20141009122242.GT3591@betterave.cristau.org> Message-ID: <86lho61njw.fsf@hiro.keithp.com> Julien Cristau writes: > On Wed, Oct 8, 2014 at 17:18:32 +0200, Adam Jackson wrote: > >> Signed-off-by: Adam Jackson >> --- >> Xext/panoramiXprocs.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> > Reviewed-by: Julien Cristau Merged. 942e18e..3f4edd2 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:23:52 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:23:52 -0700 Subject: [PATCH 2/2] dix: Always store GC client clip as a region In-Reply-To: <1412781634-9770-2-git-send-email-ajax@redhat.com> References: <1412781634-9770-1-git-send-email-ajax@redhat.com> <1412781634-9770-2-git-send-email-ajax@redhat.com> Message-ID: <86fvee1fjb.fsf@hiro.keithp.com> Adam Jackson writes: > static Bool exaFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, > Pixel pixel, CARD32 planemask, CARD32 alu, > - unsigned int clientClipType); > + Bool clientClip); Using clientClip as the name for a boolean seems likely to lead to confusion with the usual usage of that name. Perhaps 'hasClientClip'? > > void > xnestDestroyClip(GCPtr pGC) > { > - xnestDestroyClipHelper(pGC); > - > + RegionDestroy(pGC->clientClip); Need to check for NULL before calling RegionDestroy: @@ -276,9 +276,11 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) void xnestDestroyClip(GCPtr pGC) { - RegionDestroy(pGC->clientClip); - XSetClipMask(xnestDisplay, xnestGC(pGC), None); - pGC->clientClip = NULL; + if (pGC->clientClip) { + RegionDestroy(pGC->clientClip); + XSetClipMask(xnestDisplay, xnestGC(pGC), None); + pGC->clientClip = NULL; + } } The rest of this patch has been Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:26:11 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:26:11 -0700 Subject: [PATCH 1/2] render: Always store client clip as a region In-Reply-To: <1412781634-9770-1-git-send-email-ajax@redhat.com> References: <1412781634-9770-1-git-send-email-ajax@redhat.com> Message-ID: <86d29i1ffg.fsf@hiro.keithp.com> Adam Jackson writes: > 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 and merged. 3f4edd2..462bf87 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:27:40 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:27:40 -0700 Subject: [PATCH 0/4] Finish killing VidMemInfo In-Reply-To: <201410131337.s9DDbcgS022820@glazunov.sibelius.xs4all.nl> References: <1412782739-9960-1-git-send-email-ajax@redhat.com> <201410131337.s9DDbcgS022820@glazunov.sibelius.xs4all.nl> Message-ID: <86a94m1fcz.fsf@hiro.keithp.com> Mark Kettenis writes: >> From: Adam Jackson >> Date: Wed, 8 Oct 2014 17:38:55 +0200 >> >> This finishes the job from: >> >> http://lists.freedesktop.org/archives/xorg-devel/2014-July/043343.html >> >> OpenBSD retains its special case for privsep setup, but otherwise this is >> the same as before. > > Please give me a chance to properly review and test this. Was > travelling last week. I'd love to get this merged; have you had a chance to review this yet? -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:29:14 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:29:14 -0700 Subject: [PULL] xwin engine removal In-Reply-To: <1412840196.26586.34.camel@dmt> References: <1412840196.26586.34.camel@dmt> Message-ID: <867fzq1fad.fsf@hiro.keithp.com> Adam Jackson writes: > Adam Jackson (2): > xwin: Remove native GDI engine (v2) > xwin: Remove primary DirectDraw engine Merged. 462bf87..de55aaf master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:30:53 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:30:53 -0700 Subject: [PATCH] mi: Mark the span blit routines as _X_COLD In-Reply-To: <1412841486-32402-1-git-send-email-ajax@redhat.com> References: <1412841486-32402-1-git-send-email-ajax@redhat.com> Message-ID: <864muu1f7m.fsf@hiro.keithp.com> Adam Jackson writes: > 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 and merged. de55aaf..cffd4e4 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 23 17:33:10 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 17:33:10 -0700 Subject: [PATCH 2/2] If fork fails in System(), don't fallthrough to exec() In-Reply-To: <1412858529-18856-2-git-send-email-alan.coopersmith@oracle.com> References: <1412858529-18856-1-git-send-email-alan.coopersmith@oracle.com> <1412858529-18856-2-git-send-email-alan.coopersmith@oracle.com> Message-ID: <861tpy1f3t.fsf@hiro.keithp.com> Alan Coopersmith writes: > Signed-off-by: Alan Coopersmith Both of these have been merged. cffd4e4..16a32c5 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From ahartmetz at gmail.com Thu Oct 23 15:09:55 2014 From: ahartmetz at gmail.com (Andreas Hartmetz) Date: Fri, 24 Oct 2014 00:09:55 +0200 Subject: Crash in X server [with Patch] Message-ID: <1448282.9CzppzRd38@rechenplan> Hello, (I am not subscrided) it looks like 6e50bfa706cd3ab884c933bf1f17c221a6208aa4 in xserver is faulty. The X server used to crash every couple of hours here, with backtraces as follows (some other messages included for context): [ 54.054] (II) RADEON(0): Modeline "1280x1024"x0.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync (64.0 kHz e) [ 54.054] (II) RADEON(0): Modeline "1440x900"x0.0 88.75 1440 1488 1520 1600 900 903 909 926 +hsync -vsync (55.5 kHz e) [ 54.054] (II) RADEON(0): Modeline "1600x1200"x0.0 162.00 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync (75.0 kHz e) [ 54.054] (II) RADEON(0): Modeline "1680x1050"x0.0 119.00 1680 1728 1760 1840 1050 1053 1059 1080 +hsync -vsync (64.7 kHz e) [ 54.054] (II) RADEON(0): Modeline "1920x1080"x60.0 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -hsync +vsync (67.1 kHz e) [ 81.990] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 4758 < target_msc 4759 [ 265.465] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 15748 < target_msc 15749 [ 425.104] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 25311 < target_msc 25312 [ 425.120] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 25311 < target_msc 25312 [ 761.224] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 45446 < target_msc 45447 [ 972.308] (WW) RADEON(0): radeon_dri2_flip_event_handler: Pageflip completion event has impossible msc 58091 < target_msc 58092 [ 989.809] (EE) [ 989.809] (EE) Backtrace: [ 989.813] (EE) 0: /opt/xorg/bin/Xorg (OsSigHandler+0x29) [0x594149] [ 989.815] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0 (__restore_rt+0x0) [0x7f4df0db7c8f] [ 989.816] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (strerror_l+0x6a0) [0x7f4df0a7c080] [ 989.821] (EE) 3: /opt/xorg/lib/dri/radeonsi_dri.so (memcpy_texture.isra.1+0x166) [0x7f4deb94fcc6] [ 989.825] (EE) 4: /opt/xorg/lib/dri/radeonsi_dri.so (_mesa_texstore+0x457) [0x7f4deb950927] [ 989.830] (EE) 5: /opt/xorg/lib/dri/radeonsi_dri.so (store_texsubimage+0x1ba) [0x7f4deb9514ea] [ 989.835] (EE) 6: /opt/xorg/lib/dri/radeonsi_dri.so (st_TexSubImage+0x10f) [0x7f4deb9a7b5f] [ 989.841] (EE) 7: /opt/xorg/lib/dri/radeonsi_dri.so (texsubimage+0x477) [0x7f4deb940817] [ 989.847] (EE) 8: /opt/xorg/lib/dri/radeonsi_dri.so (_mesa_TexSubImage2D+0x3f) [0x7f4deb9447ff] [ 989.853] (EE) 9: /opt/xorg/lib/xorg/modules/libglamoregl.so (__glamor_upload_pixmap_to_texture+0x1de) [0x7f4def40894e] [ 989.855] (EE) 10: /opt/xorg/lib/xorg/modules/libglamoregl.so (_glamor_upload_bits_to_pixmap_texture+0x2b9) [0x7f4def408e49] [ 989.857] (EE) 11: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_upload_sub_pixmap_to_texture+0x4c9) [0x7f4def409f79] [ 989.858] (EE) 12: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_upload_pixmap_to_texture+0x63) [0x7f4def40ad13] [ 989.860] (EE) 13: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_composite_choose_shader+0xfa4) [0x7f4def3fb724] [ 989.862] (EE) 14: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_composite_with_shader+0xce) [0x7f4def3fb9be] [ 989.864] (EE) 15: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_composite_clipped_region+0x46c) [0x7f4def3fcaac] [ 989.867] (EE) 16: /opt/xorg/lib/xorg/modules/libglamoregl.so (_glamor_composite+0x7ac) [0x7f4def3fd7ac] [ 989.869] (EE) 17: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_composite+0x3b) [0x7f4def3fdcab] [ 989.870] (EE) 18: /opt/xorg/bin/Xorg (damageComposite+0x141) [0x516d51] [ 989.872] (EE) 19: /opt/xorg/lib/xorg/modules/libglamoregl.so (glamor_trapezoids+0x2d6) [0x7f4def4069d6] [ 989.873] (EE) 20: /opt/xorg/bin/Xorg (ProcRenderTrapezoids+0x16c) [0x50d6cc] [ 989.873] (EE) 21: /opt/xorg/bin/Xorg (Dispatch+0x277) [0x438167] [ 989.873] (EE) 22: /opt/xorg/bin/Xorg (dix_main+0x3db) [0x43c30b] [ 989.876] (EE) 23: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf5) [0x7f4df0a04ec5] [ 989.876] (EE) 24: /opt/xorg/bin/Xorg (_start+0x29) [0x42679e] [ 989.878] (EE) 25: ? (?+0x29) [0x29] [ 989.879] (EE) [ 989.879] (EE) Segmentation fault at address 0x7f4de1950010 [ 989.879] (EE) Fatal server error: [ 989.879] (EE) Caught signal 11 (Segmentation fault). Server aborting The proposed fix is: commit bbcc084afc1396d3df42516baafea5839c95a488 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. diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 355fe4b..7c9bf26 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -774,8 +774,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, return FALSE; bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, stride, no_alpha, revert, swap_rb); - free(converted_bits); 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; I've already, a week or two ago, sent this to Michel a who reviewed it (no idea how to forward that, guess I'll need another review from whoever volunteers) and OK'd it. Cheers, Andreas Hartmetz From michel at daenzer.net Thu Oct 23 19:45:35 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Fri, 24 Oct 2014 11:45:35 +0900 Subject: Crash in X server [with Patch] In-Reply-To: <1448282.9CzppzRd38@rechenplan> References: <1448282.9CzppzRd38@rechenplan> Message-ID: <5449BD4F.7020001@daenzer.net> On 24.10.2014 07:09, Andreas Hartmetz wrote: > > commit bbcc084afc1396d3df42516baafea5839c95a488 > 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. > > diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c > index 355fe4b..7c9bf26 100644 > --- a/glamor/glamor_pixmap.c > +++ b/glamor/glamor_pixmap.c > @@ -774,8 +774,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr > pixmap, GLenum format, > return FALSE; > bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, > stride, no_alpha, revert, > swap_rb); > - free(converted_bits); > 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; > > I've already, a week or two ago, sent this to Michel a who reviewed it > (no idea how to forward that, guess I'll need another review from > whoever volunteers) and OK'd it. You could have just submitted the patch with my Reviewed-by: Michel D?nzer to this list and to Keith Packard (Cc'd, though that probably won't be visible in my post as distributed by the list), as I suggested. :) -- Earthling Michel D?nzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From keithp at keithp.com Thu Oct 23 22:12:42 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 23 Oct 2014 22:12:42 -0700 Subject: [PATCH] composite: Wrap GetSpans In-Reply-To: <1414086109.23167.2.camel@redhat.com> References: <1413998358-4186-1-git-send-email-ajax@redhat.com> <861tpz3kp7.fsf@hiro.keithp.com> <1414086109.23167.2.camel@redhat.com> Message-ID: <86oat2yrsl.fsf@hiro.keithp.com> Adam Jackson writes: > I'm not sure this is true? ProcCopyArea doesn't call SourceValidate. > fbCopyArea does (by way of miDoCopy), but miCopyArea does not, in fact > there's no calls to SourceValidate in mibitblt at all. Yeah, I completely missed that. > So if you found > yourself on the span routines and wanted to take a screenshot, GetImage > would work (because composite wraps it) but CopyArea to a shm pixmap > would not, the child-to-parent paint wouldn't get triggered and you'd > get stale contents. > > If we fixed mibitblt (and fbGetImage) to call SourceValidate, then I > think we could remove misprite's GetImage and GetSpans wrappers, since > SourceValidate would be sufficient. And I think we could remove > compGetImage too for the same reason. I guess we could argue about > whether to do the SourceValidate at the top in dix or at the bottom in > mi/fb/etc. Hrm. Doing it at the DIX level would rather change how software cursors work; right now, all rendering hits the software cursor pull-down code, even stuff which doesn't go directly through the DIX level. > Obviously this wouldn't address the other direction of rendering with > IncludeInferiors to a redirected child, but it'd still be bugfix by > deletion. At this point, it seems easiest to just take your GetSpans patch as a pure bugfix and consider whether to use SourceValidate in the future, and whether to push that up to DIX or leave it down at the bottom of the rendering stack... -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From airlied at gmail.com Fri Oct 24 00:25:58 2014 From: airlied at gmail.com (Dave Airlie) Date: Fri, 24 Oct 2014 17:25:58 +1000 Subject: tile property contents In-Reply-To: <20141023075840.GZ26941@phenom.ffwll.local> References: <20141022063440.GD26807@parker.nvidia.com> <20141022230321.GH30256@parker.nvidia.com> <20141023075840.GZ26941@phenom.ffwll.local> Message-ID: >> > > There are also configurations where users configure multiple heads to >> > > drive power walls that they want to be treated as one logical monitor, >> > > similar to the DP MST tiled display case. Normally, those powerwall >> > > configurations don't have any layout information from the monitors >> > > themselves, and the layout is configured by the user. >> > > >> > > Would it be appropriate for users to be able to set the TILE property >> > > in that sort of scenario? >> > > >> > > For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc >> > > should be expressed in pixels rather than tiles? Sometimes, the tiles >> > > in those powerwalls may not all have the same resolution, or may be >> > > configured with overlap. I suppose that would make the TILE configuration >> > > specific to the current modetimings on each tile... >> > >> > Why can't users just set that mode? >> >> Sure, users can set the mode, but: >> >> * Part of what the TILE property conveys is how monitors should be grouped >> for purposes of window maximization. Users don't have a great way to >> express that today, that I'm aware of. > > My understanding for why we want the TILE property is to avoid to > duplicate displayId parsing over every bit of userspace (and the fbcon > stuff in the kernel) interested in it. Imo the proper way for userspace is > to always just inherit whatever modeset config is already there. Andy's idea is good, I'd considered it before, the problem being how to expose it nicely, not sure if you'd want persistent via /sys or dynamic setting of the property by user for that session, so we could do it like xrandr modes. Daniel you are missing the nice case of using TILE for non-displayid monitors once the infrastructure is in place. Having it so you can create user defined tile groups to allow users to configure arbitrary walls is a useful thing, that you can't do any other way. > >> * Users might configure the mode they want, but then gnome-settings-daemon >> may come along later and decide it knows better than the user how things >> should be configured. One scenario where this comes up is: >> (a) user meticulously configures his power wall >> (b) user hotplugs another monitor >> I've definitely seen cases where window managers will try to be clever >> in response to a hotplug, and clobber the user's current configuration. >> If the TILE property conveyed how some set of monitors was supposed >> to be grouped, that would hopefully give window managers additional >> information, such that they would know to keep that group intact. > > Well, imnsho gnome display control center is a bit too opiniated about > automatic modeset changes. If their assumption is that they always know > perfectly what the user wants upon hotplug I really don't want to work > around this in the kernel. Since for everything else than a laptop + > beamer gnome panel always pisses me off ;-) > > I think gnome should just ask the user what it wants if there's more than > 2 physical displays (treating a tiled 4k screen as one ofc), since there's > really no way at all to tell. Well its not just a GNOME problem either, once things like SDL respect tIle properrty, we can create arbitary tile walls that the whole stack will respect, instead of hacks like fake xinerama. Dave. From keithp at keithp.com Fri Oct 24 12:02:16 2014 From: keithp at keithp.com (Keith Packard) Date: Fri, 24 Oct 2014 12:02:16 -0700 Subject: Crash in X server [with Patch] In-Reply-To: <5449BD4F.7020001@daenzer.net> References: <1448282.9CzppzRd38@rechenplan> <5449BD4F.7020001@daenzer.net> Message-ID: <86ioj9z3yf.fsf@hiro.keithp.com> Michel D?nzer writes: > On 24.10.2014 07:09, Andreas Hartmetz wrote: >> >> commit bbcc084afc1396d3df42516baafea5839c95a488 >> 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. >> >> diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c >> index 355fe4b..7c9bf26 100644 >> --- a/glamor/glamor_pixmap.c >> +++ b/glamor/glamor_pixmap.c >> @@ -774,8 +774,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr >> pixmap, GLenum format, >> return FALSE; >> bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, >> stride, no_alpha, revert, >> swap_rb); >> - free(converted_bits); >> 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; >> >> I've already, a week or two ago, sent this to Michel a who reviewed it >> (no idea how to forward that, guess I'll need another review from >> whoever volunteers) and OK'd it. > > You could have just submitted the patch with my > > Reviewed-by: Michel D?nzer > > to this list and to Keith Packard (Cc'd, though that probably won't be > visible in my post as distributed by the list), as I suggested. :) Looks like there's a path which will leak these bits still -- the fast path doesn't reach the call to free the bits. Can either of you review this patch and I'll merge both in? -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-glamor-Free-converted-bits-in-_glamor_upload_bits_to.patch Type: text/x-diff Size: 4824 bytes Desc: not available URL: -------------- next part -------------- -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From alan.coopersmith at oracle.com Fri Oct 24 18:13:12 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Fri, 24 Oct 2014 18:13:12 -0700 Subject: [PATCH font/encodings] jisx0201.1976-0.enc: Add undefined mapping for 0x7f - 0xa0 range In-Reply-To: <1414065772-28709-1-git-send-email-hdegoede@redhat.com> References: <1414065772-28709-1-git-send-email-hdegoede@redhat.com> Message-ID: <544AF928.2090608@oracle.com> On 10/23/14 05:02 AM, Hans de Goede wrote: > From: Akira TAGOH > > The jisx0201 encoding has a hole in it in the 0x7f - 0xa0 range, see: > http://en.wikipedia.org/wiki/JIS_X_0201 > > The document for the format of the encoding files says: > "Codes not listed are assumed to map through the identity (i.e. to the same > numerical value). In order to override this default mapping, you may specify > a range of codes to be undefined by using an `UNDEFINE' line" > > jisx0201.1976-0.enc was not doing this, causing all the codes on the range > to be mapped 1:1. This specifically is causing problems for ttmkfdir, which > checks that a font covers (most of) an encoding before adding a line for that > encoding to fonts.scale, and the hole not properly being undefined causes > this check to fail for atleast the Sazanami fonts. > > Cc: Akira TAGOH > BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1009350 > Signed-off-by: Hans de Goede > --- > large/jisx0201.1976-0.enc | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/large/jisx0201.1976-0.enc b/large/jisx0201.1976-0.enc > index 915d50c..328bc7a 100644 > --- a/large/jisx0201.1976-0.enc > +++ b/large/jisx0201.1976-0.enc > @@ -68,6 +68,7 @@ ENDMAPPING > STARTMAPPING unicode > 0x5C 0x00A5 # YEN SIGN > 0x7E 0x203E # OVERLINE > +UNDEFINE 0x7F 0xA0 > 0x00A1 0x00DF 0xFF61 > ENDMAPPING > STARTMAPPING cmap 1 1 > Reviewed-by: Alan Coopersmith -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From daniel at ffwll.ch Fri Oct 24 00:41:44 2014 From: daniel at ffwll.ch (Daniel Vetter) Date: Fri, 24 Oct 2014 09:41:44 +0200 Subject: tile property contents In-Reply-To: References: <20141022063440.GD26807@parker.nvidia.com> <20141022230321.GH30256@parker.nvidia.com> <20141023075840.GZ26941@phenom.ffwll.local> Message-ID: <20141024074144.GS26941@phenom.ffwll.local> On Fri, Oct 24, 2014 at 05:25:58PM +1000, Dave Airlie wrote: > >> > > There are also configurations where users configure multiple heads to > >> > > drive power walls that they want to be treated as one logical monitor, > >> > > similar to the DP MST tiled display case. Normally, those powerwall > >> > > configurations don't have any layout information from the monitors > >> > > themselves, and the layout is configured by the user. > >> > > > >> > > Would it be appropriate for users to be able to set the TILE property > >> > > in that sort of scenario? > >> > > > >> > > For the sake of generality, I wonder if max[hv]tiles and [hv]_tile_loc > >> > > should be expressed in pixels rather than tiles? Sometimes, the tiles > >> > > in those powerwalls may not all have the same resolution, or may be > >> > > configured with overlap. I suppose that would make the TILE configuration > >> > > specific to the current modetimings on each tile... > >> > > >> > Why can't users just set that mode? > >> > >> Sure, users can set the mode, but: > >> > >> * Part of what the TILE property conveys is how monitors should be grouped > >> for purposes of window maximization. Users don't have a great way to > >> express that today, that I'm aware of. > > > > My understanding for why we want the TILE property is to avoid to > > duplicate displayId parsing over every bit of userspace (and the fbcon > > stuff in the kernel) interested in it. Imo the proper way for userspace is > > to always just inherit whatever modeset config is already there. > > Andy's idea is good, I'd considered it before, the problem being how > to expose it nicely, > > not sure if you'd want persistent via /sys or dynamic setting of the > property by user for that session, so we could do it like xrandr > modes. > > Daniel you are missing the nice case of using TILE for non-displayid > monitors once the infrastructure is in place. > > Having it so you can create user defined tile groups to allow users to > configure arbitrary walls is a useful thing, that you can't do any > other way. > > > > >> * Users might configure the mode they want, but then gnome-settings-daemon > >> may come along later and decide it knows better than the user how things > >> should be configured. One scenario where this comes up is: > >> (a) user meticulously configures his power wall > >> (b) user hotplugs another monitor > >> I've definitely seen cases where window managers will try to be clever > >> in response to a hotplug, and clobber the user's current configuration. > >> If the TILE property conveyed how some set of monitors was supposed > >> to be grouped, that would hopefully give window managers additional > >> information, such that they would know to keep that group intact. > > > > Well, imnsho gnome display control center is a bit too opiniated about > > automatic modeset changes. If their assumption is that they always know > > perfectly what the user wants upon hotplug I really don't want to work > > around this in the kernel. Since for everything else than a laptop + > > beamer gnome panel always pisses me off ;-) > > > > I think gnome should just ask the user what it wants if there's more than > > 2 physical displays (treating a tiled 4k screen as one ofc), since there's > > really no way at all to tell. > > Well its not just a GNOME problem either, once things like SDL respect > tIle properrty, > we can create arbitary tile walls that the whole stack will respect, > instead of hacks > like fake xinerama. Hm yeah if we want tile walls als logical displays for full-screening and all that then this makes indeed sense. I didn't really consider that part, was probably thrown off by Andy's comments that some tile walls aren't pixel aligned which would look funky for full-screen apps I guess. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From alan.coopersmith at oracle.com Sat Oct 25 10:32:11 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Sat, 25 Oct 2014 10:32:11 -0700 Subject: [PATCH:rgb] Use asprintf() instead of malloc/strcpy/strcat, if its available Message-ID: <1414258331-2341-1-git-send-email-alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith --- configure.ac | 3 +++ showrgb.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 534e41d..bf7974a 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,7 @@ AC_INIT([rgb], [1.0.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [rgb]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) +AC_USE_SYSTEM_EXTENSIONS # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -37,6 +38,8 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS +AC_CHECK_FUNCS([asprintf]) + PKG_CHECK_MODULES(RGB, xproto) AC_MSG_CHECKING([for rgb database location]) diff --git a/showrgb.c b/showrgb.c index 31936ea..4796c5a 100644 --- a/showrgb.c +++ b/showrgb.c @@ -124,9 +124,16 @@ dumprgb (const char *filename) int lineno = 0; int red, green, blue; +#ifdef HAVE_ASPRINTF + if (asprintf(&path, "%s.txt", filename) == -1) { + perror (ProgramName); + exit (1); + } +#else path = (char *)malloc(strlen(filename) + 5); strcpy(path, filename); strcat(path, ".txt"); +#endif if (!(rgb = fopen(path, "r"))) { fprintf (stderr, "%s: unable to open rgb database \"%s\"\n", -- 1.7.9.2 From matthieu at herrb.eu Sat Oct 25 10:47:59 2014 From: matthieu at herrb.eu (Matthieu Herrb) Date: Sat, 25 Oct 2014 19:47:59 +0200 Subject: [PATCH:rgb] Use asprintf() instead of malloc/strcpy/strcat, if its available In-Reply-To: <1414258331-2341-1-git-send-email-alan.coopersmith@oracle.com> References: <1414258331-2341-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <20141025174758.GA14608@nebraska.herrb.net> On Sat, Oct 25, 2014 at 10:32:11AM -0700, Alan Coopersmith wrote: > Signed-off-by: Alan Coopersmith Reviewed-by: Matthieu Herrb > --- > configure.ac | 3 +++ > showrgb.c | 7 +++++++ > 2 files changed, 10 insertions(+) > > diff --git a/configure.ac b/configure.ac > index 534e41d..bf7974a 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -27,6 +27,7 @@ AC_INIT([rgb], [1.0.5], > [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [rgb]) > AC_CONFIG_SRCDIR([Makefile.am]) > AC_CONFIG_HEADERS([config.h]) > +AC_USE_SYSTEM_EXTENSIONS > > # Initialize Automake > AM_INIT_AUTOMAKE([foreign dist-bzip2]) > @@ -37,6 +38,8 @@ m4_ifndef([XORG_MACROS_VERSION], > XORG_MACROS_VERSION(1.8) > XORG_DEFAULT_OPTIONS > > +AC_CHECK_FUNCS([asprintf]) > + > PKG_CHECK_MODULES(RGB, xproto) > > AC_MSG_CHECKING([for rgb database location]) > diff --git a/showrgb.c b/showrgb.c > index 31936ea..4796c5a 100644 > --- a/showrgb.c > +++ b/showrgb.c > @@ -124,9 +124,16 @@ dumprgb (const char *filename) > int lineno = 0; > int red, green, blue; > > +#ifdef HAVE_ASPRINTF > + if (asprintf(&path, "%s.txt", filename) == -1) { > + perror (ProgramName); > + exit (1); > + } > +#else > path = (char *)malloc(strlen(filename) + 5); > strcpy(path, filename); > strcat(path, ".txt"); > +#endif > > if (!(rgb = fopen(path, "r"))) { > fprintf (stderr, "%s: unable to open rgb database \"%s\"\n", > -- > 1.7.9.2 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel -- Matthieu Herrb From wharms at bfs.de Sat Oct 25 11:01:59 2014 From: wharms at bfs.de (walter harms) Date: Sat, 25 Oct 2014 20:01:59 +0200 Subject: [PATCH:rgb] Use asprintf() instead of malloc/strcpy/strcat, if its available In-Reply-To: <1414258331-2341-1-git-send-email-alan.coopersmith@oracle.com> References: <1414258331-2341-1-git-send-email-alan.coopersmith@oracle.com> Message-ID: <544BE597.4000305@bfs.de> Am 25.10.2014 19:32, schrieb Alan Coopersmith: > Signed-off-by: Alan Coopersmith > --- > configure.ac | 3 +++ > showrgb.c | 7 +++++++ > 2 files changed, 10 insertions(+) > > diff --git a/configure.ac b/configure.ac > index 534e41d..bf7974a 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -27,6 +27,7 @@ AC_INIT([rgb], [1.0.5], > [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [rgb]) > AC_CONFIG_SRCDIR([Makefile.am]) > AC_CONFIG_HEADERS([config.h]) > +AC_USE_SYSTEM_EXTENSIONS > > # Initialize Automake > AM_INIT_AUTOMAKE([foreign dist-bzip2]) > @@ -37,6 +38,8 @@ m4_ifndef([XORG_MACROS_VERSION], > XORG_MACROS_VERSION(1.8) > XORG_DEFAULT_OPTIONS > > +AC_CHECK_FUNCS([asprintf]) > + > PKG_CHECK_MODULES(RGB, xproto) > > AC_MSG_CHECKING([for rgb database location]) > diff --git a/showrgb.c b/showrgb.c > index 31936ea..4796c5a 100644 > --- a/showrgb.c > +++ b/showrgb.c > @@ -124,9 +124,16 @@ dumprgb (const char *filename) > int lineno = 0; > int red, green, blue; > > +#ifdef HAVE_ASPRINTF > + if (asprintf(&path, "%s.txt", filename) == -1) { > + perror (ProgramName); > + exit (1); > + } > +#else > path = (char *)malloc(strlen(filename) + 5); > strcpy(path, filename); > strcat(path, ".txt"); > +#endif Why an error check for asprintf() but not for malloc() ? Intentional ? re, wh > if (!(rgb = fopen(path, "r"))) { > fprintf (stderr, "%s: unable to open rgb database \"%s\"\n", From alexdeucher at gmail.com Sun Oct 26 10:24:21 2014 From: alexdeucher at gmail.com (Alex Deucher) Date: Sun, 26 Oct 2014 13:24:21 -0400 Subject: [PATCH 3/4] modesetting: Export two functions I want to reuse from DRI2/Present. In-Reply-To: <1412932180-829-3-git-send-email-eric@anholt.net> References: <1412932180-829-1-git-send-email-eric@anholt.net> <1412932180-829-3-git-send-email-eric@anholt.net> Message-ID: On Fri, Oct 10, 2014 at 5:09 AM, Eric Anholt wrote: > 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: Alex Deucher > --- > hw/xfree86/drivers/modesetting/drmmode_display.c | 8 ++++---- > hw/xfree86/drivers/modesetting/drmmode_display.h | 3 +++ > 2 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c > index d959837..d8d1b44 100644 > --- a/hw/xfree86/drivers/modesetting/drmmode_display.c > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c > @@ -116,7 +116,7 @@ dumb_bo_unmap(int fd, struct dumb_bo *bo) > } > #endif > > -static int > +int > dumb_bo_destroy(int fd, struct dumb_bo *bo) > { > struct drm_mode_destroy_dumb arg; > @@ -137,8 +137,8 @@ dumb_bo_destroy(int fd, struct dumb_bo *bo) > return 0; > } > > -static struct dumb_bo * > -dumb_get_bo_from_handle(int fd, int handle, int pitch, int size) > +struct dumb_bo * > +dumb_get_bo_from_fd(int fd, int handle, int pitch, int size) > { > struct dumb_bo *bo; > int ret; > @@ -164,7 +164,7 @@ drmmode_SetSlaveBO(PixmapPtr ppix, > msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); > > ppriv->backing_bo = > - dumb_get_bo_from_handle(drmmode->fd, fd_handle, pitch, size); > + dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size); > if (!ppriv->backing_bo) > return FALSE; > > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h > index 438743b..c7e7ef0 100644 > --- a/hw/xfree86/drivers/modesetting/drmmode_display.h > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h > @@ -121,6 +121,9 @@ 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); > +struct dumb_bo *dumb_get_bo_from_fd(int drm_fd, int fd, int pitch, int size); > +int dumb_bo_destroy(int fd, struct dumb_bo *bo); > + > > #ifndef DRM_CAP_DUMB_PREFERRED_DEPTH > #define DRM_CAP_DUMB_PREFERRED_DEPTH 3 > -- > 2.1.1 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From alexdeucher at gmail.com Sun Oct 26 10:36:02 2014 From: alexdeucher at gmail.com (Alex Deucher) Date: Sun, 26 Oct 2014 13:36:02 -0400 Subject: Crash in X server [with Patch] In-Reply-To: <86ioj9z3yf.fsf@hiro.keithp.com> References: <1448282.9CzppzRd38@rechenplan> <5449BD4F.7020001@daenzer.net> <86ioj9z3yf.fsf@hiro.keithp.com> Message-ID: On Fri, Oct 24, 2014 at 3:02 PM, Keith Packard wrote: > Michel D?nzer writes: > >> On 24.10.2014 07:09, Andreas Hartmetz wrote: >>> >>> commit bbcc084afc1396d3df42516baafea5839c95a488 >>> 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. >>> >>> diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c >>> index 355fe4b..7c9bf26 100644 >>> --- a/glamor/glamor_pixmap.c >>> +++ b/glamor/glamor_pixmap.c >>> @@ -774,8 +774,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr >>> pixmap, GLenum format, >>> return FALSE; >>> bits = glamor_color_convert_to_bits(bits, converted_bits, w, h, >>> stride, no_alpha, revert, >>> swap_rb); >>> - free(converted_bits); >>> 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; >>> >>> I've already, a week or two ago, sent this to Michel a who reviewed it >>> (no idea how to forward that, guess I'll need another review from >>> whoever volunteers) and OK'd it. >> >> You could have just submitted the patch with my >> >> Reviewed-by: Michel D?nzer >> >> to this list and to Keith Packard (Cc'd, though that probably won't be >> visible in my post as distributed by the list), as I suggested. :) > > Looks like there's a path which will leak these bits still -- the fast > path doesn't reach the call to free the bits. Can either of you review > this patch and I'll merge both in? Makes sense to me. Reviewed-by: Alex Deucher From keithp at keithp.com Sun Oct 26 17:01:07 2014 From: keithp at keithp.com (Keith Packard) Date: Sun, 26 Oct 2014 17:01:07 -0700 Subject: Crash in X server [with Patch] In-Reply-To: References: <1448282.9CzppzRd38@rechenplan> <5449BD4F.7020001@daenzer.net> <86ioj9z3yf.fsf@hiro.keithp.com> Message-ID: <86siiaxtx8.fsf@hiro.keithp.com> Alex Deucher writes: > Makes sense to me. > > Reviewed-by: Alex Deucher I've merged and pushed both of these patches. 16a32c5..d181e52 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Sun Oct 26 17:23:42 2014 From: keithp at keithp.com (Keith Packard) Date: Sun, 26 Oct 2014 17:23:42 -0700 Subject: [PATCH] dri2: Only invalidate our tree upon Pixmap changes In-Reply-To: <1413788543-25289-1-git-send-email-chris@chris-wilson.co.uk> References: <1413788543-25289-1-git-send-email-chris@chris-wilson.co.uk> Message-ID: <86ppdexsvl.fsf@hiro.keithp.com> Chris Wilson writes: > 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 > invalidate at all. Might be better to just catch this in DIX and not call the SetWindowPixmap chain at all? diff --git a/composite/compwindow.c b/composite/compwindow.c index 9a6b2da..77bdfa2 100644 --- a/composite/compwindow.c +++ b/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)], -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From Gatis.Paeglis at theqtcompany.com Sun Oct 26 07:17:53 2014 From: Gatis.Paeglis at theqtcompany.com (Paeglis Gatis) Date: Sun, 26 Oct 2014 14:17:53 +0000 Subject: xlocale-config In-Reply-To: <1410727479-12160-1-git-send-email-ran234@gmail.com> References: <1410727479-12160-1-git-send-email-ran234@gmail.com> Message-ID: <1414333073045.40403@theqtcompany.com> +1 from me. I also agree that this is the best way. The aim of XCB project is to replace Xlib, which means that XCB clients should have a Xlib independent way of handling Compose keys. There is no way to get the Compose file location from Xlib's pkg-config file. My current implementation in Qt5 simply searches the most probably paths where Compose data could be located on the system which is not a very satisfying solution. It is a logical step to move Compose/locale data into a separate repository as suggested by Ran. Then other libraries that don't want to be dependent on Xlib could still use the Compose files. Gatis. ________________________________________ From: xorg-devel on behalf of Ran Benita Sent: Sunday, September 14, 2014 10:44 PM To: xorg-devel at lists.freedesktop.org Subject: xlocale-config This set of patches splits the locale data (the nls/ directory and a couple of related patches) from Xlib to a separate repository, "xlocale-config" (the insparation is xkeyboard-config which I think has worked out well). Xlib is made to depend on xlocale-config. The reason for doing this is to be able to use the Compose files without depending on Xlib. To correctly use the Compose files, the rest of the locale data is also needed. My own interest is for a Compose implementation in libxkbcommon, but other projects also have Compose implementations independent of Xlib (Qt5 and probably others). Some distributions such as Debian already have a split libx11-data package. But I think this is better done upstream, and I don't think many other distribution which do something similar. Note: when we discussed this on IRC, we agreed to leave the nls/*/XI18N_OBJS files in the libX11 repo. Having tried that, it causes a lot of duplication and fragility, and it would make it harder to e.g. add new locales. This could potentially create a circular dependency if some change in Xlib necessitates a change in the XI18N_OBJS files. >From looking at git log something like that was never necessary besides (maybe?) one case: http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=0e45f64766c0557c8e99a979c70ca6f55664dae7 Finally, the xlocale-config copies over the files from libX11. If you prefer to preserve the git history it is not a problem (I wanted to avoid having duplicate history with different SHAs in two live repos). Some patches are snipped due to large size (and for deletions I used --irreversible-delete). You can find them here: https://github.com/bluetech/libX11/ (xlocale-config branch) https://github.com/bluetech/xlocale-config Thanks, Ran _______________________________________________ xorg-devel at lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel From peter.hutterer at who-t.net Sun Oct 26 21:37:30 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Mon, 27 Oct 2014 14:37:30 +1000 Subject: [PATCH inputproto] specs: rename EVENTMASK to EVTYPEMASK Message-ID: <20141027043730.GA21536@jelly.redhat.com> EVENTMASK was used twice in the spec, once as the actual bitmask for events, once as the set of deviceid, mask length and mask. The libXi public API uses XIEventMask for the latter data triplet, so leave EVENTMASK, and rename the pure bitmask to EVTYPEMASK. Reported-by: Gabriel Laskar Signed-off-by: Peter Hutterer --- specs/XI2proto.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt index e3636ac..697dd89 100644 --- a/specs/XI2proto.txt +++ b/specs/XI2proto.txt @@ -672,9 +672,9 @@ Data types device hierarchy. See Section "The Master/Slave device hierarchy" for more information. - EVENTMASK - An EVENTMASK is a binary mask defined as (1 << event type). - A SETofEVENTMASK is a binary OR of zero or more EVENTMASK. + EVTYPEMASK + An EVTYPEMASK is a binary mask defined as (1 << event type). + A SETofEVTYPEMASK is a binary OR of zero or more EVTYPEMASK. FP1616 Fixed point decimal in 16.16 format as one INT16 and one CARD16. @@ -971,7 +971,7 @@ XISelectEvents EVENTMASK { deviceid: DEVICE, mask_len: CARD16, - mask: SETofEVENTMASK + mask: SETofEVTYPEMASK } window The window to select the events on. @@ -1392,7 +1392,7 @@ XIGrabDevice time: TIMESTAMP or CurrentTime cursor: Cursor mask_len: CARD16 - masks: SETofEVENTMASK + masks: SETofEVTYPEMASK ? status: Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable ???? @@ -1638,7 +1638,7 @@ XIPassiveGrabDevice paired_device_mode: { Synchronous, Asynchronous } num_modifiers: INT16 mask_len: CARD16 - masks: SETofEVENTMASK + masks: SETofEVTYPEMASK modifiers: LISTofSETofMODIFIERMASK ? num_modifiers_return: INT16 -- 1.9.3 From chris at chris-wilson.co.uk Mon Oct 27 01:33:59 2014 From: chris at chris-wilson.co.uk (Chris Wilson) Date: Mon, 27 Oct 2014 08:33:59 +0000 Subject: [PATCH] dri2: Only invalidate our tree upon Pixmap changes In-Reply-To: <86ppdexsvl.fsf@hiro.keithp.com> References: <1413788543-25289-1-git-send-email-chris@chris-wilson.co.uk> <86ppdexsvl.fsf@hiro.keithp.com> Message-ID: <20141027083359.GC14095@nuc-i3427.alporthouse.com> On Sun, Oct 26, 2014 at 05:23:42PM -0700, Keith Packard wrote: > Chris Wilson writes: > > > 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 > > invalidate at all. > > Might be better to just catch this in DIX and not call the > SetWindowPixmap chain at all? Possibly. I wasn't sure if anything on the callchain was interested in knowing about calls to SetWindowPixmap() with the same pixmap. It seems dubious but it might have been used as a notification hook somewhere. I also wasn't sure if another path would also reset the old Pixmap - though that possibility seems limited to miext/rootless. As I was uncertain, I patched hw/xfree86/dri2. > diff --git a/composite/compwindow.c b/composite/compwindow.c > index 9a6b2da..77bdfa2 100644 > --- a/composite/compwindow.c > +++ b/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)], > This patch also fixes the regression, so if you are happier with applying the fix here, Reviewed-by: Chris Wilson Tested-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre From hdegoede at redhat.com Mon Oct 27 01:51:20 2014 From: hdegoede at redhat.com (Hans de Goede) Date: Mon, 27 Oct 2014 09:51:20 +0100 Subject: [PATCH inputproto] specs: rename EVENTMASK to EVTYPEMASK In-Reply-To: <20141027043730.GA21536@jelly.redhat.com> References: <20141027043730.GA21536@jelly.redhat.com> Message-ID: <544E0788.2040606@redhat.com> Hi, On 10/27/2014 05:37 AM, Peter Hutterer wrote: > EVENTMASK was used twice in the spec, once as the actual bitmask for events, > once as the set of deviceid, mask length and mask. > > The libXi public API uses XIEventMask for the latter data triplet, so leave > EVENTMASK, and rename the pure bitmask to EVTYPEMASK. > > Reported-by: Gabriel Laskar > Signed-off-by: Peter Hutterer Looks good: Reviewed-by: Hans de Goede Regards, Hans > --- > specs/XI2proto.txt | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt > index e3636ac..697dd89 100644 > --- a/specs/XI2proto.txt > +++ b/specs/XI2proto.txt > @@ -672,9 +672,9 @@ Data types > device hierarchy. See Section "The Master/Slave device hierarchy" > for more information. > > - EVENTMASK > - An EVENTMASK is a binary mask defined as (1 << event type). > - A SETofEVENTMASK is a binary OR of zero or more EVENTMASK. > + EVTYPEMASK > + An EVTYPEMASK is a binary mask defined as (1 << event type). > + A SETofEVTYPEMASK is a binary OR of zero or more EVTYPEMASK. > > FP1616 > Fixed point decimal in 16.16 format as one INT16 and one CARD16. > @@ -971,7 +971,7 @@ XISelectEvents > > EVENTMASK { deviceid: DEVICE, > mask_len: CARD16, > - mask: SETofEVENTMASK > + mask: SETofEVTYPEMASK } > > window > The window to select the events on. > @@ -1392,7 +1392,7 @@ XIGrabDevice > time: TIMESTAMP or CurrentTime > cursor: Cursor > mask_len: CARD16 > - masks: SETofEVENTMASK > + masks: SETofEVTYPEMASK > ▶ > status: Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable > └─── > @@ -1638,7 +1638,7 @@ XIPassiveGrabDevice > paired_device_mode: { Synchronous, Asynchronous } > num_modifiers: INT16 > mask_len: CARD16 > - masks: SETofEVENTMASK > + masks: SETofEVTYPEMASK > modifiers: LISTofSETofMODIFIERMASK > ▶ > num_modifiers_return: INT16 > From vincent at vinc17.net Mon Oct 27 02:50:30 2014 From: vincent at vinc17.net (Vincent Lefevre) Date: Mon, 27 Oct 2014 10:50:30 +0100 Subject: [PATCH] xkbcomp: Improved -w option parsing Message-ID: <20141027095030.GA29316@xvii.vinc17.org> This patch improves -w option parsing even further, for cases like "xkbcomp -w6 4.xkb out.xkb" (which were not handled by the fix of #66344). Moreover, though this form can be regarded as ambiguous, the warning level is still optional (set to 0 if not present), and errors like "xkbcomp -wfoo in out" are detected and reported. Signed-off-by: Vincent Lefevre --- xkbcomp.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/xkbcomp.c b/xkbcomp.c index 956e79c..adfa89a 100644 --- a/xkbcomp.c +++ b/xkbcomp.c @@ -576,17 +576,37 @@ parseArgs(int argc, char *argv[]) } else if (strncmp(argv[i], "-w", 2) == 0) { - if ((i >= (argc - 1)) || (!isdigit(argv[i + 1][0]))) + unsigned long utmp; + char *tmp2; + /* If text is just after "-w" in the same word, then it must + * be a number and it is the warning level. Otherwise, if the + * next argument is a number, then it is the warning level, + * else the warning level is assumed to be 0. + */ + if (argv[i][2] == '\0') { warningLevel = 0; - if (isdigit(argv[i][2])) - if (sscanf(&argv[i][2], "%i", &itmp) == 1) - warningLevel = itmp; + if (i < argc - 1) + { + utmp = strtoul(argv[i+1], &tmp2, 10); + if (argv[i+1][0] != '\0' && *tmp2 == '\0') + { + warningLevel = utmp > 10 ? 10 : utmp; + i++; + } + } } else { - if (sscanf(argv[++i], "%i", &itmp) == 1) - warningLevel = itmp; + utmp = strtoul(&argv[i][2], &tmp2, 10); + if (*tmp2 == '\0') + warningLevel = utmp > 10 ? 10 : utmp; + else + { + ERROR1("Unknown flag \"%s\" on command line\n", argv[i]); + Usage(argc, argv); + return False; + } } } else if ((strcmp(argv[i], "-xkb") == 0) && (!xkblist)) -- 2.1.1 From thombarepr at yahoo.com Mon Oct 27 04:15:10 2014 From: thombarepr at yahoo.com (Pasrshuram Thombare) Date: Mon, 27 Oct 2014 11:15:10 +0000 (UTC) Subject: xf86-input-evdev not working with touch device with MT only axes Message-ID: <1937211792.593842.1414408510967.JavaMail.yahoo@jws100100.mail.ne1.yahoo.com> Hi, I am using xf86-input-evdev(2.8.1) for touch device with MT only axes, but I am getting following error. "evdev: found only multitouch-axes. That shouldn't happen. evdev: failed to initialize for absolute axes." I am aware of Bug#64029. But solution seems just a way to avoid crash. Is there any fix available for this issue? Thanks, Parshuram From ajax at nwnk.net Mon Oct 27 08:56:45 2014 From: ajax at nwnk.net (Adam Jackson) Date: Mon, 27 Oct 2014 11:56:45 -0400 Subject: [PATCH xfree86] Skip SetCursor when vtSema is FALSE. In-Reply-To: <1413962728-16125-1-git-send-email-yogishk@nvidia.com> References: <1413962728-16125-1-git-send-email-yogishk@nvidia.com> Message-ID: <1414425405.15671.17.camel@dmt> On Wed, 2014-10-22 at 12:55 +0530, Yogish Kulkarni wrote: > 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 Reviewed-by: Adam Jackson - ajax From ajax at redhat.com Mon Oct 27 12:51:49 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:49 -0400 Subject: [PATCH 01/23] mi: Unexport wide line details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-2-git-send-email-ajax@redhat.com> XAA wanted these, once upon a time, but that's gone now. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 2 +- mi/miwideline.c | 8 ++++---- mi/miwideline.h | 25 ------------------------- 4 files changed, 5 insertions(+), 31 deletions(-) diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index d9a4478..c2a1942 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -217,7 +217,6 @@ cat > sdksyms.c << EOF #include "micoord.h" #include "mifillarc.h" #include "mispans.h" -#include "miwideline.h" #include "mistruct.h" #include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 0cef779..526f4bb 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 + mispans.h mistruct.h mifpoly.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/miwideline.c b/mi/miwideline.c index 29ba12c..295a05a 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -273,7 +273,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 +325,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 +865,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 +886,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; diff --git a/mi/miwideline.h b/mi/miwideline.h index 1105411..a9f2740 100644 --- a/mi/miwideline.h +++ b/mi/miwideline.h @@ -92,28 +92,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); -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:50 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:50 -0400 Subject: [PATCH 02/23] mi: Unexport polygon edge table implementation details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-3-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/mipoly.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/mi/mipoly.h b/mi/mipoly.h index e37fb48..02fcfc8 100644 --- a/mi/mipoly.h +++ b/mi/mipoly.h @@ -174,20 +174,17 @@ typedef struct _ScanLineListBlock { /* mipolyutil.c */ -extern _X_EXPORT Bool miCreateETandAET(int /*count */ , - DDXPointPtr /*pts */ , - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs */ , - ScanLineListBlock * /*pSLLBlock */ - ); +extern Bool miCreateETandAET(int /*count */ , + DDXPointPtr /*pts */ , + EdgeTable * /*ET*/, + EdgeTableEntry * /*AET*/, + EdgeTableEntry * /*pETEs */ , + ScanLineListBlock * /*pSLLBlock */); -extern _X_EXPORT void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */ - ); +extern void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */); -extern _X_EXPORT void micomputeWAET(EdgeTableEntry * /*AET*/); +extern void micomputeWAET(EdgeTableEntry * /*AET*/); -extern _X_EXPORT int miInsertionSort(EdgeTableEntry * /*AET*/); +extern int miInsertionSort(EdgeTableEntry * /*AET*/); -extern _X_EXPORT void miFreeStorage(ScanLineListBlock * /*pSLLBlock */ - ); +extern void miFreeStorage(ScanLineListBlock * /*pSLLBlock */); -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:48 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:48 -0400 Subject: [PATCH 00/23] mi/fb diet, GC client clip, and GC type fixes Message-ID: <1414439531-28146-1-git-send-email-ajax@redhat.com> Mostly a resend of previous efforts. 23 changes the unsigned longs in the GC to be unsigned int, since that's all the bigger pixels are anyway, and the serial number needn't be 64 bits. This series is also available in my for-keithp branch on people.fd.o. - ajax From ajax at redhat.com Mon Oct 27 12:51:52 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:52 -0400 Subject: [PATCH 04/23] mi: Unexport subpixel polygon implementation details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-5-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mifpoly.h | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index b93a8f9..b243029 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 \ - mistruct.h mifpoly.h mioverlay.h + mistruct.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/mifpoly.h b/mi/mifpoly.h index f853fb4..4b27d1c 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -89,14 +89,13 @@ typedef struct _SppArc { /* mifpolycon.c */ -extern _X_EXPORT void miFillSppPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - SppPointPtr /*ptsIn */ , - int /*xTrans */ , - int /*yTrans */ , - double /*xFtrans */ , - double /*yFtrans */ - ); +extern void miFillSppPoly(DrawablePtr /*dst */ , + GCPtr /*pgc */ , + int /*count */ , + SppPointPtr /*ptsIn */ , + int /*xTrans */ , + int /*yTrans */ , + double /*xFtrans */ , + double /*yFtrans */); #endif /* __MIFPOLY_H__ */ -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:51 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:51 -0400 Subject: [PATCH 03/23] mi: Unexport span group implementation details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-4-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mispans.h | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index 526f4bb..b93a8f9 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -3,7 +3,7 @@ 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 mistruct.h mifpoly.h mioverlay.h + mistruct.h mifpoly.h mioverlay.h endif AM_CFLAGS = $(DIX_CFLAGS) diff --git a/mi/mispans.h b/mi/mispans.h index f3148ff..7c3fcef 100644 --- a/mi/mispans.h +++ b/mi/mispans.h @@ -61,24 +61,20 @@ typedef struct { } SpanGroup; /* Initialize SpanGroup. MUST BE DONE before use. */ -extern _X_EXPORT void miInitSpanGroup(SpanGroup * /*spanGroup */ - ); +extern 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 */ - ); +extern 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 */ - ); +extern 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 */ - ); +extern void miFreeSpanGroup(SpanGroup * /*spanGroup */); /* Rops which must use span groups */ #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:54 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:54 -0400 Subject: [PATCH 06/23] mi: Fold mispans.c into miwideline.c In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-7-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 2 - mi/mispans.c | 526 -------------------------------------------------- mi/mispans.h | 83 -------- mi/miwideline.c | 518 +++++++++++++++++++++++++++++++++++++++++++++++++ mi/miwideline.h | 1 - 6 files changed, 518 insertions(+), 613 deletions(-) delete mode 100644 mi/mispans.c delete mode 100644 mi/mispans.h diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index c2a1942..9c3c02f 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -216,7 +216,6 @@ cat > sdksyms.c << EOF #include "mizerarc.h" #include "micoord.h" #include "mifillarc.h" -#include "mispans.h" #include "mistruct.h" #include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 4466f69..149dc06 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -47,8 +47,6 @@ libmi_la_SOURCES = \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ - mispans.c \ - mispans.h \ misprite.c \ misprite.h \ mistruct.h \ diff --git a/mi/mispans.c b/mi/mispans.c deleted file mode 100644 index 11c8a43..0000000 --- a/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/mi/mispans.h b/mi/mispans.h deleted file mode 100644 index 7c3fcef..0000000 --- a/mi/mispans.h +++ /dev/null @@ -1,83 +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 void miInitSpanGroup(SpanGroup * /*spanGroup */); - -/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */ -extern void miAppendSpans(SpanGroup * /*spanGroup */ , - SpanGroup * /*otherGroup */ , - Spans * /*spans */); - -/* Paint a span group, insuring that each pixel is painted at most once */ -extern 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 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/mi/miwideline.c b/mi/miwideline.c index 295a05a..452d74f 100644 --- a/mi/miwideline.c +++ b/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) { diff --git a/mi/miwideline.h b/mi/miwideline.h index a9f2740..88bc3d6 100644 --- a/mi/miwideline.h +++ b/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 */ /* -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:55 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:55 -0400 Subject: [PATCH 07/23] mi: Fold mifpolycon.c into miarc.c In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-8-git-send-email-ajax@redhat.com> 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 --- hw/xfree86/sdksyms.sh | 1 - mi/Makefile.am | 1 - mi/miarc.c | 205 +++++++++++++++++++++++++++++++++++++++++ mi/midash.c | 1 - mi/mifillarc.c | 1 - mi/mifpoly.h | 41 --------- mi/mifpolycon.c | 249 -------------------------------------------------- 7 files changed, 205 insertions(+), 294 deletions(-) delete mode 100644 mi/mifpolycon.c diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index 9c3c02f..2305073 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -217,7 +217,6 @@ cat > sdksyms.c << EOF #include "micoord.h" #include "mifillarc.h" #include "mistruct.h" -#include "mifpoly.h" #include "mioverlay.h" diff --git a/mi/Makefile.am b/mi/Makefile.am index 149dc06..d9139a3 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -24,7 +24,6 @@ libmi_la_SOURCES = \ mifillarc.c \ mifillarc.h \ mifillrct.c \ - mifpolycon.c \ mifpoly.h \ migc.c \ migc.h \ diff --git a/mi/miarc.c b/mi/miarc.c index e55108a..7bbe5b3 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -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); @@ -1110,6 +1126,195 @@ miWideArc(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) { diff --git a/mi/midash.c b/mi/midash.c index 78cbaf2..50b0fbe 100644 --- a/mi/midash.c +++ b/mi/midash.c @@ -49,7 +49,6 @@ SOFTWARE. #include "regionstr.h" #include "mistruct.h" -#include "mifpoly.h" void miStepDash(int dist, /* distance to step */ diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 9a5e785..246d70f 100644 --- a/mi/mifillarc.c +++ b/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" diff --git a/mi/mifpoly.h b/mi/mifpoly.h index 4b27d1c..9304c6f 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -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,27 +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 void miFillSppPoly(DrawablePtr /*dst */ , - GCPtr /*pgc */ , - int /*count */ , - SppPointPtr /*ptsIn */ , - int /*xTrans */ , - int /*yTrans */ , - double /*xFtrans */ , - double /*yFtrans */); - #endif /* __MIFPOLY_H__ */ diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c deleted file mode 100644 index b133731..0000000 --- a/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; -} -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:56 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:56 -0400 Subject: [PATCH 08/23] mi: Fold mipoly{con,gen}.c into mipoly.c In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-9-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 - mi/mi.h | 16 --- mi/mipoly.c | 334 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- mi/mipolycon.c | 235 ---------------------------------------- mi/mipolygen.c | 213 ------------------------------------ 5 files changed, 329 insertions(+), 471 deletions(-) delete mode 100644 mi/mipolycon.c delete mode 100644 mi/mipolygen.c diff --git a/mi/Makefile.am b/mi/Makefile.am index d9139a3..44e4f20 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -36,8 +36,6 @@ libmi_la_SOURCES = \ mipointrst.h \ mipoly.c \ mipoly.h \ - mipolycon.c \ - mipolygen.c \ mipolypnt.c \ mipolyrect.c \ mipolyseg.c \ diff --git a/mi/mi.h b/mi/mi.h index 5a455c9..3269d9b 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -288,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 */ , diff --git a/mi/mipoly.c b/mi/mipoly.c index 07d9818..3d49789 100644 --- a/mi/mipoly.c +++ b/mi/mipoly.c @@ -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,337 @@ SOFTWARE. #include "gcstruct.h" #include "pixmapstr.h" #include "mi.h" +#include "miscanfill.h" +#include "mipoly.h" #include "regionstr.h" +/* 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/mi/mipolycon.c b/mi/mipolycon.c deleted file mode 100644 index e831633..0000000 --- a/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/mi/mipolygen.c b/mi/mipolygen.c deleted file mode 100644 index 2031b42..0000000 --- a/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; -} -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:58 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:58 -0400 Subject: [PATCH 10/23] mi: Fold micursor.c into mipointer.c In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-11-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 1 - mi/micursor.c | 68 ---------------------------------------------------------- mi/mipointer.c | 14 ++++++++++++ 3 files changed, 14 insertions(+), 69 deletions(-) delete mode 100644 mi/micursor.c diff --git a/mi/Makefile.am b/mi/Makefile.am index ce416c4..110c3f5 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -16,7 +16,6 @@ libmi_la_SOURCES = \ micmap.h \ micoord.h \ micopy.c \ - micursor.c \ midash.c \ midispcur.c \ mieq.c \ diff --git a/mi/micursor.c b/mi/micursor.c deleted file mode 100644 index 13ce776..0000000 --- a/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/mi/mipointer.c b/mi/mipointer.c index 6fa416d..9805425 100644 --- a/mi/mipointer.c +++ b/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 -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:53 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:53 -0400 Subject: [PATCH 05/23] mi: Unexport arc fill implementation details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-6-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 2 +- mi/mifillarc.c | 4 ++-- mi/mifillarc.h | 9 --------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/mi/Makefile.am b/mi/Makefile.am index b243029..4466f69 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -2,7 +2,7 @@ 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 \ + migc.h mipointrst.h mizerarc.h micoord.h \ mistruct.h mioverlay.h endif diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 08484d7..9a5e785 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -51,7 +51,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 +277,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; diff --git a/mi/mifillarc.h b/mi/mifillarc.h index 1478d18..61ab253 100644 --- a/mi/mifillarc.h +++ b/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__ */ -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:57 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:57 -0400 Subject: [PATCH 09/23] mi: Fold mipolyutil.c into mipoly.c In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-10-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- mi/Makefile.am | 1 - mi/mipoly.c | 285 +++++++++++++++++++++++++++++++++++++++++++ mi/mipoly.h | 17 --- mi/mipolyutil.c | 369 -------------------------------------------------------- 4 files changed, 285 insertions(+), 387 deletions(-) delete mode 100644 mi/mipolyutil.c diff --git a/mi/Makefile.am b/mi/Makefile.am index 44e4f20..ce416c4 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -40,7 +40,6 @@ libmi_la_SOURCES = \ mipolyrect.c \ mipolyseg.c \ mipolytext.c \ - mipolyutil.c \ mipushpxl.c \ miscanfill.h \ miscrinit.c \ diff --git a/mi/mipoly.c b/mi/mipoly.c index 3d49789..0ed2edb 100644 --- a/mi/mipoly.c +++ b/mi/mipoly.c @@ -61,6 +61,291 @@ SOFTWARE. #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) diff --git a/mi/mipoly.h b/mi/mipoly.h index 02fcfc8..fc5a5cf 100644 --- a/mi/mipoly.h +++ b/mi/mipoly.h @@ -171,20 +171,3 @@ typedef struct _ScanLineListBlock { pAET = pAET->next; \ } \ } - -/* mipolyutil.c */ - -extern Bool miCreateETandAET(int /*count */ , - DDXPointPtr /*pts */ , - EdgeTable * /*ET*/, - EdgeTableEntry * /*AET*/, - EdgeTableEntry * /*pETEs */ , - ScanLineListBlock * /*pSLLBlock */); - -extern void miloadAET(EdgeTableEntry * /*AET*/, EdgeTableEntry * /*ETEs */); - -extern void micomputeWAET(EdgeTableEntry * /*AET*/); - -extern int miInsertionSort(EdgeTableEntry * /*AET*/); - -extern void miFreeStorage(ScanLineListBlock * /*pSLLBlock */); diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c deleted file mode 100644 index 5e6301d..0000000 --- a/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; - } -} -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:51:59 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:51:59 -0400 Subject: [PATCH 11/23] fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-12-git-send-email-ajax@redhat.com> 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 --- fb/fbbltone.c | 32 +++++++++++++++----------------- fb/wfbrename.h | 5 ----- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/fb/fbbltone.c b/fb/fbbltone.c index bfcb5a2..d2f0416 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -81,7 +81,7 @@ #endif #if FB_SHIFT == 6 -CARD8 fb8Lane[256] = { +static const 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, @@ -107,40 +107,32 @@ CARD8 fb8Lane[256] = { 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, }; -CARD8 fb16Lane[256] = { +static const CARD8 fb16Lane[256] = { 0x00, 0x03, 0x0c, 0x0f, 0x30, 0x33, 0x3c, 0x3f, 0xc0, 0xc3, 0xcc, 0xcf, 0xf0, 0xf3, 0xfc, 0xff, }; -CARD8 fb32Lane[16] = { +static const CARD8 fb32Lane[16] = { 0x00, 0x0f, 0xf0, 0xff, }; #endif #if FB_SHIFT == 5 -CARD8 fb8Lane[16] = { +static const CARD8 fb8Lane[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; -CARD8 fb16Lane[16] = { +static const CARD8 fb16Lane[16] = { 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -CARD8 fb32Lane[16] = { +static const 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 +161,7 @@ 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; + const CARD8 *fbLane; int startbyte, endbyte; if (dstBpp == 24) { @@ -236,8 +228,14 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ if (pixelsPerDst <= 8) fbBits = fbStippleTable[pixelsPerDst]; fbLane = 0; - if (transparent && fgand == 0 && dstBpp >= 8) - fbLane = fbLaneTable[dstBpp]; + if (transparent && fgand == 0) { + if (dstBpp == 8) + fbLane = fb8Lane; + if (dstBpp == 16) + fbLane = fb16Lane; + if (dstBpp == 32) + fbLane = fb32Lane; + } /* * Compute total number of destination words written, but diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 749c6d0..a80858a 100644 --- a/fb/wfbrename.h +++ b/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 @@ -85,8 +82,6 @@ #define fbIn wfbIn #define fbInitializeColormap wfbInitializeColormap #define fbInitVisuals wfbInitVisuals -#define fbInstallColormap wfbInstallColormap -#define fbLaneTable wfbLaneTable #define fbListInstalledColormaps wfbListInstalledColormaps #define FbMergeRopBits wFbMergeRopBits #define fbOddStipple wfbOddStipple -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:00 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:00 -0400 Subject: [PATCH 12/23] fb: FB_SHIFT is 5 (and FB_UNIT is 32) In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-13-git-send-email-ajax@redhat.com> 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 --- fb/fb.h | 173 +----------------------------------- fb/fbbits.c | 12 --- fb/fbblt.c | 271 +-------------------------------------------------------- fb/fbbltone.c | 114 +----------------------- fb/fbglyph.c | 4 - fb/fbpict.c | 8 -- fb/fbrop.h | 4 - fb/fbstipple.c | 23 +---- fb/fbutil.c | 123 -------------------------- 9 files changed, 9 insertions(+), 723 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index d176bb3..6db5803 100644 --- a/fb/fb.h +++ b/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) diff --git a/fb/fbbits.c b/fb/fbbits.c index ac44f3e..d7d089c 100644 --- a/fb/fbbits.c +++ b/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/fb/fbblt.c b/fb/fbblt.c index c615106..b412365 100644 --- a/fb/fbblt.c +++ b/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/fb/fbbltone.c b/fb/fbbltone.c index d2f0416..3042c4b 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -67,59 +67,9 @@ #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 -static const 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, -}; - -static const CARD8 fb16Lane[256] = { - 0x00, 0x03, 0x0c, 0x0f, - 0x30, 0x33, 0x3c, 0x3f, - 0xc0, 0xc3, 0xcc, 0xcf, - 0xf0, 0xf3, 0xfc, 0xff, -}; - -static const CARD8 fb32Lane[16] = { - 0x00, 0x0f, 0xf0, 0xff, -}; -#endif -#if FB_SHIFT == 5 static const CARD8 fb8Lane[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; @@ -131,7 +81,6 @@ static const CARD8 fb16Lane[16] = { static const CARD8 fb32Lane[16] = { 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -#endif void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ @@ -285,12 +234,7 @@ 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (fbLane) { fbTransparentSpan(dst, mask & startmask, fgxor, 1); } @@ -312,12 +256,7 @@ 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); @@ -367,12 +306,7 @@ 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; if (fbLane) { fbTransparentSpan(dst, mask & endmask, fgxor, 1); } @@ -410,47 +344,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)) @@ -476,7 +369,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/fb/fbglyph.c b/fb/fbglyph.c index 4f2904c..8484782 100644 --- a/fb/fbglyph.c +++ b/fb/fbglyph.c @@ -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 diff --git a/fb/fbpict.c b/fb/fbpict.c index f9c9917..7a9e46a 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -309,17 +309,9 @@ 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 diff --git a/fb/fbrop.h b/fb/fbrop.h index 4362adb..b995f23 100644 --- a/fb/fbrop.h +++ b/fb/fbrop.h @@ -95,10 +95,6 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; * 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]; diff --git a/fb/fbstipple.c b/fb/fbstipple.c index f6c84a2..9a877c1 100644 --- a/fb/fbstipple.c +++ b/fb/fbstipple.c @@ -38,18 +38,8 @@ #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 @@ -64,12 +54,6 @@ fbTransparentSpan(FbBits * dst, FbBits stip, FbBits fgxor, int n) 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); } @@ -142,12 +126,7 @@ fbEvenStipple(FbBits * dst, 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)]; + mask = fbBits[FbLeftStipBits(bits, pixelsPerDst)]; /* * Rotate into position and compute reduced rop values */ diff --git a/fb/fbutil.c b/fb/fbutil.c index 2ca80d1..9d66c2a 100644 --- a/fb/fbutil.c +++ b/fb/fbutil.c @@ -174,24 +174,6 @@ const FbMergeRopRec FbMergeRopBits[16] = { 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), @@ -252,112 +234,7 @@ const FbBits fbStipple2Bits[4] = { 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, -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:01 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:01 -0400 Subject: [PATCH 13/23] fb: Remove even/odd stipple slow-pathing In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-14-git-send-email-ajax@redhat.com> 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 --- fb/Makefile.am | 1 - fb/fb.h | 58 -------------- fb/fbbltone.c | 85 ++++---------------- fb/fbfill.c | 46 ++++++++++- fb/fbgc.c | 83 -------------------- fb/fbstipple.c | 243 --------------------------------------------------------- fb/wfbrename.h | 4 - 7 files changed, 60 insertions(+), 460 deletions(-) delete mode 100644 fb/fbstipple.c diff --git a/fb/Makefile.am b/fb/Makefile.am index 752eabe..ff6dc3a 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -44,7 +44,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbstipple.c \ fbtile.c \ fbtrap.c \ fbutil.c \ diff --git a/fb/fb.h b/fb/fb.h index 6db5803..f7cbaf9 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -452,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; @@ -545,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 @@ -1338,58 +1332,6 @@ fbSolid24(FbBits * dst, 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 */ diff --git a/fb/fbbltone.c b/fb/fbbltone.c index 3042c4b..bd3229a 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -62,26 +62,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 LaneCases(a) LaneCases16(0,a) - -static const CARD8 fb8Lane[16] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -}; - -static const CARD8 fb16Lane[16] = { - 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const CARD8 fb32Lane[16] = { - 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - void fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ @@ -110,7 +90,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 */ - const CARD8 *fbLane; int startbyte, endbyte; if (dstBpp == 24) { @@ -176,15 +155,6 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ fbBits = 0; /* unused */ if (pixelsPerDst <= 8) fbBits = fbStippleTable[pixelsPerDst]; - fbLane = 0; - if (transparent && fgand == 0) { - if (dstBpp == 8) - fbLane = fb8Lane; - if (dstBpp == 16) - fbLane = fb16Lane; - if (dstBpp == 32) - fbLane = fb32Lane; - } /* * Compute total number of destination words written, but @@ -235,15 +205,10 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ */ if (startmask) { 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); - } + if (mask || !transparent) + FbDoLeftMaskByteStippleRRop(dst, mask, + fgand, fgxor, bgand, bgxor, + startbyte, startmask); bits = FbStipLeft(bits, pixelsPerDst); dst++; n--; @@ -263,29 +228,15 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ } } 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) @@ -307,15 +258,9 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ LoadBits; } 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); - } + if (mask || !transparent) + FbDoRightMaskByteStippleRRop(dst, mask, fgand, fgxor, + bgand, bgxor, endbyte, endmask); } dst += dstStride; src += srcStride; diff --git a/fb/fbfill.c b/fb/fbfill.c index de9d6b3..ad09671 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -26,6 +26,50 @@ #include "fb.h" +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 +141,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/fb/fbgc.c b/fb/fbgc.c index f4d7f3a..21c9b03 100644 --- a/fb/fbgc.c +++ b/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) { @@ -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/fb/fbstipple.c b/fb/fbstipple.c deleted file mode 100644 index 9a877c1..0000000 --- a/fb/fbstipple.c +++ /dev/null @@ -1,243 +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 LaneCases(a) LaneCases16(0,a) - -/* - * 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); - 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; - 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/fb/wfbrename.h b/fb/wfbrename.h index a80858a..0bd233e 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -58,7 +58,6 @@ #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 -#define fbEvenStipple wfbEvenStipple #define fbEvenTile wfbEvenTile #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill @@ -84,7 +83,6 @@ #define fbInitVisuals wfbInitVisuals #define fbListInstalledColormaps wfbListInstalledColormaps #define FbMergeRopBits wFbMergeRopBits -#define fbOddStipple wfbOddStipple #define fbOddTile wfbOddTile #define fbOver wfbOver #define fbOver24 wfbOver24 @@ -143,7 +141,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbStipple wfbStipple #define fbStipple1Bits wfbStipple1Bits #define fbStipple24Bits wfbStipple24Bits #define fbStipple2Bits wfbStipple2Bits @@ -151,7 +148,6 @@ #define fbStipple8Bits wfbStipple8Bits #define fbStippleTable wfbStippleTable #define fbTile wfbTile -#define fbTransparentSpan wfbTransparentSpan #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:02 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:02 -0400 Subject: [PATCH 14/23] fb: Move fbStipple*Bits near their only consumer In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-15-git-send-email-ajax@redhat.com> And remove fbStippleTable since gcc can't figure that out itself. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fbbltone.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- fb/fbrop.h | 6 --- fb/fbutil.c | 107 ------------------------------------------------------ fb/wfbrename.h | 6 --- 4 files changed, 111 insertions(+), 121 deletions(-) diff --git a/fb/fbbltone.c b/fb/fbbltone.c index bd3229a..d5806e5 100644 --- a/fb/fbbltone.c +++ b/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" @@ -153,8 +248,22 @@ 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]; + 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 diff --git a/fb/fbrop.h b/fb/fbrop.h index b995f23..872ae52 100644 --- a/fb/fbrop.h +++ b/fb/fbrop.h @@ -95,12 +95,6 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; * Stippling operations; */ -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/fb/fbutil.c b/fb/fbutil.c index 9d66c2a..078fc42 100644 --- a/fb/fbutil.c +++ b/fb/fbutil.c @@ -139,110 +139,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)) - -#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), -}; - -const FbBits *const fbStippleTable[] = { - 0, - fbStipple1Bits, - fbStipple2Bits, - 0, - fbStipple4Bits, - 0, - 0, - 0, - fbStipple8Bits, -}; diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 0bd233e..c8be10f 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -141,12 +141,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbStipple1Bits wfbStipple1Bits -#define fbStipple24Bits wfbStipple24Bits -#define fbStipple2Bits wfbStipple2Bits -#define fbStipple4Bits wfbStipple4Bits -#define fbStipple8Bits wfbStipple8Bits -#define fbStippleTable wfbStippleTable #define fbTile wfbTile #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:03 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:03 -0400 Subject: [PATCH 15/23] fb: Remove unused fbReduceRasterOp In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-16-git-send-email-ajax@redhat.com> Appears to have been cargo-culted in from cfb and then never used. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 3 --- fb/fbutil.c | 78 ---------------------------------------------------------- fb/wfbrename.h | 2 -- 3 files changed, 83 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index f7cbaf9..9a67b9d 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1375,9 +1375,6 @@ fbTile(FbBits * dst, */ 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; diff --git a/fb/fbutil.c b/fb/fbutil.c index 078fc42..c1d5923 100644 --- a/fb/fbutil.c +++ b/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 diff --git a/fb/wfbrename.h b/fb/wfbrename.h index c8be10f..d32c7a4 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -126,8 +126,6 @@ #define fbQueryBestSize wfbQueryBestSize #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont -#define fbRealizeWindow wfbRealizeWindow -#define fbReduceRasterOp wfbReduceRasterOp #define fbReplicatePixel wfbReplicatePixel #define fbResolveColor wfbResolveColor #define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:04 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:04 -0400 Subject: [PATCH 16/23] fb: Remove even/odd tile slow-pathing In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-17-git-send-email-ajax@redhat.com> 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 --- fb/Makefile.am | 1 - fb/fb.h | 39 -------------- fb/fbfill.c | 38 ++++++++++++++ fb/fbtile.c | 163 --------------------------------------------------------- fb/wfbrename.h | 3 -- 5 files changed, 38 insertions(+), 206 deletions(-) delete mode 100644 fb/fbtile.c diff --git a/fb/Makefile.am b/fb/Makefile.am index ff6dc3a..65b5d94 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -44,7 +44,6 @@ libfb_la_SOURCES = \ fbseg.c \ fbsetsp.c \ fbsolid.c \ - fbtile.c \ fbtrap.c \ fbutil.c \ fbwindow.c diff --git a/fb/fb.h b/fb/fb.h index 9a67b9d..5099b0f 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1332,45 +1332,6 @@ fbSolid24(FbBits * dst, int dstX, int width, int height, FbBits and, FbBits xor); /* - * 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); diff --git a/fb/fbfill.c b/fb/fbfill.c index ad09671..05d81ab 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -27,6 +27,44 @@ #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, diff --git a/fb/fbtile.c b/fb/fbtile.c deleted file mode 100644 index 785c5f0..0000000 --- a/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/fb/wfbrename.h b/fb/wfbrename.h index d32c7a4..30221c5 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -58,7 +58,6 @@ #define fbDots24 wfbDots24 #define fbDots32 wfbDots32 #define fbDots8 wfbDots8 -#define fbEvenTile wfbEvenTile #define fbExpandDirectColors wfbExpandDirectColors #define fbFill wfbFill #define fbFillRegionSolid wfbFillRegionSolid @@ -83,7 +82,6 @@ #define fbInitVisuals wfbInitVisuals #define fbListInstalledColormaps wfbListInstalledColormaps #define FbMergeRopBits wFbMergeRopBits -#define fbOddTile wfbOddTile #define fbOver wfbOver #define fbOver24 wfbOver24 #define fbOverlayCloseScreen wfbOverlayCloseScreen @@ -139,7 +137,6 @@ #define fbSolid wfbSolid #define fbSolid24 wfbSolid24 #define fbSolidBoxClipped wfbSolidBoxClipped -#define fbTile wfbTile #define fbTrapezoids wfbTrapezoids #define fbTriangles wfbTriangles #define fbUninstallColormap wfbUninstallColormap -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:05 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:05 -0400 Subject: [PATCH 17/23] fb: Hide glyph implementation details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-18-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 10 ---------- fb/fbglyph.c | 4 ++-- fb/fbpict.c | 2 +- fb/fbpict.h | 4 ---- fb/wfbrename.h | 1 - 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 5099b0f..e567332 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -750,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); @@ -1045,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, diff --git a/fb/fbglyph.c b/fb/fbglyph.c index 8484782..2f3bb8a 100644 --- a/fb/fbglyph.c +++ b/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; @@ -116,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/fb/fbpict.c b/fb/fbpict.c index 7a9e46a..e726691 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -82,7 +82,7 @@ fbDestroyGlyphCache(void) } } -void +static void fbUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr pGlyph) { diff --git a/fb/fbpict.h b/fb/fbpict.h index 8b0f59f..5cb8663 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -72,10 +72,6 @@ fbTriangles(CARD8 op, 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, PicturePtr pDst, diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 30221c5..adac64a 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -74,7 +74,6 @@ #define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 #define fbGlyph8 wfbGlyph8 -#define fbGlyphIn wfbGlyphIn #define fbHasVisualTypes wfbHasVisualTypes #define fbImageGlyphBlt wfbImageGlyphBlt #define fbIn wfbIn -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:06 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:06 -0400 Subject: [PATCH 18/23] fb: Hide some zero-width line details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-19-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 9 --------- fb/fbline.c | 4 ++-- fb/wfbrename.h | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index e567332..23e4c8d 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1098,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); diff --git a/fb/fbline.c b/fb/fbline.c index 80dc89d..3e582e6 100644 --- a/fb/fbline.c +++ b/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/fb/wfbrename.h b/fb/wfbrename.h index adac64a..baa80f8 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -143,7 +143,5 @@ #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 -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:08 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:08 -0400 Subject: [PATCH 20/23] fb: Hide fbDots In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-21-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 10 ---------- fb/fbpoint.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index a3d5185..f6bceea 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1145,16 +1145,6 @@ 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); diff --git a/fb/fbpoint.c b/fb/fbpoint.c index d5129d7..be7c801 100644 --- a/fb/fbpoint.c +++ b/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, -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:07 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:07 -0400 Subject: [PATCH 19/23] fb: Hide Bresenham line details In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-20-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 22 ++++------------------ fb/fbseg.c | 22 +++++----------------- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 23e4c8d..a3d5185 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1268,34 +1268,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 */ diff --git a/fb/fbseg.c b/fb/fbseg.c index 1848387..36b17e3 100644 --- a/fb/fbseg.c +++ b/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, @@ -103,7 +103,7 @@ fbBresSolid(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -176,7 +176,7 @@ fbBresDash(DrawablePtr pDrawable, fbFinishAccess(pDrawable); } -void +static void fbBresFill(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -216,7 +216,7 @@ fbSetFg(DrawablePtr pDrawable, GCPtr pGC, Pixel fg) } } -void +static void fbBresFillDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, @@ -434,7 +434,7 @@ fbBresDash24RRop(DrawablePtr pDrawable, * based on the contents of the specified GC. */ -FbBres * +static FbBres * fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); @@ -494,18 +494,6 @@ fbSelectBres(DrawablePtr pDrawable, GCPtr pGC) } 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, int x1, int y1, int x2, int y2, Bool drawLast, int *dashOffset) -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:09 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:09 -0400 Subject: [PATCH 21/23] fb: Hide fbPush{Pattern,Fill} In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-22-git-send-email-ajax@redhat.com> Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- fb/fb.h | 14 -------------- fb/fbpush.c | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index f6bceea..ab110f3 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -1151,20 +1151,6 @@ fbPolyPoint(DrawablePtr pDrawable, /* * 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 diff --git a/fb/fbpush.c b/fb/fbpush.c index f0a861c..1d1bcfd 100644 --- a/fb/fbpush.c +++ b/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, -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:10 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:10 -0400 Subject: [PATCH 22/23] dix: Always store GC client clip as a region (v2) In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-23-git-send-email-ajax@redhat.com> 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 --- dix/gc.c | 3 +-- exa/exa_accel.c | 20 ++++++++--------- exa/exa_priv.h | 7 +++--- exa/exa_unaccel.c | 11 +++++---- hw/dmx/dmxgc.c | 12 ++-------- hw/kdrive/src/kxv.c | 2 +- hw/xfree86/common/xf86xv.c | 2 +- hw/xnest/GC.c | 56 ++++++++++------------------------------------ hw/xnest/XNGC.h | 1 - include/gcstruct.h | 5 ++--- mi/micopy.c | 5 ++--- mi/miexpose.c | 2 +- mi/migc.c | 45 +++++++++---------------------------- mi/mioverlay.c | 2 +- xfixes/region.c | 13 +++-------- 15 files changed, 53 insertions(+), 133 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index 88d6501..d10b7d6 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -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; @@ -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/exa/exa_accel.c b/exa/exa_accel.c index 9c742bd..5aa7d10 100644 --- a/exa/exa_accel.c +++ b/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/exa/exa_priv.h b/exa/exa_priv.h index 88bfd37..ca4db72 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -455,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 @@ -470,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/exa/exa_unaccel.c b/exa/exa_unaccel.c index b0c6344..73eada9 100644 --- a/exa/exa_unaccel.c +++ b/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/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 2d61ea2..2343167 100644 --- a/hw/dmx/dmxgc.c +++ b/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/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 163d5c1..369db33 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -492,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 */ diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 5ef5de1..b974cd2 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -599,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 */ diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index 0ec60fc..96af6eb 100644 --- a/hw/xnest/GC.c +++ b/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/hw/xnest/XNGC.h b/hw/xnest/XNGC.h index e2f10fb..974173e 100644 --- a/hw/xnest/XNGC.h +++ b/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/include/gcstruct.h b/include/gcstruct.h index 6358b8c..32e89a1 100644 --- a/include/gcstruct.h +++ b/include/gcstruct.h @@ -254,13 +254,12 @@ 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 int unused:15; /* see comment above */ unsigned long planemask; unsigned long fgPixel; unsigned long bgPixel; @@ -273,7 +272,7 @@ typedef struct _GC { DDXPointRec patOrg; /* origin for (tile, stipple) */ struct _Font *font; DDXPointRec clipOrg; - void *clientClip; + RegionPtr clientClip; unsigned long stateChanges; /* masked with GC_ */ unsigned long serialNumber; const GCFuncs *funcs; diff --git a/mi/micopy.c b/mi/micopy.c index a52b0a7..2409c78 100644 --- a/mi/micopy.c +++ b/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 { diff --git a/mi/miexpose.c b/mi/miexpose.c index de8ee6c..e74b9c3 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -230,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); /* diff --git a/mi/migc.c b/mi/migc.c index 9bbe884..8fdd481 100644 --- a/mi/migc.c +++ b/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/mi/mioverlay.c b/mi/mioverlay.c index eb8dda1..2b20fd7 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -1667,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/xfixes/region.c b/xfixes/region.c index 4cfeee1..4492f12 100644 --- a/xfixes/region.c +++ b/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)) -- 1.9.3 From ajax at redhat.com Mon Oct 27 12:52:11 2014 From: ajax at redhat.com (Adam Jackson) Date: Mon, 27 Oct 2014 15:52:11 -0400 Subject: [PATCH 23/23] dix: Retype and repack GC In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <1414439531-28146-24-git-send-email-ajax@redhat.com> LP64: 160 bytes before, 128 after. Signed-off-by: Adam Jackson --- include/gcstruct.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/gcstruct.h b/include/gcstruct.h index 32e89a1..aa2064c 100644 --- a/include/gcstruct.h +++ b/include/gcstruct.h @@ -260,9 +260,9 @@ typedef struct _GC { unsigned int freeCompClip:1; /* Free composite clip */ unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */ unsigned int unused:15; /* see comment above */ - unsigned long planemask; - unsigned long fgPixel; - unsigned long bgPixel; + unsigned int planemask; + unsigned int fgPixel; + unsigned int bgPixel; /* * alas -- both tile and stipple must be here as they * are independently specifiable @@ -270,11 +270,11 @@ typedef struct _GC { PixUnion tile; PixmapPtr stipple; DDXPointRec patOrg; /* origin for (tile, stipple) */ - struct _Font *font; DDXPointRec clipOrg; + struct _Font *font; RegionPtr clientClip; - unsigned long stateChanges; /* masked with GC_ */ - unsigned long serialNumber; + unsigned int stateChanges; /* masked with GC_ */ + unsigned int serialNumber; const GCFuncs *funcs; const GCOps *ops; PrivateRec *devPrivates; -- 1.9.3 From keithp at keithp.com Mon Oct 27 13:04:48 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 13:04:48 -0700 Subject: [PATCH 2/2] dix: Always store GC client clip as a region In-Reply-To: <86fvee1fjb.fsf@hiro.keithp.com> References: <1412781634-9770-1-git-send-email-ajax@redhat.com> <1412781634-9770-2-git-send-email-ajax@redhat.com> <86fvee1fjb.fsf@hiro.keithp.com> Message-ID: <86a94hcm8v.fsf@hiro.keithp.com> Keith Packard writes: The updated version of this patch was part of Adam's 'for-keithp' branch which has just been merged. d181e52..839f053 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 13:05:33 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 13:05:33 -0700 Subject: [PATCH 00/23] mi/fb diet, GC client clip, and GC type fixes In-Reply-To: <1414439531-28146-1-git-send-email-ajax@redhat.com> References: <1414439531-28146-1-git-send-email-ajax@redhat.com> Message-ID: <867fzlcm7m.fsf@hiro.keithp.com> Adam Jackson writes: > Mostly a resend of previous efforts. 23 changes the unsigned longs in > the GC to be unsigned int, since that's all the bigger pixels are anyway, > and the serial number needn't be 64 bits. > > This series is also available in my for-keithp branch on people.fd.o. Merged with review. d181e52..839f053 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From eric at anholt.net Mon Oct 27 13:30:36 2014 From: eric at anholt.net (Eric Anholt) Date: Mon, 27 Oct 2014 13:30:36 -0700 Subject: [PULL] modesetting DRI2 support Message-ID: <87h9ypi7bn.fsf@eliezer.anholt.net> The following changes since commit 61a292adf45405641de1c522a04c148e0a152acd: glx: check return from __glXGetAnswerBuffer (2014-10-09 15:30:52 +0200) are available in the git repository at: people.freedesktop.org:~anholt/xserver modesetting-dri2-no-pageflip for you to fetch changes up to cac4b064f9f66435430f61568c6a516c54bf3c40: modesetting: Add support for DRI2 with glamor. (2014-10-27 13:16:43 -0700) ---------------------------------------------------------------- Eric Anholt ( dri2: Import a copy of Mesa's PCI ID -> driver name mappings. dri2: Automatically fill in the driver name if the DDX doesn't provide it. modesetting: Export two functions I want to reuse from DRI2/Present. modesetting: Add support for DRI2 with glamor. hw/xfree86/dri2/dri2.c | 62 +- 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 +++ hw/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 + hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h | 157 +++++ hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h | 1 + hw/xfree86/drivers/modesetting/Makefile.am | 6 +- hw/xfree86/drivers/modesetting/dri2.c | 863 +++++++++++++++++++++++ hw/xfree86/drivers/modesetting/driver.c | 27 +- hw/xfree86/drivers/modesetting/driver.h | 44 ++ hw/xfree86/drivers/modesetting/drmmode_display.c | 25 +- hw/xfree86/drivers/modesetting/drmmode_display.h | 31 +- hw/xfree86/drivers/modesetting/vblank.c | 382 ++++++++++ 18 files changed, 2405 insertions(+), 8 deletions(-) create mode 100644 hw/xfree86/dri2/pci_ids/i810_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/i915_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/i965_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/pci_id_driver_map.h create mode 100644 hw/xfree86/dri2/pci_ids/r200_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/r300_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/r600_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/radeon_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h create mode 100644 hw/xfree86/dri2/pci_ids/vmwgfx_pci_ids.h create mode 100644 hw/xfree86/drivers/modesetting/dri2.c create mode 100644 hw/xfree86/drivers/modesetting/vblank.c -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 13:37:22 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 13:37:22 -0700 Subject: [PATCH xfree86] Skip SetCursor when vtSema is FALSE. In-Reply-To: <1414425405.15671.17.camel@dmt> References: <1413962728-16125-1-git-send-email-yogishk@nvidia.com> <1414425405.15671.17.camel@dmt> Message-ID: <864mupckql.fsf@hiro.keithp.com> Adam Jackson writes: > On Wed, 2014-10-22 at 12:55 +0530, Yogish Kulkarni wrote: >> 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 > > Reviewed-by: Adam Jackson Merged (with fixup for master). 839f053..df6a3a0 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 14:24:25 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 14:24:25 -0700 Subject: [PATCH] dri2: Only invalidate our tree upon Pixmap changes In-Reply-To: <20141027083359.GC14095@nuc-i3427.alporthouse.com> References: <1413788543-25289-1-git-send-email-chris@chris-wilson.co.uk> <86ppdexsvl.fsf@hiro.keithp.com> <20141027083359.GC14095@nuc-i3427.alporthouse.com> Message-ID: <861tptcik6.fsf@hiro.keithp.com> Chris Wilson writes: > This patch also fixes the regression, so if you are happier with > applying the fix here, > > Reviewed-by: Chris Wilson > Tested-by: Chris Wilson > -Chris Less work seems like a feature, so I've merged the DIX-level patch: df6a3a0..5574a0a master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 15:32:54 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 15:32:54 -0700 Subject: [PULL] modesetting DRI2 support In-Reply-To: <87h9ypi7bn.fsf@eliezer.anholt.net> References: <87h9ypi7bn.fsf@eliezer.anholt.net> Message-ID: <86y4s1b0tl.fsf@hiro.keithp.com> Eric Anholt writes: > Eric Anholt ( > dri2: Import a copy of Mesa's PCI ID -> driver name mappings. > dri2: Automatically fill in the driver name if the DDX doesn't provide it. > modesetting: Export two functions I want to reuse from DRI2/Present. > modesetting: Add support for DRI2 with glamor. Merged, along with a minor fixup to recover from kernel failure. 5574a0a..5adc201 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 15:34:30 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 15:34:30 -0700 Subject: [PATCH] Xext/shm: Detach SHM segment after Pixmap is released In-Reply-To: <1413555819.17629.11.camel@dmt> References: <1413464948-24828-1-git-send-email-chris@chris-wilson.co.uk> <20141016152214.GC18808@nuc-i3427.alporthouse.com> <1413555819.17629.11.camel@dmt> Message-ID: <86vbn5b0qx.fsf@hiro.keithp.com> Adam Jackson writes: > On Thu, 2014-10-16 at 16:22 +0100, Chris Wilson wrote: >> On Thu, Oct 16, 2014 at 02:09:08PM +0100, Chris Wilson wrote: >> > The GPU may still have a reference to the SHM segment which would only >> > be finally released when the Pixmap is destroy. So we can only detach >> > the SHM segment (and thereby making the memory unaccessible) after the >> > backend has had a chance to flush any remaining references. >> >> Reported-and-tested-by: gedgon at gmail.com > > Reviewed-by: Adam Jackson Merged. 5adc201..9b29fa9 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 15:42:31 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 15:42:31 -0700 Subject: [PULL] hw/xwin configure, build and warning fixes In-Reply-To: <20141011141025.GA7764@tambora> References: <20141011141025.GA7764@tambora> Message-ID: <86sii9b0dk.fsf@hiro.keithp.com> Jon TURNEY writes: > Jon TURNEY (13): > hw/xwin: Fix compilation with -Werror=return-type > hw/xwin: Fix compilation with -Werror=declaration-after-statement > hw/xwin: Fix warnings in glx/glshim.c > hw/xwin: Fix format warnings with debug printing of pointers on 64-bit > hw/xwin: Fix warning in winXIconToHICON() > hw/xwin: Fix const warning in winCheckDisplayNumber() > hw/xwin: Fix const warnings in winprefsyacc.y > hw/xwin: Fix const warning in winPrefsLoadPreferences() > hw/xwin: Fix warning in yyerror() > hw/xwin: Fix redundant declaration warning in winprefslex.l > hw/xwin: Fix unused variable warning in winCreateMsgWindow() > configure.ac: Avoid "Your OS is unknown" warning when configuring for Cygwin > configure.ac: Force --disable-libdrm on Cygwin There was a minor conflict -- this series patched a warning in winpixmap.c, which Adam had recemtly removed. Easily fixed, and Merged. 9b29fa9..3a123fb master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 15:45:05 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 15:45:05 -0700 Subject: [PATCH] os: -displayfd should check ports up to 65535 In-Reply-To: <1413912628.14199.43.camel@dmt> References: <1413900235-7060-1-git-send-email-jon.turney@dronecode.org.uk> <1413912628.14199.43.camel@dmt> Message-ID: <86ppddb09a.fsf@hiro.keithp.com> Adam Jackson writes: > On Tue, 2014-10-21 at 15:03 +0100, Jon TURNEY wrote: >> -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 Merged. 3a123fb..ea5b2b0 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From peter.hutterer at who-t.net Mon Oct 27 16:32:45 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Tue, 28 Oct 2014 09:32:45 +1000 Subject: xf86-input-evdev not working with touch device with MT only axes In-Reply-To: <1937211792.593842.1414408510967.JavaMail.yahoo@jws100100.mail.ne1.yahoo.com> References: <1937211792.593842.1414408510967.JavaMail.yahoo@jws100100.mail.ne1.yahoo.com> Message-ID: <20141027233245.GE32346@jelly.redhat.com> On Mon, Oct 27, 2014 at 11:15:10AM +0000, Pasrshuram Thombare wrote: > I am using xf86-input-evdev(2.8.1) for touch device with MT only axes, but > I am getting following error. > > "evdev: found only multitouch-axes. That shouldn't happen. > evdev: failed to initialize for absolute axes." > > I am aware of Bug#64029. But solution seems just a way to avoid crash. > Is there any fix available for this issue? it means your kernel driver isn't adhering to the evdev protocol, so you're most likely on android, right? see https://bugs.freedesktop.org/show_bug.cgi?id=80470 Cheers, Peter From keithp at keithp.com Mon Oct 27 16:34:53 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 16:34:53 -0700 Subject: [PATCH 33/37] composite: Factor out backing store transition In-Reply-To: <1412780701-8818-34-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-34-git-send-email-ajax@redhat.com> Message-ID: <86mw8haxya.fsf@hiro.keithp.com> Adam Jackson writes: > No functional change. > > Signed-off-by: Adam Jackson > --- > composite/compinit.c | 27 ++++++++++++++++----------- > 1 file changed, 16 insertions(+), 11 deletions(-) > > diff --git a/composite/compinit.c b/composite/compinit.c > index 111c16e..7daf171 100644 > --- a/composite/compinit.c > +++ b/composite/compinit.c > @@ -104,6 +104,20 @@ compInstallColormap(ColormapPtr pColormap) > pScreen->InstallColormap = compInstallColormap; > } > > +static void > +compCheckBackingStore(WindowPtr pWin) > +{ > + if (pWin->backingStore != NotUseful && !pWin->backStorage) { > + compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); > + pWin->backStorage = TRUE; > + } > + else if (pWin->backingStore == NotUseful && pWin->backStorage) { > + compUnredirectWindow(serverClient, pWin, > + CompositeRedirectAutomatic); > + pWin->backStorage = FALSE; > + } > +} > + > /* Fake backing store via automatic redirection */ > static Bool > compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) > @@ -116,17 +130,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) > ret = pScreen->ChangeWindowAttributes(pWin, mask); > > if (ret && (mask & CWBackingStore) && > - pScreen->backingStoreSupport != NotUseful) { > - if (pWin->backingStore != NotUseful && !pWin->backStorage) { > - compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); > - pWin->backStorage = TRUE; > - } > - else if (pWin->backingStore == NotUseful && pWin->backStorage) { > - compUnredirectWindow(serverClient, pWin, > - CompositeRedirectAutomatic); > - pWin->backStorage = FALSE; > - } > - } > + pScreen->backingStoreSupport != NotUseful) > + compCheckBackingStore(pWin); > Looks like this is missing a } here? -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Mon Oct 27 16:37:38 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 16:37:38 -0700 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. In-Reply-To: <5432A90F.40305@opentext.com> References: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> <5432A90F.40305@opentext.com> Message-ID: <86k33laxtp.fsf@hiro.keithp.com> Peter Harris writes: > On 2014-10-03 17:41, Alex Orange wrote: >> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 >> >> Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said >> patch does indeed remove the problematic writes to bad memory, however >> it also introduces errors in the algoritm. This patch has the effect of >> reverting said patch and adding an if in the proper location to catch >> the out of bounds memory write without causing problems to the overall >> algorithm. >> >> Signed-off-by: Alex Orange > > Reviewed-by: Peter Harris > Tested-by: Peter Harris Merged. ea5b2b0..1b94fd7 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From jstpierre at mecheye.net Mon Oct 27 16:40:00 2014 From: jstpierre at mecheye.net (Jasper St. Pierre) Date: Mon, 27 Oct 2014 16:40:00 -0700 Subject: [PATCH 33/37] composite: Factor out backing store transition In-Reply-To: <86mw8haxya.fsf@hiro.keithp.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-34-git-send-email-ajax@redhat.com> <86mw8haxya.fsf@hiro.keithp.com> Message-ID: No? He removed the brace so it's a one-line if body. On Mon, Oct 27, 2014 at 4:34 PM, Keith Packard wrote: > Adam Jackson writes: > > > No functional change. > > > > Signed-off-by: Adam Jackson > > --- > > composite/compinit.c | 27 ++++++++++++++++----------- > > 1 file changed, 16 insertions(+), 11 deletions(-) > > > > diff --git a/composite/compinit.c b/composite/compinit.c > > index 111c16e..7daf171 100644 > > --- a/composite/compinit.c > > +++ b/composite/compinit.c > > @@ -104,6 +104,20 @@ compInstallColormap(ColormapPtr pColormap) > > pScreen->InstallColormap = compInstallColormap; > > } > > > > +static void > > +compCheckBackingStore(WindowPtr pWin) > > +{ > > + if (pWin->backingStore != NotUseful && !pWin->backStorage) { > > + compRedirectWindow(serverClient, pWin, > CompositeRedirectAutomatic); > > + pWin->backStorage = TRUE; > > + } > > + else if (pWin->backingStore == NotUseful && pWin->backStorage) { > > + compUnredirectWindow(serverClient, pWin, > > + CompositeRedirectAutomatic); > > + pWin->backStorage = FALSE; > > + } > > +} > > + > > /* Fake backing store via automatic redirection */ > > static Bool > > compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) > > @@ -116,17 +130,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned > long mask) > > ret = pScreen->ChangeWindowAttributes(pWin, mask); > > > > if (ret && (mask & CWBackingStore) && > > - pScreen->backingStoreSupport != NotUseful) { > > - if (pWin->backingStore != NotUseful && !pWin->backStorage) { > > - compRedirectWindow(serverClient, pWin, > CompositeRedirectAutomatic); > > - pWin->backStorage = TRUE; > > - } > > - else if (pWin->backingStore == NotUseful && pWin->backStorage) { > > - compUnredirectWindow(serverClient, pWin, > > - CompositeRedirectAutomatic); > > - pWin->backStorage = FALSE; > > - } > > - } > > + pScreen->backingStoreSupport != NotUseful) > > + compCheckBackingStore(pWin); > > > > Looks like this is missing a } here? > > -- > keith.packard at intel.com > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > -- Jasper -------------- next part -------------- An HTML attachment was scrubbed... URL: From macdonald at maths.ox.ac.uk Mon Oct 27 16:44:32 2014 From: macdonald at maths.ox.ac.uk (Colin Macdonald) Date: Mon, 27 Oct 2014 23:44:32 +0000 Subject: xf86-input-evdev not working with touch device with MT only axes In-Reply-To: <20141027233245.GE32346@jelly.redhat.com> References: <1937211792.593842.1414408510967.JavaMail.yahoo@jws100100.mail.ne1.yahoo.com> <20141027233245.GE32346@jelly.redhat.com> Message-ID: <544ED8E0.8080203@maths.ox.ac.uk> On 27/10/14 23:32, Peter Hutterer wrote: > it means your kernel driver isn't adhering to the evdev protocol, so you're > most likely on android, right? > > see https://bugs.freedesktop.org/show_bug.cgi?id=80470 I'm sorry Peter, I never improved my patch for this which you kindly review months ago. I will eventually do so but certainly don't mind if someone else does it first! Colin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0xC5326EE5.asc Type: application/pgp-keys Size: 2214 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From keithp at keithp.com Mon Oct 27 17:59:43 2014 From: keithp at keithp.com (Keith Packard) Date: Mon, 27 Oct 2014 17:59:43 -0700 Subject: [PATCH 33/37] composite: Factor out backing store transition In-Reply-To: References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-34-git-send-email-ajax@redhat.com> <86mw8haxya.fsf@hiro.keithp.com> Message-ID: <86h9ypau0w.fsf@hiro.keithp.com> "Jasper St. Pierre" writes: > No? He removed the brace so it's a one-line if body. Thanks, I misread the patch. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From peter.hutterer at who-t.net Mon Oct 27 22:30:21 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Tue, 28 Oct 2014 15:30:21 +1000 Subject: [PATCH] xkb: ignore floating slave devices when updating from master (#81885) In-Reply-To: <20140804004703.GA9873@jelly.redhat.com> References: <20140804004703.GA9873@jelly.redhat.com> Message-ID: <20141028053021.GA5182@jelly.redhat.com> On Mon, Aug 04, 2014 at 10:47:03AM +1000, Peter Hutterer wrote: > 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 please merge this one for 1.16.2. Upstream commit 1e30fc1b99bda040038e4fd56d1b27c686b44c75 Cheers, Peter > --- > dix/devices.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dix/devices.c b/dix/devices.c > index 7f079ff..9e1c546 100644 > --- a/dix/devices.c > +++ b/dix/devices.c > @@ -416,7 +416,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) > XISendDeviceHierarchyEvent(flags); > } > > - if (!IsMaster(dev)) > + if (!IsMaster(dev) && !IsFloating(dev)) > XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0); > RecalculateMasterButtons(dev); > > -- > 1.9.3 From peter.hutterer at who-t.net Mon Oct 27 22:35:44 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Tue, 28 Oct 2014 15:35:44 +1000 Subject: [PATCH 2/2] xkb: Initialize 'bad' Atom in _XkbSetNamesCheck In-Reply-To: <1414014518-3461-2-git-send-email-keithp@keithp.com> References: <1414014518-3461-1-git-send-email-keithp@keithp.com> <1414014518-3461-2-git-send-email-keithp@keithp.com> Message-ID: <20141028053544.GA891@jelly.redhat.com> On Wed, Oct 22, 2014 at 02:48:38PM -0700, Keith Packard wrote: > 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 > --- > xkb/xkb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xkb/xkb.c b/xkb/xkb.c > index dc570f0..fdc5923 100644 > --- a/xkb/xkb.c > +++ b/xkb/xkb.c > @@ -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; > -- > 2.1.1 Reviewed-by: Peter Hutterer for both Cheers, Peter From jcristau at debian.org Tue Oct 28 00:43:44 2014 From: jcristau at debian.org (Julien Cristau) Date: Tue, 28 Oct 2014 08:43:44 +0100 Subject: [PATCH] xkb: ignore floating slave devices when updating from master (#81885) In-Reply-To: <20141028053021.GA5182@jelly.redhat.com> References: <20140804004703.GA9873@jelly.redhat.com> <20141028053021.GA5182@jelly.redhat.com> Message-ID: <20141028074344.GZ3591@betterave.cristau.org> On Tue, Oct 28, 2014 at 15:30:21 +1000, Peter Hutterer wrote: > On Mon, Aug 04, 2014 at 10:47:03AM +1000, Peter Hutterer wrote: > > 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 > > please merge this one for 1.16.2. Upstream commit > 1e30fc1b99bda040038e4fd56d1b27c686b44c75 > Done, To git.freedesktop.org:/git/xorg/xserver f7ca20c..0e62f27 server-1.16-branch -> server-1.16-branch Cheers, Julien From thombarepr at yahoo.com Mon Oct 27 23:05:05 2014 From: thombarepr at yahoo.com (Pasrshuram Thombare) Date: Tue, 28 Oct 2014 06:05:05 +0000 (UTC) Subject: xf86-input-evdev not working with touch device with MT only axes In-Reply-To: <20141027233245.GE32346@jelly.redhat.com> References: <20141027233245.GE32346@jelly.redhat.com> Message-ID: <907785151.753637.1414476305257.JavaMail.yahoo@jws10069.mail.ne1.yahoo.com> No I am on linux (3.10). I think, need to change touchscreen driver to support ABS_X & ABS_Y. Will give try and update findings. Thanks for your help. On Tuesday, 28 October 2014 5:02 AM, Peter Hutterer wrote: On Mon, Oct 27, 2014 at 11:15:10AM +0000, Pasrshuram Thombare wrote: > I am using xf86-input-evdev(2.8.1) for touch device with MT only axes, but > I am getting following error. > > "evdev: found only multitouch-axes. That shouldn't happen. > evdev: failed to initialize for absolute axes." > > I am aware of Bug#64029. But solution seems just a way to avoid crash. > Is there any fix available for this issue? it means your kernel driver isn't adhering to the evdev protocol, so you're most likely on android, right? see https://bugs.freedesktop.org/show_bug.cgi?id=80470 Cheers, Peter From jon.turney at dronecode.org.uk Tue Oct 28 04:12:09 2014 From: jon.turney at dronecode.org.uk (Jon TURNEY) Date: Tue, 28 Oct 2014 11:12:09 +0000 Subject: [PATCH] xdmcp: Simplify format specifier in XdmcpFatal() for vpnprintf() In-Reply-To: <001001cfed3a$e3bb4220$ab31c660$@virgin.net> References: <001001cfed3a$e3bb4220$ab31c660$@virgin.net> Message-ID: <544F7A09.9080604@dronecode.org.uk> On 21/10/2014 15:25, Colin Harrison wrote: > There are instances of this format also in os/access.c (not that I > ever get sight of them!) Probably best fixed in vpnprintf() but your > xdmcp patch fixes the most seen instance (for me). Oh yes. Also there are some occurrences of the "%*.*s" pattern in dmx. Patch withdrawn, I'll try to come up with a fix to vpnprintf() instead. From smout.jan at gmail.com Tue Oct 28 04:51:55 2014 From: smout.jan at gmail.com (Jan Smout) Date: Tue, 28 Oct 2014 12:51:55 +0100 Subject: [PATCH libX11] xcb_io: Fix Xlib 32-bit request number issues In-Reply-To: References: <1411585990-6423-1-git-send-email-jnsptrsn1@gmail.com> <867g0pu4p4.fsf@hiro.keithp.com> Message-ID: reminder... On 21 October 2014 12:49, Jan Smout wrote: > > Keith, we are approaching the one year anniversary of this bug already. > Maybe it is time to finish the patch and leave the issue behind? > > > fyi, I have been running my application with the first version of Jonas's > patch for 65 days straight now without a glitch (it used to crash in less > than 20 hours). > > I also intend to restart this long duration test once the final patch will > be released > > > On 27 September 2014 05:23, Keith Packard wrote: > >> Matt Turner writes: >> >> > On Fri, Sep 26, 2014 at 3:40 AM, Jan Smout wrote: >> >> Keith Packard doesn't seem very responsive (as in 'completely ignoring >> the >> >> subject') >> > >> > Perhaps you should try Ccing him? (now Cc'd) >> >> The problem is that reviewing this patch is *really hard*. The last >> time, I think I spent a solid couple of days thinking about this and >> making sure I'd caught all of the cases. I'm still not sure it's right, >> but I guess it's probably better than what we have? >> >> -- >> keith.packard at intel.com >> > > > > -- > Life is complex, it has a real part and an imaginary part. > -- Life is complex, it has a real part and an imaginary part. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfergeau at redhat.com Tue Oct 28 03:26:18 2014 From: cfergeau at redhat.com (Christophe Fergeau) Date: Tue, 28 Oct 2014 11:26:18 +0100 Subject: [randrproto] spec: Fix RRCrtcGetModes typo Message-ID: <1414491978-20366-1-git-send-email-cfergeau@redhat.com> The correct name is RRCrtcGetInfo. Signed-off-by: Christophe Fergeau --- randrproto.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/randrproto.txt b/randrproto.txt index 864268e..5371eaa 100644 --- a/randrproto.txt +++ b/randrproto.txt @@ -929,7 +929,7 @@ dynamic changes in the display environment. Errors: Window - RRGetCrtcModes returns information about the current and available + RRGetCrtcInfo returns information about the current and available configurations for the specified crtc connected to the screen associated with 'window'. @@ -1663,7 +1663,7 @@ factors, such as re-cabling a monitor, etc. This event is sent whenever the monitor's configuration changes or if a new monitor configuration becomes available that was not available in the past. In this case, the client MUST call - RRGetCrtcModes to update its view of possible monitor + RRGetCrtcInfo to update its view of possible monitor configurations to have a correct view of possible monitor organizations. -- 2.1.0 From keithp at keithp.com Tue Oct 28 11:28:50 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 11:28:50 -0700 Subject: [PATCH 2/2] xkb: Initialize 'bad' Atom in _XkbSetNamesCheck In-Reply-To: <20141028053544.GA891@jelly.redhat.com> References: <1414014518-3461-1-git-send-email-keithp@keithp.com> <1414014518-3461-2-git-send-email-keithp@keithp.com> <20141028053544.GA891@jelly.redhat.com> Message-ID: <8661f4aw0t.fsf@hiro.keithp.com> Peter Hutterer writes: > Reviewed-by: Peter Hutterer > for both Merged. 1b94fd7..da70c7d master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 11:32:18 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 11:32:18 -0700 Subject: [PATCH] composite: Wrap GetSpans In-Reply-To: <1413998358-4186-1-git-send-email-ajax@redhat.com> References: <1413998358-4186-1-git-send-email-ajax@redhat.com> Message-ID: <8638a8avv1.fsf@hiro.keithp.com> Adam Jackson writes: > 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 Merged (with review) da70c7d..0fbbdb3 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From jstpierre at mecheye.net Tue Oct 28 12:32:29 2014 From: jstpierre at mecheye.net (Jasper St. Pierre) Date: Tue, 28 Oct 2014 12:32:29 -0700 Subject: [randrproto] spec: Fix RRCrtcGetModes typo In-Reply-To: <1414491978-20366-1-git-send-email-cfergeau@redhat.com> References: <1414491978-20366-1-git-send-email-cfergeau@redhat.com> Message-ID: Reviewed-by: Jasper St. Pierre On Tue, Oct 28, 2014 at 3:26 AM, Christophe Fergeau wrote: > The correct name is RRCrtcGetInfo. > > Signed-off-by: Christophe Fergeau > --- > randrproto.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/randrproto.txt b/randrproto.txt > index 864268e..5371eaa 100644 > --- a/randrproto.txt > +++ b/randrproto.txt > @@ -929,7 +929,7 @@ dynamic changes in the display environment. > > Errors: Window > > - RRGetCrtcModes returns information about the current and available > + RRGetCrtcInfo returns information about the current and available > configurations for the specified crtc connected to the screen > associated with 'window'. > > @@ -1663,7 +1663,7 @@ factors, such as re-cabling a monitor, etc. > This event is sent whenever the monitor's configuration changes > or if a new monitor configuration becomes available that was > not available in the past. In this case, the client MUST call > - RRGetCrtcModes to update its view of possible monitor > + RRGetCrtcInfo to update its view of possible monitor > configurations to have a correct view of possible monitor > organizations. > > -- > 2.1.0 > > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel -- Jasper -------------- next part -------------- An HTML attachment was scrubbed... URL: From keithp at keithp.com Tue Oct 28 13:38:05 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:38:05 -0700 Subject: [PATCH 18/37] dix: Add 'paintable' bit to the window state In-Reply-To: <1412780701-8818-19-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-19-git-send-email-ajax@redhat.com> Message-ID: <86zjcg9bgy.fsf@hiro.keithp.com> Adam Jackson writes: > A paintable window is a window whose pixels are (potentially) modifiable > by rendering commands. Right now this is effectively a shadow of the > viewable bit, but set by DDX instead of DIX. Later in this series it > will also indicate a window with allocated backing store. This should be tracked in DIX; it will be trivial to validate this patch if every assignment to viewable was paired with a matching assignment to paintable. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:38:28 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:38:28 -0700 Subject: [PATCH 19/37] dix: Update border state based on paintable not viewable In-Reply-To: <1412780701-8818-20-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-20-git-send-email-ajax@redhat.com> Message-ID: <86wq7k9bgb.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:38:56 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:38:56 -0700 Subject: [PATCH 20/37] dix: ReflectStackChange based on paintable not viewable In-Reply-To: <1412780701-8818-21-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-21-git-send-email-ajax@redhat.com> Message-ID: <86tx2o9bfj.fsf@hiro.keithp.com> Adam Jackson writes: > Imagine an unmapped-but-backed window with children; stack changes among > those children should be reflected in clip list updates. Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:42:14 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:42:14 -0700 Subject: [PATCH 21/37] dix: Drive tree mark/validate on unmap from paintable not viewable In-Reply-To: <1412780701-8818-22-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-22-git-send-email-ajax@redhat.com> Message-ID: <86r3xs9ba1.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:44:01 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:44:01 -0700 Subject: [PATCH 22/37] dix: MapWindow based on paintable as well In-Reply-To: <1412780701-8818-23-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-23-git-send-email-ajax@redhat.com> Message-ID: <86oasvapri.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson > --- > dix/window.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/dix/window.c b/dix/window.c > index f3b6d2e..b0c2d9f 100644 > --- a/dix/window.c > +++ b/dix/window.c > @@ -2568,7 +2568,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) > if (SubStrSend(pWin, pParent)) > DeliverMapNotify(pWin); > > - if (!pParent->realized) > + if (!pParent->realized && !pParent->paintable) > return Success; > RealizeTree(pWin); > if (pWin->viewable) { > @@ -2637,7 +2637,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) > > if (!pFirstMapped) > pFirstMapped = pWin; > - if (pParent->realized) { > + if (pParent->realized || pParent->paintable) { > RealizeTree(pWin); > if (pWin->viewable) { > anyMarked |= (*pScreen->MarkOverlappedWindows) > (pWin, pWin, This needs the fixup at the end of the series which sets realized values based on the parent realized values, and sets the viewable value based on the parent viewable value, but sets the paintable value solely based on the drawable.class. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:44:19 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:44:19 -0700 Subject: [PATCH 23/37] mi: Mark overlapped windows based on paintable not viewable In-Reply-To: <1412780701-8818-24-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-24-git-send-email-ajax@redhat.com> Message-ID: <86lhnzapr0.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:44:42 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:44:42 -0700 Subject: [PATCH 24/37] mi: Mark/validate windows in MoveWindow based on paintable not viewable In-Reply-To: <1412780701-8818-25-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-25-git-send-email-ajax@redhat.com> Message-ID: <86ioj3apqd.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:46:37 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:46:37 -0700 Subject: [PATCH 25/37] mi: Mark/validate based on paintable not viewable In-Reply-To: <1412780701-8818-26-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-26-git-send-email-ajax@redhat.com> Message-ID: <86egtrapn6.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:46:54 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:46:54 -0700 Subject: [PATCH 26/37] mi: miValidateTree based on paintable not viewable In-Reply-To: <1412780701-8818-27-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-27-git-send-email-ajax@redhat.com> Message-ID: <86bnovapmp.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:47:37 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:47:37 -0700 Subject: [PATCH 28/37] mi: miComputeClips based on paintable not viewable In-Reply-To: <1412780701-8818-29-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-29-git-send-email-ajax@redhat.com> Message-ID: <868ujzapli.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:47:57 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:47:57 -0700 Subject: [PATCH 29/37] mi: Shortcut miDoCopy based on paintable not realized In-Reply-To: <1412780701-8818-30-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-30-git-send-email-ajax@redhat.com> Message-ID: <8661f3apky.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:48:11 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:48:11 -0700 Subject: [PATCH 30/37] mi: Shortcut miCopyArea based on paintable not realized In-Reply-To: <1412780701-8818-31-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-31-git-send-email-ajax@redhat.com> Message-ID: <8638a7apkk.fsf@hiro.keithp.com> Adam Jackson writes: > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:49:52 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:49:52 -0700 Subject: [PATCH 32/37] mi: Treat paintable-but-not-mapped windows as transparent too In-Reply-To: <1412780701-8818-33-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-33-git-send-email-ajax@redhat.com> Message-ID: <86zjcf9axb.fsf@hiro.keithp.com> Adam Jackson writes: > + return (w->redirectDraw == RedirectDrawManual) || > + (w->paintable && !w->mapped); I think you want !w->viewable (or !w->realized) to capture windows for which an ancestor is not mapped as well. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Tue Oct 28 13:51:20 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 13:51:20 -0700 Subject: [PATCH 33/37] composite: Factor out backing store transition In-Reply-To: <1412780701-8818-34-git-send-email-ajax@redhat.com> References: <1412780701-8818-1-git-send-email-ajax@redhat.com> <1412780701-8818-34-git-send-email-ajax@redhat.com> Message-ID: <86wq7j9auv.fsf@hiro.keithp.com> Adam Jackson writes: > No functional change. > > Signed-off-by: Adam Jackson Reviewed-by: Keith Packard -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From remi at gentoo.org Tue Oct 28 16:18:13 2014 From: remi at gentoo.org (=?windows-1252?Q?R=E9mi_Cardona?=) Date: Wed, 29 Oct 2014 00:18:13 +0100 Subject: [PATCH] xf86xv.h cannot be included without first including xorg-server.h. In-Reply-To: <543C9A7F.7060700@daenzer.net> References: <1412674172-9607-1-git-send-email-sndirsch@suse.de> <5433B83B.9050204@daenzer.net> <20141013125840.GA26489@suse.de> <543C7615.8010807@daenzer.net> <20141014032556.GA31452@suse.de> <543C9A7F.7060700@daenzer.net> Message-ID: <54502435.4060402@gentoo.org> Le 14/10/2014 05:37, Michel Dänzer a écrit : > Ah, I thought this was about the -vmmouse patch. Sorry for the noise. :( Speaking of -vmmouse, last release is nearly 2 years old. Could anyone spin a new tarball? Cheers, Rémi From peter.hutterer at who-t.net Tue Oct 28 20:46:18 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Wed, 29 Oct 2014 13:46:18 +1000 Subject: [PATCH] dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings In-Reply-To: <1414014490-3332-1-git-send-email-keithp@keithp.com> References: <1414014490-3332-1-git-send-email-keithp@keithp.com> Message-ID: <20141029034618.GA30398@jelly.redhat.com> On Wed, Oct 22, 2014 at 02:48:10PM -0700, Keith Packard wrote: > 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 > Cc: Peter Hutterer Reviewed-by: Peter Hutterer please merge at your leisure. Cheers, Peter > --- > dix/getevents.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/dix/getevents.c b/dix/getevents.c > index ffa89fa..dd96265 100644 > --- a/dix/getevents.c > +++ b/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); > } > > -- > 2.1.1 > From keithp at keithp.com Tue Oct 28 20:58:47 2014 From: keithp at keithp.com (Keith Packard) Date: Tue, 28 Oct 2014 20:58:47 -0700 Subject: [PATCH] dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings In-Reply-To: <20141029034618.GA30398@jelly.redhat.com> References: <1414014490-3332-1-git-send-email-keithp@keithp.com> <20141029034618.GA30398@jelly.redhat.com> Message-ID: <86egtr8r2g.fsf@hiro.keithp.com> Peter Hutterer writes: > Reviewed-by: Peter Hutterer > please merge at your leisure. Thanks. I'm back to a single warning ('bswap_CARD64' defined but not used). Merged. 0fbbdb3..65dd1ba master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Wed Oct 29 07:25:14 2014 From: keithp at keithp.com (Keith Packard) Date: Wed, 29 Oct 2014 07:25:14 -0700 Subject: [PATCH] Fix present_notify to return right away when querying current or past msc. In-Reply-To: <1414585902-2941-1-git-send-email-axel.davy@ens.fr> References: <1414585902-2941-1-git-send-email-axel.davy@ens.fr> Message-ID: <8661f37y2d.fsf@hiro.keithp.com> Axel Davy writes: > 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 -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From axel.davy at ens.fr Wed Oct 29 05:31:42 2014 From: axel.davy at ens.fr (Axel Davy) Date: Wed, 29 Oct 2014 13:31:42 +0100 Subject: [PATCH] Fix present_notify to return right away when querying current or past msc. Message-ID: <1414585902-2941-1-git-send-email-axel.davy@ens.fr> 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 --- present/present.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/present/present.c b/present/present.c index 47566c7..a9f2214 100644 --- a/present/present.c +++ b/present/present.c @@ -866,7 +866,7 @@ present_pixmap(WindowPtr window, xorg_list_add(&vblank->event_queue, &present_exec_queue); vblank->queued = TRUE; - if (target_msc >= crtc_msc) { + 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); @@ -929,7 +929,7 @@ present_notify_msc(WindowPtr window, 0, 0, NULL, NULL, NULL, - 0, + PresentOptionAsync, target_msc, divisor, remainder, NULL, 0); } -- 1.9.1 From thierry.reding at gmail.com Wed Oct 29 08:59:27 2014 From: thierry.reding at gmail.com (Thierry Reding) Date: Wed, 29 Oct 2014 16:59:27 +0100 Subject: [PATCH] xv: Add missing gcstruct.h include Message-ID: <1414598367-18592-1-git-send-email-thierry.reding@gmail.com> From: Thierry Reding 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 --- Xext/xvmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/xvmain.c b/Xext/xvmain.c index bc176c852069..1f424402be39 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -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" -- 2.1.2 From peter.hutterer at who-t.net Wed Oct 29 16:49:01 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Thu, 30 Oct 2014 09:49:01 +1000 Subject: config: revert quirk for the Evoluent Vertical Mouse In-Reply-To: <20141010183632.GC32974@dtor-ws> References: <20140515025439.GA11354@yabbi.redhat.com> <20141010181211.GA11474@dtor-glaptop> <20141010183632.GC32974@dtor-ws> Message-ID: <20141029234901.GA12805@jelly.redhat.com> On Fri, Oct 10, 2014 at 11:36:32AM -0700, Dmitry Torokhov wrote: > On Friday, October 10, 2014 11:12:11 AM Dmitry Torokhov wrote: > > On Thu, May 15, 2014 at 12:54:40PM +1000, Peter Hutterer wrote: > > > This quick makes the mouse behaviour more obvious (LMR buttons generate > > > LMR > > > > > > events) but goes against the manufacturer's intended defaults: > > > Top button - left click. > > > Wheel button - .middle click (e.g., for pan and rotate in CAD > > > programs). > > > Middle button - right click. > > > Bottom button - back. > > > Thumb button - forward. > > > > > > from http://www.evoluent.com/vm3.html > > > > For what it worth I think the current mapping is correct. Manufacturer's > > recommendations are geared towards Windows set up where middle click is not > > normally used, whereas in Linux it is extremely useful. > > FWIW here is what the hardware reports for version 4 of the mouse: > > topmost on right size - BTN_LEFT > middle on the right side - BTN_MIDDLE > wheel click - BTN_EXTRA > lowest on the right side - BTN_RIGHT > top on the left side - BTN_SIDE > bottom on the left side - BTN_FORWARD > > so it seems that manufacturer itself decided to change the default mapping > in newer version. thanks for pointing that out. I think I'm going to leave the revert in place though, simply because there's manufacturer documentation on what the intended mapping is. I'm glad they switched for V4 of the device though... Cheers, Peter From aplattner at nvidia.com Wed Oct 29 19:19:18 2014 From: aplattner at nvidia.com (Aaron Plattner) Date: Wed, 29 Oct 2014 19:19:18 -0700 Subject: [PATCH] xfree86: Bump ABI versions (video: 19, extension: 9) Message-ID: <1414635558-1967-1-git-send-email-aplattner@nvidia.com> Among other things, commit b851ca968b7cce6d1a6438c05d3d5c8832249704 added a NameWindowPixmap function pointer to ScreenRec, shifting some of the fields around. Signed-off-by: Aaron Plattner --- Since the merge window closed yesterday with the xserver 1.17 RC 1 release, the ABI freeze date will be one month later, Nov. 28. That means that the ABI can still change between now and then, but please only change it if necessary. hw/xfree86/common/xf86Module.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index b848f53f1561..e68fe9cbaa18 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/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 -- 2.1.2 From peter.hutterer at who-t.net Wed Oct 29 19:41:54 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Thu, 30 Oct 2014 12:41:54 +1000 Subject: [PATCH] xkbcomp: Improved -w option parsing In-Reply-To: <20141027095030.GA29316@xvii.vinc17.org> References: <20141027095030.GA29316@xvii.vinc17.org> Message-ID: <20141030024154.GA19884@jelly.redhat.com> On Mon, Oct 27, 2014 at 10:50:30AM +0100, Vincent Lefevre wrote: > This patch improves -w option parsing even further, for cases like > "xkbcomp -w6 4.xkb out.xkb" (which were not handled by the fix of > #66344). Moreover, though this form can be regarded as ambiguous, > the warning level is still optional (set to 0 if not present), and > errors like "xkbcomp -wfoo in out" are detected and reported. > > Signed-off-by: Vincent Lefevre pushed, thanks. d4e02a0..978998a master -> master Cheers, Peter > --- > xkbcomp.c | 32 ++++++++++++++++++++++++++------ > 1 file changed, 26 insertions(+), 6 deletions(-) > > diff --git a/xkbcomp.c b/xkbcomp.c > index 956e79c..adfa89a 100644 > --- a/xkbcomp.c > +++ b/xkbcomp.c > @@ -576,17 +576,37 @@ parseArgs(int argc, char *argv[]) > } > else if (strncmp(argv[i], "-w", 2) == 0) > { > - if ((i >= (argc - 1)) || (!isdigit(argv[i + 1][0]))) > + unsigned long utmp; > + char *tmp2; > + /* If text is just after "-w" in the same word, then it must > + * be a number and it is the warning level. Otherwise, if the > + * next argument is a number, then it is the warning level, > + * else the warning level is assumed to be 0. > + */ > + if (argv[i][2] == '\0') > { > warningLevel = 0; > - if (isdigit(argv[i][2])) > - if (sscanf(&argv[i][2], "%i", &itmp) == 1) > - warningLevel = itmp; > + if (i < argc - 1) > + { > + utmp = strtoul(argv[i+1], &tmp2, 10); > + if (argv[i+1][0] != '\0' && *tmp2 == '\0') > + { > + warningLevel = utmp > 10 ? 10 : utmp; > + i++; > + } > + } > } > else > { > - if (sscanf(argv[++i], "%i", &itmp) == 1) > - warningLevel = itmp; > + utmp = strtoul(&argv[i][2], &tmp2, 10); > + if (*tmp2 == '\0') > + warningLevel = utmp > 10 ? 10 : utmp; > + else > + { > + ERROR1("Unknown flag \"%s\" on command line\n", argv[i]); > + Usage(argc, argv); > + return False; > + } > } > } > else if ((strcmp(argv[i], "-xkb") == 0) && (!xkblist)) > -- > 2.1.1 > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > From keithp at keithp.com Thu Oct 30 13:58:07 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 30 Oct 2014 13:58:07 -0700 Subject: [PATCH] xfree86: Bump ABI versions (video: 19, extension: 9) In-Reply-To: <1414635558-1967-1-git-send-email-aplattner@nvidia.com> References: <1414635558-1967-1-git-send-email-aplattner@nvidia.com> Message-ID: <86k33h6zs0.fsf@hiro.keithp.com> Aaron Plattner writes: > Among other things, commit b851ca968b7cce6d1a6438c05d3d5c8832249704 added a > NameWindowPixmap function pointer to ScreenRec, shifting some of the fields > around. > > Signed-off-by: Aaron Plattner Reviewed and merged. e9db768..72a0754 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From aplattner at nvidia.com Thu Oct 30 14:24:14 2014 From: aplattner at nvidia.com (Aaron Plattner) Date: Thu, 30 Oct 2014 14:24:14 -0700 Subject: [PATCH] xfree86: Bump ABI versions (video: 19, extension: 9) In-Reply-To: <86k33h6zs0.fsf@hiro.keithp.com> References: <1414635558-1967-1-git-send-email-aplattner@nvidia.com> <86k33h6zs0.fsf@hiro.keithp.com> Message-ID: <5452AC7E.30200@nvidia.com> On 10/30/2014 01:58 PM, Keith Packard wrote: > Aaron Plattner writes: > >> Among other things, commit b851ca968b7cce6d1a6438c05d3d5c8832249704 added a >> NameWindowPixmap function pointer to ScreenRec, shifting some of the fields >> around. >> >> Signed-off-by: Aaron Plattner > > Reviewed and merged. > e9db768..72a0754 master -> master Awesome, thanks. In case anyone is confused, apparently I diffed incorrectly and forgot that the NameWindowPixmap commit I mentioned here is actually in server-1.16-branch already. What actually broke the ABI here is the removal of SendGraphicsExpose from ScreenRec in commit 1e56b2dfc6377. Too bad I only noticed that *after* you merged it... oh well. -- Aaron From keithp at keithp.com Thu Oct 30 14:34:29 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 30 Oct 2014 14:34:29 -0700 Subject: [PATCH] xfree86: Bump ABI versions (video: 19, extension: 9) In-Reply-To: <5452AC7E.30200@nvidia.com> References: <1414635558-1967-1-git-send-email-aplattner@nvidia.com> <86k33h6zs0.fsf@hiro.keithp.com> <5452AC7E.30200@nvidia.com> Message-ID: <86h9yl6y3e.fsf@hiro.keithp.com> Aaron Plattner writes: > Too bad I only noticed that *after* you merged it... oh well. Not a big deal. There were plenty of ABI changes in this release; I wasn't too worried about making the notes about which changes you noticed correct. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 30 14:38:02 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 30 Oct 2014 14:38:02 -0700 Subject: [PATCH] Fix present_notify to return right away when querying current or past msc. In-Reply-To: <8661f37y2d.fsf@hiro.keithp.com> References: <1414585902-2941-1-git-send-email-axel.davy@ens.fr> <8661f37y2d.fsf@hiro.keithp.com> Message-ID: <86egtp6xxh.fsf@hiro.keithp.com> Keith Packard writes: > Axel Davy writes: > >> 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 Merged. 72a0754..882f2d1 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From keithp at keithp.com Thu Oct 30 14:38:53 2014 From: keithp at keithp.com (Keith Packard) Date: Thu, 30 Oct 2014 14:38:53 -0700 Subject: [PATCH] xv: Add missing gcstruct.h include In-Reply-To: <1414598367-18592-1-git-send-email-thierry.reding@gmail.com> References: <1414598367-18592-1-git-send-email-thierry.reding@gmail.com> Message-ID: <86bnot6xw2.fsf@hiro.keithp.com> Thierry Reding writes: > From: Thierry Reding > > 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); I'm curious as to how I'm not seeing this bug? -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From peter.hutterer at who-t.net Thu Oct 30 16:52:37 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:37 +1000 Subject: [PATCH 0/9] Couple of compiler warning fixes Message-ID: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> A couple of compiler warning fixes, like most warning fixes attempts I got demotivated quickly, so this is nowhere near the lot. Some of these affect the server build (with clang), others like the first 3 affect drivers simply because they headers are included through a couple of subheaders. Take what seems sensible, leave the rest. Cheers, Peter From peter.hutterer at who-t.net Thu Oct 30 16:52:38 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:38 +1000 Subject: [PATCH 1/9] include: fix compiler warning about casting int to uint16_t In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-2-git-send-email-peter.hutterer@who-t.net> /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 --- include/misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/misc.h b/include/misc.h index 9c2f573..f5b85ee 100644 --- a/include/misc.h +++ b/include/misc.h @@ -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 -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:39 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:39 +1000 Subject: [PATCH 2/9] include: fix documentation for list.h In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-3-git-send-email-peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer --- include/list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/list.h b/include/list.h index 455c670..9154e1c 100644 --- a/include/list.h +++ b/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 initialized. */ static inline void xorg_list_init(struct xorg_list *list) -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:40 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:40 +1000 Subject: [PATCH 3/9] include: change RegionSize() to take a size_t In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-4-git-send-email-peter.hutterer@who-t.net> /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 --- include/regionstr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/regionstr.h b/include/regionstr.h index 4a0725d..515e93f 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -125,7 +125,7 @@ RegionEnd(RegionPtr reg) } static inline size_t -RegionSizeof(int n) +RegionSizeof(size_t n) { return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); } -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:41 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:41 +1000 Subject: [PATCH 4/9] Xext: fix clang compiler warning In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-5-git-send-email-peter.hutterer@who-t.net> shm.c:1150:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((shmdesc->addr == ((char *) -1))) { Signed-off-by: Peter Hutterer --- Xext/shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/shm.c b/Xext/shm.c index b787918..30f688a 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -1147,7 +1147,7 @@ ProcShmAttachFd(ClientPtr client) fd, 0); close(fd); - if ((shmdesc->addr == ((char *) -1))) { + if (shmdesc->addr == ((char *) -1)) { free(shmdesc); return BadAccess; } @@ -1237,7 +1237,7 @@ ProcShmCreateSegment(ClientPtr client) MAP_SHARED, fd, 0); - if ((shmdesc->addr == ((char *) -1))) { + if (shmdesc->addr == ((char *) -1)) { close(fd); free(shmdesc); return BadAccess; -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:42 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:42 +1000 Subject: [PATCH 5/9] xfree86: drop double-typedef of DBusConnection In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-6-git-send-email-peter.hutterer@who-t.net> Just include dbus.h, it's been typedef'd there since 2003. Signed-off-by: Peter Hutterer --- hw/xfree86/common/Makefile.am | 4 ++++ include/dbus-core.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index 7a2b4bc..54e7f4d 100644 --- a/hw/xfree86/common/Makefile.am +++ b/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/include/dbus-core.h b/include/dbus-core.h index b2d6d1b..d6260dc 100644 --- a/include/dbus-core.h +++ b/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); -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:43 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:43 +1000 Subject: [PATCH 6/9] xwayland: declare fatal log handler as noreturn In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-7-git-send-email-peter.hutterer@who-t.net> xwayland.c:661:1: warning: function 'xwl_log_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn] Signed-off-by: Peter Hutterer --- hw/xwayland/xwayland.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 9132969..37d6d82 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -656,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) { -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:44 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:44 +1000 Subject: [PATCH 7/9] dix: silence compiler warning In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-8-git-send-email-peter.hutterer@who-t.net> 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 --- dix/inpututils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/inpututils.c b/dix/inpututils.c index e5bcc31..5c2a32d 100644 --- a/dix/inpututils.c +++ b/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; -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:45 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:45 +1000 Subject: [PATCH 8/9] dix: silence compiler warning comparing CARD32 to -1 In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-9-git-send-email-peter.hutterer@who-t.net> 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 --- dix/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index d43ef03..9019852 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3243,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; -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 16:52:46 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 09:52:46 +1000 Subject: [PATCH 9/9] Drop trailing whitespaces In-Reply-To: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> Message-ID: <1414713166-27887-10-git-send-email-peter.hutterer@who-t.net> sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer --- Xext/dpms.c | 10 ++-- Xext/dpmsstubs.c | 10 ++-- Xext/panoramiX.c | 2 +- Xext/panoramiX.h | 2 +- Xext/panoramiXprocs.c | 4 +- Xext/security.c | 4 +- Xext/shm.c | 2 +- Xext/sync.c | 2 +- Xext/syncsrv.h | 8 ++-- Xext/xres.c | 12 ++--- Xext/xvdisp.c | 8 ++-- Xext/xvdix.h | 14 +++--- Xext/xvmain.c | 18 +++---- composite/compalloc.c | 8 ++-- composite/compext.c | 4 +- composite/compinit.c | 2 +- composite/compint.h | 2 +- composite/compoverlay.c | 4 +- dbe/dbe.c | 16 +++---- dbe/dbestruct.h | 12 ++--- dbe/midbe.c | 14 +++--- dbe/midbe.h | 8 ++-- dix/atom.c | 8 ++-- dix/colormap.c | 34 +++++++------- dix/cursor.c | 8 ++-- dix/dispatch.c | 16 +++---- dix/dispatch.h | 2 +- dix/dixfonts.c | 6 +-- dix/dixutils.c | 12 ++--- dix/extension.c | 8 ++-- dix/gc.c | 22 ++++----- dix/globals.c | 8 ++-- dix/glyphcurs.c | 8 ++-- dix/grabs.c | 16 +++---- dix/main.c | 8 ++-- dix/property.c | 8 ++-- dix/region.c | 22 ++++----- dix/resource.c | 16 +++---- dix/selection.c | 10 ++-- dix/swaprep.c | 8 ++-- dix/swapreq.c | 8 ++-- dix/tables.c | 8 ++-- dix/window.c | 36 +++++++------- exa/exa.c | 2 +- exa/exa.h | 8 ++-- exa/exa_glyphs.c | 8 ++-- exa/exa_render.c | 4 +- fb/fb24_32.c | 2 +- fb/fb24_32.h | 2 +- fb/fbbltone.c | 6 +-- fb/fbfillrect.c | 2 +- fb/fbgc.c | 2 +- fb/fbglyph.c | 2 +- fb/fboverlay.c | 2 +- fb/fboverlay.h | 2 +- fb/fbpict.c | 6 +-- fb/fbpixmap.c | 6 +-- fb/fbrop.h | 2 +- glamor/glamor_picture.c | 2 +- glx/glxbyteorder.h | 8 ++-- glx/glxcmds.c | 22 ++++----- glx/glxdri2.c | 2 +- glx/glxscreens.c | 2 +- glx/glxscreens.h | 2 +- glx/indirect_dispatch.c | 6 +-- glx/indirect_dispatch.h | 6 +-- glx/indirect_dispatch_swap.c | 6 +-- glx/indirect_program.c | 6 +-- glx/indirect_reqsize.c | 6 +-- glx/indirect_reqsize.h | 6 +-- glx/indirect_size.h | 6 +-- glx/indirect_size_get.c | 6 +-- glx/indirect_size_get.h | 6 +-- glx/indirect_table.c | 6 +-- glx/indirect_table.h | 6 +-- glx/indirect_texture_compression.c | 6 +-- glx/indirect_util.c | 8 ++-- glx/indirect_util.h | 6 +-- glx/rensize.c | 4 +- hw/dmx/config/Canvas.c | 2 +- hw/dmx/config/dmxprint.c | 2 +- hw/dmx/dmxpict.h | 2 +- hw/dmx/glxProxy/glxcmds.c | 16 +++---- hw/dmx/glxProxy/glxsingle.c | 4 +- hw/dmx/glxProxy/glxvendor.c | 4 +- hw/dmx/input/ChkNotMaskEv.c | 2 +- hw/dmx/input/lnx-keyboard.c | 20 ++++---- hw/dmx/input/lnx-ms.c | 2 +- hw/kdrive/ephyr/ephyr.c | 14 +++--- hw/kdrive/ephyr/ephyr.h | 4 +- hw/kdrive/ephyr/ephyrdri.c | 4 +- hw/kdrive/ephyr/ephyrdri.h | 4 +- hw/kdrive/ephyr/ephyrdriext.c | 4 +- hw/kdrive/ephyr/ephyrdriext.h | 4 +- hw/kdrive/ephyr/ephyrglxext.c | 4 +- hw/kdrive/ephyr/ephyrglxext.h | 4 +- hw/kdrive/ephyr/ephyrhostglx.c | 4 +- hw/kdrive/ephyr/ephyrhostglx.h | 4 +- hw/kdrive/ephyr/ephyrinit.c | 4 +- hw/kdrive/ephyr/ephyrlog.h | 4 +- hw/kdrive/ephyr/ephyrvideo.c | 4 +- hw/kdrive/ephyr/hostx.c | 12 ++--- hw/kdrive/ephyr/hostx.h | 4 +- hw/kdrive/ephyr/os.c | 4 +- hw/xfree86/common/compiler.h | 4 +- hw/xfree86/common/xf86AutoConfig.c | 8 ++-- hw/xfree86/common/xf86Bus.c | 2 +- hw/xfree86/common/xf86Config.c | 4 +- hw/xfree86/common/xf86Configure.c | 4 +- hw/xfree86/common/xf86Mode.c | 8 ++-- hw/xfree86/common/xf86PciInfo.h | 2 +- hw/xfree86/common/xf86Xinput.c | 16 +++---- hw/xfree86/common/xf86Xinput.h | 6 +-- hw/xfree86/common/xf86cmap.c | 4 +- hw/xfree86/common/xf86fbman.c | 6 +-- hw/xfree86/common/xf86platformBus.c | 2 +- hw/xfree86/common/xf86str.h | 2 +- hw/xfree86/common/xf86vmode.c | 8 ++-- hw/xfree86/common/xf86xvmc.h | 10 ++-- hw/xfree86/ddc/ddc.c | 10 ++-- hw/xfree86/ddc/edid.h | 8 ++-- hw/xfree86/ddc/print_edid.c | 2 +- hw/xfree86/ddc/xf86DDC.h | 6 +-- hw/xfree86/dixmods/xkbKillSrv.c | 16 +++---- hw/xfree86/dixmods/xkbVT.c | 16 +++---- hw/xfree86/dri/dri.c | 4 +- hw/xfree86/dri/sarea.h | 10 ++-- hw/xfree86/drivers/modesetting/driver.c | 2 +- hw/xfree86/fbdevhw/fbdevhw.c | 2 +- hw/xfree86/i2c/xf86i2c.c | 40 ++++++++-------- hw/xfree86/i2c/xf86i2c.h | 2 +- hw/xfree86/loader/loadmod.c | 4 +- hw/xfree86/modes/xf86Crtc.c | 4 +- hw/xfree86/modes/xf86Crtc.h | 10 ++-- hw/xfree86/modes/xf86RandR12.c | 4 +- hw/xfree86/modes/xf86cvt.c | 4 +- hw/xfree86/modes/xf86gtf.c | 10 ++-- hw/xfree86/os-support/bsd/alpha_video.c | 20 ++++---- hw/xfree86/os-support/bsd/arm_video.c | 28 +++++------ hw/xfree86/os-support/bsd/bsd_apm.c | 2 +- hw/xfree86/os-support/bsd/bsd_bell.c | 20 ++++---- hw/xfree86/os-support/bsd/bsd_init.c | 24 +++++----- hw/xfree86/os-support/bsd/bsd_kqueue_apm.c | 16 +++---- hw/xfree86/os-support/bsd/i386_video.c | 22 ++++----- hw/xfree86/os-support/bsd/ppc_video.c | 20 ++++---- hw/xfree86/os-support/bsd/sparc64_video.c | 20 ++++---- hw/xfree86/os-support/hurd/hurd_video.c | 4 +- hw/xfree86/os-support/linux/lnx_agp.c | 4 +- hw/xfree86/os-support/linux/lnx_kmod.c | 2 +- hw/xfree86/os-support/linux/systemd-logind.c | 2 +- hw/xfree86/os-support/misc/SlowBcopy.c | 8 ++-- hw/xfree86/os-support/shared/ioperm_noop.c | 2 +- hw/xfree86/os-support/shared/sigio.c | 6 +-- hw/xfree86/os-support/solaris/sun_apm.c | 2 +- hw/xfree86/os-support/xf86_OSlib.h | 30 ++++++------ hw/xfree86/os-support/xf86_OSproc.h | 28 +++++------ hw/xfree86/parser/Configint.h | 18 +++---- hw/xfree86/parser/DRI.c | 8 ++-- hw/xfree86/parser/Device.c | 16 +++---- hw/xfree86/parser/Files.c | 14 +++--- hw/xfree86/parser/Flags.c | 16 +++---- hw/xfree86/parser/Input.c | 16 +++---- hw/xfree86/parser/Layout.c | 16 +++---- hw/xfree86/parser/Module.c | 16 +++---- hw/xfree86/parser/Monitor.c | 18 +++---- hw/xfree86/parser/Pointer.c | 16 +++---- hw/xfree86/parser/Screen.c | 16 +++---- hw/xfree86/parser/Vendor.c | 16 +++---- hw/xfree86/parser/Video.c | 16 +++---- hw/xfree86/parser/read.c | 22 ++++----- hw/xfree86/parser/scan.c | 36 +++++++------- hw/xfree86/parser/write.c | 14 +++--- hw/xfree86/parser/xf86Optrec.h | 18 +++---- hw/xfree86/parser/xf86Parser.h | 18 +++---- hw/xfree86/parser/xf86tokens.h | 18 +++---- hw/xfree86/ramdac/IBM.c | 4 +- hw/xfree86/ramdac/TI.c | 2 +- hw/xfree86/ramdac/xf86Cursor.c | 2 +- hw/xfree86/ramdac/xf86HWCurs.c | 2 +- hw/xfree86/ramdac/xf86RamDac.h | 4 +- hw/xfree86/shadowfb/shadowfb.h | 2 +- hw/xfree86/utils/gtf/gtf.c | 26 +++++------ hw/xfree86/vbe/vbe.c | 4 +- hw/xfree86/vbe/vbe.h | 4 +- hw/xfree86/vgahw/vgaHW.c | 8 ++-- hw/xfree86/vgahw/vgaHW.h | 2 +- hw/xfree86/x86emu/debug.c | 4 +- hw/xfree86/x86emu/ops.c | 22 ++++----- hw/xfree86/x86emu/prim_ops.c | 70 ++++++++++++++-------------- hw/xfree86/x86emu/sys.c | 6 +-- hw/xfree86/x86emu/x86emu/regs.h | 10 ++-- hw/xnest/Color.c | 2 +- hw/xnest/Xnest.h | 2 +- hw/xquartz/darwin.c | 8 ++-- hw/xquartz/darwinEvents.c | 4 +- hw/xwin/InitInput.c | 2 +- hw/xwin/InitOutput.c | 8 ++-- hw/xwin/ddraw.h | 6 +-- hw/xwin/win.h | 2 +- hw/xwin/wincmap.c | 2 +- hw/xwin/winconfig.c | 10 ++-- hw/xwin/wincreatewnd.c | 4 +- hw/xwin/wincursor.c | 10 ++-- hw/xwin/windialogs.c | 8 ++-- hw/xwin/winlayouts.h | 2 +- hw/xwin/winmultiwindowwindow.c | 6 +-- hw/xwin/winmultiwindowwm.c | 2 +- hw/xwin/winmultiwindowwndproc.c | 4 +- hw/xwin/winscrinit.c | 4 +- hw/xwin/winshaddd.c | 8 ++-- hw/xwin/winshadddnl.c | 6 +-- hw/xwin/winshadgdi.c | 10 ++-- hw/xwin/winwin32rootlesswndproc.c | 2 +- hw/xwin/winwindowswm.c | 2 +- hw/xwin/winwndproc.c | 6 +-- include/closure.h | 8 ++-- include/colormap.h | 8 ++-- include/colormapst.h | 8 ++-- include/cursor.h | 8 ++-- include/cursorstr.h | 10 ++-- include/dix.h | 8 ++-- include/extension.h | 8 ++-- include/extnsionst.h | 10 ++-- include/gc.h | 8 ++-- include/gcstruct.h | 8 ++-- include/input.h | 8 ++-- include/inputstr.h | 14 +++--- include/misc.h | 16 +++---- include/miscstruct.h | 8 ++-- include/os.h | 8 ++-- include/pixmap.h | 8 ++-- include/pixmapstr.h | 10 ++-- include/property.h | 8 ++-- include/propertyst.h | 10 ++-- include/region.h | 8 ++-- include/resource.h | 10 ++-- include/rgb.h | 8 ++-- include/screenint.h | 8 ++-- include/scrnintstr.h | 8 ++-- include/selection.h | 10 ++-- include/servermd.h | 10 ++-- include/site.h | 14 +++--- include/window.h | 8 ++-- include/windowstr.h | 8 ++-- include/xkbfile.h | 18 +++---- include/xkbsrv.h | 16 +++---- include/xkbstr.h | 24 +++++----- include/xsha1.h | 2 +- mi/mi.h | 8 ++-- mi/miarc.c | 24 +++++----- mi/mibitblt.c | 30 ++++++------ mi/midash.c | 8 ++-- mi/midispcur.c | 4 +- mi/miexpose.c | 16 +++---- mi/mifillrct.c | 8 ++-- mi/mifpoly.h | 8 ++-- mi/miglblt.c | 8 ++-- mi/miinitext.c | 8 ++-- mi/mipoly.c | 8 ++-- mi/mipoly.h | 2 +- mi/mipolypnt.c | 8 ++-- mi/mipolyrect.c | 8 ++-- mi/mipolyseg.c | 10 ++-- mi/mipolytext.c | 8 ++-- mi/mipushpxl.c | 8 ++-- mi/miscrinit.c | 2 +- mi/mistruct.h | 8 ++-- mi/mivaltree.c | 20 ++++---- mi/miwindow.c | 8 ++-- mi/mizerclip.c | 8 ++-- mi/mizerline.c | 12 ++--- miext/damage/damage.c | 2 +- miext/rootless/rootless.h | 2 +- miext/rootless/rootlessGC.c | 2 +- miext/rootless/rootlessValTree.c | 32 ++++++------- miext/rootless/rootlessWindow.c | 6 +-- miext/shadow/shrotate.c | 2 +- miext/sync/misyncfd.c | 4 +- os/WaitFor.c | 18 +++---- os/access.c | 42 ++++++++--------- os/busfault.c | 2 +- os/connection.c | 16 +++---- os/io.c | 10 ++-- os/log.c | 2 +- os/oscolor.c | 8 ++-- os/osdep.h | 8 ++-- os/osinit.c | 14 +++--- os/xdmcp.c | 2 +- present/present.c | 4 +- randr/randrstr.h | 20 ++++---- randr/rrprovider.c | 2 +- randr/rrtransform.c | 2 +- randr/rrtransform.h | 2 +- randr/rrxinerama.c | 2 +- record/record.c | 20 ++++---- render/animcur.c | 2 +- render/glyph.c | 2 +- render/glyphstr.h | 2 +- render/mipict.h | 2 +- render/picture.c | 2 +- render/picture.h | 8 ++-- render/render.c | 4 +- xfixes/cursor.c | 22 ++++----- xkb/XKBAlloc.c | 16 +++---- xkb/XKBGAlloc.c | 16 +++---- xkb/XKBMAlloc.c | 18 +++---- xkb/XKBMisc.c | 16 +++---- xkb/ddxBeep.c | 16 +++---- xkb/ddxCtrls.c | 16 +++---- xkb/ddxKillSrv.c | 16 +++---- xkb/ddxLEDs.c | 16 +++---- xkb/ddxLoad.c | 16 +++---- xkb/ddxVT.c | 16 +++---- xkb/maprules.c | 18 +++---- xkb/xkb.c | 16 +++---- xkb/xkbAccessX.c | 18 +++---- xkb/xkbActions.c | 16 +++---- xkb/xkbEvents.c | 16 +++---- xkb/xkbInit.c | 22 ++++----- xkb/xkbLEDs.c | 44 ++++++++--------- xkb/xkbPrKeyEv.c | 16 +++---- xkb/xkbSwap.c | 16 +++---- xkb/xkbUtils.c | 16 +++---- xkb/xkbfmisc.c | 18 +++---- xkb/xkbgeom.h | 16 +++---- xkb/xkbout.c | 18 +++---- xkb/xkbtext.c | 18 +++---- xkb/xkmread.c | 18 +++---- 328 files changed, 1576 insertions(+), 1576 deletions(-) diff --git a/Xext/dpms.c b/Xext/dpms.c index 5f1a35d..cdfaa97 100644 --- a/Xext/dpms.c +++ b/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/Xext/dpmsstubs.c b/Xext/dpmsstubs.c index 80f13f5..f05d1e9 100644 --- a/Xext/dpmsstubs.c +++ b/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/Xext/panoramiX.c b/Xext/panoramiX.c index 4d79c46..2bbae2f 100644 --- a/Xext/panoramiX.c +++ b/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/Xext/panoramiX.h b/Xext/panoramiX.h index 6578dfa..c16b9a5 100644 --- a/Xext/panoramiX.h +++ b/Xext/panoramiX.h @@ -28,7 +28,7 @@ Equipment Corporation. /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ -/* +/* * PanoramiX definitions */ diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 0122ff3..413a66a 100644 --- a/Xext/panoramiXprocs.c +++ b/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 diff --git a/Xext/security.c b/Xext/security.c index bf2ab2e..cce7c46 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -928,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/Xext/shm.c b/Xext/shm.c index 30f688a..db9d474 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -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) { diff --git a/Xext/sync.c b/Xext/sync.c index 755ed94..ba08cd1 100644 --- a/Xext/sync.c +++ b/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/Xext/syncsrv.h b/Xext/syncsrv.h index 8c2c00d..a8062d1 100644 --- a/Xext/syncsrv.h +++ b/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/Xext/xres.c b/Xext/xres.c index 546b942..2737938 100644 --- a/Xext/xres.c +++ b/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/Xext/xvdisp.c b/Xext/xvdisp.c index 0bdfed3..86f982a 100644 --- a/Xext/xvdisp.c +++ b/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 diff --git a/Xext/xvdix.h b/Xext/xvdix.h index e67a3c7..621a1e3 100644 --- a/Xext/xvdix.h +++ b/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 diff --git a/Xext/xvmain.c b/Xext/xvmain.c index bc176c8..14ad1ec 100644 --- a/Xext/xvmain.c +++ b/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 @@ -915,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) { diff --git a/composite/compalloc.c b/composite/compalloc.c index dfbff06..8daded0 100644 --- a/composite/compalloc.c +++ b/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/composite/compext.c b/composite/compext.c index fcfc349..f1a8255 100644 --- a/composite/compext.c +++ b/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. */ diff --git a/composite/compinit.c b/composite/compinit.c index 10433a1..3ac075a 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -209,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; diff --git a/composite/compint.h b/composite/compint.h index f06b846..09241f2 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -76,7 +76,7 @@ /* * enable this for debugging - + #define COMPOSITE_DEBUG */ diff --git a/composite/compoverlay.c b/composite/compoverlay.c index 7932dda..20c860d 100644 --- a/composite/compoverlay.c +++ b/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/dbe/dbe.c b/dbe/dbe.c index 8896720..527588c 100644 --- a/dbe/dbe.c +++ b/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 @@ -835,7 +835,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 @@ -1058,7 +1058,7 @@ SProcDbeDispatch(ClientPtr client) * * TRUE - setup was successful * FALSE - the window's background state is NONE - * + * *****************************************************************************/ static Bool diff --git a/dbe/dbestruct.h b/dbe/dbestruct.h index 2002066..fe2ef0a 100644 --- a/dbe/dbestruct.h +++ b/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/dbe/midbe.c b/dbe/midbe.c index 0479ecc..8f75910 100644 --- a/dbe/midbe.c +++ b/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/dbe/midbe.h b/dbe/midbe.h index 4eed538..67320ea 100644 --- a/dbe/midbe.h +++ b/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/dix/atom.c b/dix/atom.c index 6f85968..22cd0dc 100644 --- a/dix/atom.c +++ b/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/dix/colormap.c b/dix/colormap.c index c1ff88e..4d408d5 100644 --- a/dix/colormap.c +++ b/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/dix/cursor.c b/dix/cursor.c index 56c5606..1525857 100644 --- a/dix/cursor.c +++ b/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/dix/dispatch.c b/dix/dispatch.c index 74abecd..d844a09 100644 --- a/dix/dispatch.c +++ b/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)) { @@ -3198,7 +3198,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. *********************/ diff --git a/dix/dispatch.h b/dix/dispatch.h index 3f3f3a2..939a6b9 100644 --- a/dix/dispatch.h +++ b/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/dix/dixfonts.c b/dix/dixfonts.c index 1c6442c..bc2732f 100644 --- a/dix/dixfonts.c +++ b/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/dix/dixutils.c b/dix/dixutils.c index cdd370b..205550e 100644 --- a/dix/dixutils.c +++ b/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/dix/extension.c b/dix/extension.c index e43291e..56e3abc 100644 --- a/dix/extension.c +++ b/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 diff --git a/dix/gc.c b/dix/gc.c index d10b7d6..78f3be2 100644 --- a/dix/gc.c +++ b/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. * @@ -790,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 @@ -1032,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.) diff --git a/dix/globals.c b/dix/globals.c index eaa2afe..f36a938 100644 --- a/dix/globals.c +++ b/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/dix/glyphcurs.c b/dix/glyphcurs.c index 5404025..eca6a4c 100644 --- a/dix/glyphcurs.c +++ b/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/dix/grabs.c b/dix/grabs.c index e3fc38b..b92f1e7 100644 --- a/dix/grabs.c +++ b/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/dix/main.c b/dix/main.c index 930a85f..09f9504 100644 --- a/dix/main.c +++ b/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 diff --git a/dix/property.c b/dix/property.c index 9f51cd0..ff7f31a 100644 --- a/dix/property.c +++ b/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/dix/region.c b/dix/region.c index 15f3d01..ce1014e 100644 --- a/dix/region.c +++ b/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 @@ -944,7 +944,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 @@ -1099,7 +1099,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/dix/resource.c b/dix/resource.c index c254244..26debdb 100644 --- a/dix/resource.c +++ b/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. @@ -725,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. * @@ -1118,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/dix/selection.c b/dix/selection.c index e905b1e..4e994b1 100644 --- a/dix/selection.c +++ b/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/dix/swaprep.c b/dix/swaprep.c index 559fe27..905fef7 100644 --- a/dix/swaprep.c +++ b/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/dix/swapreq.c b/dix/swapreq.c index 0f6d49e..61d3ce0 100644 --- a/dix/swapreq.c +++ b/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/dix/tables.c b/dix/tables.c index 686cddd..88b372e 100644 --- a/dix/tables.c +++ b/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/dix/window.c b/dix/window.c index 9019852..d49276c 100644 --- a/dix/window.c +++ b/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, @@ -633,7 +633,7 @@ RealChildHead(WindowPtr pWin) /***** * CreateWindow - * Makes a window in response to client request + * Makes a window in response to client request *****/ WindowPtr @@ -1038,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 @@ -1459,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. */ @@ -1814,7 +1814,7 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) /* * 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 @@ -1914,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: @@ -1922,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 @@ -2316,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 * ******/ @@ -3327,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. @@ -3424,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); @@ -3491,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, diff --git a/exa/exa.c b/exa/exa.c index a2995db..51d36f3 100644 --- a/exa/exa.c +++ b/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/exa/exa.h b/exa/exa.h index 98d094d..949ea3a 100644 --- a/exa/exa.h +++ b/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/exa/exa_glyphs.c b/exa/exa_glyphs.c index aa71b21..41f3694 100644 --- a/exa/exa_glyphs.c +++ b/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/exa/exa_render.c b/exa/exa_render.c index c4edf40..e3e5526 100644 --- a/exa/exa_render.c +++ b/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/fb/fb24_32.c b/fb/fb24_32.c index ecb3951..b95019e 100644 --- a/fb/fb24_32.c +++ b/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/fb/fb24_32.h b/fb/fb24_32.h index b357edf..77eef23 100644 --- a/fb/fb24_32.h +++ b/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/fb/fbbltone.c b/fb/fbbltone.c index d5806e5..d089a43 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -206,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; @@ -266,8 +266,8 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */ } /* - * 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) diff --git a/fb/fbfillrect.c b/fb/fbfillrect.c index 64ba2b4..0075b2c 100644 --- a/fb/fbfillrect.c +++ b/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/fb/fbgc.c b/fb/fbgc.c index 21c9b03..19c6131 100644 --- a/fb/fbgc.c +++ b/fb/fbgc.c @@ -119,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 & diff --git a/fb/fbglyph.c b/fb/fbglyph.c index 2f3bb8a..61cb8de 100644 --- a/fb/fbglyph.c +++ b/fb/fbglyph.c @@ -65,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 diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 6a5f0f8..1e5e6b3 100644 --- a/fb/fboverlay.c +++ b/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. diff --git a/fb/fboverlay.h b/fb/fboverlay.h index 47727e4..3312145 100644 --- a/fb/fboverlay.h +++ b/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. diff --git a/fb/fbpict.c b/fb/fbpict.c index e726691..c8378ad 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -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--) { diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index 677f28a..951a925 100644 --- a/fb/fbpixmap.c +++ b/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/fb/fbrop.h b/fb/fbrop.h index 872ae52..bc12b14 100644 --- a/fb/fbrop.h +++ b/fb/fbrop.h @@ -92,7 +92,7 @@ extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16]; #define fbAndStip(rop,fg,pm) fbAndT(rop,fg,pm,FbStip) /* - * Stippling operations; + * Stippling operations; */ #define FbStippleRRop(dst, b, fa, fx, ba, bx) \ diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c index cbbc194..bc658f8 100644 --- a/glamor/glamor_picture.c +++ b/glamor/glamor_picture.c @@ -45,7 +45,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) return glamor_upload_pixmap_to_texture(pixmap); } -/* +/* * 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/glx/glxbyteorder.h b/glx/glxbyteorder.h index 73f0f7d..aa88b44 100644 --- a/glx/glxbyteorder.h +++ b/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/glx/glxcmds.c b/glx/glxcmds.c index d11c667..8d3fa9f 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -233,13 +233,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; @@ -992,7 +992,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 +1041,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. */ @@ -2253,9 +2253,9 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) /* NOTE: the two pad macros have been added below; they are needed ** because the client library pads the total byte count, but not ** the per-request byte counts. The Protocol Encoding says the - ** total byte count should not be padded, so a proposal will be - ** made to the ARB to relax the padding constraint on the total - ** byte count, thus preserving backward compatibility. Meanwhile, + ** total byte count should not be padded, so a proposal will be + ** made to the ARB to relax the padding constraint on the total + ** byte count, thus preserving backward compatibility. Meanwhile, ** the padding done below fixes a bug that did not allow ** large commands of odd sizes to be accepted by the server. */ @@ -2528,7 +2528,7 @@ __glXpresentCompleteNotify(WindowPtr window, CARD8 present_kind, CARD8 present_m glx_type = GLX_FLIP_COMPLETE_INTEL; else glx_type = GLX_BLIT_COMPLETE_INTEL; - + __glXsendSwapEvent(drawable, glx_type, ust, msc, serial); } diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 5a8966f..bcd57a4 100644 --- a/glx/glxdri2.c +++ b/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); } diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 78769f4..b0ad3b7 100644 --- a/glx/glxscreens.c +++ b/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/glx/glxscreens.h b/glx/glxscreens.h index c8119fd..a905877 100644 --- a/glx/glxscreens.h +++ b/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/glx/indirect_dispatch.c b/glx/indirect_dispatch.c index f6cabef..24784e6 100644 --- a/glx/indirect_dispatch.c +++ b/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/glx/indirect_dispatch.h b/glx/indirect_dispatch.h index e6e3fda..536be60 100644 --- a/glx/indirect_dispatch.h +++ b/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/glx/indirect_dispatch_swap.c b/glx/indirect_dispatch_swap.c index c0bb64d..7ebcc63 100644 --- a/glx/indirect_dispatch_swap.c +++ b/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/glx/indirect_program.c b/glx/indirect_program.c index d503262..cda139e 100644 --- a/glx/indirect_program.c +++ b/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/glx/indirect_reqsize.c b/glx/indirect_reqsize.c index 026afb6..abd0766 100644 --- a/glx/indirect_reqsize.c +++ b/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/glx/indirect_reqsize.h b/glx/indirect_reqsize.h index 43e1e69..49d400c 100644 --- a/glx/indirect_reqsize.h +++ b/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/glx/indirect_size.h b/glx/indirect_size.h index fec7ed3..6a3d14c 100644 --- a/glx/indirect_size.h +++ b/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/glx/indirect_size_get.c b/glx/indirect_size_get.c index f879311..7e81e62 100644 --- a/glx/indirect_size_get.c +++ b/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/glx/indirect_size_get.h b/glx/indirect_size_get.h index 9b62036..5af11d3 100644 --- a/glx/indirect_size_get.h +++ b/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/glx/indirect_table.c b/glx/indirect_table.c index 33e3d6a..f0f0b83 100644 --- a/glx/indirect_table.c +++ b/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/glx/indirect_table.h b/glx/indirect_table.h index a39dc4e..c0d6ee9 100644 --- a/glx/indirect_table.h +++ b/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/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c index 2018de6..cda7656 100644 --- a/glx/indirect_texture_compression.c +++ b/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/glx/indirect_util.c b/glx/indirect_util.c index f9d1243..926e57c 100644 --- a/glx/indirect_util.c +++ b/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 @@ -205,7 +205,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/glx/indirect_util.h b/glx/indirect_util.h index 0e65075..f5db262 100644 --- a/glx/indirect_util.h +++ b/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/glx/rensize.c b/glx/rensize.c index bcc3a53..ba22d10 100644 --- a/glx/rensize.c +++ b/glx/rensize.c @@ -129,12 +129,12 @@ __glXMap2fReqSize(const GLbyte * pc, Bool swap) /** * 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/hw/dmx/config/Canvas.c b/hw/dmx/config/Canvas.c index 1031033..3662fe8 100644 --- a/hw/dmx/config/Canvas.c +++ b/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/hw/dmx/config/dmxprint.c b/hw/dmx/config/dmxprint.c index 3145fb5..9dec52b 100644 --- a/hw/dmx/config/dmxprint.c +++ b/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/hw/dmx/dmxpict.h b/hw/dmx/dmxpict.h index 080da3b..f36eca3 100644 --- a/hw/dmx/dmxpict.h +++ b/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/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 23c3366..fb4d5ac 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/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/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c index 679a302..0344973 100644 --- a/hw/dmx/glxProxy/glxsingle.c +++ b/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/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c index b475daf..fc8aff0 100644 --- a/hw/dmx/glxProxy/glxvendor.c +++ b/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/hw/dmx/input/ChkNotMaskEv.c b/hw/dmx/input/ChkNotMaskEv.c index bde04ae..8411af8 100644 --- a/hw/dmx/input/ChkNotMaskEv.c +++ b/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/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c index 1a4d01f..0aa62f4 100644 --- a/hw/dmx/input/lnx-keyboard.c +++ b/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/hw/dmx/input/lnx-ms.c b/hw/dmx/input/lnx-ms.c index 210f6de..621f0fe 100644 --- a/hw/dmx/input/lnx-ms.c +++ b/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/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 5761710..93a48a9 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/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 @@ -313,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); @@ -535,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'. */ @@ -687,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)) @@ -773,7 +773,7 @@ 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 */ diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h index f3a3c8e..2395a7f 100644 --- a/hw/kdrive/ephyr/ephyr.h +++ b/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 diff --git a/hw/kdrive/ephyr/ephyrdri.c b/hw/kdrive/ephyr/ephyrdri.c index 16678fc..1e34301 100644 --- a/hw/kdrive/ephyr/ephyrdri.c +++ b/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/hw/kdrive/ephyr/ephyrdri.h b/hw/kdrive/ephyr/ephyrdri.h index 8f2d302..b312e62 100644 --- a/hw/kdrive/ephyr/ephyrdri.h +++ b/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/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 8368d12..3d5cf77 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/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/hw/kdrive/ephyr/ephyrdriext.h b/hw/kdrive/ephyr/ephyrdriext.h index 5808576..9755715 100644 --- a/hw/kdrive/ephyr/ephyrdriext.h +++ b/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/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c index 632a9c4..248689e 100644 --- a/hw/kdrive/ephyr/ephyrglxext.c +++ b/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/hw/kdrive/ephyr/ephyrglxext.h b/hw/kdrive/ephyr/ephyrglxext.h index 053f8d3..8b4b3a2 100644 --- a/hw/kdrive/ephyr/ephyrglxext.h +++ b/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/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c index 007524d..0b98cce 100644 --- a/hw/kdrive/ephyr/ephyrhostglx.c +++ b/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/hw/kdrive/ephyr/ephyrhostglx.h b/hw/kdrive/ephyr/ephyrhostglx.h index 309d0f2..f1eec5f 100644 --- a/hw/kdrive/ephyr/ephyrhostglx.h +++ b/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/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index bcfb750..897aa19 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/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 diff --git a/hw/kdrive/ephyr/ephyrlog.h b/hw/kdrive/ephyr/ephyrlog.h index 0da0a25..43679e1 100644 --- a/hw/kdrive/ephyr/ephyrlog.h +++ b/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/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c index ab18c7a..56a5ff1 100644 --- a/hw/kdrive/ephyr/ephyrvideo.c +++ b/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 diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 0562625..8d6d5e8 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/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 @@ -974,15 +974,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. */ diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index 229961e..87acd5a 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/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 diff --git a/hw/kdrive/ephyr/os.c b/hw/kdrive/ephyr/os.c index 56b52d1..0dbcbb8 100644 --- a/hw/kdrive/ephyr/os.c +++ b/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/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 5325129..1653574 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1077,9 +1077,9 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); (*xf86WriteMmio16)((CARD16)(val), base, offset) #elif defined(__powerpc__) || defined(__sparc__) - /* + /* * we provide byteswapping and no byteswapping functions here - * with byteswapping as default, + * with byteswapping as default, * drivers that don't need byteswapping should define MMIO_IS_BE */ #define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 2b53b90..03dad15 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/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 . */ diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index bd3e4e3..889294f 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/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/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 5b254ba..d42572f 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/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) { @@ -1941,7 +1941,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)) { diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 8dbca3a..cc7ff1b 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -679,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/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 44bc559..9a5550f 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/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/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h index d6450e2..0f54308 100644 --- a/hw/xfree86/common/xf86PciInfo.h +++ b/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/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 4e8060b..1fb5b16 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/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/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 66a64fb..42d66d2 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/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 diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index c4bae56..ab51f96 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -443,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); @@ -958,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/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index db715bd..1b2cb57 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/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/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 5ad9b70..15988b8 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -497,7 +497,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); diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 9ad1b90..643a65d 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -568,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; diff --git a/hw/xfree86/common/xf86vmode.c b/hw/xfree86/common/xf86vmode.c index 2b07833..0ce58e3 100644 --- a/hw/xfree86/common/xf86vmode.c +++ b/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/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h index aaa4e65..023aff5 100644 --- a/hw/xfree86/common/xf86xvmc.h +++ b/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/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index 15e4beb..29185ad 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/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; diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h index 91565a2..4c2da51 100644 --- a/hw/xfree86/ddc/edid.h +++ b/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/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c index 4f983f9..e16b124 100644 --- a/hw/xfree86/ddc/print_edid.c +++ b/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/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 727813f..7d81ab9 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/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 diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/dixmods/xkbKillSrv.c index 6dd21dd..79cf081 100644 --- a/hw/xfree86/dixmods/xkbKillSrv.c +++ b/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/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/dixmods/xkbVT.c index 4ca4451..9840961 100644 --- a/hw/xfree86/dixmods/xkbVT.c +++ b/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/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 5077c7c..ae92fc2 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2292,11 +2292,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/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h index 7a55b49..1bef242 100644 --- a/hw/xfree86/dri/sarea.h +++ b/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/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index e0391db..592f246 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -25,7 +25,7 @@ * * * Original Author: Alan Hourihane - * Rewrite: Dave Airlie + * Rewrite: Dave Airlie * */ diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 0450822..8cd2079 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/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/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 2d261d4..cf2cd09 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/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/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h index 26303ff..7b0ccdf 100644 --- a/hw/xfree86/i2c/xf86i2c.h +++ b/hw/xfree86/i2c/xf86i2c.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1998 Itai Nahshon, Michael Schimek */ diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 7021bdd..fdf5bd8 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -918,7 +918,7 @@ LoadModule(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 */ @@ -938,7 +938,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist, } } - /* + /* * did we find the module? */ if (!found) { diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 87ba0b7..9d592a7 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/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/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index eebe6f4..692bf40 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/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 */ @@ -922,7 +922,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 +947,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/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 8a04dfc..b1c306a 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1072,7 +1072,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; @@ -1890,7 +1890,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/hw/xfree86/modes/xf86cvt.c b/hw/xfree86/modes/xf86cvt.c index 8b7bb8b..b6c1bc8 100644 --- a/hw/xfree86/modes/xf86cvt.c +++ b/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/hw/xfree86/modes/xf86gtf.c b/hw/xfree86/modes/xf86gtf.c index 0a80784..17c2f32 100644 --- a/hw/xfree86/modes/xf86gtf.c +++ b/hw/xfree86/modes/xf86gtf.c @@ -5,11 +5,11 @@ * * Copyright (c) 2001, Andy Ritger aritger at 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/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index 236def6..b4038bd 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/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. * */ diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c index 3a639b8..dd1020e 100644 --- a/hw/xfree86/os-support/bsd/arm_video.c +++ b/hw/xfree86/os-support/bsd/arm_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. * */ @@ -28,7 +28,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 @@ -38,7 +38,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 @@ -50,9 +50,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. * */ diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c index 1b92962..60a19d7 100644 --- a/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/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/hw/xfree86/os-support/bsd/bsd_bell.c b/hw/xfree86/os-support/bsd/bsd_bell.c index f6643ee..19d1f48 100644 --- a/hw/xfree86/os-support/bsd/bsd_bell.c +++ b/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/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index c9f8233..38dfde1 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.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. * */ @@ -173,7 +173,7 @@ xf86OpenConsole() if (!KeepTty) { /* * detaching the controlling tty solves problems of kbd character - * loss. This is not interesting for CO driver, because it is + * loss. This is not interesting for CO driver, because it is * exclusive. */ setpgrp(0, getpid()); @@ -631,7 +631,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/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index 32ea489..1756612 100644 --- a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/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/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index 6c3bbcb..a38a7de 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_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. * */ @@ -238,7 +238,7 @@ xf86DisableIO() if (amd64_iopl(FALSE) == 0) { ExtendedEnabled = FALSE; } - /* Otherwise, the X server has revoqued its root uid, + /* Otherwise, the X server has revoqued its root uid, and thus cannot give up IO privileges any more */ return; diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index b1cf7eb..5a58da1 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_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. * */ diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c index 5bed017..3f8cccd 100644 --- a/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/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. * */ diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 2a96393..ac24f19 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -40,11 +40,11 @@ #include "xf86OSpriv.h" /************************************************************************** - * Video Memory Mapping section + * Video Memory Mapping section ***************************************************************************/ /************************************************************************** - * I/O Permissions section + * I/O Permissions section ***************************************************************************/ /* diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index e1fa3f8..2a28c6a 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/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/hw/xfree86/os-support/linux/lnx_kmod.c b/hw/xfree86/os-support/linux/lnx_kmod.c index f5917ee..6d12226 100644 --- a/hw/xfree86/os-support/linux/lnx_kmod.c +++ b/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/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c index 73a8d55..49758f4 100644 --- a/hw/xfree86/os-support/linux/systemd-logind.c +++ b/hw/xfree86/os-support/linux/systemd-logind.c @@ -387,7 +387,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); diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index 254748f..4f4881c 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/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/hw/xfree86/os-support/shared/ioperm_noop.c b/hw/xfree86/os-support/shared/ioperm_noop.c index eeacee9..de5fb9b 100644 --- a/hw/xfree86/os-support/shared/ioperm_noop.c +++ b/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/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index f3c153b..45949f7 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/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/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c index 38fa5ec..4d4dbc1 100644 --- a/hw/xfree86/os-support/solaris/sun_apm.c +++ b/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/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index 9120bd7..3a83f34 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/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. * */ @@ -331,7 +331,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. */ diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 822bab2..fa3ff0e 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/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. * */ diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h index e853220..31035ae 100644 --- a/hw/xfree86/parser/Configint.h +++ b/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/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c index 6be32d7..9ed5b9e 100644 --- a/hw/xfree86/parser/DRI.c +++ b/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/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c index 28c274d..7e49843 100644 --- a/hw/xfree86/parser/Device.c +++ b/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. diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c index 24940a9..849bf92 100644 --- a/hw/xfree86/parser/Files.c +++ b/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/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 71b50ac..5169665 100644 --- a/hw/xfree86/parser/Flags.c +++ b/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/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c index 1bfe5c1..cfacd4e 100644 --- a/hw/xfree86/parser/Input.c +++ b/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/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c index 994b31a..0ace5da 100644 --- a/hw/xfree86/parser/Layout.c +++ b/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/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c index e2d9120..0dcf4ba 100644 --- a/hw/xfree86/parser/Module.c +++ b/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/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c index 8aebce0..0a8c081 100644 --- a/hw/xfree86/parser/Monitor.c +++ b/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/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c index fe60d95..2f9d505 100644 --- a/hw/xfree86/parser/Pointer.c +++ b/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/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c index 0e9746a..9d8eda2 100644 --- a/hw/xfree86/parser/Screen.c +++ b/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/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c index 2c870ae..4f6e510 100644 --- a/hw/xfree86/parser/Vendor.c +++ b/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/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c index 93209c4..666b0ab 100644 --- a/hw/xfree86/parser/Video.c +++ b/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/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index 22f6e6a..327c02a 100644 --- a/hw/xfree86/parser/read.c +++ b/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/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index a6c1295..b8a08cf 100644 --- a/hw/xfree86/parser/scan.c +++ b/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/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 472b27b..8792783 100644 --- a/hw/xfree86/parser/write.c +++ b/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/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h index ea0cb13..dfa9079 100644 --- a/hw/xfree86/parser/xf86Optrec.h +++ b/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/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 73187f3..43e1755 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/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. */ diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index 8e15f12..9c44970 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/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. */ diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c index 45876cf..6822be5 100644 --- a/hw/xfree86/ramdac/IBM.c +++ b/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/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c index 2492bb5..f8081ca 100644 --- a/hw/xfree86/ramdac/TI.c +++ b/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/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 4ff1b59..04496d5 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -349,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/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index 953c86a..be7154e 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/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/hw/xfree86/ramdac/xf86RamDac.h b/hw/xfree86/ramdac/xf86RamDac.h index 50a659a..af16b7f 100644 --- a/hw/xfree86/ramdac/xf86RamDac.h +++ b/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/hw/xfree86/shadowfb/shadowfb.h b/hw/xfree86/shadowfb/shadowfb.h index bcf59f9..b3dd448 100644 --- a/hw/xfree86/shadowfb/shadowfb.h +++ b/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/hw/xfree86/utils/gtf/gtf.c b/hw/xfree86/utils/gtf/gtf.c index 15503bb..e88387d 100644 --- a/hw/xfree86/utils/gtf/gtf.c +++ b/hw/xfree86/utils/gtf/gtf.c @@ -4,11 +4,11 @@ * * Copyright (c) 2001, Andy Ritger aritger at 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/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index d41e61b..5ea0197 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/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/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h index bc36533..c8fb4e4 100644 --- a/hw/xfree86/vbe/vbe.h +++ b/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/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c index a64f4f8..7223fc0 100644 --- a/hw/xfree86/vgahw/vgaHW.c +++ b/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/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h index 63a10f4..b979b85 100644 --- a/hw/xfree86/vgahw/vgaHW.h +++ b/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/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c index 1a8d1d6..cbea994 100644 --- a/hw/xfree86/x86emu/debug.c +++ b/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/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c index b50badb..853792e 100644 --- a/hw/xfree86/x86emu/ops.c +++ b/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/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c index 24f76b4..5604c7e 100644 --- a/hw/xfree86/x86emu/prim_ops.c +++ b/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/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c index c514dde..5eba358 100644 --- a/hw/xfree86/x86emu/sys.c +++ b/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/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h index 3a7456e..c040259 100644 --- a/hw/xfree86/x86emu/x86emu/regs.h +++ b/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/hw/xnest/Color.c b/hw/xnest/Color.c index 95c3343..8d9d356 100644 --- a/hw/xnest/Color.c +++ b/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/hw/xnest/Xnest.h b/hw/xnest/Xnest.h index adb9daf..37ea6e5 100644 --- a/hw/xnest/Xnest.h +++ b/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/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 29c6438..3403436 100644 --- a/hw/xquartz/darwin.c +++ b/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/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index b41c6fd..5a5e4da 100644 --- a/hw/xquartz/darwinEvents.c +++ b/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/hw/xwin/InitInput.c b/hw/xwin/InitInput.c index 3e9ee41..6cd9e06 100644 --- a/hw/xwin/InitInput.c +++ b/hw/xwin/InitInput.c @@ -52,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/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index eb19dce..fef46a9 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -628,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); @@ -885,7 +885,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 */ diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h index 1871d95..4c9af77 100644 --- a/hw/xwin/ddraw.h +++ b/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/hw/xwin/win.h b/hw/xwin/win.h index ed1ad01..b7d20ca 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -706,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; \ diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c index 5dcc8bc..1bdc7df 100644 --- a/hw/xwin/wincmap.c +++ b/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/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index a6d3c0a..321dfee 100644 --- a/hw/xwin/winconfig.c +++ b/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/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c index 9f72016..6c5b21d 100644 --- a/hw/xwin/wincreatewnd.c +++ b/hw/xwin/wincreatewnd.c @@ -160,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; diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c index f3ac0f7..bddd6b7 100644 --- a/hw/xwin/wincursor.c +++ b/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/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 07fd409..6fe3fc4 100644 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -389,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, @@ -411,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 @@ -481,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/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h index 8b6b984..a61fd7a 100644 --- a/hw/xwin/winlayouts.h +++ b/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/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 421223a..c22d690 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -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/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index e17a950..6599dfb 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -339,7 +339,7 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo) #if 0 /* - * HaveMessage - + * HaveMessage - */ static Bool diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 17823ba..d296f0f 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/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/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index ed1773c..ce0aada 100644 --- a/hw/xwin/winscrinit.c +++ b/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. */ diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 5f3b658..4904eb4 100644 --- a/hw/xwin/winshaddd.c +++ b/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/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 896fd53..48599b2 100644 --- a/hw/xwin/winshadddnl.c +++ b/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 diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 5c815eb..3d222ad 100644 --- a/hw/xwin/winshadgdi.c +++ b/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/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c index 001d0d2..f65811c 100644 --- a/hw/xwin/winwin32rootlesswndproc.c +++ b/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/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 2805ff7..db41d6b 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -284,7 +284,7 @@ ProcWindowsWMReenableUpdate(ClientPtr client) { REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq); - //winEnableUpdate(); + //winEnableUpdate(); return Success; } diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 76e487c..0c434c9 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -403,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. */ @@ -1053,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: diff --git a/include/closure.h b/include/closure.h index 0a7dae6..0d941df 100644 --- a/include/closure.h +++ b/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/include/colormap.h b/include/colormap.h index b89bbe1..5f6b97f 100644 --- a/include/colormap.h +++ b/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 diff --git a/include/colormapst.h b/include/colormapst.h index ac0c62e..53b61cb 100644 --- a/include/colormapst.h +++ b/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/include/cursor.h b/include/cursor.h index 1e483ac..281d88b 100644 --- a/include/cursor.h +++ b/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 diff --git a/include/cursorstr.h b/include/cursorstr.h index 2157954..221cd70 100644 --- a/include/cursorstr.h +++ b/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/include/dix.h b/include/dix.h index 116da2e..991a3ce 100644 --- a/include/dix.h +++ b/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 diff --git a/include/extension.h b/include/extension.h index 7c09af1..a4c09de 100644 --- a/include/extension.h +++ b/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/include/extnsionst.h b/include/extnsionst.h index fbdb73c..636f0a8 100644 --- a/include/extnsionst.h +++ b/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/include/gc.h b/include/gc.h index eb0a583..53f9c29 100644 --- a/include/gc.h +++ b/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 diff --git a/include/gcstruct.h b/include/gcstruct.h index aa2064c..e48d610 100644 --- a/include/gcstruct.h +++ b/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 diff --git a/include/input.h b/include/input.h index 35ceafa..bf22dc7 100644 --- a/include/input.h +++ b/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 diff --git a/include/inputstr.h b/include/inputstr.h index f6cfb04..568f5f9 100644 --- a/include/inputstr.h +++ b/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/include/misc.h b/include/misc.h index f5b85ee..9b1c03a 100644 --- a/include/misc.h +++ b/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 * */ diff --git a/include/miscstruct.h b/include/miscstruct.h index dbab10f..589a6cb 100644 --- a/include/miscstruct.h +++ b/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/include/os.h b/include/os.h index e4ec4b1..3e68c49 100644 --- a/include/os.h +++ b/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 diff --git a/include/pixmap.h b/include/pixmap.h index 4b8fc24..9656c3a 100644 --- a/include/pixmap.h +++ b/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 diff --git a/include/pixmapstr.h b/include/pixmapstr.h index 2bdff98..380e483 100644 --- a/include/pixmapstr.h +++ b/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 { diff --git a/include/property.h b/include/property.h index cae4471..e350513 100644 --- a/include/property.h +++ b/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 diff --git a/include/propertyst.h b/include/propertyst.h index da99576..d8ca840 100644 --- a/include/propertyst.h +++ b/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/include/region.h b/include/region.h index 11dd59e..14d283f 100644 --- a/include/region.h +++ b/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/include/resource.h b/include/resource.h index fe56bb2..772f363 100644 --- a/include/resource.h +++ b/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 */ diff --git a/include/rgb.h b/include/rgb.h index ddfb1d8..449bc54 100644 --- a/include/rgb.h +++ b/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/include/screenint.h b/include/screenint.h index e61cd33..e383848 100644 --- a/include/screenint.h +++ b/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/include/scrnintstr.h b/include/scrnintstr.h index 269ff5a..faf0563 100644 --- a/include/scrnintstr.h +++ b/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 diff --git a/include/selection.h b/include/selection.h index 37e4f5e..7a516f1 100644 --- a/include/selection.h +++ b/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/include/servermd.h b/include/servermd.h index c88a542..a3b5c3a 100644 --- a/include/servermd.h +++ b/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 @@ -86,7 +86,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 diff --git a/include/site.h b/include/site.h index 25caabb..9bd8e2f 100644 --- a/include/site.h +++ b/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/include/window.h b/include/window.h index c123728..6daec85 100644 --- a/include/window.h +++ b/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 diff --git a/include/windowstr.h b/include/windowstr.h index 740f4a6..53eef37 100644 --- a/include/windowstr.h +++ b/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 diff --git a/include/xkbfile.h b/include/xkbfile.h index 9f3b04c..f93d31a 100644 --- a/include/xkbfile.h +++ b/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/include/xkbsrv.h b/include/xkbsrv.h index a4878fc..cc6307a 100644 --- a/include/xkbsrv.h +++ b/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. diff --git a/include/xkbstr.h b/include/xkbstr.h index 935330c..8d71557 100644 --- a/include/xkbstr.h +++ b/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/include/xsha1.h b/include/xsha1.h index aab7106..60c6a90 100644 --- a/include/xsha1.h +++ b/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/mi/mi.h b/mi/mi.h index 3269d9b..db62c91 100644 --- a/mi/mi.h +++ b/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 diff --git a/mi/miarc.c b/mi/miarc.c index 7bbe5b3..288bea3 100644 --- a/mi/miarc.c +++ b/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 @@ -98,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 @@ -369,7 +369,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 @@ -1496,7 +1496,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 @@ -1648,7 +1648,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 @@ -1667,7 +1667,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 */ @@ -2753,7 +2753,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 @@ -2766,7 +2766,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) @@ -2793,7 +2793,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) * */ diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 114f72d..7243963 100644 --- a/mi/mibitblt.c +++ b/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,7 +66,7 @@ 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 @@ -253,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. */ @@ -358,9 +358,9 @@ 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. @@ -504,10 +504,10 @@ 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 */ _X_COLD RegionPtr miCopyPlane(DrawablePtr pSrcDrawable, @@ -670,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 diff --git a/mi/midash.c b/mi/midash.c index 50b0fbe..08f11aa 100644 --- a/mi/midash.c +++ b/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 diff --git a/mi/midispcur.c b/mi/midispcur.c index 8cca5fe..50f0dd2 100644 --- a/mi/midispcur.c +++ b/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/mi/miexpose.c b/mi/miexpose.c index e74b9c3..fc4dbc0 100644 --- a/mi/miexpose.c +++ b/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. @@ -131,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; @@ -564,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/mi/mifillrct.c b/mi/mifillrct.c index faf6049..28f2322 100644 --- a/mi/mifillrct.c +++ b/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 diff --git a/mi/mifpoly.h b/mi/mifpoly.h index 9304c6f..3202476 100644 --- a/mi/mifpoly.h +++ b/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 diff --git a/mi/miglblt.c b/mi/miglblt.c index b53ab9c..0183e99 100644 --- a/mi/miglblt.c +++ b/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/mi/miinitext.c b/mi/miinitext.c index 1d90516..5872bf5 100644 --- a/mi/miinitext.c +++ b/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/mi/mipoly.c b/mi/mipoly.c index 0ed2edb..a332376 100644 --- a/mi/mipoly.c +++ b/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 diff --git a/mi/mipoly.h b/mi/mipoly.h index fc5a5cf..d67a524 100644 --- a/mi/mipoly.h +++ b/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. diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c index 086502b..4fa521d 100644 --- a/mi/mipolypnt.c +++ b/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/mi/mipolyrect.c b/mi/mipolyrect.c index e316ae0..8308225 100644 --- a/mi/mipolyrect.c +++ b/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/mi/mipolyseg.c b/mi/mipolyseg.c index d6f1807..7909b39 100644 --- a/mi/mipolyseg.c +++ b/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/mi/mipolytext.c b/mi/mipolytext.c index 02c4588..f1e5ed8 100644 --- a/mi/mipolytext.c +++ b/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/mi/mipushpxl.c b/mi/mipushpxl.c index 9a78f40..f6a1b52 100644 --- a/mi/mipushpxl.c +++ b/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/mi/miscrinit.c b/mi/miscrinit.c index 327bd15..b53c7e4 100644 --- a/mi/miscrinit.c +++ b/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 diff --git a/mi/mistruct.h b/mi/mistruct.h index 17f7d83..00856f1 100644 --- a/mi/mistruct.h +++ b/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/mi/mivaltree.c b/mi/mivaltree.c index 8e4e9a9..ea6889f 100644 --- a/mi/mivaltree.c +++ b/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. diff --git a/mi/miwindow.c b/mi/miwindow.c index 0cf5046..a1af3a7 100644 --- a/mi/miwindow.c +++ b/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 diff --git a/mi/mizerclip.c b/mi/mizerclip.c index d05bf67..0ae9641 100644 --- a/mi/mizerclip.c +++ b/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/mi/mizerline.c b/mi/mizerline.c index f30e012..5a24470 100644 --- a/mi/mizerline.c +++ b/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 @@ -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/miext/damage/damage.c b/miext/damage/damage.c index 9bd9c84..6ef7f9d 100644 --- a/miext/damage/damage.c +++ b/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/miext/rootless/rootless.h b/miext/rootless/rootless.h index a3f38b6..1be61cd 100644 --- a/miext/rootless/rootless.h +++ b/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/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c index 23ff393..4fba26c 100644 --- a/miext/rootless/rootlessGC.c +++ b/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/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index c7c2c99..0f7b76c 100644 --- a/miext/rootless/rootlessValTree.c +++ b/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. @@ -456,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*/ @@ -491,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. */ @@ -520,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/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 3dbd588..a8f296a 100644 --- a/miext/rootless/rootlessWindow.c +++ b/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/miext/shadow/shrotate.c b/miext/shadow/shrotate.c index 779a905..a0fc4ec 100644 --- a/miext/shadow/shrotate.c +++ b/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/miext/sync/misyncfd.c b/miext/sync/misyncfd.c index 93ff85f..92f3b22 100644 --- a/miext/sync/misyncfd.c +++ b/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/os/WaitFor.c b/os/WaitFor.c index 3eb15b9..86d96c8 100644 --- a/os/WaitFor.c +++ b/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 */ @@ -343,14 +343,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. */ @@ -358,7 +358,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/os/access.c b/os/access.c index fe01420..5c510de 100644 --- a/os/access.c +++ b/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 @@ -201,7 +201,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 { @@ -309,7 +309,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 +712,7 @@ DefineSelf(int fd) ) continue; - /* + /* * ignore 'localhost' entries as they're not useful * on the other end of the wire */ @@ -1010,7 +1010,7 @@ ComputeLocalClient(ClientPtr client) /* * 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 */ @@ -1037,8 +1037,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)) { @@ -1203,7 +1203,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) @@ -1352,7 +1352,7 @@ 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 @@ -1370,7 +1370,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) { @@ -1474,7 +1474,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. */ @@ -1571,7 +1571,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; @@ -1638,8 +1638,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) @@ -1717,7 +1717,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; @@ -1771,12 +1771,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/os/busfault.c b/os/busfault.c index ac0268f..d4afa6d 100644 --- a/os/busfault.c +++ b/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/os/connection.c b/os/connection.c index d53bd34..da3397d 100644 --- a/os/connection.c +++ b/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 @@ -648,8 +648,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 @@ -974,7 +974,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 @@ -1035,7 +1035,7 @@ CheckConnections(void) /***************** * CloseDownConnection - * Delete client from AllClients and free resources + * Delete client from AllClients and free resources *****************/ void diff --git a/os/io.c b/os/io.c index 8181a86..bb273bb 100644 --- a/os/io.c +++ b/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; diff --git a/os/log.c b/os/log.c index 7348ad4..2e3b3f6 100644 --- a/os/log.c +++ b/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"); diff --git a/os/oscolor.c b/os/oscolor.c index a44ed3f..017aab1 100644 --- a/os/oscolor.c +++ b/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 diff --git a/os/osdep.h b/os/osdep.h index 0ccdb62..77a5b53 100644 --- a/os/osdep.h +++ b/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/os/osinit.c b/os/osinit.c index 4d48ea9..ff0979a 100644 --- a/os/osinit.c +++ b/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 @@ -225,9 +225,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/os/xdmcp.c b/os/xdmcp.c index 99616d9..b6e97c9 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -562,7 +562,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/present/present.c b/present/present.c index 47566c7..acbb0ea 100644 --- a/present/present.c +++ b/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; } @@ -372,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) { diff --git a/randr/randrstr.h b/randr/randrstr.h index e142232..13e6a85 100644 --- a/randr/randrstr.h +++ b/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/randr/rrprovider.c b/randr/rrprovider.c index 4507ba8..bbb8e51 100644 --- a/randr/rrprovider.c +++ b/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/randr/rrtransform.c b/randr/rrtransform.c index f93181d..c8a2749 100644 --- a/randr/rrtransform.c +++ b/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/randr/rrtransform.h b/randr/rrtransform.h index 2269b4c..f811d2b 100644 --- a/randr/rrtransform.h +++ b/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/randr/rrxinerama.c b/randr/rrxinerama.c index 76d728c..26894a6 100644 --- a/randr/rrxinerama.c +++ b/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/record/record.c b/record/record.c index c900219..0a466e2 100644 --- a/record/record.c +++ b/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/render/animcur.c b/render/animcur.c index 69f9f88..825ae1f 100644 --- a/render/animcur.c +++ b/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/render/glyph.c b/render/glyph.c index ae38121..f3310db 100644 --- a/render/glyph.c +++ b/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/render/glyphstr.h b/render/glyphstr.h index 835c1a7..2df055d 100644 --- a/render/glyphstr.h +++ b/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/render/mipict.h b/render/mipict.h index a16dd31..23ce9e8 100644 --- a/render/mipict.h +++ b/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/render/picture.c b/render/picture.c index cd9bc74..711cbc7 100644 --- a/render/picture.c +++ b/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. diff --git a/render/picture.h b/render/picture.h index c85353a..66c85c5 100644 --- a/render/picture.h +++ b/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/render/render.c b/render/render.c index 9ac4a98..e3031da 100644 --- a/render/render.c +++ b/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/xfixes/cursor.c b/xfixes/cursor.c index 31a408f..94d24a8 100644 --- a/xfixes/cursor.c +++ b/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/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index 20e0459..78c9837 100644 --- a/xkb/XKBAlloc.c +++ b/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/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index 8880784..25917d3 100644 --- a/xkb/XKBGAlloc.c +++ b/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/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 3ffd5da..37ed1a7 100644 --- a/xkb/XKBMAlloc.c +++ b/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/xkb/XKBMisc.c b/xkb/XKBMisc.c index 6abd1d1..df268b5 100644 --- a/xkb/XKBMisc.c +++ b/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/xkb/ddxBeep.c b/xkb/ddxBeep.c index caf78c9..52353ea 100644 --- a/xkb/ddxBeep.c +++ b/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/xkb/ddxCtrls.c b/xkb/ddxCtrls.c index 0805fb2..964ac3d 100644 --- a/xkb/ddxCtrls.c +++ b/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/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c index 1cabb1b..7c7e739 100644 --- a/xkb/ddxKillSrv.c +++ b/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/xkb/ddxLEDs.c b/xkb/ddxLEDs.c index 81b7b00..e5aecb5 100644 --- a/xkb/ddxLEDs.c +++ b/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/xkb/ddxLoad.c b/xkb/ddxLoad.c index 1dc0e4e..f71815a 100644 --- a/xkb/ddxLoad.c +++ b/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/xkb/ddxVT.c b/xkb/ddxVT.c index 6529102..f3cd26a 100644 --- a/xkb/ddxVT.c +++ b/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/xkb/maprules.c b/xkb/maprules.c index 6f5f8cc..28148d9 100644 --- a/xkb/maprules.c +++ b/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/xkb/xkb.c b/xkb/xkb.c index fdc5923..15c7f34 100644 --- a/xkb/xkb.c +++ b/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. diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 5f3de0d..7fd6a48 100644 --- a/xkb/xkbAccessX.c +++ b/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/xkb/xkbActions.c b/xkb/xkbActions.c index c44f44b..2a196f1 100644 --- a/xkb/xkbActions.c +++ b/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/xkb/xkbEvents.c b/xkb/xkbEvents.c index cc9a535..0dbbd6c 100644 --- a/xkb/xkbEvents.c +++ b/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. diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 06ec46e..30e10bd 100644 --- a/xkb/xkbInit.c +++ b/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/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index e1e22d1..4e16002 100644 --- a/xkb/xkbLEDs.c +++ b/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/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c index b24fd6c..f7a6b4b 100644 --- a/xkb/xkbPrKeyEv.c +++ b/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/xkb/xkbSwap.c b/xkb/xkbSwap.c index 076da34..ecec63e 100644 --- a/xkb/xkbSwap.c +++ b/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/xkb/xkbUtils.c b/xkb/xkbUtils.c index c14a790..6019f0f 100644 --- a/xkb/xkbUtils.c +++ b/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/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index d96ee4b..2ecdcd5 100644 --- a/xkb/xkbfmisc.c +++ b/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/xkb/xkbgeom.h b/xkb/xkbgeom.h index 1999f5c..5ade436 100644 --- a/xkb/xkbgeom.h +++ b/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/xkb/xkbout.c b/xkb/xkbout.c index 7bb6cea..5f77ab0 100644 --- a/xkb/xkbout.c +++ b/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/xkb/xkbtext.c b/xkb/xkbtext.c index fdf1d17..ffbc546 100644 --- a/xkb/xkbtext.c +++ b/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/xkb/xkmread.c b/xkb/xkmread.c index b6241b5..0b9f0ef 100644 --- a/xkb/xkmread.c +++ b/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. -- 2.1.0 From alan.coopersmith at oracle.com Thu Oct 30 16:58:42 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 30 Oct 2014 16:58:42 -0700 Subject: [PATCH 2/9] include: fix documentation for list.h In-Reply-To: <1414713166-27887-3-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> <1414713166-27887-3-git-send-email-peter.hutterer@who-t.net> Message-ID: <5452D0B2.3060203@oracle.com> On 10/30/14 04:52 PM, Peter Hutterer wrote: > - * @param The list to initialized. > + * @param list The list to initialized. ^ be ? -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From michel at daenzer.net Thu Oct 30 20:14:41 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Fri, 31 Oct 2014 12:14:41 +0900 Subject: [PATCH 8/9] dix: silence compiler warning comparing CARD32 to -1 In-Reply-To: <1414713166-27887-9-git-send-email-peter.hutterer@who-t.net> References: <1414713166-27887-1-git-send-email-peter.hutterer@who-t.net> <1414713166-27887-9-git-send-email-peter.hutterer@who-t.net> Message-ID: <5452FEA1.3070704@daenzer.net> On 31.10.2014 08:52, Peter Hutterer wrote: > 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 > --- > dix/window.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dix/window.c b/dix/window.c > index d43ef03..9019852 100644 > --- a/dix/window.c > +++ b/dix/window.c > @@ -3243,7 +3243,7 @@ CheckWindowOptionalNeed(WindowPtr w) > return; > if (optional->userProps != NULL) > return; > - if (optional->backingBitPlanes != ~0L) > + if (optional->backingBitPlanes != (CARD32)~0L) Just changing ~0L to ~0UL might work? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From peter.hutterer at who-t.net Thu Oct 30 21:07:58 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 14:07:58 +1000 Subject: [PATCH v2] include: fix documentation for list.h In-Reply-To: <5452D0B2.3060203@oracle.com> Message-ID: <20141031040757.GA12596@jelly.redhat.com> Signed-off-by: Peter Hutterer --- include/list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/list.h b/include/list.h index 455c670..39f1985 100644 --- a/include/list.h +++ b/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) -- 2.1.0 From peter.hutterer at who-t.net Thu Oct 30 21:10:17 2014 From: peter.hutterer at who-t.net (Peter Hutterer) Date: Fri, 31 Oct 2014 14:10:17 +1000 Subject: [PATCH v2] dix: silence compiler warning comparing CARD32 to -1 In-Reply-To: <5452FEA1.3070704@daenzer.net> Message-ID: <20141031041017.GA12720@jelly.redhat.com> 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 --- Changes to v1: - use ~0U instead of the (CARD32) cast ~0UL causes another warning for shortening long to int. dix/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index d43ef03..22e9e49 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3243,7 +3243,7 @@ CheckWindowOptionalNeed(WindowPtr w) return; if (optional->userProps != NULL) return; - if (optional->backingBitPlanes != ~0L) + if (optional->backingBitPlanes != ~0U) return; if (optional->backingPixel != 0) return; -- 2.1.0 From alan.coopersmith at oracle.com Thu Oct 30 21:22:28 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Thu, 30 Oct 2014 21:22:28 -0700 Subject: [PATCH v2] include: fix documentation for list.h In-Reply-To: <20141031040757.GA12596@jelly.redhat.com> References: <20141031040757.GA12596@jelly.redhat.com> Message-ID: <54530E84.8000706@oracle.com> On 10/30/14 09:07 PM, Peter Hutterer wrote: > Signed-off-by: Peter Hutterer > --- > include/list.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/list.h b/include/list.h > index 455c670..39f1985 100644 > --- a/include/list.h > +++ b/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) > Reviewed-by: Alan Coopersmith -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From michel at daenzer.net Fri Oct 31 01:41:37 2014 From: michel at daenzer.net (=?UTF-8?Q?Michel_D=c3=a4nzer?=) Date: Fri, 31 Oct 2014 17:41:37 +0900 Subject: [PATCH v2] dix: silence compiler warning comparing CARD32 to -1 In-Reply-To: <20141031041017.GA12720@jelly.redhat.com> References: <20141031041017.GA12720@jelly.redhat.com> Message-ID: <54534B41.1070307@daenzer.net> On 31.10.2014 13:10, Peter Hutterer wrote: > 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 > --- > Changes to v1: > - use ~0U instead of the (CARD32) cast > > ~0UL causes another warning for shortening long to int. > > dix/window.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dix/window.c b/dix/window.c > index d43ef03..22e9e49 100644 > --- a/dix/window.c > +++ b/dix/window.c > @@ -3243,7 +3243,7 @@ CheckWindowOptionalNeed(WindowPtr w) > return; > if (optional->userProps != NULL) > return; > - if (optional->backingBitPlanes != ~0L) > + if (optional->backingBitPlanes != ~0U) > return; > if (optional->backingPixel != 0) > return; > Taking a closer look, this might generate a warning on x32, which seems to define CARD32 as unsigned long... And there's precedent in this file for the (CARD32) cast. Anyway, both versions have my Reviewed-by: Michel Dänzer -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer From thierry.reding at gmail.com Fri Oct 31 05:16:39 2014 From: thierry.reding at gmail.com (Thierry Reding) Date: Fri, 31 Oct 2014 13:16:39 +0100 Subject: [PATCH] xv: Add missing gcstruct.h include In-Reply-To: <86bnot6xw2.fsf@hiro.keithp.com> References: <1414598367-18592-1-git-send-email-thierry.reding@gmail.com> <86bnot6xw2.fsf@hiro.keithp.com> Message-ID: <20141031121637.GF10778@ulmo.nvidia.com> On Thu, Oct 30, 2014 at 02:38:53PM -0700, Keith Packard wrote: > Thierry Reding writes: > > > From: Thierry Reding > > > > 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); > > I'm curious as to how I'm not seeing this bug? It seems to be triggered by --disable-xinerama, in which case gcstruct.h is pulled in via panoramiX.h. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:06 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:06 -0200 Subject: [PATCH xf86-video-nested 0/5] Bring up a new XCB client, start pairing with Xephyr code. Message-ID: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This is my first effort to improve xf86-video-nested driver, bringing up a new XCB backend client and trying to pair it with latest Xephyr code, so that we can port any Xephyr optimizations to this driver. My main motivation for this driver is making single-GPU multiseat configuration (i.e. launching nested X servers on top of a bare display server spanning all available video outputs) more reliable, thus I've made some build parts optional and disabled by default, like nested input driver. If nested input is needed for other use cases, I need help for reviewing and fixing current code. I also need help for porting any relevant features present in Xephyr (e.g. GLAMOR support) to this XCB backend. Laércio de Sousa (5): Make nested input driver build optional (and disabled by default) Add support for option "Xauthority" in xorg.conf Add preliminary support for screen options "Fullscreen" and "Output" in xorg.conf Add configure option for choosing driver backend Introduce a new XCB client backend, and make it the default one. README | 7 +- TODO | 3 +- configure.ac | 52 ++- src/Makefile.am | 14 +- src/client.h | 14 +- src/driver.c | 131 +++++-- src/nested_input.c | 9 +- src/xcbclient.c | 1022 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/xlibclient.c | 57 ++- 9 files changed, 1234 insertions(+), 75 deletions(-) -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:07 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:07 -0200 Subject: [PATCH xf86-video-nested 1/5] Make nested input driver build optional (and disabled by default) In-Reply-To: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <1414761131-3663-2-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This patch allow skipping build of nested input driver included in xf86-video-nested code. Actually, nested input driver is not needed for single-GPU multiseat setups, and may need maintenance for other use cases. Nested input driver build will be disabled by default. If one wants to build it, just pass configure option --enable-nested-input. Signed-off-by: Laércio de Sousa --- configure.ac | 30 +++++++++++++++++++++++++----- src/Makefile.am | 10 ++++++++-- src/client.h | 3 +++ src/driver.c | 13 +++++++++++++ src/nested_input.c | 9 +++++---- src/xlibclient.c | 36 ++++++++++++++++++++++++++++-------- 6 files changed, 82 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 32e9ab0..7bdb8ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,5 @@ # Copyright 2005 Adam Jackson. +# 2014 Prefeitura de Mogi das Cruzes, SP, Brazil. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -22,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xf86-video-nestedy], +AC_INIT([xf86-video-nested], [0.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-nested]) @@ -45,11 +46,24 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL # Define a configure option for an alternate module directory -AC_ARG_WITH(xorg-module-dir, [ --with-xorg-module-dir=DIR ], - [ moduledir="$withval" ], - [ moduledir="$libdir/xorg/modules" ]) -AC_SUBST(moduledir) +AC_ARG_WITH([xorg-module-dir], + AS_HELP_STRING([--with-xorg-module-dir=DIR], + [Alternate Xorg module directory]), + [moduledir="$withval"], + [moduledir="$libdir/xorg/modules"]) +AC_SUBST([moduledir]) +# Define a configure option to enable/disable nested input driver build +AC_ARG_ENABLE([nested-input], + AS_HELP_STRING([--enable-nested-input], + [Enable building nested input driver]), + [NESTED_INPUT="$enableval"], + [NESTED_INPUT=no]) +AC_SUBST([NESTED_INPUT]) +AM_CONDITIONAL([NESTED_INPUT], [test "x$NESTED_INPUT" = xyes]) +if test "x$NESTED_INPUT" = xyes; then + AC_DEFINE([NESTED_INPUT], [1], [Define if nested input driver is enabled]) +fi # Store the list of server defined optional extensions in REQUIRED_MODULES #XORG_DRIVER_CHECK_EXT(RANDR, randrproto) @@ -69,3 +83,9 @@ AC_CONFIG_FILES([ src/Makefile ]) AC_OUTPUT +AC_MSG_RESULT([ + $PACKAGE_NAME $VERSION + + moduledir: ${moduledir} + nested input: ${NESTED_INPUT} +]) diff --git a/src/Makefile.am b/src/Makefile.am index 44dc656..11e610d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,8 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # -# Author: Paulo Zanoni +# Authors: Paulo Zanoni +# Laércio de Sousa # AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(X11_CFLAGS) $(XEXT_CFLAGS) @@ -26,6 +27,11 @@ AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(X11_CFLAGS) $(XEXT_CFLAGS) nested_drv_la_LTLIBRARIES = nested_drv.la nested_drv_la_LDFLAGS = -module -avoid-version nested_drv_la_LIBADD = $(XORG_LIBS) $(X11_LIBS) $(XEXT_LIBS) + nested_drv_ladir = @moduledir@/drivers -nested_drv_la_SOURCES = driver.c nested_input.c nested_input.h xlibclient.c client.h compat-api.h +nested_drv_la_SOURCES = driver.c client.h compat-api.h xlibclient.c + +if NESTED_INPUT +nested_drv_la_SOURCES += nested_input.h nested_input.c +endif diff --git a/src/client.h b/src/client.h index 4c73b3c..c6f88af 100644 --- a/src/client.h +++ b/src/client.h @@ -27,6 +27,7 @@ * Colin Hill * Weseung Hwang * Nathaniel Way + * Laércio de Sousa */ #include @@ -72,4 +73,6 @@ void NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, DeviceIntPtr dev); int NestedClientGetFileDescriptor(NestedClientPrivatePtr pPriv); +#ifdef NESTED_INPUT Bool NestedClientGetKeyboardMappings(NestedClientPrivatePtr pPriv, KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr ctrls); +#endif diff --git a/src/driver.c b/src/driver.c index 68b7aa8..b573a97 100644 --- a/src/driver.c +++ b/src/driver.c @@ -27,6 +27,7 @@ * Colin Hill * Weseung Hwang * Nathaniel Way + * Laércio de Sousa */ #include @@ -44,12 +45,16 @@ #include #include #include +#ifdef NESTED_INPUT #include "xf86Xinput.h" +#endif #include "compat-api.h" #include "client.h" +#ifdef NESTED_INPUT #include "nested_input.h" +#endif #define NESTED_VERSION 0 #define NESTED_NAME "NESTED" @@ -129,6 +134,7 @@ _X_EXPORT DriverRec NESTED = { 0 /* PciProbe */ }; +#ifdef NESTED_INPUT _X_EXPORT InputDriverRec NESTEDINPUT = { 1, "nestedinput", @@ -138,6 +144,7 @@ _X_EXPORT InputDriverRec NESTEDINPUT = { NULL, 0, }; +#endif static XF86ModuleVersionInfo NestedVersRec = { NESTED_DRIVER_NAME, @@ -184,7 +191,9 @@ NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) { setupDone = TRUE; xf86AddDriver(&NESTED, module, HaveDriverFuncs); +#ifdef NESTED_INPUT xf86AddInputDriver(&NESTEDINPUT, module, 0); +#endif return (pointer)1; } else { @@ -525,11 +534,13 @@ NestedAddMode(ScrnInfoPtr pScrn, int width, int height) { // Wrapper for timed call to NestedInputLoadDriver. Used with timer in order // to force the initialization to wait until the input core is initialized. +#ifdef NESTED_INPUT static CARD32 NestedMouseTimer(OsTimerPtr timer, CARD32 time, pointer arg) { NestedInputLoadDriver(arg); return 0; } +#endif static void NestedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask) { @@ -577,7 +588,9 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) // Schedule the NestedInputLoadDriver function to load once the // input core is initialized. +#ifdef NESTED_INPUT TimerSet(NULL, 0, 1, NestedMouseTimer, pNested->clientData); +#endif miClearVisualTypes(); if (!miSetVisualTypesAndMasks(pScrn->depth, diff --git a/src/nested_input.c b/src/nested_input.c index 9d2e0d3..9122b30 100644 --- a/src/nested_input.c +++ b/src/nested_input.c @@ -27,8 +27,13 @@ * Colin Hill * Weseung Hwang * Nathaniel Way + * Laércio de Sousa */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -47,10 +52,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "client.h" #include "nested_input.h" diff --git a/src/xlibclient.c b/src/xlibclient.c index f7fe652..0f1034a 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -27,8 +27,13 @@ * Colin Hill * Weseung Hwang * Nathaniel Way + * Laércio de Sousa */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include @@ -36,19 +41,19 @@ #include #include +#ifdef NESTED_INPUT #include +#endif #include #include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "client.h" +#ifdef NESTED_INPUT #include "nested_input.h" +#endif struct NestedClientPrivate { Display *display; @@ -67,6 +72,7 @@ struct NestedClientPrivate { DeviceIntPtr dev; // The pointer to the input device. Passed back to the // input driver when posting input events. +#ifdef NESTED_INPUT struct { int op; int event; @@ -74,6 +80,7 @@ struct NestedClientPrivate { int major; int minor; } xkb; +#endif }; /* Checks if a display is open */ @@ -181,6 +188,7 @@ NestedClientCreateScreen(int scrnIndex, if (!pPriv->display) return NULL; +#ifdef NESTED_INPUT supported = XkbQueryExtension(pPriv->display, &pPriv->xkb.op, &pPriv->xkb.event, &pPriv->xkb.error, &pPriv->xkb.major, &pPriv->xkb.minor); if (!supported) { @@ -188,6 +196,7 @@ NestedClientCreateScreen(int scrnIndex, XCloseDisplay(pPriv->display); return NULL; } +#endif pPriv->screenNumber = DefaultScreen(pPriv->display); pPriv->screen = ScreenOfDisplay(pPriv->display, pPriv->screenNumber); @@ -210,10 +219,17 @@ NestedClientCreateScreen(int scrnIndex, XMapWindow(pPriv->display, pPriv->window); - XSelectInput(pPriv->display, pPriv->window, ExposureMask | - PointerMotionMask | EnterWindowMask | LeaveWindowMask | - ButtonPressMask | ButtonReleaseMask | KeyPressMask | - KeyReleaseMask); + XSelectInput(pPriv->display, pPriv->window, +#ifdef NESTED_INPUT + PointerMotionMask | + EnterWindowMask | + LeaveWindowMask | + ButtonPressMask | + ButtonReleaseMask | + KeyPressMask | + KeyReleaseMask | +#endif + ExposureMask); if (!NestedClientTryXShm(pPriv, scrnIndex, width, height, depth)) { pPriv->img = XCreateImage(pPriv->display, @@ -318,6 +334,7 @@ NestedClientCheckEvents(NestedClientPrivatePtr pPriv) { ((XExposeEvent*)&ev)->height); break; +#ifdef NESTED_INPUT case MotionNotify: if (!pPriv->dev) { xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initialized, ignoring input.\n"); @@ -348,6 +365,7 @@ NestedClientCheckEvents(NestedClientPrivatePtr pPriv) { NestedInputPostKeyboardEvent(pPriv->dev, ev.xkey.keycode, ev.type == KeyPress); break; +#endif } } } @@ -373,6 +391,7 @@ NestedClientGetFileDescriptor(NestedClientPrivatePtr pPriv) { return ConnectionNumber(pPriv->display); } +#ifdef NESTED_INPUT Bool NestedClientGetKeyboardMappings(NestedClientPrivatePtr pPriv, KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr ctrls) { XModifierKeymap *modifier_keymap; KeySym *keymap; @@ -419,3 +438,4 @@ Bool NestedClientGetKeyboardMappings(NestedClientPrivatePtr pPriv, KeySymsPtr ke XkbFreeKeyboard(xkb, 0, False); return TRUE; } +#endif -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:08 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:08 -0200 Subject: [PATCH xf86-video-nested 2/5] Add support for option "Xauthority" in xorg.conf In-Reply-To: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <1414761131-3663-3-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> With this patch, one can set explicitely an authorization file for "nested" video driver in xorg.conf section "Device". Example: Section "Device" Identifier "nested_device" Driver "nested" Option "Display" ":0" Option "Xauthority" "/var/run/Xauthority/:0" EndSection If no such an option is defined in xorg.conf, the value defined in environment variable XAUTHORITY will be used, as before. Signed-off-by: Laércio de Sousa --- README | 7 +++---- src/client.h | 5 ++++- src/driver.c | 32 ++++++++++++++++++++++---------- src/xlibclient.c | 15 ++++++++++++++- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/README b/README index 12a2fc6..5b2fc97 100644 --- a/README +++ b/README @@ -13,20 +13,20 @@ My xorg.conf: Section "ServerFlags" Option "AutoEnableDevices" "false" Option "AutoAddDevices" "false" - Option "AllowEmptyInput" "true" EndSection Section "Device" Identifier "device1" Driver "nested" - Option "Display" ":0" # you can omit this + Option "Display" ":0" # you can omit this + Option "Xauthority" "/var/run/Xauthority/:0" # you can omit this EndSection Section "Screen" Identifier "screen1" Device "device1" DefaultDepth 24 - Option "Origin" "100 100" # you can omit this + Option "Origin" "100 100" # you can omit this SubSection "Display" Depth 24 Modes "640x480" @@ -49,7 +49,6 @@ xorg.conf with 2 screens and a mouse: Section "ServerFlags" Option "AutoEnableDevices" "false" Option "AutoAddDevices" "false" - Option "AllowEmptyInput" "true" EndSection Section "Device" diff --git a/src/client.h b/src/client.h index c6f88af..46f372b 100644 --- a/src/client.h +++ b/src/client.h @@ -39,12 +39,15 @@ struct NestedClientPrivate; typedef struct NestedClientPrivate *NestedClientPrivatePtr; -Bool NestedClientCheckDisplay(char *displayName); +Bool NestedClientCheckDisplay(int scrnIndex, + char *displayName, + char *xauthFile); Bool NestedClientValidDepth(int depth); NestedClientPrivatePtr NestedClientCreateScreen(int scrnIndex, char *displayName, + char *xauthFile, int width, int height, int originX, diff --git a/src/driver.c b/src/driver.c index b573a97..a91954f 100644 --- a/src/driver.c +++ b/src/driver.c @@ -100,6 +100,7 @@ void NestedPrintMode(ScrnInfoPtr p, DisplayModePtr m); typedef enum { OPTION_DISPLAY, + OPTION_XAUTHORITY, OPTION_ORIGIN } NestedOpts; @@ -116,9 +117,10 @@ static SymTabRec NestedChipsets[] = { * port NestedClient to something that's not Xlib/Xcb we might need to add some * custom options */ static OptionInfoRec NestedOptions[] = { - { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE }, - { OPTION_ORIGIN, "Origin", OPTV_STRING, {0}, FALSE }, - { -1, NULL, OPTV_NONE, {0}, FALSE } + { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE }, + { OPTION_XAUTHORITY, "Xauthority", OPTV_STRING, {0}, FALSE }, + { OPTION_ORIGIN, "Origin", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } }; _X_EXPORT DriverRec NESTED = { @@ -170,6 +172,7 @@ _X_EXPORT XF86ModuleData nestedModuleData = { /* These stuff should be valid to all server generations */ typedef struct NestedPrivate { char *displayName; + char *xauthFile; int originX; int originY; NestedClientPrivatePtr clientData; @@ -325,6 +328,10 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { } pNested = PNESTED(pScrn); + pNested->displayName = NULL; + pNested->xauthFile = NULL; + pNested->originX = 0; + pNested->originY = 0; if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) return FALSE; @@ -351,8 +358,13 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { OPTION_DISPLAY); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using display \"%s\"\n", pNested->displayName); - } else { - pNested->displayName = NULL; + } + + if (xf86IsOptionSet(NestedOptions, OPTION_XAUTHORITY)) { + pNested->xauthFile = xf86GetOptValString(NestedOptions, + OPTION_XAUTHORITY); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using authorization file \"%s\"\n", + pNested->xauthFile); } if (xf86IsOptionSet(NestedOptions, OPTION_ORIGIN)) { @@ -365,16 +377,15 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using origin x:%d y:%d\n", pNested->originX, pNested->originY); - } else { - pNested->originX = 0; - pNested->originY = 0; } xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); - if (!NestedClientCheckDisplay(pNested->displayName)) { + if (!NestedClientCheckDisplay(pScrn->scrnIndex, + pNested->displayName, + pNested->xauthFile)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Can't open display: %s\n", - pNested->displayName); + pNested->displayName ? pNested->displayName : getenv("DISPLAY")); return FALSE; } @@ -573,6 +584,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) pNested->clientData = NestedClientCreateScreen(pScrn->scrnIndex, pNested->displayName, + pNested->xauthFile, pScrn->virtualX, pScrn->virtualY, pNested->originX, diff --git a/src/xlibclient.c b/src/xlibclient.c index 0f1034a..3a87c96 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -85,9 +85,16 @@ struct NestedClientPrivate { /* Checks if a display is open */ Bool -NestedClientCheckDisplay(char *displayName) { +NestedClientCheckDisplay(int scrnIndex, + char *displayName, + char *xauthFile) { Display *d; + /* Needed until we can pass authorization file + * directly to XOpenDisplay() */ + if (xauthFile != NULL) + setenv("XAUTHORITY", xauthFile, 1); + d = XOpenDisplay(displayName); if (!d) { return FALSE; @@ -167,6 +174,7 @@ NestedClientTryXShm(NestedClientPrivatePtr pPriv, int scrnIndex, int width, int NestedClientPrivatePtr NestedClientCreateScreen(int scrnIndex, char *displayName, + char *xauthFile, int width, int height, int originX, @@ -184,6 +192,11 @@ NestedClientCreateScreen(int scrnIndex, pPriv = malloc(sizeof(struct NestedClientPrivate)); pPriv->scrnIndex = scrnIndex; + /* Needed until we can pass authorization file + * directly to XOpenDisplay() */ + if (xauthFile != NULL) + setenv("XAUTHORITY", xauthFile, 1); + pPriv->display = XOpenDisplay(displayName); if (!pPriv->display) return NULL; -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:09 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:09 -0200 Subject: [PATCH xf86-video-nested 3/5] Add preliminary support for screen options "Fullscreen" and "Output" in xorg.conf In-Reply-To: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <1414761131-3663-4-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This patch introduces support for new screen options in xorg.conf, namely: "Fullscreen" and "Output". They are expected to work exactly as command-line options -fullscreen and -output for Xephyr, allowing to open nested Xorg window in fullscreen mode (restricted to given host X server output if option "Output" is set). In order to achieve this, NestedClientCheckDisplay() needs to be extended to allow collecting fullscreen geometry from host X server while checking if it's ready for connections, which has to be implemented on each backend client. NestedClientCreateScreen() also was extended to include a boolean argument that tells backend client if it needs to set appropriate fullscreen hint for nested Xorg window. Signed-off-by: Laércio de Sousa --- src/client.h | 12 +++++-- src/driver.c | 96 ++++++++++++++++++++++++++++++++++++++------------------ src/xlibclient.c | 8 ++++- 3 files changed, 82 insertions(+), 34 deletions(-) diff --git a/src/client.h b/src/client.h index 46f372b..be7d501 100644 --- a/src/client.h +++ b/src/client.h @@ -39,15 +39,21 @@ struct NestedClientPrivate; typedef struct NestedClientPrivate *NestedClientPrivatePtr; -Bool NestedClientCheckDisplay(int scrnIndex, - char *displayName, - char *xauthFile); +Bool NestedClientCheckDisplay(int scrnIndex, + char *displayName, + char *xauthFile, + char *output, + unsigned int *width, + unsigned int *height, + int *x, + int *y); Bool NestedClientValidDepth(int depth); NestedClientPrivatePtr NestedClientCreateScreen(int scrnIndex, char *displayName, char *xauthFile, + Bool wantFullscreenHint, int width, int height, int originX, diff --git a/src/driver.c b/src/driver.c index a91954f..3ac2cc4 100644 --- a/src/driver.c +++ b/src/driver.c @@ -101,7 +101,9 @@ void NestedPrintMode(ScrnInfoPtr p, DisplayModePtr m); typedef enum { OPTION_DISPLAY, OPTION_XAUTHORITY, - OPTION_ORIGIN + OPTION_ORIGIN, + OPTION_FULLSCREEN, + OPTION_OUTPUT } NestedOpts; typedef enum { @@ -117,10 +119,12 @@ static SymTabRec NestedChipsets[] = { * port NestedClient to something that's not Xlib/Xcb we might need to add some * custom options */ static OptionInfoRec NestedOptions[] = { - { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE }, - { OPTION_XAUTHORITY, "Xauthority", OPTV_STRING, {0}, FALSE }, - { OPTION_ORIGIN, "Origin", OPTV_STRING, {0}, FALSE }, - { -1, NULL, OPTV_NONE, {0}, FALSE } + { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE }, + { OPTION_XAUTHORITY, "Xauthority", OPTV_STRING, {0}, FALSE }, + { OPTION_ORIGIN, "Origin", OPTV_STRING, {0}, FALSE }, + { OPTION_FULLSCREEN, "Fullscreen", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_OUTPUT, "Output", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } }; _X_EXPORT DriverRec NESTED = { @@ -175,6 +179,10 @@ typedef struct NestedPrivate { char *xauthFile; int originX; int originY; + unsigned int fullWidth; + unsigned int fullHeight; + Bool fullscreen; + char *output; NestedClientPrivatePtr clientData; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; @@ -332,6 +340,10 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { pNested->xauthFile = NULL; pNested->originX = 0; pNested->originY = 0; + pNested->fullWidth = 0; + pNested->fullHeight = 0; + pNested->fullscreen = FALSE; + pNested->output = NULL; if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) return FALSE; @@ -379,11 +391,27 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { pNested->originX, pNested->originY); } + if (xf86GetOptValBool(NestedOptions, OPTION_FULLSCREEN, &pNested->fullscreen)) + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Fullscreen mode %s\n", + pNested->fullscreen ? "enabled" : "disabled"); + + if (xf86IsOptionSet(NestedOptions, OPTION_OUTPUT)) { + pNested->output = xf86GetOptValString(NestedOptions, + OPTION_OUTPUT); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Targeting host X server output \"%s\"\n", + pNested->output); + } + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); if (!NestedClientCheckDisplay(pScrn->scrnIndex, pNested->displayName, - pNested->xauthFile)) { + pNested->xauthFile, + pNested->output, + &pNested->fullWidth, + &pNested->fullHeight, + &pNested->originX, + &pNested->originY)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Can't open display: %s\n", pNested->displayName ? pNested->displayName : getenv("DISPLAY")); return FALSE; @@ -433,35 +461,42 @@ NestedValidateModes(ScrnInfoPtr pScrn) { DisplayModePtr mode; int i, width, height, ret = 0; int maxX = 0, maxY = 0; + NestedPrivatePtr pNested = PNESTED(pScrn); - /* Print useless stuff */ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor wants these modes:\n"); - for(mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, " %s (%dx%d)\n", mode->name, - mode->HDisplay, mode->VDisplay); - } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Too bad for it...\n"); - - /* If user requested modes, add them. If not, use 640x480 */ - if (pScrn->display->modes != NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "User wants these modes:\n"); - for(i = 0; pScrn->display->modes[i] != NULL; i++) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, " %s\n", - pScrn->display->modes[i]); - if (sscanf(pScrn->display->modes[i], "%dx%d", &width, - &height) != 2) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "This is not the mode name I was expecting...\n"); - return 0; + if (pNested->output != NULL || pNested->fullscreen) { + if (!NestedAddMode(pScrn, pNested->fullWidth, pNested->fullHeight)) { + return 0; + } + } else { + /* Print useless stuff */ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor wants these modes:\n"); + for(mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, " %s (%dx%d)\n", mode->name, + mode->HDisplay, mode->VDisplay); + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Too bad for it...\n"); + + /* If user requested modes, add them. If not, use 640x480 */ + if (pScrn->display->modes != NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "User wants these modes:\n"); + for(i = 0; pScrn->display->modes[i] != NULL; i++) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, " %s\n", + pScrn->display->modes[i]); + if (sscanf(pScrn->display->modes[i], "%dx%d", &width, + &height) != 2) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "This is not the mode name I was expecting...\n"); + return 0; + } + if (!NestedAddMode(pScrn, width, height)) { + return 0; + } } - if (!NestedAddMode(pScrn, width, height)) { + } else { + if (!NestedAddMode(pScrn, 640, 480)) { return 0; } } - } else { - if (!NestedAddMode(pScrn, 640, 480)) { - return 0; - } } pScrn->modePool = NULL; @@ -585,6 +620,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) pNested->clientData = NestedClientCreateScreen(pScrn->scrnIndex, pNested->displayName, pNested->xauthFile, + pNested->output != NULL || pNested->fullscreen, pScrn->virtualX, pScrn->virtualY, pNested->originX, diff --git a/src/xlibclient.c b/src/xlibclient.c index 3a87c96..7ad6a9a 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -87,7 +87,12 @@ struct NestedClientPrivate { Bool NestedClientCheckDisplay(int scrnIndex, char *displayName, - char *xauthFile) { + char *xauthFile, + char *output, + unsigned int *width, + unsigned int *height, + int *x, + int *y) { Display *d; /* Needed until we can pass authorization file @@ -175,6 +180,7 @@ NestedClientPrivatePtr NestedClientCreateScreen(int scrnIndex, char *displayName, char *xauthFile, + Bool wantFullscreenHint, int width, int height, int originX, -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:10 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:10 -0200 Subject: [PATCH xf86-video-nested 4/5] Add configure option for choosing driver backend In-Reply-To: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <1414761131-3663-5-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This patch will introduce a new configure option --with-backend=NAME, that will allow switching easily between available client backend implementations when building xf86-video-nested. Signed-off-by: Laércio de Sousa --- configure.ac | 16 +++++++++++++++- src/Makefile.am | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7bdb8ca..65be273 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,14 @@ AC_ARG_WITH([xorg-module-dir], [moduledir="$libdir/xorg/modules"]) AC_SUBST([moduledir]) +# Define a configure option for choosing the client backend when building driver +AC_ARG_WITH([backend], + AS_HELP_STRING([--with-backend=NAME], + [Backend to be used when building the driver. Available options: xlib, xcb (default: xlib)]), + [BACKEND="$withval"], + [BACKEND=xlib]) +AC_SUBST([BACKEND]) + # Define a configure option to enable/disable nested input driver build AC_ARG_ENABLE([nested-input], AS_HELP_STRING([--enable-nested-input], @@ -73,7 +81,12 @@ PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) # Checks for libraries. PKG_CHECK_MODULES(X11, x11) -PKG_CHECK_MODULES(XEXT, xext) +case "$BACKEND" in + xlib) + PKG_CHECK_MODULES(XEXT, xext) + ;; +esac + DRIVER_NAME=nested AC_SUBST([DRIVER_NAME]) @@ -87,5 +100,6 @@ AC_MSG_RESULT([ $PACKAGE_NAME $VERSION moduledir: ${moduledir} + backend: ${BACKEND} nested input: ${NESTED_INPUT} ]) diff --git a/src/Makefile.am b/src/Makefile.am index 11e610d..0588b6b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,7 @@ nested_drv_la_LIBADD = $(XORG_LIBS) $(X11_LIBS) $(XEXT_LIBS) nested_drv_ladir = @moduledir@/drivers -nested_drv_la_SOURCES = driver.c client.h compat-api.h xlibclient.c +nested_drv_la_SOURCES = driver.c client.h compat-api.h @BACKEND at client.c if NESTED_INPUT nested_drv_la_SOURCES += nested_input.h nested_input.c -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 31 06:12:11 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 31 Oct 2014 11:12:11 -0200 Subject: [PATCH xf86-video-nested 5/5] Introduce a new XCB client backend, and make it the default one. In-Reply-To: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1414761131-3663-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <1414761131-3663-6-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This patch brings up a new XCB backend client, translated from original xlibclient.c, and based on latest Xephyr code. This XCB backend Alread brings some improvements already present in Xephyr, like fullscreen and output support. This patch will also change configure.ac to make the new XCB backend the default one for building the driver. For switching back to Xlib backend, pass configure option --with-backend=xlib. Signed-off-by: Laércio de Sousa --- TODO | 3 +- configure.ac | 10 +- src/Makefile.am | 4 +- src/xcbclient.c | 1022 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 1023 insertions(+), 16 deletions(-) diff --git a/TODO b/TODO index aed9ca2..618547f 100644 --- a/TODO +++ b/TODO @@ -9,8 +9,6 @@ TODO - implement FreeScreen? (http://www.x.org/archive/X11R6.8.2/doc/DESIGN6.html#38) - implement the code that validates depths, implement other checks - compare Xlib's bpp with pScrn's bpp? is it needed? other similar checks? -- add some Option "fullscreen"? (for Multiseat) -- write the xcb backend - write other backends (for different window systems, or maybe using portable libraries like SDL or Qt) - ability to detach from one xserver and attach to other? @@ -20,3 +18,4 @@ TODO - improve the code that redraws the screen (damage tracking) - fully understand the fb/shadow code to get a clue on what's really going on =) - write a man page +- bring latest Xephyr optimizations (e.g. GLAMOR support) to xcb client. diff --git a/configure.ac b/configure.ac index 65be273..27e9941 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ AC_ARG_WITH([backend], AS_HELP_STRING([--with-backend=NAME], [Backend to be used when building the driver. Available options: xlib, xcb (default: xlib)]), [BACKEND="$withval"], - [BACKEND=xlib]) + [BACKEND=xcb]) AC_SUBST([BACKEND]) # Define a configure option to enable/disable nested input driver build @@ -85,9 +85,15 @@ case "$BACKEND" in xlib) PKG_CHECK_MODULES(XEXT, xext) ;; + xcb) + if test "x$NESTED_INPUT" = xyes; then + PKG_CHECK_MODULES(XCB, xcb xcb-aux xcb-icccm xcb-image xcb-shm xcb-randr xcb-xkb) + else + PKG_CHECK_MODULES(XCB, xcb xcb-aux xcb-icccm xcb-image xcb-shm xcb-randr) + fi + ;; esac - DRIVER_NAME=nested AC_SUBST([DRIVER_NAME]) diff --git a/src/Makefile.am b/src/Makefile.am index 0588b6b..64f0d5e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,11 +22,11 @@ # Laércio de Sousa # -AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(X11_CFLAGS) $(XEXT_CFLAGS) +AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(X11_CFLAGS) $(XEXT_CFLAGS) $(XCB_CFLAGS) nested_drv_la_LTLIBRARIES = nested_drv.la nested_drv_la_LDFLAGS = -module -avoid-version -nested_drv_la_LIBADD = $(XORG_LIBS) $(X11_LIBS) $(XEXT_LIBS) +nested_drv_la_LIBADD = $(XORG_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(XCB_LIBS) nested_drv_ladir = @moduledir@/drivers diff --git a/src/xcbclient.c b/src/xcbclient.c index d10887b..3f648d6 100644 --- a/src/xcbclient.c +++ b/src/xcbclient.c @@ -20,16 +20,1018 @@ * * Authors: * - * Paulo Zanoni - * Tuan Bui - * Colin Cornaby - * Timothy Fleck - * Colin Hill - * Weseung Hwang - * Nathaniel Way + * Laércio de Sousa */ -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -/* The idea for this driver is that we can change the "client" backend, so we - * can use xlib, xcb or even something else if we're not on top of X */ +#include + +#include +#include + +#ifdef NESTED_INPUT +#include +#endif + +#include +#include +#include +#include +#include +#include +#ifdef NESTED_INPUT +#include +#endif + +#include +#include + +#include "client.h" + +#ifdef NESTED_INPUT +#include "nested_input.h" +#endif + +#define BUF_LEN 256 + +extern char *display; + +struct NestedClientPrivate { + /* Host X server data */ + char *displayName; + char *xauthFile; + int screenNumber; + xcb_connection_t *conn; + xcb_visualtype_t *visual; + xcb_window_t rootWindow; + xcb_gcontext_t gc; + xcb_cursor_t emptyCursor; + Bool usingShm; + + /* Nested X server window data */ + xcb_window_t window; + int scrnIndex; + int x; + int y; + unsigned int width; + unsigned int height; + Bool usingFullscreen; + xcb_image_t *img; + xcb_shm_segment_info_t shminfo; + DeviceIntPtr dev; // The pointer to the input device. Passed back to the + // input driver when posting input events. + + /* Common data */ + uint32_t attrs[2]; + uint32_t attr_mask; +}; + +static inline Bool +_NestedClientCheckExtension(xcb_connection_t *connection, + xcb_extension_t *extension) +{ + const xcb_query_extension_reply_t *rep = + xcb_get_extension_data(connection, extension); + return rep && rep->present; +} + +static inline void +_NestedClientFree(NestedClientPrivatePtr pPriv) +{ + xcb_disconnect(pPriv->conn); + free(pPriv); +} + +static Bool +_NestedClientGetOutputGeometry(int scrnIndex, + xcb_connection_t *c, + xcb_window_t rootWindow, + char *output, + unsigned int *width, + unsigned int *height, + int *x, + int *y) +{ + Bool output_found = FALSE; + int i, name_len = 0; + 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; + + if (!_NestedClientCheckExtension(c, &xcb_randr_id)) + { + xf86DrvMsg(scrnIndex, + X_ERROR, + "Host X server does not support RANDR extension (or it's disabled).\n"); + return FALSE; + } + + /* Check RandR version */ + version_c = xcb_randr_query_version(c, 1, 2); + version_r = xcb_randr_query_version_reply(c, + version_c, + &error); + + if (error != NULL || version_r == NULL) + { + xf86DrvMsg(scrnIndex, + X_ERROR, + "Failed to get RandR version supported by host X server.\n"); + return FALSE; + } + else if (version_r->major_version < 1 || version_r->minor_version < 2) + { + free(version_r); + xf86DrvMsg(scrnIndex, + X_ERROR, + "Host X server doesn't support RandR 1.2, needed for -output usage.\n"); + return FALSE; + } + + free(version_r); + + /* Get list of outputs from screen resources */ + screen_resources_c = xcb_randr_get_screen_resources(c, + rootWindow); + screen_resources_r = xcb_randr_get_screen_resources_reply(c, + 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(c, + randr_outputs[i], + XCB_CURRENT_TIME); + output_info_r = xcb_randr_get_output_info_reply(c, + 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); + xf86DrvMsg(scrnIndex, + X_ERROR, + "Output %s is currently disabled (or not connected).\n", output); + return FALSE; + } + + /* Get CRTC from output info */ + crtc_info_c = xcb_randr_get_crtc_info(c, + output_info_r->crtc, + XCB_CURRENT_TIME); + crtc_info_r = xcb_randr_get_crtc_info_reply(c, + crtc_info_c, + NULL); + + /* Get CRTC geometry */ + if (x != NULL) + *x = crtc_info_r->x; + + if (y != NULL) + *y = crtc_info_r->y; + + if (width != NULL) + *width = crtc_info_r->width; + + if (height != NULL) + *height = crtc_info_r->height; + + free(crtc_info_r); + } + + free(name); + free(output_info_r); + } + + free(screen_resources_r); + + if (!output_found) + xf86DrvMsg(scrnIndex, + X_ERROR, + "Output %s not available in host X server.\n", output); + + return output_found; +} + +static Bool +_NestedClientConnectionHasError(int scrnIndex, xcb_connection_t *c, char *displayName) +{ + switch (xcb_connection_has_error(c)) + { + case XCB_CONN_ERROR: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Failed to connect to host X server at display %s.\n", displayName); + return TRUE; + case XCB_CONN_CLOSED_EXT_NOTSUPPORTED: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Connection to host X server closed: unsupported extension.\n"); + return TRUE; + case XCB_CONN_CLOSED_MEM_INSUFFICIENT: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Connection to host X server closed: out of memory.\n"); + return TRUE; + case XCB_CONN_CLOSED_REQ_LEN_EXCEED: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Connection to host X server closed: too many requests.\n"); + return TRUE; + case XCB_CONN_CLOSED_PARSE_ERR: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Invalid display for host X server: %s\n", displayName); + return TRUE; + case XCB_CONN_CLOSED_INVALID_SCREEN: + xf86DrvMsg(scrnIndex, + X_ERROR, + "Host X server does not have a screen matching display %s.\n", displayName); + return TRUE; + default: + return FALSE; + } +} + +Bool +NestedClientCheckDisplay(int scrnIndex, + char *displayName, + char *xauthFile, + char *output, + unsigned int *width, + unsigned int *height, + int *x, + int *y) +{ + int n; + xcb_connection_t *c; + xcb_screen_t *s; + + /* Needed until we can pass authorization file + * directly to xcb_connect(). */ + if (xauthFile) + setenv("XAUTHORITY", xauthFile, 1); + + c = xcb_connect(displayName, &n); + + if (_NestedClientConnectionHasError(scrnIndex, c, displayName)) + return FALSE; + + s = xcb_aux_get_screen(c, n); + + if (output != NULL) + { + if (!_NestedClientGetOutputGeometry(scrnIndex, c, s->root, + output, width, height, x, y)) + return FALSE; + } + else + { + if (width != NULL) + *width = s->width_in_pixels; + + if (height != NULL) + *height = s->height_in_pixels; + } + + xcb_disconnect(c); + return TRUE; +} + +Bool +NestedClientValidDepth(int depth) +{ + /* XXX: implement! */ + return TRUE; +} + +static void +_NestedClientTryXShm(NestedClientPrivatePtr pPriv) +{ + int shmMajor, shmMinor; + Bool hasSharedPixmaps; + + /* Try to get share memory ximages for a little bit more speed */ + if (!_NestedClientCheckExtension(pPriv->conn, &xcb_shm_id)) + pPriv->usingShm = FALSE; + else + { + xcb_generic_error_t *e; + xcb_shm_query_version_cookie_t c; + xcb_shm_query_version_reply_t *r; + + c = xcb_shm_query_version(pPriv->conn); + r = xcb_shm_query_version_reply(pPriv->conn, c, &e); + + if (e) + { + pPriv->usingShm = FALSE; + free(e); + } + else + { + shmMajor = r->major_version; + shmMinor = r->minor_version; + hasSharedPixmaps = r->shared_pixmaps; + free(r); + + /* Really really check we have shm - better way ?*/ + xcb_shm_segment_info_t shminfo; + xcb_void_cookie_t cookie; + xcb_shm_seg_t shmseg; + + pPriv->usingShm = TRUE; + + shminfo.shmid = shmget(IPC_PRIVATE, 1, IPC_CREAT | 0777); + shminfo.shmaddr = shmat(shminfo.shmid, 0, 0); + + shmseg = xcb_generate_id(pPriv->conn); + cookie = xcb_shm_attach_checked(pPriv->conn, + shmseg, + shminfo.shmid, + TRUE); + e = xcb_request_check(pPriv->conn, cookie); + + if (e) + { + pPriv->usingShm = FALSE; + free(e); + } + + shmdt(shminfo.shmaddr); + shmctl(shminfo.shmid, IPC_RMID, 0); + } + } + + if (!pPriv->usingShm) + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "XShm extension query failed. Dropping XShm support.\n"); + + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "XShm extension version %d.%d %s shared pixmaps\n", + shmMajor, shmMinor, hasSharedPixmaps ? "with" : "without"); +} + +static void +_NestedClientCreateXImage(NestedClientPrivatePtr pPriv, int depth) +{ + if (pPriv->img != NULL) + { + /* Free up the image data if previously used + * i.e. called by server reset */ + if (pPriv->usingShm) + { + xcb_shm_detach(pPriv->conn, pPriv->shminfo.shmseg); + xcb_image_destroy(pPriv->img); + shmdt(pPriv->shminfo.shmaddr); + shmctl(pPriv->shminfo.shmid, IPC_RMID, 0); + } + else + { + free(pPriv->img->data); + pPriv->img->data = NULL; + xcb_image_destroy(pPriv->img); + } + } + + if (pPriv->usingShm) + { + pPriv->img = xcb_image_create_native(pPriv->conn, + pPriv->width, + pPriv->height, + XCB_IMAGE_FORMAT_Z_PIXMAP, + depth, + NULL, + ~0, + NULL); + + /* XXX: change the 0777 mask? */ + pPriv->shminfo.shmid = shmget(IPC_PRIVATE, + pPriv->img->stride * pPriv->height, + IPC_CREAT | 0777); + pPriv->img->data = shmat(pPriv->shminfo.shmid, 0, 0); + pPriv->shminfo.shmaddr = pPriv->img->data; + + if (pPriv->img->data == (uint8_t *) -1) + { + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "Can't attach SHM Segment, falling back to plain XImages.\n"); + pPriv->usingShm = FALSE; + xcb_image_destroy(pPriv->img); + shmctl(pPriv->shminfo.shmid, IPC_RMID, 0); + } + else + { + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "SHM segment attached %p\n", + pPriv->shminfo.shmaddr); + pPriv->shminfo.shmseg = xcb_generate_id(pPriv->conn); + xcb_shm_attach(pPriv->conn, + pPriv->shminfo.shmseg, + pPriv->shminfo.shmid, + FALSE); + } + } + + if (!pPriv->usingShm) + { + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "Creating image %dx%d for screen pPriv=%p\n", + pPriv->width, pPriv->height, pPriv); + pPriv->img = xcb_image_create_native(pPriv->conn, + pPriv->width, + pPriv->height, + XCB_IMAGE_FORMAT_Z_PIXMAP, + depth, + NULL, + ~0, + NULL); + + pPriv->img->data = + malloc(pPriv->img->stride * pPriv->height); + } +} + +static void +_NestedClientSetWindowTitle(NestedClientPrivatePtr pPriv, + const char *extra_text) +{ + char buf[BUF_LEN + 1]; + + if (!pPriv) + return; + + memset(buf, 0, BUF_LEN + 1); + snprintf(buf, BUF_LEN, "Xorg at :%s.%d nested on %s%s%s", + display, + pPriv->scrnIndex, + getenv("DISPLAY"), + extra_text ? " " : "", + extra_text ? extra_text : ""); + xcb_icccm_set_wm_name(pPriv->conn, + pPriv->window, + XCB_ATOM_STRING, + 8, + strlen(buf), + buf); + xcb_flush(pPriv->conn); +} + +static void +_NestedClientSetWMClass(NestedClientPrivatePtr pPriv, + const char* wm_class) +{ + size_t class_len = strlen(wm_class) + 1; + char *class_hint = malloc(class_len); + + if (class_hint) + { + strcpy(class_hint, wm_class); + xcb_change_property(pPriv->conn, + XCB_PROP_MODE_REPLACE, + pPriv->window, + XCB_ATOM_WM_CLASS, + XCB_ATOM_STRING, + 8, + class_len, + class_hint); + free(class_hint); + } +} + +static void +_NestedClientEmptyCursorInit(NestedClientPrivatePtr pPriv) +{ + uint32_t pixel = 0; + xcb_pixmap_t cursor_pxm; + xcb_gcontext_t cursor_gc; + xcb_rectangle_t rect = { 0, 0, 1, 1 }; + + cursor_pxm = xcb_generate_id(pPriv->conn); + xcb_create_pixmap(pPriv->conn, 1, cursor_pxm, pPriv->rootWindow, 1, 1); + + cursor_gc = xcb_generate_id(pPriv->conn); + xcb_create_gc(pPriv->conn, cursor_gc, cursor_pxm, + XCB_GC_FOREGROUND, &pixel); + xcb_poly_fill_rectangle(pPriv->conn, cursor_pxm, cursor_gc, 1, &rect); + xcb_free_gc(pPriv->conn, cursor_gc); + + pPriv->emptyCursor = xcb_generate_id(pPriv->conn); + xcb_create_cursor(pPriv->conn, + pPriv->emptyCursor, + cursor_pxm, cursor_pxm, + 0, 0, 0, + 0, 0, 0, + 1, 1); + + xcb_free_pixmap(pPriv->conn, cursor_pxm); +} + +static Bool +_NestedClientHostXInit(NestedClientPrivatePtr pPriv) +{ + uint16_t red, green, blue; + uint32_t pixel; + xcb_screen_t *screen; + + pPriv->attrs[0] = +#ifdef NESTED_INPUT + XCB_EVENT_MASK_BUTTON_PRESS | + XCB_EVENT_MASK_BUTTON_RELEASE | + XCB_EVENT_MASK_POINTER_MOTION | + XCB_EVENT_MASK_KEY_PRESS | + XCB_EVENT_MASK_KEY_RELEASE | +#endif + XCB_EVENT_MASK_EXPOSURE; + pPriv->attr_mask = XCB_CW_EVENT_MASK; + + /* Needed until we can pass xauthFile directly to xcb_connect(). */ + if (pPriv->xauthFile) + setenv("XAUTHORITY", pPriv->xauthFile, 1); + + pPriv->conn = xcb_connect(pPriv->displayName, &pPriv->screenNumber); + + if (_NestedClientConnectionHasError(pPriv->scrnIndex, pPriv->conn, pPriv->displayName)) + return FALSE; + + screen = xcb_aux_get_screen(pPriv->conn, pPriv->screenNumber); + pPriv->rootWindow = screen->root; + pPriv->gc = xcb_generate_id(pPriv->conn); + pPriv->visual = xcb_aux_find_visual_by_id(screen, + screen->root_visual); + + xcb_create_gc(pPriv->conn, pPriv->gc, pPriv->rootWindow, 0, NULL); + + if (!xcb_aux_parse_color("red", &red, &green, &blue)) + { + xcb_lookup_color_cookie_t c = + xcb_lookup_color(pPriv->conn, screen->default_colormap, 3, "red"); + xcb_lookup_color_reply_t *r = + xcb_lookup_color_reply(pPriv->conn, c, NULL); + red = r->exact_red; + green = r->exact_green; + blue = r->exact_blue; + free(r); + } + + { + xcb_alloc_color_cookie_t c = xcb_alloc_color(pPriv->conn, + screen->default_colormap, + red, green, blue); + xcb_alloc_color_reply_t *r = xcb_alloc_color_reply(pPriv->conn, c, NULL); + pixel = r->pixel; + free(r); + } + + xcb_change_gc(pPriv->conn, pPriv->gc, XCB_GC_FOREGROUND, &pixel); + + _NestedClientEmptyCursorInit(pPriv); + + xcb_flush(pPriv->conn); +} + +static void +_NestedClientSetFullscreenHint(NestedClientPrivatePtr pPriv) +{ + xcb_intern_atom_cookie_t cookie_WINDOW_STATE, + cookie_WINDOW_STATE_FULLSCREEN; + xcb_atom_t atom_WINDOW_STATE, atom_WINDOW_STATE_FULLSCREEN; + int index; + xcb_intern_atom_reply_t *reply; + + cookie_WINDOW_STATE = xcb_intern_atom(pPriv->conn, FALSE, + strlen("_NET_WM_STATE"), + "_NET_WM_STATE"); + cookie_WINDOW_STATE_FULLSCREEN = + xcb_intern_atom(pPriv->conn, FALSE, + strlen("_NET_WM_STATE_FULLSCREEN"), + "_NET_WM_STATE_FULLSCREEN"); + + reply = xcb_intern_atom_reply(pPriv->conn, cookie_WINDOW_STATE, NULL); + atom_WINDOW_STATE = reply->atom; + free(reply); + + reply = xcb_intern_atom_reply(pPriv->conn, cookie_WINDOW_STATE_FULLSCREEN, + NULL); + atom_WINDOW_STATE_FULLSCREEN = reply->atom; + free(reply); + + xcb_change_property(pPriv->conn, + PropModeReplace, + pPriv->window, + atom_WINDOW_STATE, + XCB_ATOM_ATOM, + 32, + 1, + &atom_WINDOW_STATE_FULLSCREEN); + +} + +static void +_NestedClientCreateWindow(NestedClientPrivatePtr pPriv) +{ + xcb_size_hints_t sizeHints; + + sizeHints.flags = XCB_ICCCM_SIZE_HINT_P_POSITION + | XCB_ICCCM_SIZE_HINT_P_SIZE + | XCB_ICCCM_SIZE_HINT_P_MIN_SIZE + | XCB_ICCCM_SIZE_HINT_P_MAX_SIZE; + sizeHints.min_width = pPriv->width; + sizeHints.max_width = pPriv->width; + sizeHints.min_height = pPriv->height; + sizeHints.max_height = pPriv->height; + + pPriv->window = xcb_generate_id(pPriv->conn); + pPriv->img = NULL; + + xcb_create_window(pPriv->conn, + XCB_COPY_FROM_PARENT, + pPriv->window, + pPriv->rootWindow, + 0, 0, 100, 100, /* will resize */ + 0, + XCB_WINDOW_CLASS_COPY_FROM_PARENT, + pPriv->visual->visual_id, + pPriv->attr_mask, + pPriv->attrs); + + xcb_icccm_set_wm_normal_hints(pPriv->conn, + pPriv->window, + &sizeHints); + + if (pPriv->usingFullscreen) + _NestedClientSetFullscreenHint(pPriv); + + _NestedClientSetWindowTitle(pPriv, ""); + _NestedClientSetWMClass(pPriv, "Xorg"); + + { + uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; + uint32_t values[2] = { pPriv->width, pPriv->height }; + xcb_configure_window(pPriv->conn, pPriv->window, mask, values); + } + + xcb_map_window(pPriv->conn, pPriv->window); + + { + uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; + uint32_t values[2] = { pPriv->x, pPriv->y }; + xcb_configure_window(pPriv->conn, pPriv->window, mask, values); + } +} + +NestedClientPrivatePtr +NestedClientCreateScreen(int scrnIndex, + char *displayName, + char *xauthFile, + Bool wantFullscreenHint, + int width, + int height, + int originX, + int originY, + int depth, + int bitsPerPixel, + Pixel *retRedMask, + Pixel *retGreenMask, + Pixel *retBlueMask) +{ + NestedClientPrivatePtr pPriv = malloc(sizeof(struct NestedClientPrivate)); + + if (!pPriv) + return NULL; + + pPriv->displayName = displayName; + pPriv->xauthFile = xauthFile; + pPriv->scrnIndex = scrnIndex; + pPriv->usingFullscreen = wantFullscreenHint; + pPriv->width = width; + pPriv->height = height; + pPriv->x = originX; + pPriv->y = originY; + pPriv->dev = NULL; + + _NestedClientHostXInit(pPriv); + _NestedClientCreateWindow(pPriv); + _NestedClientTryXShm(pPriv); + _NestedClientCreateXImage(pPriv, depth); + NestedClientHideCursor(pPriv); + +#if 0 + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "width: %d\n", pPriv->img->width); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "height: %d\n", pPriv->img->height); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "depth: %d\n", pPriv->img->depth); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "bpp: %d\n", pPriv->img->bpp); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "red_mask: 0x%x\n", pPriv->visual->red_mask); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "gre_mask: 0x%x\n", pPriv->visual->green_mask); + xf86DrvMsg(pPriv->scrnIndex, X_INFO, "blu_mask: 0x%x\n", pPriv->visual->blue_mask); +#endif + + *retRedMask = pPriv->visual->red_mask; + *retGreenMask = pPriv->visual->green_mask; + *retBlueMask = pPriv->visual->blue_mask; + + return pPriv; +} + +void +NestedClientHideCursor(NestedClientPrivatePtr pPriv) +{ + xcb_change_window_attributes(pPriv->conn, + pPriv->window, + XCB_CW_CURSOR, + &pPriv->emptyCursor); +} + +char * +NestedClientGetFrameBuffer(NestedClientPrivatePtr pPriv) +{ + return pPriv->img->data; +} + +void +NestedClientUpdateScreen(NestedClientPrivatePtr pPriv, + int16_t x1, int16_t y1, + int16_t x2, int16_t y2) +{ + if (pPriv->usingShm) + xcb_image_shm_put(pPriv->conn, pPriv->window, + pPriv->gc, pPriv->img, + pPriv->shminfo, + x1, y1, x1, y1, x2 - x1, y2 - y1, FALSE); + else + xcb_image_put(pPriv->conn, pPriv->window, pPriv->gc, + pPriv->img, x1, y1, 0); + + xcb_aux_sync(pPriv->conn); +} + +static inline void +_NestedClientProcessExpose(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + xcb_expose_event_t *xev = (xcb_expose_event_t *)ev; + NestedClientUpdateScreen(pPriv, + xev->x, + xev->y, + xev->x + xev->width, + xev->y + xev->height); +} + +#ifdef NESTED_INPUT +static inline Bool +_NestedClientEventCheckInputDevice(NestedClientPrivatePtr pPriv) +{ + if (!pPriv->dev) + { + xf86DrvMsg(pPriv->scrnIndex, + X_INFO, + "Input device is not yet initialized, ignoring input.\n"); + + return FALSE; + } + + return TRUE; +} + +static inline void +_NestedClientProcessMotionNotify(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + if (_NestedClientEventCheckInputDevice(pPriv)) + { + xcb_motion_notify_event_t *mev = (xcb_motion_notify_event_t *)ev; + NestedInputPostMouseMotionEvent(pPriv->dev, + mev->event_x, + mev->event_y); + } +} + +static inline void +_NestedClientProcessKeyPress(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + if (_NestedClientEventCheckInputDevice(pPriv)) + { + xcb_key_press_event_t *kev = (xcb_key_press_event_t *)ev; + NestedInputPostKeyboardEvent(pPriv->dev, kev->detail, TRUE); + } +} + +static inline void +_NestedClientProcessKeyRelease(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + if (_NestedClientEventCheckInputDevice(pPriv)) + { + xcb_key_release_event_t *kev = (xcb_key_release_event_t *)ev; + NestedInputPostKeyboardEvent(pPriv->dev, kev->detail, FALSE); + } +} + +static inline void +_NestedClientProcessButtonPress(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + if (_NestedClientEventCheckInputDevice(pPriv)) + { + xcb_button_press_event_t *bev = (xcb_button_press_event_t *)ev; + NestedInputPostButtonEvent(pPriv->dev, bev->detail, TRUE); + } +} + +static inline void +_NestedClientProcessButtonRelease(NestedClientPrivatePtr pPriv, + xcb_generic_event_t *ev) +{ + if (_NestedClientEventCheckInputDevice(pPriv)) + { + xcb_button_release_event_t *bev = (xcb_button_release_event_t *)ev; + NestedInputPostButtonEvent(pPriv->dev, bev->detail, FALSE); + } +} +#endif + +void +NestedClientCheckEvents(NestedClientPrivatePtr pPriv) +{ + xcb_generic_event_t *ev; + + while (TRUE) + { + ev = xcb_poll_for_event(pPriv->conn); + + if (!ev) + { + if (xcb_connection_has_error(pPriv->conn)) + exit(1); + + break; + } + + switch (ev->response_type & ~0x80) + { + case XCB_EXPOSE: + _NestedClientProcessExpose(pPriv, ev); + break; +#ifdef NESTED_INPUT + case XCB_MOTION_NOTIFY: + _NestedClientProcessMotionNotify(pPriv, ev); + break; + case XCB_KEY_PRESS: + _NestedClientProcessKeyPress(pPriv, ev); + break; + case XCB_KEY_RELEASE: + _NestedClientProcessKeyRelease(pPriv, ev); + break; + case XCB_BUTTON_PRESS: + _NestedClientProcessButtonPress(pPriv, ev); + break; + case XCB_BUTTON_RELEASE: + _NestedClientProcessButtonRelease(pPriv, ev); + break; +#endif + } + + free(ev); + } +} + +void +NestedClientCloseScreen(NestedClientPrivatePtr pPriv) +{ + if (pPriv->usingShm) + { + xcb_shm_detach(pPriv->conn, pPriv->shminfo.shmseg); + shmdt(pPriv->shminfo.shmaddr); + } + + xcb_image_destroy(pPriv->img); + _NestedClientFree(pPriv); +} + +void +NestedClientSetDevicePtr(NestedClientPrivatePtr pPriv, DeviceIntPtr dev) +{ + pPriv->dev = dev; +} + +int +NestedClientGetFileDescriptor(NestedClientPrivatePtr pPriv) +{ + return xcb_get_file_descriptor(pPriv->conn); +} + +#ifdef NESTED_INPUT +Bool NestedClientGetKeyboardMappings(NestedClientPrivatePtr pPriv, + KeySymsPtr keySyms, + CARD8 *modmap, + XkbControlsPtr ctrls) +{ + /* XXX: REVIEW THIS CODE AFTER XCB-XKB BECOMES STABLE */ + int mapWidth; + int min_keycode, max_keycode; + int i, j; + int keymap_len; + xcb_generic_error_t *e; + xcb_keysym_t *keymap; + xcb_keycode_t *modifiermap; + xcb_get_keyboard_mapping_cookie_t mapping_c; + xcb_get_keyboard_mapping_reply_t *mapping_r; + xcb_get_modifier_mapping_cookie_t modifier_c; + xcb_get_modifier_mapping_reply_t *modifier_r; + xcb_xkb_get_controls_cookie_t controls_c; + xcb_xkb_get_controls_reply_t *controls_r; + + min_keycode = xcb_get_setup(pPriv->conn)->min_keycode; + max_keycode = xcb_get_setup(pPriv->conn)->max_keycode; + + mapping_c = xcb_get_keyboard_mapping(pPriv->conn, + min_keycode, + max_keycode - min_keycode + 1); + mapping_r = xcb_get_keyboard_mapping_reply(pPriv->conn, + mapping_c, + NULL); + mapWidth = mapping_r->keysyms_per_keycode; + keymap = xcb_get_keyboard_mapping_keysyms(mapping_r); + keymap_len = xcb_get_keyboard_mapping_keysyms_length(mapping_r); + + modifier_c = xcb_get_modifier_mapping(pPriv->conn); + modifier_r = xcb_get_modifier_mapping_reply(pPriv->conn, + modifier_c, + NULL); + modifiermap = xcb_get_modifier_mapping_keycodes(modifier_r); + memset(modmap, 0, sizeof(CARD8) * MAP_LENGTH); + + for (j = 0; j < 8; j++) + for (i = 0; i < modifier_r->keycodes_per_modifier; i++) { + CARD8 keycode; + + if ((keycode = modifiermap[j * modifier_r->keycodes_per_modifier + i])) + modmap[keycode] |= 1 << j; + } + + free(modifier_r); + + keySyms->minKeyCode = min_keycode; + keySyms->maxKeyCode = max_keycode; + keySyms->mapWidth = mapWidth; + keySyms->map = calloc(keymap_len, sizeof(KeySym)); + + for (i = 0; i < keymap_len; i++) + keySyms->map[i] = keymap[i]; + + free(mapping_r); + + controls_c = xcb_xkb_get_controls(pPriv->conn, + XCB_XKB_ID_USE_CORE_KBD); + controls_r = xcb_xkb_get_controls_reply(pPriv->conn, + controls_c, + &e); + + if (e) + { + free(e); + return FALSE; + } + + ctrls->enabled_ctrls = controls_r->enabledControls; + + for (i = 0; i < XkbPerKeyBitArraySize; i++) + ctrls->per_key_repeat[i] = controls_r->perKeyRepeat[i]; + + free(controls_r); + + return TRUE; +} +#endif -- 1.8.4.5 From keithp at keithp.com Fri Oct 31 07:01:00 2014 From: keithp at keithp.com (Keith Packard) Date: Fri, 31 Oct 2014 07:01:00 -0700 Subject: [PATCH] xv: Add missing gcstruct.h include In-Reply-To: <20141031121637.GF10778@ulmo.nvidia.com> References: <1414598367-18592-1-git-send-email-thierry.reding@gmail.com> <86bnot6xw2.fsf@hiro.keithp.com> <20141031121637.GF10778@ulmo.nvidia.com> Message-ID: <86a94c5of7.fsf@hiro.keithp.com> Thierry Reding writes: > It seems to be triggered by --disable-xinerama, in which case gcstruct.h > is pulled in via panoramiX.h. Thanks. I've reproduced this, tested your fix and merged. 882f2d1..63bb5c5 master -> master -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 810 bytes Desc: not available URL: From crazycasta at gmail.com Fri Oct 31 12:25:27 2014 From: crazycasta at gmail.com (Alex Orange) Date: Fri, 31 Oct 2014 13:25:27 -0600 Subject: [PATCH] fb: Fix Bresenham algorithms for commonly used small segments. In-Reply-To: <86k33laxtp.fsf@hiro.keithp.com> References: <1412372498-8522-1-git-send-email-crazycasta@gmail.com> <5432A90F.40305@opentext.com> <86k33laxtp.fsf@hiro.keithp.com> Message-ID: A request has been made to back-port this to "older branches" presumably just 1.16. Do I just apply the same patch to the 1.16 branch, and repeat the process (i.e. get someone to test and review it). Alex On Mon, Oct 27, 2014 at 5:37 PM, Keith Packard wrote: > Peter Harris writes: > > > On 2014-10-03 17:41, Alex Orange wrote: > >> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 > >> > >> Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said > >> patch does indeed remove the problematic writes to bad memory, however > >> it also introduces errors in the algoritm. This patch has the effect of > >> reverting said patch and adding an if in the proper location to catch > >> the out of bounds memory write without causing problems to the overall > >> algorithm. > >> > >> Signed-off-by: Alex Orange > > > > Reviewed-by: Peter Harris > > Tested-by: Peter Harris > > Merged. > ea5b2b0..1b94fd7 master -> master > > -- > keith.packard at intel.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: