git snapshot of what will be 1.18.0 (should be ABI stable)
This commit is contained in:
parent
f91a58a800
commit
ad7af00128
@ -1,210 +0,0 @@
|
||||
From e1a7f4bb5333b0271d29f785eb55f1c3273e626a Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Tue, 5 May 2015 14:18:54 +1000
|
||||
Subject: [PATCH] dix: Add unaccelerated valuators to the ValuatorMask
|
||||
|
||||
Allows a mask to carry both accelerated and unaccelerated motion at the same
|
||||
time.
|
||||
|
||||
This is required for xf86-input-libinput where the pointer acceleration
|
||||
happens in libinput already, but parts of the server, specifically raw events
|
||||
and DGA rely on device-specific unaccelerated data.
|
||||
|
||||
To ease integration add this as a second set to the ValuatorMask rather than
|
||||
extending all APIs to carry a second, possibly NULL set of valuators.
|
||||
|
||||
Note that a valuator mask should only be used in either accel/unaccel or
|
||||
standard mode at any time. Switching requires either a valuator_mask_zero()
|
||||
call or unsetting all valuators one-by-one. Trying to mix the two will produce
|
||||
a warning.
|
||||
|
||||
The server has a shortcut for changing a mask with the
|
||||
valuator_mask_drop_unaccelerated() call. This saves us from having to loop
|
||||
through all valuators on every event, we can just drop the bits we know we
|
||||
don't want.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
dix/inpututils.c | 82 +++++++++++++++++++++++++++++++++++++++---
|
||||
hw/xfree86/common/xf86Module.h | 2 +-
|
||||
include/input.h | 15 ++++++++
|
||||
include/inpututils.h | 2 ++
|
||||
4 files changed, 95 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dix/inpututils.c b/dix/inpututils.c
|
||||
index 5c2a32d..1363988 100644
|
||||
--- a/dix/inpututils.c
|
||||
+++ b/dix/inpututils.c
|
||||
@@ -505,11 +505,8 @@ valuator_mask_isset(const ValuatorMask *mask, int valuator)
|
||||
return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator);
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Set the valuator to the given floating-point data.
|
||||
- */
|
||||
-void
|
||||
-valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
|
||||
+static inline void
|
||||
+_valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
|
||||
{
|
||||
mask->last_bit = max(valuator, mask->last_bit);
|
||||
SetBit(mask->mask, valuator);
|
||||
@@ -517,6 +514,17 @@ valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Set the valuator to the given floating-point data.
|
||||
+ */
|
||||
+void
|
||||
+valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
|
||||
+{
|
||||
+ BUG_WARN_MSG(mask->has_unaccelerated,
|
||||
+ "Do not mix valuator types, zero mask first\n");
|
||||
+ _valuator_mask_set_double(mask, valuator, data);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* Set the valuator to the given integer data.
|
||||
*/
|
||||
void
|
||||
@@ -594,11 +602,15 @@ valuator_mask_unset(ValuatorMask *mask, int valuator)
|
||||
|
||||
ClearBit(mask->mask, valuator);
|
||||
mask->valuators[valuator] = 0.0;
|
||||
+ mask->unaccelerated[valuator] = 0.0;
|
||||
|
||||
for (i = 0; i <= mask->last_bit; i++)
|
||||
if (valuator_mask_isset(mask, i))
|
||||
lastbit = max(lastbit, i);
|
||||
mask->last_bit = lastbit;
|
||||
+
|
||||
+ if (mask->last_bit == -1)
|
||||
+ mask->has_unaccelerated = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,6 +623,66 @@ valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src)
|
||||
valuator_mask_zero(dest);
|
||||
}
|
||||
|
||||
+Bool
|
||||
+valuator_mask_has_unaccelerated(const ValuatorMask *mask)
|
||||
+{
|
||||
+ return mask->has_unaccelerated;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+valuator_mask_drop_unaccelerated(ValuatorMask *mask)
|
||||
+{
|
||||
+ memset(mask->unaccelerated, 0, sizeof(mask->unaccelerated));
|
||||
+ mask->has_unaccelerated = FALSE;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Set both accelerated and unaccelerated value for this mask.
|
||||
+ */
|
||||
+void
|
||||
+valuator_mask_set_unaccelerated(ValuatorMask *mask,
|
||||
+ int valuator,
|
||||
+ double accel,
|
||||
+ double unaccel)
|
||||
+{
|
||||
+ BUG_WARN_MSG(mask->last_bit != -1 && !mask->has_unaccelerated,
|
||||
+ "Do not mix valuator types, zero mask first\n");
|
||||
+ _valuator_mask_set_double(mask, valuator, accel);
|
||||
+ mask->has_unaccelerated = TRUE;
|
||||
+ mask->unaccelerated[valuator] = unaccel;
|
||||
+}
|
||||
+
|
||||
+double
|
||||
+valuator_mask_get_accelerated(const ValuatorMask *mask,
|
||||
+ int valuator)
|
||||
+{
|
||||
+ return valuator_mask_get_double(mask, valuator);
|
||||
+}
|
||||
+
|
||||
+double
|
||||
+valuator_mask_get_unaccelerated(const ValuatorMask *mask,
|
||||
+ int valuator)
|
||||
+{
|
||||
+ return mask->unaccelerated[valuator];
|
||||
+}
|
||||
+
|
||||
+Bool
|
||||
+valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
|
||||
+ int valuator,
|
||||
+ double *accel,
|
||||
+ double *unaccel)
|
||||
+{
|
||||
+ if (valuator_mask_isset(mask, valuator)) {
|
||||
+ if (accel)
|
||||
+ *accel = valuator_mask_get_accelerated(mask, valuator);
|
||||
+ if (unaccel)
|
||||
+ *unaccel = valuator_mask_get_unaccelerated(mask, valuator);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
int
|
||||
CountBits(const uint8_t * mask, int len)
|
||||
{
|
||||
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
|
||||
index e68fe9c..6133641 100644
|
||||
--- a/hw/xfree86/common/xf86Module.h
|
||||
+++ b/hw/xfree86/common/xf86Module.h
|
||||
@@ -81,7 +81,7 @@ typedef enum {
|
||||
*/
|
||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
|
||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(19, 0)
|
||||
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0)
|
||||
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 1)
|
||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0)
|
||||
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
|
||||
|
||||
diff --git a/include/input.h b/include/input.h
|
||||
index bf22dc7..0a4c4f7 100644
|
||||
--- a/include/input.h
|
||||
+++ b/include/input.h
|
||||
@@ -674,6 +674,21 @@ extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
|
||||
extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
|
||||
int valnum, double *val);
|
||||
|
||||
+extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask);
|
||||
+extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask,
|
||||
+ int valuator,
|
||||
+ double accel,
|
||||
+ double unaccel);
|
||||
+extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask,
|
||||
+ int valuator);
|
||||
+extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
|
||||
+ int valuator);
|
||||
+extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
|
||||
+ int valuator,
|
||||
+ double *accel,
|
||||
+ double *unaccel);
|
||||
+extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
|
||||
+
|
||||
/* InputOption handling interface */
|
||||
extern _X_EXPORT InputOption *input_option_new(InputOption *list,
|
||||
const char *key,
|
||||
diff --git a/include/inpututils.h b/include/inpututils.h
|
||||
index 53c96ba..4e90815 100644
|
||||
--- a/include/inpututils.h
|
||||
+++ b/include/inpututils.h
|
||||
@@ -36,8 +36,10 @@ extern Mask event_filters[MAXDEVICES][MAXEVENTS];
|
||||
|
||||
struct _ValuatorMask {
|
||||
int8_t last_bit; /* highest bit set in mask */
|
||||
+ int8_t has_unaccelerated;
|
||||
uint8_t mask[(MAX_VALUATORS + 7) / 8];
|
||||
double valuators[MAX_VALUATORS]; /* valuator data */
|
||||
+ double unaccelerated[MAX_VALUATORS]; /* valuator data */
|
||||
};
|
||||
|
||||
extern void verify_internal_event(const InternalEvent *ev);
|
||||
--
|
||||
2.4.1
|
||||
|
25
0001-fix-Xdmx-link-harder.patch
Normal file
25
0001-fix-Xdmx-link-harder.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From cd0024646df28c208ef5d73b55564d6d184afdfd Mon Sep 17 00:00:00 2001
|
||||
From: Fedora X Ninjas <x@fedoraproject.org>
|
||||
Date: Wed, 29 Jul 2015 10:34:08 +1000
|
||||
Subject: [PATCH] fix Xdmx link harder
|
||||
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 98d0821..20f31e6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2268,7 +2268,7 @@ if test "x$DMX" = xyes; then
|
||||
fi
|
||||
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
|
||||
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
|
||||
- XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
|
||||
+ XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB $RANDR_LIB"
|
||||
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
|
||||
AC_SUBST([XDMX_CFLAGS])
|
||||
AC_SUBST([XDMX_LIBS])
|
||||
--
|
||||
2.4.3
|
||||
|
@ -1,241 +0,0 @@
|
||||
From 92bc12b7085ff80d4f5a2389b5a00cda501e27c7 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 21 Jan 2015 09:31:39 +0100
|
||||
Subject: [PATCH v2 1/3] linux: Add linux_parse_vt_settings and
|
||||
linux_get_keeptty helpers
|
||||
|
||||
systemd-logind integration does not work when starting X on a new tty, as
|
||||
that detaches X from the current session and after hat systemd-logind revokes
|
||||
all rights on any already open fds and refuses to open new fds for X.
|
||||
|
||||
This means that currently e.g. "startx -- vt7" breaks, and breaks badly,
|
||||
requiring ssh access to the system to kill X.
|
||||
|
||||
The fix for this is easy, we must not use systemd-logind integration when
|
||||
not using KeepTty, or iow we may only use systemd-logind integration together
|
||||
with KeepTty.
|
||||
|
||||
But the final KeepTty value is not known until the code to chose which vtno to
|
||||
run on has been called, which currently happens after intializing
|
||||
systemd-logind.
|
||||
|
||||
This commit is step 1 in fixing the "startx -- vt7" breakage, it factors out
|
||||
the linux xf86OpenConsole bits which set xf86Info.vtno and keepTty so that
|
||||
these can be called earlier. Calling this earlier is safe as this code has
|
||||
no side effects other than setting xf86Info.vtno and keepTty.
|
||||
|
||||
Note this basically only moves a large chunk of xf86OpenConsole() into
|
||||
linux_parse_vt_settings() without changing a single line of it, this is
|
||||
hard to see in the diff because the identation level has changed.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
Changes in v2:
|
||||
-Rename linux_get_vtno to linux_parse_vt_settings
|
||||
Changes in v3:
|
||||
-Carry the rename of linux_get_vtno to linux_parse_vt_settings over into
|
||||
the commit msg
|
||||
---
|
||||
hw/xfree86/os-support/linux/linux.h | 32 +++++++++
|
||||
hw/xfree86/os-support/linux/lnx_init.c | 122 ++++++++++++++++++++-------------
|
||||
2 files changed, 105 insertions(+), 49 deletions(-)
|
||||
create mode 100644 hw/xfree86/os-support/linux/linux.h
|
||||
|
||||
diff --git a/hw/xfree86/os-support/linux/linux.h b/hw/xfree86/os-support/linux/linux.h
|
||||
new file mode 100644
|
||||
index 0000000..8cb8e3d
|
||||
--- /dev/null
|
||||
+++ b/hw/xfree86/os-support/linux/linux.h
|
||||
@@ -0,0 +1,32 @@
|
||||
+/*
|
||||
+ * Copyright © 2015 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a
|
||||
+ * copy of this software and associated documentation files (the "Software"),
|
||||
+ * to deal in the Software without restriction, including without limitation
|
||||
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
+ * and/or sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice (including the next
|
||||
+ * paragraph) shall be included in all copies or substantial portions of the
|
||||
+ * Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
+ * DEALINGS IN THE SOFTWARE.
|
||||
+ *
|
||||
+ * Author: Hans de Goede <hdegoede@redhat.com>
|
||||
+ */
|
||||
+
|
||||
+#ifndef XF86_LINUX_H
|
||||
+#define XF86_LINUX_H
|
||||
+
|
||||
+void linux_parse_vt_settings(void);
|
||||
+int linux_get_keeptty(void);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
|
||||
index 9485307..22c61bf 100644
|
||||
--- a/hw/xfree86/os-support/linux/lnx_init.c
|
||||
+++ b/hw/xfree86/os-support/linux/lnx_init.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#include "compiler.h"
|
||||
+#include "linux.h"
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
@@ -80,71 +81,94 @@ switch_to(int vt, const char *from)
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
void
|
||||
-xf86OpenConsole(void)
|
||||
+linux_parse_vt_settings(void)
|
||||
{
|
||||
int i, fd = -1, ret, current_vt = -1;
|
||||
- struct vt_mode VT;
|
||||
struct vt_stat vts;
|
||||
struct stat st;
|
||||
MessageType from = X_PROBED;
|
||||
const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
|
||||
- const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
|
||||
|
||||
- if (serverGeneration == 1) {
|
||||
- /*
|
||||
- * setup the virtual terminal manager
|
||||
- */
|
||||
- if (xf86Info.vtno != -1) {
|
||||
- from = X_CMDLINE;
|
||||
- }
|
||||
- else {
|
||||
+ /* Only do this once */
|
||||
+ static int vt_settings_parsed = 0;
|
||||
|
||||
- i = 0;
|
||||
- while (tty0[i] != NULL) {
|
||||
- if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0)
|
||||
- break;
|
||||
- i++;
|
||||
- }
|
||||
+ if (vt_settings_parsed)
|
||||
+ return;
|
||||
|
||||
- if (fd < 0)
|
||||
- FatalError("xf86OpenConsole: Cannot open /dev/tty0 (%s)\n",
|
||||
- strerror(errno));
|
||||
+ /*
|
||||
+ * setup the virtual terminal manager
|
||||
+ */
|
||||
+ if (xf86Info.vtno != -1) {
|
||||
+ from = X_CMDLINE;
|
||||
+ }
|
||||
+ else {
|
||||
|
||||
- if (xf86Info.ShareVTs) {
|
||||
- SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
|
||||
- if (ret < 0)
|
||||
- FatalError("xf86OpenConsole: Cannot find the current"
|
||||
- " VT (%s)\n", strerror(errno));
|
||||
- xf86Info.vtno = vts.v_active;
|
||||
- }
|
||||
- else {
|
||||
- SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
|
||||
- if (ret < 0)
|
||||
- FatalError("xf86OpenConsole: Cannot find a free VT: "
|
||||
- "%s\n", strerror(errno));
|
||||
- if (xf86Info.vtno == -1)
|
||||
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
|
||||
- }
|
||||
- close(fd);
|
||||
+ i = 0;
|
||||
+ while (tty0[i] != NULL) {
|
||||
+ if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0)
|
||||
+ break;
|
||||
+ i++;
|
||||
}
|
||||
|
||||
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
|
||||
+ if (fd < 0)
|
||||
+ FatalError("parse_vt_settings: Cannot open /dev/tty0 (%s)\n",
|
||||
+ strerror(errno));
|
||||
|
||||
- /* Some of stdin / stdout / stderr maybe redirected to a file */
|
||||
- for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) {
|
||||
- ret = fstat(i, &st);
|
||||
- if (ret == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) {
|
||||
- current_vt = minor(st.st_rdev);
|
||||
- break;
|
||||
- }
|
||||
+ if (xf86Info.ShareVTs) {
|
||||
+ SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
|
||||
+ if (ret < 0)
|
||||
+ FatalError("parse_vt_settings: Cannot find the current"
|
||||
+ " VT (%s)\n", strerror(errno));
|
||||
+ xf86Info.vtno = vts.v_active;
|
||||
}
|
||||
+ else {
|
||||
+ SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
|
||||
+ if (ret < 0)
|
||||
+ FatalError("parse_vt_settings: Cannot find a free VT: "
|
||||
+ "%s\n", strerror(errno));
|
||||
+ if (xf86Info.vtno == -1)
|
||||
+ FatalError("parse_vt_settings: Cannot find a free VT\n");
|
||||
+ }
|
||||
+ close(fd);
|
||||
+ }
|
||||
+
|
||||
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
|
||||
|
||||
- if (!KeepTty && current_vt == xf86Info.vtno) {
|
||||
- xf86Msg(X_PROBED,
|
||||
- "controlling tty is VT number %d, auto-enabling KeepTty\n",
|
||||
- current_vt);
|
||||
- KeepTty = TRUE;
|
||||
+ /* Some of stdin / stdout / stderr maybe redirected to a file */
|
||||
+ for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) {
|
||||
+ ret = fstat(i, &st);
|
||||
+ if (ret == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) {
|
||||
+ current_vt = minor(st.st_rdev);
|
||||
+ break;
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ if (!KeepTty && current_vt == xf86Info.vtno) {
|
||||
+ xf86Msg(X_PROBED,
|
||||
+ "controlling tty is VT number %d, auto-enabling KeepTty\n",
|
||||
+ current_vt);
|
||||
+ KeepTty = TRUE;
|
||||
+ }
|
||||
+
|
||||
+ vt_settings_parsed = 1;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+linux_get_keeptty(void)
|
||||
+{
|
||||
+ return KeepTty;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+xf86OpenConsole(void)
|
||||
+{
|
||||
+ int i, ret;
|
||||
+ struct vt_stat vts;
|
||||
+ struct vt_mode VT;
|
||||
+ const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
|
||||
+
|
||||
+ if (serverGeneration == 1) {
|
||||
+ linux_parse_vt_settings();
|
||||
|
||||
if (!KeepTty) {
|
||||
pid_t ppid = getppid();
|
||||
--
|
||||
2.4.0
|
||||
|
@ -1,134 +0,0 @@
|
||||
From 7504fbd2239257f1a00a1a15d02862eea81f167c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Tue, 5 May 2015 14:48:41 +1000
|
||||
Subject: [PATCH] dix: hook up the unaccelerated valuator masks
|
||||
|
||||
If present, access the unaccelerated valuator mask values for DGA and XI2 raw
|
||||
events.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
dix/getevents.c | 31 ++++++++++++++++++++++---------
|
||||
hw/xfree86/common/xf86Xinput.c | 4 ++++
|
||||
2 files changed, 26 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dix/getevents.c b/dix/getevents.c
|
||||
index 6fb12c5..64bf76e 100644
|
||||
--- a/dix/getevents.c
|
||||
+++ b/dix/getevents.c
|
||||
@@ -213,14 +213,25 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
|
||||
}
|
||||
|
||||
static void
|
||||
-set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, double *data)
|
||||
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask,
|
||||
+ BOOL use_unaccel, double *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
+ use_unaccel = use_unaccel && valuator_mask_has_unaccelerated(mask);
|
||||
+
|
||||
for (i = 0; i < valuator_mask_size(mask); i++) {
|
||||
if (valuator_mask_isset(mask, i)) {
|
||||
+ double v;
|
||||
+
|
||||
SetBit(event->valuators.mask, i);
|
||||
- data[i] = valuator_mask_get_double(mask, i);
|
||||
+
|
||||
+ if (use_unaccel)
|
||||
+ v = valuator_mask_get_unaccelerated(mask, i);
|
||||
+ else
|
||||
+ v = valuator_mask_get_double(mask, i);
|
||||
+
|
||||
+ data[i] = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1138,11 +1149,11 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
|
||||
valuator_mask_copy(&mask, mask_in);
|
||||
|
||||
init_raw(pDev, raw, ms, type, key_code);
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
|
||||
+ set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
|
||||
|
||||
clipValuators(pDev, &mask);
|
||||
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data);
|
||||
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
|
||||
|
||||
event = &events->device_event;
|
||||
init_device_event(event, pDev, ms);
|
||||
@@ -1423,9 +1434,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
|
||||
num_events++;
|
||||
|
||||
init_raw(pDev, raw, ms, type, buttons);
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
|
||||
+ set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
|
||||
}
|
||||
|
||||
+ valuator_mask_drop_unaccelerated(&mask);
|
||||
+
|
||||
/* valuators are in driver-native format (rel or abs) */
|
||||
|
||||
if (flags & POINTER_ABSOLUTE) {
|
||||
@@ -1438,7 +1451,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
|
||||
transformAbsolute(pDev, &mask);
|
||||
clipAbsolute(pDev, &mask);
|
||||
if ((flags & POINTER_NORAW) == 0 && raw)
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data);
|
||||
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
|
||||
}
|
||||
else {
|
||||
transformRelative(pDev, &mask);
|
||||
@@ -1446,7 +1459,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
|
||||
if (flags & POINTER_ACCELERATE)
|
||||
accelPointer(pDev, &mask, ms);
|
||||
if ((flags & POINTER_NORAW) == 0 && raw)
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data);
|
||||
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
|
||||
|
||||
moveRelative(pDev, flags, &mask);
|
||||
}
|
||||
@@ -1951,7 +1964,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
|
||||
events++;
|
||||
num_events++;
|
||||
init_raw(dev, raw, ms, type, client_id);
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
|
||||
+ set_raw_valuators(raw, &mask, TRUE, raw->valuators.data_raw);
|
||||
}
|
||||
|
||||
event = &events->device_event;
|
||||
@@ -2013,7 +2026,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
|
||||
screeny = dev->spriteInfo->sprite->hotPhys.y;
|
||||
}
|
||||
if (need_rawevent)
|
||||
- set_raw_valuators(raw, &mask, raw->valuators.data);
|
||||
+ set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
|
||||
|
||||
/* Indirect device touch coordinates are not used for cursor positioning.
|
||||
* They are merely informational, and are provided in device coordinates.
|
||||
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
|
||||
index 1fb5b16..5ce4c71 100644
|
||||
--- a/hw/xfree86/common/xf86Xinput.c
|
||||
+++ b/hw/xfree86/common/xf86Xinput.c
|
||||
@@ -1137,12 +1137,16 @@ xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
|
||||
dx = valuator_mask_get(mask, 0);
|
||||
if (is_absolute)
|
||||
dx -= device->last.valuators[0];
|
||||
+ else if (valuator_mask_has_unaccelerated(mask))
|
||||
+ dx = valuator_mask_get_unaccelerated(mask, 0);
|
||||
}
|
||||
|
||||
if (valuator_mask_isset(mask, 1)) {
|
||||
dy = valuator_mask_get(mask, 1);
|
||||
if (is_absolute)
|
||||
dy -= device->last.valuators[1];
|
||||
+ else if (valuator_mask_has_unaccelerated(mask))
|
||||
+ dy = valuator_mask_get_unaccelerated(mask, 1);
|
||||
}
|
||||
|
||||
if (DGAStealMotionEvent(device, idx, dx, dy))
|
||||
--
|
||||
2.4.1
|
||||
|
@ -1,121 +0,0 @@
|
||||
From 4237375e8c159ce95ec77868f74edacc896f8714 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 13 May 2015 13:17:09 +0200
|
||||
Subject: [PATCH v2 2/3] linux: Add a may_fail paramter to
|
||||
linux_parse_vt_settings
|
||||
|
||||
linux_parse_vt_settings() was split out of xf86OpenConsole so that it can
|
||||
be called earlier during systemd-logind init, but it is possible to run
|
||||
the xserver in such a way that xf86OpenConsole() is never used.
|
||||
|
||||
The FatalError calls in linux_parse_vt_settings() may stop the Xorg xserver
|
||||
from working when e.g. no /dev/tty0 is present in such a setup.
|
||||
|
||||
This commit adds a may_fail parameter to linux_parse_vt_settings() which
|
||||
can be used to make linux_parse_vt_settings() fail silenty with an error
|
||||
return in this case, rather then calling FatalError().
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
hw/xfree86/os-support/linux/linux.h | 2 +-
|
||||
hw/xfree86/os-support/linux/lnx_init.c | 29 +++++++++++++++++++++--------
|
||||
2 files changed, 22 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/os-support/linux/linux.h b/hw/xfree86/os-support/linux/linux.h
|
||||
index 8cb8e3d..83506fd 100644
|
||||
--- a/hw/xfree86/os-support/linux/linux.h
|
||||
+++ b/hw/xfree86/os-support/linux/linux.h
|
||||
@@ -26,7 +26,7 @@
|
||||
#ifndef XF86_LINUX_H
|
||||
#define XF86_LINUX_H
|
||||
|
||||
-void linux_parse_vt_settings(void);
|
||||
+int linux_parse_vt_settings(int may_fail);
|
||||
int linux_get_keeptty(void);
|
||||
|
||||
#endif
|
||||
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
|
||||
index 22c61bf..12ddf91 100644
|
||||
--- a/hw/xfree86/os-support/linux/lnx_init.c
|
||||
+++ b/hw/xfree86/os-support/linux/lnx_init.c
|
||||
@@ -80,8 +80,8 @@ switch_to(int vt, const char *from)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
|
||||
-void
|
||||
-linux_parse_vt_settings(void)
|
||||
+int
|
||||
+linux_parse_vt_settings(int may_fail)
|
||||
{
|
||||
int i, fd = -1, ret, current_vt = -1;
|
||||
struct vt_stat vts;
|
||||
@@ -93,7 +93,7 @@ linux_parse_vt_settings(void)
|
||||
static int vt_settings_parsed = 0;
|
||||
|
||||
if (vt_settings_parsed)
|
||||
- return;
|
||||
+ return 1;
|
||||
|
||||
/*
|
||||
* setup the virtual terminal manager
|
||||
@@ -110,24 +110,36 @@ linux_parse_vt_settings(void)
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (fd < 0)
|
||||
+ if (fd < 0) {
|
||||
+ if (may_fail)
|
||||
+ return 0;
|
||||
FatalError("parse_vt_settings: Cannot open /dev/tty0 (%s)\n",
|
||||
strerror(errno));
|
||||
+ }
|
||||
|
||||
if (xf86Info.ShareVTs) {
|
||||
SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
|
||||
- if (ret < 0)
|
||||
+ if (ret < 0) {
|
||||
+ if (may_fail)
|
||||
+ return 0;
|
||||
FatalError("parse_vt_settings: Cannot find the current"
|
||||
" VT (%s)\n", strerror(errno));
|
||||
+ }
|
||||
xf86Info.vtno = vts.v_active;
|
||||
}
|
||||
else {
|
||||
SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
|
||||
- if (ret < 0)
|
||||
+ if (ret < 0) {
|
||||
+ if (may_fail)
|
||||
+ return 0;
|
||||
FatalError("parse_vt_settings: Cannot find a free VT: "
|
||||
"%s\n", strerror(errno));
|
||||
- if (xf86Info.vtno == -1)
|
||||
+ }
|
||||
+ if (xf86Info.vtno == -1) {
|
||||
+ if (may_fail)
|
||||
+ return 0;
|
||||
FatalError("parse_vt_settings: Cannot find a free VT\n");
|
||||
+ }
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
@@ -151,6 +163,7 @@ linux_parse_vt_settings(void)
|
||||
}
|
||||
|
||||
vt_settings_parsed = 1;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -168,7 +181,7 @@ xf86OpenConsole(void)
|
||||
const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
|
||||
|
||||
if (serverGeneration == 1) {
|
||||
- linux_parse_vt_settings();
|
||||
+ linux_parse_vt_settings(FALSE);
|
||||
|
||||
if (!KeepTty) {
|
||||
pid_t ppid = getppid();
|
||||
--
|
||||
2.4.0
|
||||
|
@ -1,78 +0,0 @@
|
||||
From 816c85d0e8fc517db3382bce4a94bc5d859b3eca Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Wed, 21 Jan 2015 10:13:20 +0100
|
||||
Subject: [PATCH v2 3/3] systemd-logind: Only use systemd-logind integration
|
||||
together with keeptty
|
||||
|
||||
systemd-logind integration does not work when starting X on a new tty, as
|
||||
that detaches X from the current session and after hat systemd-logind revokes
|
||||
all rights any already open fds and refuses to open new fds for X.
|
||||
|
||||
This means that currently e.g. "startx -- vt7" breaks, and breaks badly,
|
||||
requiring ssh access to the system to kill X.
|
||||
|
||||
The fix for this is easy, we must not use systemd-logind integration when
|
||||
not using KeepTty, or iow we may only use systemd-logind integration together
|
||||
with KeepTty.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
Changes in v2:
|
||||
-Document that -keeptty must be passed for logind integration in man page
|
||||
-Print an INFO message when disabling logind integration due to -keeptty
|
||||
not being set
|
||||
Changes in v3:
|
||||
-Fix typo in manpage additions
|
||||
-Use new may_fail parameter to linux_parse_vt_settings
|
||||
---
|
||||
hw/xfree86/man/Xorg.man | 6 +++---
|
||||
hw/xfree86/os-support/linux/systemd-logind.c | 8 ++++++++
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
|
||||
index 3ff6aef..ddf1358 100644
|
||||
--- a/hw/xfree86/man/Xorg.man
|
||||
+++ b/hw/xfree86/man/Xorg.man
|
||||
@@ -271,9 +271,9 @@ is ignored if
|
||||
is anything other than \(oqPCI\(cq.
|
||||
.TP 8
|
||||
.B \-keeptty
|
||||
-Prevent the server from detaching its initial controlling terminal.
|
||||
-This option is only useful when debugging the server. Not all platforms
|
||||
-support (or can use) this option.
|
||||
+Prevent the server from detaching its initial controlling terminal. If you
|
||||
+want to use systemd-logind integration you must specify this option.
|
||||
+Not all platforms support (or can use) this option.
|
||||
.TP 8
|
||||
.BI \-keyboard " keyboard-name"
|
||||
Use the xorg.conf(__filemansuffix__) file
|
||||
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
|
||||
index 4ad41a3..69e2f67 100644
|
||||
--- a/hw/xfree86/os-support/linux/systemd-logind.c
|
||||
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "os.h"
|
||||
#include "dbus-core.h"
|
||||
+#include "linux.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86platformBus.h"
|
||||
#include "xf86Xinput.h"
|
||||
@@ -596,6 +597,13 @@ static struct dbus_core_hook core_hook = {
|
||||
int
|
||||
systemd_logind_init(void)
|
||||
{
|
||||
+ if (linux_parse_vt_settings(TRUE) && !linux_get_keeptty()) {
|
||||
+ LogMessage(X_INFO,
|
||||
+ "systemd-logind: logind integration requires -keeptty and "
|
||||
+ "-keeptty was not provided, disabling logind integration\n");
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
return dbus_core_add_hook(&core_hook);
|
||||
}
|
||||
|
||||
--
|
||||
2.4.0
|
||||
|
2
commitid
2
commitid
@ -1 +1 @@
|
||||
4c3932620c29c91dfbbc8eb09c84efcaa7ec873e
|
||||
a8a0f6464a33c12c1de495d74fd478c0d952643e
|
||||
|
@ -31,7 +31,7 @@ driverlist=$(grep ^Requires *.spec | awk '{ print $2 }')
|
||||
popd
|
||||
|
||||
# Things not in -drivers for whatever reason...
|
||||
extradrivers="xorg-x11-glamor xorg-x11-drv-ivtv"
|
||||
extradrivers="xorg-x11-drv-ivtv"
|
||||
|
||||
rm -rf xorg-x11-drivers
|
||||
echo $driverlist $extradrivers | xargs -n1 $pkg co $branch
|
||||
@ -46,10 +46,6 @@ for i in xorg-x11-drv-*/ ; do
|
||||
#mockchain -r fedora-20-x86_64 -l $OLDPWD
|
||||
#mockchain -r rhel-7.0-candidate-x86_64 -l $OLDPWD
|
||||
|
||||
if [ $i = "xorg-x11-glamor" ]; then
|
||||
koji wait-repo f21-build --build $($pkg verrel)
|
||||
fi
|
||||
|
||||
popd
|
||||
done
|
||||
|
||||
|
1
sources
1
sources
@ -1 +1,2 @@
|
||||
397e405566651150490ff493e463f1ad xorg-server-1.17.2.tar.bz2
|
||||
00230d3aae5d5096dd82b0e4e087dbce xorg-server-20150728.tar.xz
|
||||
|
@ -11,7 +11,7 @@
|
||||
# X.org requires lazy relocations to work.
|
||||
%undefine _hardened_build
|
||||
|
||||
#global gitdate 20140428
|
||||
%global gitdate 20150728
|
||||
%global stable_abi 1
|
||||
|
||||
%if !0%{?gitdate} || %{stable_abi}
|
||||
@ -19,9 +19,9 @@
|
||||
# source because rpm is a terrible language.
|
||||
%global ansic_major 0
|
||||
%global ansic_minor 4
|
||||
%global videodrv_major 19
|
||||
%global videodrv_major 20
|
||||
%global videodrv_minor 0
|
||||
%global xinput_major 21
|
||||
%global xinput_major 22
|
||||
%global xinput_minor 1
|
||||
%global extension_major 9
|
||||
%global extension_minor 0
|
||||
@ -44,8 +44,8 @@
|
||||
|
||||
Summary: X.Org X11 X server
|
||||
Name: xorg-x11-server
|
||||
Version: 1.17.2
|
||||
Release: 2%{?gitdate:.%{gitdate}}%{dist}
|
||||
Version: 1.18.0
|
||||
Release: 0.1%{?gitdate:.%{gitdate}}%{dist}
|
||||
URL: http://www.x.org
|
||||
License: MIT
|
||||
Group: User Interface/X
|
||||
@ -77,12 +77,11 @@ Source31: xserver-sdk-abi-requires.git
|
||||
# maintainer convenience script
|
||||
Source40: driver-abi-rebuild.sh
|
||||
|
||||
Patch4000: 0001-fix-Xdmx-link-harder.patch
|
||||
# Trivial things to never merge upstream ever:
|
||||
# This really could be done prettier.
|
||||
Patch5002: xserver-1.4.99-ssh-isnt-local.patch
|
||||
|
||||
# ajax needs to upstream this
|
||||
Patch6030: xserver-1.6.99-right-of.patch
|
||||
#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch
|
||||
|
||||
Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
|
||||
@ -96,19 +95,6 @@ Patch9100: exa-only-draw-valid-trapezoids.patch
|
||||
# because the display-managers are not ready yet, do not upstream
|
||||
Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
||||
|
||||
# rhbz1203780, submitted upstream
|
||||
Patch10004: 0001-linux-Add-linux_parse_vt_settings-and-linux_get_keep.patch
|
||||
Patch10005: 0002-linux-Add-a-may_fail-paramter-to-linux_parse_vt_sett.patch
|
||||
Patch10006: 0003-systemd-logind-Only-use-systemd-logind-integration-t.patch
|
||||
|
||||
# rhbz1208992: Mouse cursor doesn't move when moving the physical mouse
|
||||
# slowly.
|
||||
# already upstream
|
||||
Patch10010: 0001-dix-Add-unaccelerated-valuators-to-the-ValuatorMask.patch
|
||||
Patch10011: 0002-dix-hook-up-the-unaccelerated-valuator-masks.patch
|
||||
|
||||
Patch10020: 0001-glamor-make-current-in-prepare-paths.patch
|
||||
|
||||
%global moduledir %{_libdir}/xorg/modules
|
||||
%global drimoduledir %{_libdir}/dri
|
||||
%global sdkdir %{_includedir}/xorg
|
||||
@ -589,7 +575,6 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
|
||||
%{_mandir}/man5/xorg.conf.d.5*
|
||||
%dir %{_sysconfdir}/X11/xorg.conf.d
|
||||
%dir %{_datadir}/X11/xorg.conf.d
|
||||
%{_datadir}/X11/xorg.conf.d/10-evdev.conf
|
||||
%{_datadir}/X11/xorg.conf.d/10-quirks.conf
|
||||
%endif
|
||||
|
||||
@ -646,6 +631,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 29 2015 Dave Airlie <airlied@redhat.com> 1.18.0-0.1
|
||||
- git snapshot of what will be 1.18.0 (should be ABI stable)
|
||||
|
||||
* Wed Jul 15 2015 Dave Airlie <airlied@redhat.com> 1.17.2-2
|
||||
- fix bug with glamor and PRIME where server would crash
|
||||
|
||||
|
@ -1,162 +0,0 @@
|
||||
From 291bc9f827188461ff9717efccec1e350db537e8 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Jackson <ajax@redhat.com>
|
||||
Date: Tue, 28 Jul 2009 11:07:13 -0400
|
||||
Subject: [PATCH 3/7] RANDR: right-of placement by default
|
||||
|
||||
[Enhanced to add a new prefer clone option for drivers. This
|
||||
allows for servers like RN50 where two heads are disjoint. - airlied]
|
||||
---
|
||||
hw/xfree86/common/xf86str.h | 8 ++++-
|
||||
hw/xfree86/modes/xf86Crtc.c | 76 ++++++++++++++++++++++++++++++++++++++-----
|
||||
2 files changed, 75 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
|
||||
index 0590262..d246634 100644
|
||||
--- a/hw/xfree86/common/xf86str.h
|
||||
+++ b/hw/xfree86/common/xf86str.h
|
||||
@@ -508,10 +508,13 @@ typedef struct _confdrirec {
|
||||
} confDRIRec, *confDRIPtr;
|
||||
|
||||
/* These values should be adjusted when new fields are added to ScrnInfoRec */
|
||||
-#define NUM_RESERVED_INTS 16
|
||||
+#define NUM_RESERVED_INTS 15
|
||||
#define NUM_RESERVED_POINTERS 14
|
||||
#define NUM_RESERVED_FUNCS 10
|
||||
|
||||
+/* let clients know they can use this */
|
||||
+#define XF86_SCRN_HAS_PREFER_CLONE 1
|
||||
+
|
||||
typedef void *(*funcPointer) (void);
|
||||
|
||||
/* flags for depth 24 pixmap options */
|
||||
@@ -769,6 +772,9 @@ typedef struct _ScrnInfoRec {
|
||||
ClockRangePtr clockRanges;
|
||||
int adjustFlags;
|
||||
|
||||
+ /* initial rightof support disable */
|
||||
+ int preferClone;
|
||||
+
|
||||
/*
|
||||
* These can be used when the minor ABI version is incremented.
|
||||
* The NUM_* parameters must be reduced appropriately to keep the
|
||||
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
|
||||
index 154f684..c58088d 100644
|
||||
--- a/hw/xfree86/modes/xf86Crtc.c
|
||||
+++ b/hw/xfree86/modes/xf86Crtc.c
|
||||
@@ -1130,6 +1130,15 @@ xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes)
|
||||
int o;
|
||||
int min_x, min_y;
|
||||
|
||||
+ /* check for initial right-of heuristic */
|
||||
+ for (o = 0; o < config->num_output; o++)
|
||||
+ {
|
||||
+ xf86OutputPtr output = config->output[o];
|
||||
+
|
||||
+ if (output->initial_x || output->initial_y)
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
for (o = 0; o < config->num_output; o++) {
|
||||
xf86OutputPtr output = config->output[o];
|
||||
|
||||
@@ -1998,6 +2007,57 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
|
||||
return match;
|
||||
}
|
||||
|
||||
+static int
|
||||
+numEnabledOutputs(xf86CrtcConfigPtr config, Bool *enabled)
|
||||
+{
|
||||
+ int i = 0, p;
|
||||
+
|
||||
+ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
|
||||
+
|
||||
+ return i;
|
||||
+}
|
||||
+
|
||||
+static Bool
|
||||
+xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
|
||||
+ DisplayModePtr *modes, Bool *enabled,
|
||||
+ int width, int height)
|
||||
+{
|
||||
+ int o;
|
||||
+ int w = 0;
|
||||
+
|
||||
+ if (scrn->preferClone)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (numEnabledOutputs(config, enabled) < 2)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
|
||||
+ DisplayModePtr mode =
|
||||
+ xf86OutputHasPreferredMode(config->output[o], width, height);
|
||||
+
|
||||
+ if (!mode)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ w += mode->HDisplay;
|
||||
+ }
|
||||
+
|
||||
+ if (w > width)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ w = 0;
|
||||
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
|
||||
+ DisplayModePtr mode =
|
||||
+ xf86OutputHasPreferredMode(config->output[o], width, height);
|
||||
+
|
||||
+ config->output[o]->initial_x = w;
|
||||
+ w += mode->HDisplay;
|
||||
+
|
||||
+ modes[o] = mode;
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static Bool
|
||||
xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
|
||||
DisplayModePtr * modes, Bool *enabled,
|
||||
@@ -2074,14 +2134,10 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
|
||||
*/
|
||||
if (!ret)
|
||||
do {
|
||||
- int i = 0;
|
||||
float aspect = 0.0;
|
||||
DisplayModePtr a = NULL, b = NULL;
|
||||
|
||||
- /* count the number of enabled outputs */
|
||||
- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++);
|
||||
-
|
||||
- if (i != 1)
|
||||
+ if (numEnabledOutputs(config, enabled) != 1)
|
||||
break;
|
||||
|
||||
p = -1;
|
||||
@@ -2385,6 +2441,8 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
|
||||
else {
|
||||
if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
|
||||
xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
|
||||
+ else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height))
|
||||
+ xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n");
|
||||
else if (xf86TargetPreferred
|
||||
(scrn, config, modes, enabled, width, height))
|
||||
xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
|
||||
@@ -2404,9 +2462,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
|
||||
"Output %s enabled but has no modes\n",
|
||||
config->output[o]->name);
|
||||
else
|
||||
- xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
||||
- "Output %s using initial mode %s\n",
|
||||
- config->output[o]->name, modes[o]->name);
|
||||
+ xf86DrvMsg (scrn->scrnIndex, X_INFO,
|
||||
+ "Output %s using initial mode %s +%d+%d\n",
|
||||
+ config->output[o]->name, modes[o]->name,
|
||||
+ config->output[o]->initial_x,
|
||||
+ config->output[o]->initial_y);
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.7.10.4
|
||||
|
Loading…
Reference in New Issue
Block a user