Hello community,
here is the log from the commit of package xorg-x11-server for openSUSE:Factory checked in at 2012-09-15 17:31:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xorg-x11-server (Old)
and /work/SRC/openSUSE:Factory/.xorg-x11-server.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xorg-x11-server", Maintainer is "sndirsch@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/xorg-x11-server/xorg-x11-server.changes 2012-07-23 10:46:59.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.xorg-x11-server.new/xorg-x11-server.changes 2012-09-15 17:31:20.000000000 +0200
@@ -1,0 +2,13 @@
+Wed Aug 8 20:15:33 UTC 2012 - tobias.johannes.klausmann@mni.thm.de
+
+- Update to version 1.13.0:
+ + Packaging changes:
+ - Unify naming of patches
+ - Drop upstreamed patches: 223, 224, 300 - 310 (double checked)
+ - Remove patch pio_ia64.diff - not applicable anymore
+ - Remove patch xserver-bg-none-root.patch - not applicable anymore
+ - Remove patch bug474071-fix1.diff - not appliable anymore
+ - Remove patch pci-legacy-mem-fallback.diff - not applicable anymore
+ - Remove patch pu_fixes.diff - not applicable anymore (xaa is gone)
+
+-------------------------------------------------------------------
Old:
----
0001-Check-harder-for-primary-PCI-device.patch
0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
N-VNC-Add-proto.diff
N-VNC-Add-support-for-VNC.patch
N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
N-VNC-Fix-crash-due-to-unset-input-device-names.patch
N-VNC-Fix-crash-when-no-depth-translation-is-required.patch
N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
U_dri2_add_DRI2CreateDrawable2.patch
U_glx_Free_reference_to_destroyed_GLX_drawable.patch
Use-external-tool-for-creating-backtraces-on-crashes.patch
Xvnc-pthread.diff
autoconfig_fallback_fbdev_first.diff
bug-197858_dpms.diff
bug474071-fix1.diff
bug534768-prefer_local_symbols.patch
cache-xkbcomp-output-for-fast-start-up.patch
confine_to_shape.diff
dpms_screensaver.diff
driver-autoconfig.diff
edid_data_sanity_check.diff
fbdevhw.diff
fix-dpi-values.diff
fix_fglrx_screendepth_issue.patch
p_default-module-path.diff
p_xnest-ignore-getimage-errors.diff
pci-legacy-mem-fallback.diff
pio_ia64.diff
pu_fixes.diff
randr1_1-sig11.diff
sync-fix.patch
u_0001-glx-Fix-mishandling-of-shared-contexts.patch
u_0002-glx-Don-t-track-GLClientmajorVersion-or-GLClientmino.patch
u_0003-glx-Extend-__GLXscreen-createContext-to-take-attribu.patch
u_0004-glx-Add-tracking-for-GLX_ARB_create_context-and-GLX_.patch
u_0005-glx-Optionally-call-DRI2-createContextAttribs-from-_.patch
u_0006-glx-Implement-GLX-SetClientInfoARB-protocol.patch
u_0007-glx-Initialize-all-context-fields-together.patch
u_0008-glx-Initialize-remaining-context-fields.patch
u_0009-glx-Use-one-function-to-add-a-context-to-all-global-.patch
u_0010-glx-Make-several-functions-available-outside-the-glx.patch
u_0011-glx-Implement-protocol-for-glXCreateContextAttribsAR.patch
vidmode-sig11.diff
xorg-server-1.12.3.tar.bz2
xorg-server-xdmcp.patch
xorg-x11-server-rpmmacros.patch
xserver-bg-none-root.patch
zap_warning_xserver.diff
New:
----
N_0001-Check-harder-for-primary-PCI-device.patch
N_0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
N_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
N_0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
N_Use-external-tool-for-creating-backtraces-on-crashes.patch
N_autoconfig_fallback_fbdev_first.diff
N_bug-197858_dpms.diff
N_bug534768-prefer_local_symbols.patch
N_cache-xkbcomp-output-for-fast-start-up.patch
N_confine_to_shape.diff
N_dpms_screensaver.diff
N_driver-autoconfig.diff
N_edid_data_sanity_check.diff
N_fbdevhw.diff
N_fix-dpi-values.diff
N_fix_fglrx_screendepth_issue.patch
N_p_default-module-path.diff
N_p_xnest-ignore-getimage-errors.diff
N_randr1_1-sig11.diff
N_sync-fix.patch
N_vidmode-sig11.diff
N_xorg-server-xdmcp.patch
N_zap_warning_xserver.diff
n_VNC-Add-proto.diff
n_VNC-Add-support-for-VNC.patch
n_VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
n_VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
n_VNC-Fix-crash-due-to-unset-input-device-names.patch
n_VNC-Fix-crash-when-no-depth-translation-is-required.patch
n_VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
n_Xvnc-pthread.diff
n_xorg-x11-server-rpmmacros.patch
xorg-server-1.13.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-server.spec ++++++
--- /var/tmp/diff_new_pack.SvVxSq/_old 2012-09-15 17:31:24.000000000 +0200
+++ /var/tmp/diff_new_pack.SvVxSq/_new 2012-09-15 17:31:24.000000000 +0200
@@ -17,7 +17,7 @@
Name: xorg-x11-server
-%define dirsuffix 1.12.3
+%define dirsuffix 1.13.0
%define vnc 1
Summary: X
License: GPL-2.0+ ; MIT
@@ -33,14 +33,12 @@
# Source98 and Source99 are used to ensure proper ABI provides.
Source98: xorg-server-provides
Source99: pre_checkin.sh
-# PATCH-FEATURE-OPENSUSE xorg-x11-server-rpmmacros.patch dimstar@opensuse.org -- Provide RPM macros to require correct ABI Versions.
-Patch0: xorg-x11-server-rpmmacros.patch
+# PATCH-FEATURE-OPENSUSE n_xorg-x11-server-rpmmacros.patch dimstar@opensuse.org -- Provide RPM macros to require correct ABI Versions.
+Patch0: n_xorg-x11-server-rpmmacros.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch2: p_default-module-path.diff
+Patch2: N_p_default-module-path.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch6: pu_fixes.diff
-# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch16: p_xnest-ignore-getimage-errors.diff
+Patch16: N_p_xnest-ignore-getimage-errors.diff
BuildRequires: Mesa-devel
BuildRequires: bison
BuildRequires: flex
@@ -117,89 +115,66 @@
Obsoletes: xorg-x11-server-glx
%if %vnc
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch17: N-VNC-Add-support-for-VNC.patch
+Patch17: n_VNC-Add-support-for-VNC.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch18: N-VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
+Patch18: n_VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch19: N-VNC-Fix-crash-when-no-depth-translation-is-required.patch
+Patch19: n_VNC-Fix-crash-when-no-depth-translation-is-required.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch20: N-VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
+Patch20: n_VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch21: N-VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
+Patch21: n_VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch22: N-VNC-Fix-crash-due-to-unset-input-device-names.patch
+Patch22: n_VNC-Fix-crash-due-to-unset-input-device-names.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch23: Xvnc-pthread.diff
-Patch24: N-VNC-Add-proto.diff
-%endif
+Patch23: n_Xvnc-pthread.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch45: bug-197858_dpms.diff
+Patch24: n_VNC-Add-proto.diff
+%endif
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch77: fbdevhw.diff
+Patch45: N_bug-197858_dpms.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch79: edid_data_sanity_check.diff
+Patch77: N_fbdevhw.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch101: zap_warning_xserver.diff
-# PATCH-NEEDS-REBASE
-Patch103: confine_to_shape.diff
+Patch79: N_edid_data_sanity_check.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch106: randr1_1-sig11.diff
+Patch101: N_zap_warning_xserver.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch112: fix-dpi-values.diff
+Patch103: N_confine_to_shape.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch123: vidmode-sig11.diff
+Patch106: N_randr1_1-sig11.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch125: 0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
+Patch112: N_fix-dpi-values.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch127: dpms_screensaver.diff
-# PATCH-NEEDS-REBASE (might not be applicable at all anymore)
-Patch128: pci-legacy-mem-fallback.diff
-# PATCH-NEEDS-REBASE (might not be applicable at all anymore)
-Patch129: bug474071-fix1.diff
+Patch123: N_vidmode-sig11.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch143: autoconfig_fallback_fbdev_first.diff
+Patch125: N_0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch145: driver-autoconfig.diff
+Patch127: N_dpms_screensaver.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch162: cache-xkbcomp-output-for-fast-start-up.patch
+Patch143: N_autoconfig_fallback_fbdev_first.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch163: xserver-bg-none-root.patch
+Patch145: N_driver-autoconfig.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
+Patch162: N_cache-xkbcomp-output-for-fast-start-up.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch200: bug534768-prefer_local_symbols.patch
+Patch200: N_bug534768-prefer_local_symbols.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch202: 0001-Check-harder-for-primary-PCI-device.patch
+Patch202: N_0001-Check-harder-for-primary-PCI-device.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch203: 0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
+Patch203: N_0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch206: fix_fglrx_screendepth_issue.patch
-# PATCH-NEEDS-REBASE (might not be applicable at all anymore)
-Patch210: pio_ia64.diff
+Patch206: N_fix_fglrx_screendepth_issue.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch211: 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
+Patch211: N_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch213: xorg-server-xdmcp.patch
+Patch213: N_xorg-server-xdmcp.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch220: Use-external-tool-for-creating-backtraces-on-crashes.patch
+Patch220: N_Use-external-tool-for-creating-backtraces-on-crashes.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
-Patch222: sync-fix.patch
-Patch223: U_glx_Free_reference_to_destroyed_GLX_drawable.patch
-Patch224: U_dri2_add_DRI2CreateDrawable2.patch
+Patch222: N_sync-fix.patch
+
Patch225: u_Do-not-use-intel-driver-on-Poulsbo-Oaktrail-Medfield.patch
-# Patches to implement GLX_ARB_create_context extensions required for OpenGL 3.0 support
-# http://lists.x.org/archives/xorg-devel/2012-April/030452.html
-# git://people.freedesktop.org/~idr/xserver.git
-Patch300: u_0001-glx-Fix-mishandling-of-shared-contexts.patch
-Patch301: u_0002-glx-Don-t-track-GLClientmajorVersion-or-GLClientmino.patch
-Patch302: u_0003-glx-Extend-__GLXscreen-createContext-to-take-attribu.patch
-Patch303: u_0004-glx-Add-tracking-for-GLX_ARB_create_context-and-GLX_.patch
-Patch304: u_0005-glx-Optionally-call-DRI2-createContextAttribs-from-_.patch
-Patch305: u_0006-glx-Implement-GLX-SetClientInfoARB-protocol.patch
-Patch306: u_0007-glx-Initialize-all-context-fields-together.patch
-Patch307: u_0008-glx-Initialize-remaining-context-fields.patch
-Patch308: u_0009-glx-Use-one-function-to-add-a-context-to-all-global-.patch
-Patch309: u_0010-glx-Make-several-functions-available-outside-the-glx.patch
-Patch310: u_0011-glx-Implement-protocol-for-glXCreateContextAttribsAR.patch
%description
This package contains the X.Org Server.
@@ -276,19 +251,21 @@
cp %{SOURCE96} .
%patch0 -p1
%patch2
-%patch6
%patch16 -p1
%if %vnc
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-%patch20 -p1
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch24 -p1
+### Needs to be rebased
+#%patch17 -p1
+
+#%patch18 -p1
+#%patch19 -p1
+#%patch20 -p1
+#%patch21 -p1
+#%patch22 -p1
+#%patch23 -p1
+#%patch24 -p1
%endif
-%patch45 -p0
+### Needs to be rebased
+#%patch45 -p0
%patch77
%patch79 -p1
%patch101 -p1
@@ -299,42 +276,22 @@
### disabled for now
#%patch125 -p1
%patch127 -p1
-# NEeds rebase
-#%patch128
-# Needs rebase
-#%patch129 -p0
%patch143 -p0
%patch145 -p0
### disabled for now
#%patch162 -p1
-### disabled for now
-#%patch163 -p1
%patch200 -p1
%patch202 -p1
%patch203 -p1
%patch206 -p0
-# Needs Rebase
-#%patch210 -p1
### disabled for now
#%patch211 -p1
%patch213 -p1
### Disable backtrace generation patch for now
#%patch220 -p1
-%patch222 -p1
-%patch223 -p1
-%patch224 -p1
+### patch222 might not be applicable anymore
+#%patch222 -p1
%patch225 -p1
-%patch300 -p1
-%patch301 -p1
-%patch302 -p1
-%patch303 -p1
-%patch304 -p1
-%patch305 -p1
-%patch306 -p1
-%patch307 -p1
-%patch308 -p1
-%patch309 -p1
-%patch310 -p1
%build
autoreconf -fi
@@ -544,7 +501,7 @@
%files -n xorg-x11-Xvnc
%defattr(-, root, root)
%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
-%{_bindir}/Xvnc
+#%{_bindir}/Xvnc
%endif
%changelog
++++++ N_0001-Check-harder-for-primary-PCI-device.patch ++++++
From 35540106538b24ca1765e752fe9d6efc968a88fa Mon Sep 17 00:00:00 2001
From: Egbert Eich
Date: Wed, 7 Oct 2009 16:31:44 +0200
Subject: [PATCH] Check harder for primary PCI device.
Primary PCI devices are identified by checking for an 'PCIINFOCLASSES'
device which is VGA and has access to the memory bars enabled.
If there should be more than one device for which this is true
redo the check and also check if IO resoures are also enabled,
if this still doesn't turn up a unique result also check for
the presence of a BIOS rom.
================================================================================
Index: xorg-server-1.12.1/hw/xfree86/common/xf86pciBus.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86pciBus.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86pciBus.c
@@ -134,9 +134,50 @@ xf86PciProbe(void)
primaryBus.id.pci = info;
}
else {
- xf86Msg(X_NOTICE,
- "More than one possible primary device found\n");
- primaryBus.type ^= (BusType) (-1);
+ /*
+ * Ok, we found more than one possible primary device with this heuristic
+ * Now also check if IO is enabled.
+ */
+ int j;
+
+ primaryBus.type = BUS_NONE;
+ for (j = 0; j < num; j++) {
+ info = xf86PciVideoInfo[j];
+ pci_device_cfg_read_u16(info, & command, 4);
+
+ if ((command & PCI_CMD_MEM_ENABLE)
+ && (command & PCI_CMD_IO_ENABLE)
+ && (IS_VGA(info->device_class))) {
+ if (primaryBus.type == BUS_NONE) {
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci = info;
+ } else {
+ primaryBus.type = BUS_NONE;
+ for (j = 0; j < num; j++) {
+ info = xf86PciVideoInfo[j];
+ pci_device_cfg_read_u16(info, & command, 4);
+
+ if ((command & PCI_CMD_MEM_ENABLE)
+ && (command & PCI_CMD_IO_ENABLE)
+ && (IS_VGA(info->device_class))
+ && info->rom_size) {
+ if (primaryBus.type == BUS_NONE) {
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci = info;
+ } else {
+ xf86Msg(X_NOTICE,
+ "More than one possible primary device found\n");
+ primaryBus.type ^= (BusType)(-1);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ break;
+
}
}
}
++++++ N_0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch ++++++
Index: xorg-server-1.12.1/mi/misprite.c
===================================================================
--- xorg-server-1.12.1.orig/mi/misprite.c
+++ xorg-server-1.12.1/mi/misprite.c
@@ -378,6 +378,7 @@ miSpriteCloseScreen(int i, ScreenPtr pSc
pScreen->InstallColormap = pScreenPriv->InstallColormap;
pScreen->StoreColors = pScreenPriv->StoreColors;
+ miSpriteDisableDamage(pScreen, pScreenPriv);
DamageDestroy(pScreenPriv->pDamage);
free(pScreenPriv);
++++++ N_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch ++++++
From d1d9d4e5f8f9ac1d22e1258759d6ee9e49c7fe90 Mon Sep 17 00:00:00 2001
From: Egbert Eich
Date: Fri, 9 Apr 2010 15:10:32 +0200
Subject: [PATCH] Prevent XSync Alarms from senslessly calling CheckTrigger() when inactive.
If an XSync Alarm is set to inactive there is no need to check if a trigger
needs to fire. Doing so if the counter is the IdleCounter will put the
server on 100 percent CPU load since the select timeout is set to 0.
---
xorg-server-1.8.0/Xext/sync.c | 11 +++++++++--
xorg-server-1.8.0/Xext/syncsrv.h | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
Index: xorg-server-1.8.0/Xext/sync.c
===================================================================
--- xorg-server-1.8.0.orig/Xext/sync.c
+++ xorg-server-1.8.0/Xext/sync.c
@@ -518,6 +518,10 @@ SyncAlarmTriggerFired(SyncTrigger *pTrig
pAlarm->state = XSyncAlarmInactive;
}
}
+ /* Stop server from looping! */
+ if (pAlarm->state == XSyncAlarmInactive)
+ SyncDeleteTriggerFromCounter(&pAlarm->trigger);
+
/* The AlarmNotify event has to have the "new state of the alarm"
* which we can't be sure of until this point. However, it has
* to have the "old" trigger test value. That's the reason for
@@ -730,7 +734,7 @@ SyncChangeAlarmAttributes(ClientPtr clie
XSyncCounter counter;
Mask origmask = mask;
- counter = pAlarm->trigger.pCounter ? pAlarm->trigger.pCounter->id : None;
+ counter = pAlarm->counter_id;
while (mask)
{
@@ -741,7 +745,7 @@ SyncChangeAlarmAttributes(ClientPtr clie
case XSyncCACounter:
mask &= ~XSyncCACounter;
/* sanity check in SyncInitTrigger */
- counter = *values++;
+ counter = pAlarm->counter_id = *values++;
break;
case XSyncCAValueType:
@@ -808,6 +812,14 @@ SyncChangeAlarmAttributes(ClientPtr clie
return BadMatch;
}
}
+ if (pAlarm->state == XSyncAlarmInactive) {
+ /*
+ * If we are inactive the trigger has been deleted from the counter.
+ * Persuade SyncInitTrigger() to readd it.
+ */
+ origmask |= XSyncCACounter;
+ pAlarm->trigger.pCounter = NULL;
+ }
/* postpone this until now, when we're sure nothing else can go wrong */
if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter,
@@ -815,6 +827,7 @@ SyncChangeAlarmAttributes(ClientPtr clie
return status;
/* XXX spec does not really say to do this - needs clarification */
+ /* It's the only place where it is set to XSyncAlarmActive! */
pAlarm->state = XSyncAlarmActive;
return Success;
}
@@ -1617,8 +1630,10 @@ ProcSyncCreateAlarm(ClientPtr client)
pAlarm->client = client;
pAlarm->alarm_id = stuff->id;
+ pAlarm->counter_id = None;
XSyncIntToValue(&pAlarm->delta, 1L);
pAlarm->events = TRUE;
+ /* SyncChangeAlarmAttributes() changes this - no need to set this here! */
pAlarm->state = XSyncAlarmInactive;
pAlarm->pEventClients = NULL;
status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
Index: xorg-server-1.8.0/Xext/syncsrv.h
===================================================================
--- xorg-server-1.8.0.orig/Xext/syncsrv.h
+++ xorg-server-1.8.0/Xext/syncsrv.h
@@ -129,6 +129,7 @@ typedef struct _SyncAlarm {
int events;
int state;
SyncAlarmClientList *pEventClients;
+ XSyncCounter counter_id;
} SyncAlarm;
typedef struct {
++++++ N_0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch ++++++
From 829037395f8b93e69a30852a95e378f78c3ccd6b Mon Sep 17 00:00:00 2001
From: Luc Verhaegen
Date: Wed, 12 Nov 2008 17:09:33 +0100
Subject: [PATCH] Xinput: Catch missing configlayout when deleting device.
In DeleteInputDeviceRequest (xf86Xinput.c), we access idev members
even if idev is null. This takes down the xserver hard in some cases
(kernel SIGABRT), and segfaults on other cases.
================================================================================
--- xorg-server-1.7.99/hw/xfree86/common/xf86Xinput.c
+++ xorg-server-1.7.99/hw/xfree86/common/xf86Xinput.c
@@ -870,17 +870,20 @@
else
xf86DeleteInput(pInfo, 0);
- /* devices added through HAL aren't in the config layout */
- it = xf86ConfigLayout.inputs;
- while(*it && *it != idev)
- it++;
-
- if (!(*it)) /* end of list, not in the layout */
+ if (idev)
{
- free(idev->driver);
- free(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- free(idev);
+ /* devices added through HAL aren't in the config layout */
+ it = xf86ConfigLayout.inputs;
+ while(*it && *it != idev)
+ it++;
+
+ if (!(*it)) /* end of list, not in the layout */
+ {
+ free(idev->driver);
+ free(idev->identifier);
+ xf86optionListFree(idev->commonOptions);
+ free(idev);
+ }
}
}
OsReleaseSignals();
++++++ N_Use-external-tool-for-creating-backtraces-on-crashes.patch ++++++
From bb4e768eaf8025d3ccf369cbad9a9b8be721e7ac Mon Sep 17 00:00:00 2001
From: Matthias Hopf
Date: Wed, 25 Aug 2010 14:12:48 +0200
Subject: [PATCH] Use external tool for creating backtraces on crashes if available.
This calls /usr/bin/xorg-backtrace to create reasonable commented backtraces
with gdb. On errors it falls back to the generic method.
Signed-off-by: Matthias Hopf
---
os/backtrace.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/os/backtrace.c b/os/backtrace.c
index 7ca6dab..1e3201a 100644
--- a/os/backtrace.c
+++ b/os/backtrace.c
@@ -28,6 +28,81 @@
#include "os.h"
#include "misc.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define XORG_BACKTRACE "/usr/bin/xorg-backtrace"
+
+/* Call gdb to create reasonable(!) backtrace. Returns 0 if successfull. */
+static int xorg_backtrace_gdb(void)
+{
+ static const char *xorg_backtrace = XORG_BACKTRACE;
+ char pidstr[12];
+ char fdname[] = "/tmp/xorg.XXXXXX";
+ char buf[256];
+ pid_t pid;
+ int fd, status = -1, ret;
+ FILE *f;
+
+ if (access (xorg_backtrace, R_OK | X_OK) != 0) {
+ ErrorF ("%s not found, using internal backtrace system\n", xorg_backtrace);
+ return 1;
+ }
+ if ( (fd = mkstemp (fdname)) == -1) {
+ ErrorF ("xorg_backtrace_gdb internal error 1\n");
+ return 1;
+ }
+ unlink (fdname);
+ snprintf (pidstr, 12, "%d", getpid());
+
+ switch ( (pid = fork()) ) {
+ case 0:
+ close (0);
+ close (1);
+ close (2);
+ dup2 (fd, 1);
+ dup2 (fd, 2);
+ close (fd);
+ execl (xorg_backtrace, xorg_backtrace, pidstr, NULL);
+ exit (-1);
+ case -1:
+ close (fd);
+ return 1;
+ }
+
+ while (waitpid (pid, &status, 0) == -1 && errno == EINTR)
+ ;
+ if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
+ ret = 0;
+ else {
+ ErrorF ("%s failed with returncode %d\n", xorg_backtrace, WEXITSTATUS (status));
+ ret = 1;
+ }
+
+ lseek (fd, 0, SEEK_SET);
+ if (! (f = fdopen (fd, "r"))) {
+ ErrorF ("xorg_backtrace_gdb internal error 2\n");
+ close (fd);
+ return 1;
+ }
+ status = 0;
+ while (fgets (buf, 256, f)) {
+ status++;
+ ErrorF("%s", buf);
+ }
+ fclose (f);
+ if (status < 10 && ret == 0) {
+ ErrorF ("%s only produced %d lines of output\n", xorg_backtrace, status);
+ return 1;
+ }
+
+ return ret;
+}
+
#ifdef HAVE_BACKTRACE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -41,6 +116,10 @@ void xorg_backtrace(void)
const char *mod;
int size, i;
Dl_info info;
+
+ if (xorg_backtrace_gdb () == 0)
+ return;
+
ErrorF("\nBacktrace:\n");
size = backtrace(array, 64);
for (i = 0; i < size; i++) {
@@ -182,6 +261,9 @@ static int xorg_backtrace_pstack(void) {
void xorg_backtrace(void) {
+ if (xorg_backtrace_gdb () == 0)
+ return;
+
ErrorF("\nBacktrace:\n");
# ifdef HAVE_PSTACK
--
1.6.0.2
++++++ N_autoconfig_fallback_fbdev_first.diff ++++++
Index: hw/xfree86/common/xf86AutoConfig.c
===================================================================
--- hw/xfree86/common/xf86AutoConfig.c.orig
+++ hw/xfree86/common/xf86AutoConfig.c
@@ -264,7 +264,7 @@ listPossibleVideoDrivers(char *matches[]
/* Fallback to platform default hardware */
if (i < (nmatches - 1)) {
#if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
- matches[i++] = xnfstrdup("vesa");
+ matches[i++] = xnfstrdup("fbdev");
#elif defined(__sparc__) && !defined(sun)
matches[i++] = xnfstrdup("sunffb");
#endif
@@ -276,7 +276,7 @@ listPossibleVideoDrivers(char *matches[]
#if !defined(__linux__) && defined(__sparc__)
matches[i++] = xnfstrdup("wsfb");
#else
- matches[i++] = xnfstrdup("fbdev");
+ matches[i++] = xnfstrdup("vesa");
#endif
}
#endif /* !sun */
++++++ N_bug-197858_dpms.diff ++++++
Index: hw/xfree86/common/xf86Events.c
===================================================================
--- hw/xfree86/common/xf86Events.c.orig
+++ hw/xfree86/common/xf86Events.c
@@ -115,6 +115,7 @@ typedef struct x_IHRec {
InputHandlerProc ihproc;
pointer data;
Bool enabled;
+ Bool is_input;
struct x_IHRec *next;
} IHRec, *IHPtr;
@@ -445,9 +446,13 @@ xf86VTSwitch(void)
* Keep the order: Disable Device > LeaveVT
* EnterVT > EnableDevice
*/
- for (ih = InputHandlers; ih; ih = ih->next)
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
xf86DisableInputHandler(ih);
- for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) {
+ else
+ xf86DisableGeneralHandler(ih);
+ }
+ for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) {
if (pInfo->dev) {
xf86ReleaseKeys(pInfo->dev);
ProcessInputEvents();
@@ -486,8 +491,12 @@ xf86VTSwitch(void)
EnableDevice(pInfo->dev, TRUE);
pInfo = pInfo->next;
}
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
+ xf86EnableInputHandler(ih);
+ else
+ xf86EnableGeneralHandler(ih);
+ }
xf86UnblockSIGIO(prevSIGIO);
@@ -542,8 +551,12 @@ xf86VTSwitch(void)
pInfo = pInfo->next;
}
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
+ xf86EnableInputHandler(ih);
+ else
+ xf86EnableGeneralHandler(ih);
+ }
xf86UnblockSIGIO(prevSIGIO);
}
@@ -579,8 +592,10 @@ xf86AddInputHandler(int fd, InputHandler
{
IHPtr ih = addInputHandler(fd, proc, data);
- if (ih)
+ if (ih) {
AddEnabledDevice(fd);
+ ih->is_input = TRUE;
+ }
return ih;
}
++++++ N_bug534768-prefer_local_symbols.patch ++++++
Index: xorg-server-1.12.1/hw/xfree86/loader/loader.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/loader/loader.c
+++ xorg-server-1.12.1/hw/xfree86/loader/loader.c
@@ -152,7 +152,7 @@ LoaderSymbol(const char *name)
return p;
if (!global_scope)
- global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL);
+ global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL | RTLD_DEEPBIND);
if (global_scope)
return dlsym(global_scope, name);
++++++ N_cache-xkbcomp-output-for-fast-start-up.patch ++++++
From 0f70ba9d3412b17ac4e08e33e1be3c226c06ea54 Mon Sep 17 00:00:00 2001
From: Yan Li
Date: Tue, 12 May 2009 17:49:07 +0800
Subject: [PATCH] XKB: cache xkbcomp output for fast start-up v5 for 1.6.1
Organization: Intel
xkbcomp outputs will be cached in files with hashed keymap as
names. This saves boot time for around 1s on commodity netbooks.
Signed-off-by: Yan Li
================================================================================
--- xorg-server-1.7.99/configure.ac
+++ xorg-server-1.7.99/configure.ac
@@ -527,9 +527,9 @@
AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
[ XKBPATH="$withval" ],
[ XKBPATH="${datadir}/X11/xkb" ])
-AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
+AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]),
[ XKBOUTPUT="$withval" ],
- [ XKBOUTPUT="compiled" ])
+ [ XKBOUTPUT="${localstatedir}/cache/xkb" ])
AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
[Keyboard ruleset (default: base/evdev)]),
[ XKB_DFLT_RULES="$withval" ],
@@ -1160,7 +1160,7 @@
dnl Make sure XKM_OUTPUT_DIR is an absolute path
XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
+ AC_MSG_ERROR([xkb-output must be an absolute path.])
fi
dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
--- xorg-server-1.7.99/xkb/README.compiled
+++ xorg-server-1.7.99/xkb/README.compiled
@@ -4,10 +4,10 @@
or some other tool might destroy or replace the files in this directory,
so it is not a safe place to store compiled keymaps for long periods of
time. The default keymap for any server is usually stored in:
- X<num>-default.xkm
-where <num> is the display number of the server in question, which makes
-it possible for several servers *on the same host* to share the same
-directory.
+ server-<SHA1>.xkm
+
+where <SHA1> is the SHA1 hash of keymap source, so that compiled
+keymap of different keymap sources are stored in different files.
Unless the X server is modified, sharing this directory between servers on
different hosts could cause problems.
--- xorg-server-1.9.0/xkb/ddxLoad.c.orig 2010-07-14 22:23:17.000000000 +0200
+++ xorg-server-1.9.0/xkb/ddxLoad.c 2010-08-23 15:23:47.000000000 +0200
@@ -30,6 +30,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include
+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
+# include
+#else /* Use OpenSSL's libcrypto */
+# include /* buggy openssl/sha.h wants size_t */
+# include
+#endif
#include
#include
#include
@@ -43,24 +49,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XKBSRV_NEED_FILE_FUNCS
#include
#include
+#include
#include "xkb.h"
#if defined(CSRG_BASED) || defined(linux) || defined(__GNU__)
#include
#endif
- /*
- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
- * relative to the top-level XKB configuration directory.
- * Making the server write to a subdirectory of that directory
- * requires some work in the general case (install procedure
- * has to create links to /var or somesuch on many machines),
- * so we just compile into /usr/tmp for now.
- */
-#ifndef XKM_OUTPUT_DIR
-#define XKM_OUTPUT_DIR "compiled/"
-#endif
-
#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
#define ERROR_PREFIX "\"> \""
#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
@@ -175,6 +170,45 @@ OutputDirectory(
}
static Bool
+Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input)
+{
+ int i;
+ unsigned char sha1[SHA_DIGEST_LENGTH];
+
+#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
+ SHA1_CTX ctx;
+
+ SHA1Init (&ctx);
+ SHA1Update (&ctx, input, strlen(input));
+ SHA1Final (sha1, &ctx);
+#else /* Use OpenSSL's libcrypto */
+ SHA_CTX ctx;
+ int success;
+
+ success = SHA1_Init (&ctx);
+ if (! success)
+ return BadAlloc;
+
+ success = SHA1_Update (&ctx, input, strlen(input));
+ if (! success)
+ return BadAlloc;
+
+ success = SHA1_Final (sha1, &ctx);
+ if (! success)
+ return BadAlloc;
+#endif
+
+ /* convert sha1 to sha1_asc */
+ for(i=0; i nameRtrnLen) && nameRtrn) {
+ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n");
+ return FALSE;
+ }
+ strncpy(nameRtrn, xkmfile, nameRtrnLen);
+
+ /* if the xkm file already exists, reuse it */
+ canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile);
+ if (access(canonicalXkmFileName, R_OK) == 0) {
+ /* yes, we can reuse the old xkm file */
+ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName);
+ result = TRUE;
+ goto _ret;
+ }
+ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName);
+
+ /* continue to call xkbcomp to compile the keymap. to avoid race
+ condition, we compile it to a tmpfile then rename it to
+ xkmfile */
+
+
#ifdef WIN32
strcpy(tmpname, Win32TempDir());
strcat(tmpname, "\\xkb_XXXXXX");
@@ -225,14 +318,20 @@ XkbDDXCompileKeymapByNames( XkbDescPtr
}
}
+ if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) {
+ ErrorF("[xkb] Can't generate temp xkm file name");
+ result = FALSE;
+ goto _ret;
+ }
+
buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
+ "-em1 %s -emp %s -eml %s \"%s\"",
xkbbindir, xkbbindirsep,
( (xkbDebugFlags < 2) ? 1 :
((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ),
- xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
+ xkbbasedirflag ? xkbbasedirflag : "", xkbfile,
PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
- xkm_output_dir, keymap);
+ tmpXkmFile);
free(xkbbasedirflag);
@@ -240,7 +339,12 @@ XkbDDXCompileKeymapByNames( XkbDescPtr
LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n");
return FALSE;
}
-
+
+ /* there's a potential race condition between calling tempnam()
+ and invoking xkbcomp to write the result file (potential temp
+ file name conflicts), but since xkbcomp is a standalone
+ program, we have to live with this */
+
#ifndef WIN32
out= Popen(buf,"w");
#else
@@ -248,31 +352,42 @@ XkbDDXCompileKeymapByNames( XkbDescPtr
#endif
if (out!=NULL) {
-#ifdef DEBUG
- if (xkbDebugFlags) {
- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
- }
-#endif
- XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
+ /* write XKBKeyMapBuf to xkbcomp */
+ if (EOF==fputs(xkbKeyMapBuf, out))
+ {
+ ErrorF("[xkb] Sending keymap to xkbcomp failed\n");
+ result = FALSE;
+ goto _ret;
+ }
#ifndef WIN32
if (Pclose(out)==0)
#else
if (fclose(out)==0 && System(buf) >= 0)
#endif
{
+ /* xkbcomp success */
if (xkbDebugFlags)
DebugF("[xkb] xkb executes: %s\n",buf);
- if (nameRtrn) {
- strncpy(nameRtrn,keymap,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
+ /* if canonicalXkmFileName already exists now, we simply
+ overwrite it, this is OK */
+ ret = rename(tmpXkmFile, canonicalXkmFileName);
+ if (0 != ret) {
+ ErrorF("[xkb] Can't rename %s to %s, error: %s\n",
+ tmpXkmFile, canonicalXkmFileName,
+ strerror(errno));
+
+ /* in case of error, don't unlink tmpXkmFile, leave it
+ for debugging */
+
+ result = FALSE;
+ goto _ret;
}
- if (buf != NULL)
- free(buf);
- return TRUE;
+
+ result = TRUE;
+ goto _ret;
}
else
- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
+ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile);
#ifdef WIN32
/* remove the temporary file */
unlink(tmpname);
@@ -289,7 +404,17 @@ XkbDDXCompileKeymapByNames( XkbDescPtr
nameRtrn[0]= '\0';
if (buf != NULL)
free(buf);
- return FALSE;
+ result = FALSE;
+
+_ret:
+ if (tmpXkmFile)
+ free(tmpXkmFile);
+ if (canonicalXkmFileName)
+ xfree(canonicalXkmFileName);
+ if (buf != NULL)
+ xfree (buf);
+
+ return result;
}
static FILE *
@@ -373,7 +498,6 @@ unsigned missing;
DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
}
fclose(file);
- (void) unlink (fileName);
return (need|want)&(~missing);
}
++++++ N_confine_to_shape.diff ++++++
--- dix/events.c.orig 2012-04-17 11:34:39.714915372 -0500
+++ dix/events.c 2012-04-17 11:26:54.735728478 -0500
@@ -671,32 +671,77 @@
{
BoxRec box;
int x = *px, y = *py;
- int incx = 1, incy = 1;
+ int nbox;
+ BoxPtr pbox;
+ int d, min = (~0U >> 1), dx2, dy2, x_r, y_r;
if (RegionContainsPoint(shape, x, y, &box))
return;
- box = *RegionExtents(shape);
- /* this is rather crude */
- do {
- x += incx;
- if (x >= box.x2) {
- incx = -1;
- x = *px - 1;
+
+ for (nbox = REGION_NUM_RECTS (shape),
+ pbox = REGION_RECTS(shape);
+ nbox--;
+ pbox++)
+ {
+ if (pbox->x1 < x && pbox->x2 > x) {
+ d = pbox->y1 - y;
+ if (d >= 0) {
+ d *= d;
+ if (d < min) {
+ *px = x;
+ *py = pbox->y1 + 1;
+ min = d;
+ }
+ } else {
+ d = pbox->y2 - y; d *= d;
+ if (d < min) {
+ *px = x;
+ *py = pbox->y2 - 1;
+ min = d;
+ }
+ }
}
- else if (x < box.x1) {
- incx = 1;
- x = *px;
- y += incy;
- if (y >= box.y2) {
- incy = -1;
- y = *py - 1;
+ else if (pbox->y1 < y && pbox->y2 > y) {
+ d = pbox->x1 - x;
+ if (d >= 0) {
+ d *= d;
+ if (d < min) {
+ *px = pbox->x1 + 1;
+ *py = y;
+ min = d;
+ }
+ } else {
+ d = pbox->x2 - x; d *= d;
+ if (d < min) {
+ *px = pbox->x2 - 1;
+ *py = y;
+ min = d;
+ }
+ }
+ } else {
+ dx2 = pbox->x1 - x;
+ if (dx2 >= 0) {
+ dx2 *= dx2;
+ x_r = pbox->x1 + 1;
+ } else {
+ dx2 = pbox->x2 - x; dx2 *= dx2;
+ x_r = pbox->x2 - 1;
+ }
+ dy2 = pbox->y1 - y;
+ if (dy2 >= 0) {
+ dy2 *= dy2;
+ y_r = pbox->y1 + 1;
+ } else {
+ dy2 = pbox->y2 - y; dy2 *= dy2;
+ y_r = pbox->y2 - 1;
+ }
+ if ((d = dx2 + dy2) < min) {
+ *px = x_r;
+ *py = y_r;
+ min = d;
}
- else if (y < box.y1)
- return; /* should never get here! */
}
- } while (!RegionContainsPoint(shape, x, y, &box));
- *px = x;
- *py = y;
+ }
}
static void
++++++ N_dpms_screensaver.diff ++++++
Index: xorg-server-1.12.1/hw/xfree86/common/xf86DPMS.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86DPMS.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86DPMS.c
@@ -151,7 +151,8 @@ DPMSSet(ClientPtr client, int level)
rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
if (rc != Success)
return rc;
- }
+ } else
+ dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverReset);
/* For each screen, set the DPMS level */
for (i = 0; i < xf86NumScreens; i++) {
++++++ N_driver-autoconfig.diff ++++++
Index: hw/xfree86/common/xf86pciBus.c
===================================================================
--- hw/xfree86/common/xf86pciBus.c.orig
+++ hw/xfree86/common/xf86pciBus.c
@@ -1107,7 +1107,9 @@ videoPtrToDriverList(struct pci_device *
driverList[0] = "ast";
break;
case 0x1002:
- driverList[0] = "ati";
+ driverList[0] = "fglrx";
+ driverList[1] = "radeonhd";
+ driverList[2] = "ati";
break;
case 0x102c:
driverList[0] = "chips";
@@ -1139,6 +1141,13 @@ videoPtrToDriverList(struct pci_device *
driverList[0] = "neomagic";
break;
case 0x10de:
+ driverList[0] = "nvidia";
+ driverList[1] = "nouveau";
+ /* GeForce 6150SE support broken (bnc #465190/544674) */
+ if (dev->device_id != 0x03D0) {
+ driverList[2] = "nv";
+ }
+ break;
case 0x12d2:
{
int idx = 0;
@@ -1150,7 +1159,9 @@ videoPtrToDriverList(struct pci_device *
break;
}
case 0x1106:
- driverList[0] = "openchrome";
+ driverList[0] = "via";
+ driverList[1] = "openchrome";
+ driverList[2] = "unichrome";
break;
case 0x1b36:
driverList[0] = "qxl";
++++++ N_edid_data_sanity_check.diff ++++++
Index: xorg-server-1.6.3.901/hw/xfree86/modes/xf86Crtc.c
================================================================================
--- xorg-server-1.7.99/hw/xfree86/modes/xf86Crtc.c
+++ xorg-server-1.7.99/hw/xfree86/modes/xf86Crtc.c
@@ -2916,8 +2916,14 @@
p->output->MonInfo->features.vsize);
if (det_mon->type == DT &&
det_mon->section.d_timings.h_size != 0 &&
- det_mon->section.d_timings.v_size != 0) {
-
+ det_mon->section.d_timings.v_size != 0 &&
+ det_mon->section.d_timings.v_size != 0 &&
+ /* some sanity checking for aspect ration */
+ ((det_mon->section.d_timings.h_size /
+ det_mon->section.d_timings.v_size) < 2) &&
+ ((det_mon->section.d_timings.v_size /
+ det_mon->section.d_timings.h_size) < 2)
+ ) {
p->output->mm_width = det_mon->section.d_timings.h_size;
p->output->mm_height = det_mon->section.d_timings.v_size;
p->ret = TRUE;
++++++ N_fbdevhw.diff ++++++
Index: hw/xfree86/fbdevhw/fbdevhw.c
===================================================================
--- hw/xfree86/fbdevhw/fbdevhw.c.orig
+++ hw/xfree86/fbdevhw/fbdevhw.c
@@ -858,9 +858,10 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mo
return;
}
+ /* Novell Bug #146462 */
if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) fbmode))
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s (Screen blanking not supported by vesafb of Linux Kernel)\n", strerror(errno));
}
Bool
@@ -875,9 +876,10 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int
unblank = xf86IsUnblank(mode);
+ /* Novell Bug #146462 */
if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) (1 - unblank))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "FBIOBLANK: %s\n", strerror(errno));
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "FBIOBLANK: %s (Screen blanking not supported by vesafb of Linux Kernel)\n", strerror(errno));
return FALSE;
}
++++++ N_fix-dpi-values.diff ++++++
Index: hw/xfree86/common/xf86Helper.c
===================================================================
--- hw/xfree86/common/xf86Helper.c.orig
+++ hw/xfree86/common/xf86Helper.c
@@ -922,12 +922,22 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int
else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) {
from = X_CONFIG;
if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
+ pScrn->xDpi =
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
+ } else {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
}
if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
+ } else {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
}
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
pScrn->yDpi = pScrn->xDpi;
@@ -966,12 +976,22 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int
pScrn->widthmm = ddcWidthmm;
pScrn->heightmm = ddcHeightmm;
if (pScrn->widthmm > 0) {
- pScrn->xDpi =
- (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
+ pScrn->xDpi =
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
+ } else {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
}
if (pScrn->heightmm > 0) {
- pScrn->yDpi =
- (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
+ } else {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
}
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
pScrn->yDpi = pScrn->xDpi;
++++++ N_fix_fglrx_screendepth_issue.patch ++++++
Index: hw/xfree86/common/xf86AutoConfig.c
===================================================================
--- hw/xfree86/common/xf86AutoConfig.c.orig
+++ hw/xfree86/common/xf86AutoConfig.c
@@ -75,6 +75,13 @@
"\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
"EndSection\n\n"
+#define BUILTIN_SCREEN_SECTION_FOR_FGLRX \
+ "Section \"Screen\"\n" \
+ "\tIdentifier\t" BUILTIN_SCREEN_NAME "\n" \
+ "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
+ "\tDefaultDepth\t24\n" \
+ "EndSection\n\n"
+
#define BUILTIN_LAYOUT_SECTION_PRE \
"Section \"ServerLayout\"\n" \
"\tIdentifier\t\"Builtin Default Layout\"\n"
@@ -153,7 +160,10 @@ xf86AutoConfig(void)
for (p = deviceList; *p; p++) {
snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p);
AppendToConfig(buf);
- snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
+ if( strcmp(*p, "fglrx") == 0 )
+ snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION_FOR_FGLRX, *p, 0, *p, 0);
+ else
+ snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
AppendToConfig(buf);
}
++++++ N_p_default-module-path.diff ++++++
Index: hw/xfree86/common/xf86Globals.c
===================================================================
--- hw/xfree86/common/xf86Globals.c.orig
+++ hw/xfree86/common/xf86Globals.c
@@ -135,7 +135,7 @@ xf86InfoRec xf86Info = {
const char *xf86ConfigFile = NULL;
const char *xf86ConfigDir = NULL;
-const char *xf86ModulePath = DEFAULT_MODULE_PATH;
+const char *xf86ModulePath = DEFAULT_MODULE_PATH "/updates," DEFAULT_MODULE_PATH;
MessageType xf86ModPathFrom = X_DEFAULT;
const char *xf86LogFile = DEFAULT_LOGPREFIX;
MessageType xf86LogFileFrom = X_DEFAULT;
++++++ N_p_xnest-ignore-getimage-errors.diff ++++++
Index: xorg-server-1.12.1/hw/xnest/GCOps.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xnest/GCOps.c
+++ xorg-server-1.12.1/hw/xnest/GCOps.c
@@ -94,15 +94,26 @@ xnestPutImage(DrawablePtr pDrawable, GCP
}
}
+static int
+xnestIgnoreErrorHandler (Display *display,
+ XErrorEvent *event)
+{
+ return False; /* return value is ignored */
+}
+
void
xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *pImage)
{
XImage *ximage;
int length;
+ int (*old_handler)(Display*, XErrorEvent*);
+ /* we may get BadMatch error when xnest window is minimized */
+ old_handler = XSetErrorHandler (xnestIgnoreErrorHandler);
ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
x, y, w, h, planeMask, format);
+ XSetErrorHandler (old_handler);
if (ximage) {
length = ximage->bytes_per_line * ximage->height;
++++++ N_randr1_1-sig11.diff ++++++
Index: xorg-server-1.12.1/hw/xfree86/common/xf86RandR.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86RandR.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86RandR.c
@@ -237,6 +237,9 @@ xf86RandRSetConfig(ScreenPtr pScreen,
DeviceIntPtr dev;
Bool view_adjusted = FALSE;
+ if (!scrp->vtSema)
+ return FALSE;
+
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (!IsMaster(dev) && !IsFloating(dev))
continue;
++++++ N_sync-fix.patch ++++++
Index: xorg-server-1.12.1/Xext/sync.c
===================================================================
--- xorg-server-1.12.1.orig/Xext/sync.c
+++ xorg-server-1.12.1/Xext/sync.c
@@ -2615,9 +2615,43 @@ static XSyncValue *pIdleTimeValueGreater
static void
IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return)
{
- CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
+ static CARD32 previousLastDeviceEventTimeMilliseconds = 0;
+ CARD32 now = GetTimeInMillis();
+ CARD32 idle = now - lastDeviceEventTime.milliseconds;
+ CARD32 previousIdle = now - previousLastDeviceEventTimeMilliseconds;
+ SyncCounter *pIdleTimeCounter = (SyncCounter*)pCounter;
XSyncIntsToValue(pValue_return, idle, 0);
+ if (pCounter == NULL)
+ {
+ return;
+ }
+ if (previousLastDeviceEventTimeMilliseconds == 0)
+ {
+ /* initialize static var when this function is invoked the first time. */
+ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
+ return;
+ }
+
+ if (previousLastDeviceEventTimeMilliseconds == lastDeviceEventTime.milliseconds)
+ {
+ /* no new user event, no need to change idle counter. */
+ return;
+ }
+ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
+
+ /*
+ * Some user event occured; now update idle counter with previous
+ * event time, so idle counter has the most up-to-date value with
+ * respect to previous user event (we need old and new counter
+ * value to compute if a transition occured). Recompute bracket
+ * values if this is system counter.
+ */
+
+ XSyncIntsToValue (&pIdleTimeCounter->value, previousIdle, 0);
+ if (IsSystemCounter(pIdleTimeCounter)) {
+ SyncComputeBracketValues(pIdleTimeCounter);
+ }
}
static void
@@ -2700,7 +2734,7 @@ IdleTimeWakeupHandler(pointer env, int r
if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
return;
- IdleTimeQueryValue(NULL, &idle);
+ IdleTimeQueryValue(IdleTimeCounter, &idle);
if ((pIdleTimeValueGreater &&
XSyncValueGreaterOrEqual(idle, *pIdleTimeValueGreater)) ||
++++++ N_vidmode-sig11.diff ++++++
Index: hw/xfree86/common/xf86VidMode.c
===================================================================
--- hw/xfree86/common/xf86VidMode.c.orig
+++ hw/xfree86/common/xf86VidMode.c
@@ -224,6 +224,8 @@ VidModeGetFirstModeline(int scrnIndex, p
return FALSE;
pVidMode = VMPTR(pScrn->pScreen);
+ if (!pScrn->modes)
+ return FALSE;
pVidMode->First = pScrn->modes;
pVidMode->Next = pVidMode->First->next;
++++++ N_xorg-server-xdmcp.patch ++++++
Index: xorg-server-1.12.1/os/access.c
===================================================================
--- xorg-server-1.12.1.orig/os/access.c
+++ xorg-server-1.12.1/os/access.c
@@ -714,7 +714,9 @@ DefineSelf(int fd)
/*
* ignore 'localhost' entries as they're not useful
- * on the other end of the wire
+ * on the other end of the wire and because on hosts
+ * with shared home dirs they'll result in conflicting
+ * entries in ~/.Xauthority
*/
if (ifr->ifa_flags & IFF_LOOPBACK)
continue;
@@ -735,6 +737,14 @@ DefineSelf(int fd)
else if (family == FamilyInternet6 &&
IN6_IS_ADDR_LOOPBACK((struct in6_addr *) addr))
continue;
+
+ /* Ignore IPv6 link local addresses (fe80::/10), because
+ * they need a scope identifier, which we have no way
+ * of telling to the other end.
+ */
+ if (family == FamilyInternet6 &&
+ IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)addr))
+ continue;
#endif
XdmcpRegisterConnection(family, (char *) addr, len);
#if defined(IPv6) && defined(AF_INET6)
++++++ N_zap_warning_xserver.diff ++++++
Index: xorg-server-1.12.1/hw/xfree86/common/xf86Config.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86Config.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86Config.c
@@ -685,6 +685,7 @@ typedef enum {
FLAG_NOTRAPSIGNALS,
FLAG_DONTVTSWITCH,
FLAG_DONTZAP,
+ FLAG_ZAPWARNING,
FLAG_DONTZOOM,
FLAG_DISABLEVIDMODE,
FLAG_ALLOWNONLOCAL,
@@ -721,6 +722,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN,
{0}, FALSE},
+ { FLAG_ZAPWARNING, "ZapWarning", OPTV_BOOLEAN,
+ {0}, FALSE },
{FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN,
{0}, FALSE},
{FLAG_DISABLEVIDMODE, "DisableVidModeExtension", OPTV_BOOLEAN,
@@ -807,6 +810,7 @@ configServerFlags(XF86ConfFlagsPtr flags
xf86GetOptValBool(FlagOptions, FLAG_NOTRAPSIGNALS, &xf86Info.notrapSignals);
xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap);
+ xf86GetOptValBool(FlagOptions, FLAG_ZAPWARNING, &xf86Info.ZapWarning);
xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);
xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI);
Index: xorg-server-1.12.1/hw/xfree86/common/xf86Events.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86Events.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86Events.c
@@ -180,12 +180,25 @@ xf86ProcessActionEvent(ActionEvent actio
DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
switch (action) {
case ACTION_TERMINATE:
- if (!xf86Info.dontZap) {
+ if (xf86Info.dontZap)
+ break;
+
+ if (xf86Info.ZapWarning) {
+ static struct timeval LastZap = { 0, 0};
+ struct timeval NewZap;
+
+ gettimeofday(&NewZap, NULL);
+
+ if ((NewZap.tv_sec - LastZap.tv_sec) >= 2) {
+ xf86OSRingBell(30, 1000, 50);
+ LastZap = NewZap;
+ break;
+ }
+ }
#ifdef XFreeXDGA
- DGAShutdown();
+ DGAShutdown();
#endif
- GiveUp(0);
- }
+ GiveUp(0);
break;
case ACTION_NEXT_MODE:
if (!xf86Info.dontZoom)
Index: xorg-server-1.12.1/hw/xfree86/common/xf86Globals.c
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86Globals.c
+++ xorg-server-1.12.1/hw/xfree86/common/xf86Globals.c
@@ -104,6 +104,7 @@ xf86InfoRec xf86Info = {
.autoVTSwitch = TRUE,
.ShareVTs = FALSE,
.dontZap = FALSE,
+ .ZapWarning = TRUE,
.dontZoom = FALSE,
.notrapSignals = FALSE,
.caughtSignal = FALSE,
Index: xorg-server-1.12.1/hw/xfree86/common/xf86Privstr.h
===================================================================
--- xorg-server-1.12.1.orig/hw/xfree86/common/xf86Privstr.h
+++ xorg-server-1.12.1/hw/xfree86/common/xf86Privstr.h
@@ -68,6 +68,7 @@ typedef struct {
Bool autoVTSwitch;
Bool ShareVTs;
Bool dontZap;
+ Bool ZapWarning;
Bool dontZoom;
Bool notrapSignals; /* don't exit cleanly - die at fault */
Bool caughtSignal;
++++++ n_VNC-Add-proto.diff ++++++
From: Mike Gorse
Date: Wed Apr 18 22:52:23 UTC 2012
Subject: [PATCH] VNC: Add a missing prototype
Patch-Mainline: Currently no upstream project.
---
diff -ur xorg-server-1.12.1.orig/hw/vnc/rfbkeyb.c xorg-server-1.12.1/hw/vnc/rfbkeyb.c
--- xorg-server-1.12.1.orig/hw/vnc/rfbkeyb.c 2012-04-18 17:38:08.302219053 -0500
+++ xorg-server-1.12.1/hw/vnc/rfbkeyb.c 2012-04-18 16:44:12.873667473 -0500
@@ -44,6 +44,7 @@
#endif
#else
#include
+#include
#include
#endif
#include "rfb.h"
diff -ur xorg-server-1.12.1.orig/hw/vnc/rfbmouse.c xorg-server-1.12.1/hw/vnc/rfbmouse.c
--- xorg-server-1.12.1.orig/hw/vnc/rfbmouse.c 2012-04-18 17:38:08.302219053 -0500
+++ xorg-server-1.12.1/hw/vnc/rfbmouse.c 2012-04-18 16:43:28.843217928 -0500
@@ -46,6 +46,7 @@
#else
#include
+#include
#include
#endif
#include "rfb.h"
++++++ n_VNC-Add-support-for-VNC.patch ++++++
++++ 23495 lines (skipped)
++++++ n_VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch ++++++
From: Michal Srb
Date: Tue, 6 Sep 2011 13:08:25 +0200
Subject: [PATCH 4/6] VNC: Don't let VNC access the framebuffer directly any more.
Patch-Mainline: Currently no upstream project.
Git-commit: 3e0de1d95b3ffd3988016b2d3f40f577393ad046
Signed-off: Egbert Eich
References: bnc #653915
It seems that accessing the framebuffer directly is not a good idea anymore.
This patch will let the tight encoding read the screen data using GetImage. It
may be little slower, but not dramatically - it already does few GetImage calls
on every repaint now.
Signed-off-by: Egbert Eich
---
hw/vnc/tight.c | 69 ++++++++++++++++++++++++++++++---------------
hw/vnc/vncext.c | 19 ++----------
hw/xfree86/vnc/vncInit.c | 11 ++-----
hw/xfree86/vnc/vncint.h | 2 -
4 files changed, 53 insertions(+), 48 deletions(-)
diff --git a/hw/vnc/tight.c b/hw/vnc/tight.c
index 5c54736..f27c73e 100644
--- a/hw/vnc/tight.c
+++ b/hw/vnc/tight.c
@@ -109,15 +109,17 @@ static unsigned char *tightAfterBuf = NULL;
static int *prevRowBuf = NULL;
+static unsigned char* fakeFrameBuffer = NULL;
+
/* Prototypes for static functions. */
-static void FindBestSolidArea (ScreenPtr pScreen, int x, int y, int w, int h,
+static void FindBestSolidArea (rfbClientPtr cl, int x, int y, int w, int h,
CARD32 colorValue, int *w_ptr, int *h_ptr);
-static void ExtendSolidArea (ScreenPtr pScreen, int x, int y, int w, int h,
+static void ExtendSolidArea (rfbClientPtr cl, int x, int y, int w, int h,
CARD32 colorValue,
int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);
-static Bool CheckSolidTile (ScreenPtr pScreen, int x, int y, int w, int h,
+static Bool CheckSolidTile (rfbClientPtr cl, int x, int y, int w, int h,
CARD32 *colorPtr, Bool needSameColor);
static Bool CheckSolidTile8 (ScreenPtr pScreen, int x, int y, int w, int h,
CARD32 *colorPtr, Bool needSameColor);
@@ -126,6 +128,7 @@ static Bool CheckSolidTile16 (ScreenPtr pScreen, int x, int y, int w, int h,
static Bool CheckSolidTile32 (ScreenPtr pScreen, int x, int y, int w, int h,
CARD32 *colorPtr, Bool needSameColor);
+static Bool SendRectEncodingTight(rfbClientPtr cl, int x, int y, int w, int h);
static Bool SendRectSimple (rfbClientPtr cl, int x, int y, int w, int h);
static Bool SendSubrect (rfbClientPtr cl, int x, int y, int w, int h);
static Bool SendTightHeader (rfbClientPtr cl, int x, int y, int w, int h);
@@ -211,6 +214,25 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
int x, int y, int w, int h)
{
VNCSCREENPTR(cl->pScreen);
+
+ /* Copy the rectangle to the fake buffer for CheckSolidTile functions. */
+
+ if(!fakeFrameBuffer) fakeFrameBuffer = malloc(pVNC->width * pVNC->height * cl->format.bitsPerPixel / 8);
+ (*cl->translateFn)(cl->pScreen, cl->translateLookupTable,
+ &pVNC->rfbServerFormat,
+ &cl->format, fakeFrameBuffer + (y * pVNC->width * cl->format.bitsPerPixel / 8),
+ pVNC->paddedWidthInBytes, pVNC->width, h, 0, y);
+
+ /* Call the inner part */
+
+ return SendRectEncodingTight(cl, x, y, w, h);
+}
+
+static Bool
+SendRectEncodingTight(rfbClientPtr cl,
+ int x, int y, int w, int h)
+{
+ VNCSCREENPTR(cl->pScreen);
int nMaxRows;
CARD32 colorValue;
int dx, dy, dw, dh;
@@ -247,7 +269,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
nMaxRows = maxRectSize / nMaxWidth;
}
-
+
/* Try to find large solid-color areas and send them separately. */
for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {
@@ -269,11 +291,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w) ?
MAX_SPLIT_TILE_SIZE : (x + w - dx);
- if (CheckSolidTile(cl->pScreen, dx, dy, dw, dh, &colorValue, FALSE)) {
+ if (CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, FALSE)) {
/* Get dimensions of solid-color area. */
- FindBestSolidArea(cl->pScreen, dx, dy, w - (dx - x), h - (dy - y),
+ FindBestSolidArea(cl, dx, dy, w - (dx - x), h - (dy - y),
colorValue, &w_best, &h_best);
/* Make sure a solid rectangle is large enough
@@ -286,7 +308,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
/* Try to extend solid rectangle to maximum size. */
x_best = dx; y_best = dy;
- ExtendSolidArea(cl->pScreen, x, y, w, h, colorValue,
+ ExtendSolidArea(cl, x, y, w, h, colorValue,
&x_best, &y_best, &w_best, &h_best);
/* Send rectangles at top and left to solid-color area. */
@@ -295,7 +317,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
!SendRectSimple(cl, x, y, w, y_best-y) )
return FALSE;
if ( x_best != x &&
- !rfbSendRectEncodingTight(cl, x, y_best,
+ !SendRectEncodingTight(cl, x, y_best,
x_best-x, h_best) )
return FALSE;
@@ -316,11 +338,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
/* Send remaining rectangles (at right and bottom). */
if ( x_best + w_best != x + w &&
- !rfbSendRectEncodingTight(cl, x_best+w_best, y_best,
+ !SendRectEncodingTight(cl, x_best+w_best, y_best,
w-(x_best-x)-w_best, h_best) )
return FALSE;
if ( y_best + h_best != y + h &&
- !rfbSendRectEncodingTight(cl, x, y_best+h_best,
+ !SendRectEncodingTight(cl, x, y_best+h_best,
w, h-(y_best-y)-h_best) )
return FALSE;
@@ -339,7 +361,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
}
static void
-FindBestSolidArea(ScreenPtr pScreen,
+FindBestSolidArea(rfbClientPtr cl,
int x, int y, int w, int h,
CARD32 colorValue,
int *w_ptr, int *h_ptr)
@@ -357,13 +379,13 @@ FindBestSolidArea(ScreenPtr pScreen,
dw = (w_prev > MAX_SPLIT_TILE_SIZE) ?
MAX_SPLIT_TILE_SIZE : w_prev;
- if (!CheckSolidTile(pScreen, x, dy, dw, dh, &colorValue, TRUE))
+ if (!CheckSolidTile(cl, x, dy, dw, dh, &colorValue, TRUE))
break;
for (dx = x + dw; dx < x + w_prev;) {
dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w_prev) ?
MAX_SPLIT_TILE_SIZE : (x + w_prev - dx);
- if (!CheckSolidTile(pScreen, dx, dy, dw, dh, &colorValue, TRUE))
+ if (!CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, TRUE))
break;
dx += dw;
}
@@ -380,7 +402,7 @@ FindBestSolidArea(ScreenPtr pScreen,
}
static void
-ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
+ExtendSolidArea(rfbClientPtr cl, int x, int y, int w, int h,
CARD32 colorValue,
int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr)
{
@@ -388,7 +410,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
/* Try to extend the area upwards. */
for ( cy = *y_ptr - 1;
- cy >= y && CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
+ cy >= y && CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
cy-- );
*h_ptr += *y_ptr - (cy + 1);
*y_ptr = cy + 1;
@@ -396,13 +418,13 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
/* ... downwards. */
for ( cy = *y_ptr + *h_ptr;
cy < y + h &&
- CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
+ CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
cy++ );
*h_ptr += cy - (*y_ptr + *h_ptr);
/* ... to the left. */
for ( cx = *x_ptr - 1;
- cx >= x && CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
+ cx >= x && CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
cx-- );
*w_ptr += *x_ptr - (cx + 1);
*x_ptr = cx + 1;
@@ -410,7 +432,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
/* ... to the right. */
for ( cx = *x_ptr + *w_ptr;
cx < x + w &&
- CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
+ CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
cx++ );
*w_ptr += cx - (*x_ptr + *w_ptr);
}
@@ -423,11 +445,12 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
*/
static Bool
-CheckSolidTile(ScreenPtr pScreen, int x, int y, int w, int h, CARD32 *colorPtr,
+CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32 *colorPtr,
Bool needSameColor)
{
- VNCSCREENPTR(pScreen);
- switch(pVNC->rfbServerFormat.bitsPerPixel) {
+ ScreenPtr pScreen = cl->pScreen;
+
+ switch(cl->format.bitsPerPixel) {
case 32:
return CheckSolidTile32(pScreen, x, y, w, h, colorPtr, needSameColor);
case 16:
@@ -449,7 +472,7 @@ static Bool \
int dx, dy; \
\
fbptr = (CARD##bpp *) \
- &pVNC->pfbMemory[y * pVNC->paddedWidthInBytes + x * (bpp/8)]; \
+ &fakeFrameBuffer[(y * pVNC->width + x) * (bpp/8)]; \
\
colorValue = *fbptr; \
if (needSameColor && (CARD32)colorValue != *colorPtr) \
@@ -460,7 +483,7 @@ static Bool \
if (colorValue != fbptr[dx]) \
return FALSE; \
} \
- fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->paddedWidthInBytes); \
+ fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->width * (bpp/8)); \
} \
\
*colorPtr = (CARD32)colorValue; \
diff --git a/hw/vnc/vncext.c b/hw/vnc/vncext.c
index ea913b7..534f3f5 100644
--- a/hw/vnc/vncext.c
+++ b/hw/vnc/vncext.c
@@ -702,15 +702,7 @@ CreateResourceTypes(void)
static unsigned long vncExtGeneration = 0;
#if XFREE86VNC
-extern Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart);
-
-/* copied from miscrinit.c */
-typedef struct
-{
- pointer pbits; /* pointer to framebuffer */
- int width; /* delta to add to a framebuffer addr to move one row down */
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
-
+extern Bool VNCInit(ScreenPtr pScreen);
static Bool
vncCreateScreenResources(ScreenPtr pScreen)
@@ -719,9 +711,6 @@ vncCreateScreenResources(ScreenPtr pScreen)
CreateScreenResourcesProcPtr CreateScreenResources =
(CreateScreenResourcesProcPtr)
dixLookupPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey);
- miScreenInitParmsPtr pScrInitParms;
-
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
if ( pScreen->CreateScreenResources != vncCreateScreenResources ) {
/* Can't find hook we are hung on */
@@ -732,9 +721,6 @@ vncCreateScreenResources(ScreenPtr pScreen)
(void *) pScreen->CreateScreenResources );
}
- /* Now do our stuff */
- VNCInit(pScreen, pScrInitParms->pbits);
-
/* Unhook this function ... */
pScreen->CreateScreenResources = CreateScreenResources;
dixSetPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey, NULL);
@@ -744,6 +730,9 @@ vncCreateScreenResources(ScreenPtr pScreen)
ret = (*pScreen->CreateScreenResources)(pScreen);
}
+ /* Now do our stuff */
+ VNCInit(pScreen);
+
#ifdef DEBUG
ErrorF("vncCreateScreenResources() returns %d\n", ret);
#endif
diff --git a/hw/xfree86/vnc/vncInit.c b/hw/xfree86/vnc/vncInit.c
index 4a124fb..8b2fa5f 100644
--- a/hw/xfree86/vnc/vncInit.c
+++ b/hw/xfree86/vnc/vncInit.c
@@ -49,7 +49,7 @@ extern void VncExtensionInit(void);
extern void vncInitMouse(void);
extern void vncInitKeyb(void);
-Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart);
+Bool VNCInit(ScreenPtr pScreen);
#ifndef XFree86LOADER
static unsigned long VNCGeneration = 0;
@@ -151,7 +151,7 @@ void rfbLogPerror(char *str)
* Called by vncCreateScreenResources()
*/
Bool
-VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
+VNCInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
VisualPtr visual;
@@ -164,9 +164,6 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
PictureScreenPtr ps;
#endif
- if (!FBStart)
- return FALSE;
-
#ifndef XFree86LOADER
if (VNCGeneration != serverGeneration) {
VncExtensionInit();
@@ -287,9 +284,7 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
pScreenPriv->depth = pScrn->depth;
pScreenPriv->paddedWidthInBytes = PixmapBytePad(pScrn->displayWidth, pScrn->depth);
pScreenPriv->bitsPerPixel = rfbBitsPerPixel(pScrn->depth);
- pScreenPriv->pfbMemory = FBStart;
- pScreenPriv->oldpfbMemory = FBStart;
-
+
pScreenPriv->cursorIsDrawn = TRUE;
pScreenPriv->dontSendFramebufferUpdate = FALSE;
diff --git a/hw/xfree86/vnc/vncint.h b/hw/xfree86/vnc/vncint.h
index 18a3630..9e4a36f 100644
--- a/hw/xfree86/vnc/vncint.h
+++ b/hw/xfree86/vnc/vncint.h
@@ -44,13 +44,11 @@ typedef struct {
size_t buf_filled;
int maxFd;
fd_set allFds;
- unsigned char * oldpfbMemory;
Bool rfbAlwaysShared;
Bool rfbNeverShared;
Bool rfbDontDisconnect;
Bool rfbUserAccept;
Bool rfbViewOnly;
- unsigned char * pfbMemory;
int paddedWidthInBytes;
ColormapPtr rfbInstalledColormap;
ColormapPtr savedColormap;
--
1.7.3.4
++++++ n_VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch ++++++
From: Matthias Hopf
Date: Tue, 6 Sep 2011 08:35:57 +0200
Subject: [PATCH 5/6] VNC: Enable use of all keyboard layouts, independent of remotely set layout
Patch-Mainline: Currently no upstream project.
Git-commit: 6885b927a6065e6379cfaa3ebbf6c51445a015d9
Signed-off: Egbert Eich
References: bnc #400520, #605015, #660797
Changes:
- Use virtual core keyboard for events and key state lookup:
Make layout changes work again - see discussion on
https://defect.opensolaris.org/bz/show_bug.cgi?id=8687
- keycode lookup:
Don't use any static keyboard layout any more.
- ISO-Level3-Shift handling:
Enable the use of keyboard layouts that use AltGr for 3rd and 4th level.
- Make keyboard handling more XKB aware:
Previous code was e.g. not multi-group aware.
- Nuke use of legacy keymap as far as possible:
Creating legacy keymap takes time, and it has to be freed again afterwards.
- Free index lookup:
Make XKB aware.
- Ignore calls for NoSymbol:
This destroys otherwise valid entries.
- Fix analysis for shift/level3 event faking:
Previous broken version lead to e.g. Shift+PgUp not being recognized.
- Add tons of debug output (disabled).
Signed-off-by: Egbert Eich
Rebased to 1.12.1 by Mike Gorse
---
diff -pruN xorg-server-1.12.1.orig/hw/vnc/kbdptr.c xorg-server-1.12.1/hw/vnc/kbdptr.c
--- xorg-server-1.12.1.orig/hw/vnc/kbdptr.c 2012-04-18 14:14:07.436250934 -0500
+++ xorg-server-1.12.1/hw/vnc/kbdptr.c 2012-04-18 14:15:27.656248047 -0500
@@ -34,6 +34,8 @@
#include "X11/Xproto.h"
#include "inputstr.h"
#include "inpututils.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
#define XK_CYRILLIC
#include
#include
@@ -46,6 +48,7 @@
#include "dmxinput.h"
#endif
+#if 0
#if !XFREE86VNC
#define MIN_KEY_CODE 8
@@ -196,21 +199,20 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_
#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY))
#endif
+#endif
#define KEY_IS_PRESSED(keycode) \
- (kbdDevice->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
+ (inputInfo.keyboard->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
static void vncXConvertCase(KeySym sym, KeySym *lower, KeySym *upper);
-static DeviceIntPtr ptrDevice = NULL, kbdDevice = NULL;
+static DeviceIntPtr ptrDevice = NULL;
void
vncSetKeyboardDevice(DeviceIntPtr kbd)
{
- if (kbdDevice && kbd)
- return; /* set once */
- kbdDevice = kbd;
+ // obsoleted by inputInfo
}
@@ -263,6 +265,29 @@ EnqueueKey(DeviceIntPtr kbdDev, int type
QueueKeyboardEvents(kbdDev, type, detail, NULL);
}
+/* In-server and highly changed version of XkbKeycodeToKeysym */
+static KeySym
+_XkbKeycodeToKeysym(XkbDescPtr xkb, KeyCode kc, int group, int level)
+{
+ KeySym ks;
+
+ if ((kc<xkb->min_key_code)||(kc>xkb->max_key_code))
+ return NoSymbol;
+ /* Treat single group elements as present in all groups */
+ if (XkbKeyNumGroups (xkb,kc) == 1)
+ group = 0;
+ if ((group<0)||(level<0)||(group>=XkbKeyNumGroups(xkb,kc)))
+ return NoSymbol;
+ if (level < XkbKeyGroupWidth(xkb, kc, group))
+ ks = XkbKeySymEntry(xkb, kc, level, group);
+ else
+ ks = NoSymbol;
+ /* Treat 'K' as 'K K', */
+ if (ks == NoSymbol && (level & 1) && level-1 < XkbKeyGroupWidth(xkb, kc, group))
+ ks = XkbKeySymEntry(xkb, kc, level-1, group);
+ return ks;
+}
+
/*
* Called when the rfbserver receives a rfbKeyEvent event from a client.
* Put an X keyboard event into the event queue.
@@ -271,21 +296,35 @@ void
KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl)
{
const int type = down ? KeyPress : KeyRelease;
- KeySymsPtr keySyms;
- XkbStateRec *xkb;
- int i;
+ XkbSrvInfoPtr xkbInfo;
+ int i, group, level;
int keyCode = 0;
- int freeIndex = -1;
Bool fakeShiftPress = FALSE;
Bool fakeShiftLRelease = FALSE;
Bool fakeShiftRRelease = FALSE;
Bool shiftMustBeReleased = FALSE;
Bool shiftMustBePressed = FALSE;
+ Bool fakeLevel3Press = FALSE;
+ Bool fakeLevel3Release = FALSE;
+ Bool level3MustBeReleased = FALSE;
+ Bool level3MustBePressed = FALSE;
+
+ /* Incomplete maps may create NoSymbol - which lets us
+ * select and/or overwrite otherwise valid entries.
+ * E.g Level3+a in serbian layout creates NoSymbol on os11.4
+ * 2011-05-24 mhopf@suse.de */
+ if (keySym == NoSymbol) {
+ ErrorF("KbdAddEvent: ignoring illegal NoSymbol\n");
+ return;
+ }
- if (!kbdDevice)
- return;
-
- keySyms = XkbGetCoreMap(kbdDevice);
+ xkbInfo = inputInfo.keyboard->key->xkbInfo;
+ group = xkbInfo->state.group;
+ level = (KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE) ? 2 : 0) |
+ (XkbStateFieldFromRec(&xkbInfo->state) & ShiftMask ? 1 : 0);
+#ifdef DEBUG
+ ErrorF ("VNCkbd:\t%s Sym %04x\n", down ? "+":"-", (int)keySym);
+#endif
#ifdef CORBA
if (cl) {
@@ -303,6 +342,12 @@ KbdAddEvent(Bool down, KeySym keySym, rf
*
* Alan.
*/
+ /* Never use predefined keys.
+ * This is inherently incapable of dealing with changing
+ * keyboard layouts. Not being able to work with non-local xmodmaps
+ * is a nuisance at worst, and probably even preferred.
+ * 2011-04-15 mhopf@suse.de */
+#ifdef NOTANYMORE
#if !XFREE86VNC
/* First check if it's one of our predefined keys. If so then we can make
some attempt at allowing an xmodmap inside a VNC desktop behave
@@ -329,107 +374,227 @@ KbdAddEvent(Bool down, KeySym keySym, rf
}
}
#endif
+#endif
if (!keyCode) {
/* not one of our predefined keys - see if it's in the current keyboard
mapping (i.e. we've already allocated an extra keycode for it) */
- if (keySyms->mapWidth < 2) {
- ErrorF("KbdAddEvent: Sanity check failed - Keyboard mapping has "
- "less than 2 keysyms per keycode (KeySym 0x%x)\n", (int)keySym);
- return;
- }
+ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) {
+ /* Check all keycodes, but only continue on those where
+ * backconversion results in keySym.
+ * 2011-05-20 mhopf@suse.de */
+
+#ifdef DEBUG
+ int j;
+ ErrorF (" keyCode %3d map# %4d++ level %d of %d: keySyms",
+ keyCode, (i / keySyms->mapWidth) * keySyms->mapWidth,
+ i % keySyms->mapWidth, keySyms->mapWidth);
+ for (j = 0; j < keySyms->mapWidth; j++)
+ ErrorF (" %02x", (int)keySyms->map[(i / keySyms->mapWidth) * keySyms->mapWidth + j]);
+ ErrorF ("\n");
+ ErrorF (" group %d of %d width %d: keySyms",
+ group, XkbKeyNumGroups(xkbInfo->desc, keyCode),
+ XkbKeyGroupWidth(xkbInfo->desc, keyCode, group));
+ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) > group)
+ for (j = 0; j < XkbKeyGroupWidth(xkbInfo->desc, keyCode, group); j++)
+ ErrorF (" %02x", (int) XkbKeySymEntry(xkbInfo->desc, keyCode, j, group));
+ ErrorF ("\n");
+#endif
- for (i = 0; i < NO_OF_KEYS * keySyms->mapWidth; i++) {
- if (keySym == keySyms->map[i]) {
- keyCode = MIN_KEY_CODE + i / keySyms->mapWidth;
-
- if (keySyms->map[(i / keySyms->mapWidth)
- * keySyms->mapWidth + 1] != NoSymbol) {
-
- /* this keycode has more than one symbol associated with
- it, so shift state is important */
-
- if ((i % keySyms->mapWidth) == 0)
- shiftMustBeReleased = TRUE;
- else
- shiftMustBePressed = TRUE;
- }
+ /* Check whether keySym is reachable in current group
+ * by any shift/Level3_shift state (preferrable w/o change).
+ * This doesn't do real modifyer analysis, only Shift and Level3_Shift.
+ * 2011-05-23 mhopf@suse.de */
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level) == keySym)
+ break;
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 2) == keySym) {
+ if (level & 2)
+ level3MustBeReleased = TRUE;
+ else
+ level3MustBePressed = TRUE;
break;
}
- if ((freeIndex == -1) && (keySyms->map[i] == NoSymbol)
- && (i % keySyms->mapWidth) == 0)
- {
- freeIndex = i;
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 1) == keySym) {
+ if (level & 1)
+ shiftMustBeReleased = TRUE;
+ else
+ shiftMustBePressed = TRUE;
+ break;
+ }
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 3) == keySym) {
+ if (level & 2)
+ level3MustBeReleased = TRUE;
+ else
+ level3MustBePressed = TRUE;
+ if (level & 1)
+ shiftMustBeReleased = TRUE;
+ else
+ shiftMustBePressed = TRUE;
+ break;
}
}
+ if (keyCode == MIN_KEY_CODE + NO_OF_KEYS)
+ keyCode = 0;
}
if (!keyCode) {
KeySym lower, upper;
+ KeySymsPtr keySyms = XkbGetCoreMap(inputInfo.keyboard);
/* we don't have an existing keycode - make one up on the fly and add
it to the keyboard mapping. Thanks to Vlad Harchev for pointing
out problems with non-ascii capitalisation. */
- if (freeIndex == -1) {
+ /* Find free index for current group. */
+ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) {
+ /* A keyCode is free if no groups are assigned at all */
+ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) == 0)
+ break;
+#ifdef NOTANYMORE
+ /* We can use exact map positions for group 1+2, but only partially
+ * filling out xkb legacy maps may suddenly change the # of groups.
+ * Reason for that is unknown yet. Might be related to (fixed) NoSymbol issue.
+ * 2011-05-24 mhopf@suse.de */
+ /* For primary groups: A keyCode is free if current group is empty */
+ if (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 1 && group < 2)
+ break;
+ /* Never touch groups that have a single level only (weird group?!?) */
+ if (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 2)
+ continue;
+ /* For primary groups: A keyCode is free if only NoSymbol is assigned
+ * to available levels (only validating levels 0-3) */
+ if (group < 2 &&
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 0, group) == NoSymbol &&
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 1, group) == NoSymbol &&
+ (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 3 ||
+ (XkbKeySymEntry(xkbInfo->desc, keyCode, 2, group) == NoSymbol &&
+ (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 4 ||
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 3, group) == NoSymbol))))
+ break;
+#endif
+ }
+
+ if (keyCode == MIN_KEY_CODE + NO_OF_KEYS) {
ErrorF("KbdAddEvent: ignoring KeySym 0x%x - no free KeyCodes\n",
(int)keySym);
+ free (keySyms->map);
+ free (keySyms);
return;
}
- keyCode = MIN_KEY_CODE + freeIndex / keySyms->mapWidth;
-
vncXConvertCase(keySym, &lower, &upper);
- if (lower == upper) {
- keySyms->map[freeIndex] = keySym;
-
- } else {
- keySyms->map[freeIndex] = lower;
- keySyms->map[freeIndex+1] = upper;
-
+ /* Adding keys is not using xkb mechanisms yet, but relying on support
+ * for changing keys in the legacy map. Should be changed, eventually.
+ * 2011-05-19 mhopf@suse.de */
+#ifdef NOTANYMORE
+ if (group < 2) {
+ /* Only set mapping for active group. Will only work with dual layouts.
+ * 2011-05-23 mhopf@suse.de */
+ int active_group_offset = group ? 2 : 0;
+
+ if (lower == upper) {
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset] = keySym;
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset + 1] = NoSymbol;
+ } else {
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset] = lower;
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset + 1] = upper;
+ }
+ }
+#endif
+ /* Generic layouts needs to set the full map width.
+ * Weird enough, mapWidth seems too big...
+ * 2011-05-23 mhopf@suse.de */
+ for (i = 0; i < (keySyms->mapWidth & ~1); i += 2) {
+ if (lower == upper) {
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i] = keySym;
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i + 1] = NoSymbol;
+ } else {
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i] = lower;
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i + 1] = upper;
+ }
+ }
+ if (lower != upper) {
if (keySym == lower)
shiftMustBeReleased = TRUE;
else
shiftMustBePressed = TRUE;
}
+ level3MustBeReleased = TRUE;
- XkbApplyMappingChange(kbdDevice, keySyms, keyCode, 1, NULL, serverClient);
+ XkbApplyMappingChange(inputInfo.keyboard, keySyms, keyCode, 1, NULL, serverClient);
ErrorF("KbdAddEvent: unknown KeySym 0x%x - allocating KeyCode %d\n",
(int)keySym, keyCode);
+ free (keySyms->map);
+ free (keySyms);
}
- xkb = &kbdDevice->key->xkbInfo->state;
+#ifdef DEBUG
+ ErrorF ("\t%s Sym %04x Code%3d\tState x%02x %s%s%s\tSh %s%s\tL3 %s%s\n",
+ down ? "+":"-", (int)keySym, keyCode, XkbStateFieldFromRec(&xkbInfo->state),
+ KEY_IS_PRESSED(SHIFT_L_KEY_CODE) ? "Sl":"",
+ KEY_IS_PRESSED(SHIFT_R_KEY_CODE) ? "Sr":"",
+ KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE) ? "L3":"",
+ shiftMustBePressed ? "+":"", shiftMustBeReleased ? "-":"",
+ level3MustBePressed ? "+":"", level3MustBeReleased ? "-":"");
+#endif
+#ifdef NOTANYMORE
+ int back = _XkbKeycodeToKeysym (xkbInfo->desc, keyCode, group,
+ ((level3MustBePressed || (!level3MustBeReleased && (level & 2))) ? 2 : 0) |
+ ((shiftMustBePressed || (!shiftMustBeReleased && (level & 1))) ? 1 : 0));
+ ErrorF ("\tvalidate code %d %-2s%-2s -> sym %04x %s\n\n", keyCode,
+ (shiftMustBePressed || (!shiftMustBeReleased && (level & 1))) ? "Sh" : "",
+ (level3MustBePressed || (!level3MustBeReleased && (level & 2))) ? "L3" : "",
+ back, (back == keySym ? "ok" : "FAILED"));
+#endif
+
if (down) {
- if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) {
+ /* TODO: would require to check which keycodes are actually
+ * bound to ISO_Level3_Shift and/or Shift_L.
+ * 2011-04-18 mhopf@suse.de */
+ if (level3MustBePressed && !(level & 2)) {
+ fakeLevel3Press = TRUE;
+ EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
+ }
+ if (level3MustBeReleased && (level & 2)) {
+ fakeLevel3Release = TRUE;
+ EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
+ }
+ if (shiftMustBePressed && !(level & 1)) {
fakeShiftPress = TRUE;
- EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
}
- if (shiftMustBeReleased && (XkbStateFieldFromRec(xkb) & ShiftMask)) {
+ if (shiftMustBeReleased && (level & 1)) {
if (KEY_IS_PRESSED(SHIFT_L_KEY_CODE)) {
fakeShiftLRelease = TRUE;
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
}
if (KEY_IS_PRESSED(SHIFT_R_KEY_CODE)) {
fakeShiftRRelease = TRUE;
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_R_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_R_KEY_CODE);
}
}
}
- EnqueueKey(kbdDevice, type, keyCode);
+ EnqueueKey(inputInfo.keyboard, type, keyCode);
if (fakeShiftPress) {
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
}
if (fakeShiftLRelease) {
- EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
}
if (fakeShiftRRelease) {
- EnqueueKey(kbdDevice, KeyPress, SHIFT_R_KEY_CODE);
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_R_KEY_CODE);
+ }
+ if (fakeLevel3Press) {
+ EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
+ }
+ if (fakeLevel3Release) {
+ EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
}
}
@@ -480,15 +645,15 @@ KbdReleaseAllKeys(void)
{
int i, j;
- if (!kbdDevice)
+ if (!inputInfo.keyboard)
return;
for (i = 0; i < DOWN_LENGTH; i++) {
- if (kbdDevice->key->down[i] != 0) {
+ if (inputInfo.keyboard->key->down[i] != 0) {
for (j = 0; j < 8; j++) {
- if (kbdDevice->key->down[i] & (1 << j)) {
+ if (inputInfo.keyboard->key->down[i] & (1 << j)) {
int detail = (i << 3) | j;
- EnqueueKey(kbdDevice, KeyRelease, detail);
+ EnqueueKey(inputInfo.keyboard, KeyRelease, detail);
}
}
}
diff -pruN xorg-server-1.12.1.orig/hw/vnc/keyboard.h xorg-server-1.12.1/hw/vnc/keyboard.h
--- xorg-server-1.12.1.orig/hw/vnc/keyboard.h 2012-04-18 14:14:07.437250922 -0500
+++ xorg-server-1.12.1/hw/vnc/keyboard.h 2012-04-18 14:15:27.657248035 -0500
@@ -32,3 +32,4 @@
#define META_R_KEY_CODE (MIN_KEY_CODE + 108)
#define ALT_L_KEY_CODE (MIN_KEY_CODE + 56)
#define ALT_R_KEY_CODE (MIN_KEY_CODE + 105)
+#define ISO_LEVEL3_KEY_CODE ALT_R_KEY_CODE
++++++ n_VNC-Fix-crash-due-to-unset-input-device-names.patch ++++++
From: Egbert Eich
Date: Tue, 6 Sep 2011 14:58:28 +0200
Subject: [PATCH 6/6] VNC: Fix crash due to unset input device names.
Patch-Mainline: Currently no upstream project.
Git-commit: b756a7efff37021ca503fe1e63084daae4082e9d
Signed-off: Egbert Eich
References: bnc #716074
Signed-off-by: Egbert Eich
---
hw/vnc/init.c | 2 +-
hw/vnc/rfb.h | 2 +-
hw/vnc/rfbkeyb.c | 7 +++++--
hw/vnc/rfbmouse.c | 9 +++++++--
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/hw/vnc/init.c b/hw/vnc/init.c
index 0977fee..6f83aa8 100644
--- a/hw/vnc/init.c
+++ b/hw/vnc/init.c
@@ -816,7 +816,7 @@ rfbMouseProc(DeviceIntPtr pDevice, int onoff)
switch (onoff)
{
case DEVICE_INIT:
- PtrDeviceInit();
+ PtrDeviceInit(pDevice, "vncMouse");
map[1] = 1;
map[2] = 2;
map[3] = 3;
diff --git a/hw/vnc/rfb.h b/hw/vnc/rfb.h
index 70b1a45..aa9abab 100644
--- a/hw/vnc/rfb.h
+++ b/hw/vnc/rfb.h
@@ -578,7 +578,7 @@ extern void rfbGotXCutText(char *str, int len);
extern Bool compatibleKbd;
extern unsigned char ptrAcceleration;
-extern void PtrDeviceInit(void);
+extern void PtrDeviceInit(DeviceIntPtr pDevice, char *name);
extern void PtrDeviceOn(DeviceIntPtr pDev);
extern void PtrDeviceOff(void);
extern void PtrDeviceControl(DeviceIntPtr dev, PtrCtrl *ctrl);
diff --git a/hw/vnc/rfbkeyb.c b/hw/vnc/rfbkeyb.c
index 4da29c2..6d97999 100644
--- a/hw/vnc/rfbkeyb.c
+++ b/hw/vnc/rfbkeyb.c
@@ -36,6 +36,7 @@
#endif
#include
#include /* Needed for InitValuator/Proximity stuff */
+#include
#include
#ifdef XFree86LOADER
@@ -49,7 +50,6 @@
extern void rfbSendBell(void);
-extern DeviceIntPtr kbdDevice;
extern void vncInitKeyb(void);
#include
@@ -212,11 +212,15 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = {
};
#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY))
+#define RFB_KEYB "rfbKeyb"
void
KbdDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
int i;
+ Atom atom = MakeAtom(RFB_KEYB, strlen(RFB_KEYB), TRUE);
+
+ AssignTypeAndName(pDevice, atom, RFB_KEYB);
for (i = 0; i < MAP_LENGTH; i++)
pModMap[i] = NoSymbol;
@@ -359,7 +363,6 @@ xf86rfbKeybInit(struct _InputDriverRec *drv,
pInfo->control_proc = NULL;
pInfo->switch_mode = NULL;
pInfo->fd = -1;
- pInfo->dev = NULL;
/* Collect the options, and process the common options. */
xf86CollectInputOptions(pInfo, (const char**)drv->default_options);
diff --git a/hw/vnc/rfbmouse.c b/hw/vnc/rfbmouse.c
index 4657128..86e8f2f 100644
--- a/hw/vnc/rfbmouse.c
+++ b/hw/vnc/rfbmouse.c
@@ -37,6 +37,7 @@
#endif
#include
#include /* Needed for InitValuator/Proximity stuff */
+#include
#include
#ifdef XFree86LOADER
@@ -63,8 +64,12 @@ PtrDeviceOn(DeviceIntPtr pDev)
}
void
-PtrDeviceInit(void)
+PtrDeviceInit(DeviceIntPtr pDevice, char *name)
{
+ Atom atom = MakeAtom(name, strlen(name), TRUE);
+
+ AssignTypeAndName(pDevice, atom, name);
+
}
void
@@ -119,7 +124,7 @@ xf86rfbMouseControlProc(DeviceIntPtr dev, int onoff)
{
case DEVICE_INIT:
vncSetPointerDevice(dev);
- PtrDeviceInit();
+ // PtrDeviceInit(dev, "rfbPointer");
map[1] = 1;
map[2] = 2;
map[3] = 3;
--
1.7.3.4
++++++ n_VNC-Fix-crash-when-no-depth-translation-is-required.patch ++++++
From: Michael Schroeder
Date: Tue, 6 Sep 2011 07:58:33 +0200
Subject: [PATCH 3/6] VNC: Fix crash when no depth translation is required.
Patch-Mainline: Currently no upstream project.
Git-commit: 74d5e3115cd955b7ee1acc64c6b8b42198ed894b
Signed-off: Egbert Eich
References: bnc #389386
Signed-off-by: Egbert Eich
---
hw/vnc/translate.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/vnc/translate.c b/hw/vnc/translate.c
index 5cc57a3..78030ed 100644
--- a/hw/vnc/translate.c
+++ b/hw/vnc/translate.c
@@ -168,17 +168,18 @@ rfbTranslateNone(ScreenPtr pScreen, char *table, rfbPixelFormat *in, rfbPixelFor
{
VNCSCREENPTR(pScreen);
DrawablePtr pDraw = (DrawablePtr)pScreen->root;
- int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4;
+ int truewidth = PixmapBytePad(width, in->bitsPerPixel);
- if ((x + truewidth > pVNC->width) || truewidth != width) {
- unsigned char *buffer = malloc(truewidth * height * in->bitsPerPixel / 8);
+ if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) {
+ unsigned char *buffer = malloc(truewidth * height);
unsigned char *buf = buffer;
- (*pScreen->GetImage)(pDraw, x, y, truewidth, height, ZPixmap, ~0, (char*)buf);
+ (*pScreen->GetImage)(pDraw, x, y, width, height, ZPixmap, ~0, (char*)buf);
+
while (height--) {
memcpy(optr, buf, width * in->bitsPerPixel / 8);
optr += width * in->bitsPerPixel / 8;
- buf += truewidth * in->bitsPerPixel / 8;
+ buf += truewidth;
}
free(buffer);
return;
--
1.7.3.4
++++++ n_VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch ++++++
From: Egbert Eich
Date: Tue, 6 Sep 2011 07:02:11 +0200
Subject: [PATCH 2/6] VNC: Readd timeout when vnc viewer connection breaks.
Patch-Mainline: Currently no upstream project.
Git-commit: 759b49ed1c4ea03e45433c92c2fb8c44a60db34a
Signed-off: Egbert Eich
References: bnc #441935, bnc #403901
This prevents Xvnc busy loop forever waiting for a viewer that no longer
response due to network or other issues.
Signed-off-by: Egbert Eich
---
hw/vnc/sockets.c | 19 +++++--------------
1 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/hw/vnc/sockets.c b/hw/vnc/sockets.c
index 39eb88a..ae43ed0 100644
--- a/hw/vnc/sockets.c
+++ b/hw/vnc/sockets.c
@@ -442,9 +442,7 @@ WriteExact(int sock, char *buf, int len)
int n;
fd_set fds;
struct timeval tv;
-#if 0
int totalTimeWaited = 0;
-#endif
while (len > 0) {
n = write(sock, buf, len);
@@ -464,7 +462,6 @@ WriteExact(int sock, char *buf, int len)
return n;
}
-#if 0
/* Retry every 5 seconds until we exceed rfbMaxClientWait. We
need to do this because select doesn't necessarily return
immediately when the other end has gone away */
@@ -473,19 +470,14 @@ WriteExact(int sock, char *buf, int len)
FD_SET(sock, &fds);
tv.tv_sec = 5;
tv.tv_usec = 0;
-#else
- /* We're in the WakeupHandler now, so don't wait */
- FD_ZERO(&fds);
- FD_SET(sock, &fds);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
-#endif
n = select(sock+1, NULL, &fds, NULL, &tv);
-#if 0
+
if (n < 0) {
- rfbLogPerror("WriteExact: select");
- return n;
+ if (errno != EINTR) {
+ rfbLogPerror("WriteExact: select");
+ return n;
+ }
}
if (n == 0) {
totalTimeWaited += 5000;
@@ -496,7 +488,6 @@ WriteExact(int sock, char *buf, int len)
} else {
totalTimeWaited = 0;
}
-#endif
}
}
return 1;
--
1.7.3.4
++++++ n_Xvnc-pthread.diff ++++++
--- xorg-server-1.10.4/hw/vnc/Makefile.am.orig 2011-09-06 15:25:27.000000000 +0000
+++ xorg-server-1.10.4/hw/vnc/Makefile.am 2011-09-06 15:26:40.000000000 +0000
@@ -37,6 +37,7 @@
JPEG_LIBS = -ljpeg
CRYPT_LIBS = -lcrypt
Z_LIBS = -lz
+PTHREAD_LIBS = -lpthread
AM_CFLAGS = $(DIX_CFLAGS) $(XVNC_CFLAGS) -I$(top_srcdir)/hw/dmx/vnc -DCHROMIUM=1
@@ -48,7 +49,8 @@
$(CRYPT_LIBS) \
$(XSERVER_SYS_LIBS) \
$(VNCMODULES_LIBS) \
- $(Z_LIBS)
+ $(Z_LIBS) \
+ $(PTHREAD_LIBS)
relink:
++++++ n_xorg-x11-server-rpmmacros.patch ++++++
Index: xorg-server-1.12.1/configure.ac
===================================================================
--- xorg-server-1.12.1.orig/configure.ac
+++ xorg-server-1.12.1/configure.ac
@@ -2232,4 +2232,5 @@ test/Makefile
test/xi2/Makefile
xserver.ent
xorg-server.pc
+xorg-x11-server.macros
])
++++++ xorg-server-1.12.3.tar.bz2 -> xorg-server-1.13.0.tar.bz2 ++++++
++++ 79327 lines of diff (skipped)
++++++ xorg-server-provides ++++++
--- /var/tmp/diff_new_pack.SvVxSq/_old 2012-09-15 17:31:26.000000000 +0200
+++ /var/tmp/diff_new_pack.SvVxSq/_new 2012-09-15 17:31:26.000000000 +0200
@@ -1,4 +1,4 @@
-Provides: X11_ABI_XINPUT = 16.0
-Provides: X11_ABI_VIDEODRV = 12.0
+Provides: X11_ABI_XINPUT = 18.0
+Provides: X11_ABI_VIDEODRV = 13.0
Provides: X11_ABI_ANSIC = 0.4
-Provides: X11_ABI_EXTENSION = 6.0
+Provides: X11_ABI_EXTENSION = 7.0
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org