Accepting request 449319 from X11:XOrg

rebase-post-manual-systemd-fix-merged-in-TW

OBS-URL: https://build.opensuse.org/request/show/449319
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xorg-x11-server?expand=0&rev=336
This commit is contained in:
Dominique Leuenberger 2017-01-12 14:44:40 +00:00 committed by Git OBS Bridge
commit c7ef9d8a1f
16 changed files with 59 additions and 1581 deletions

View File

@ -1,123 +0,0 @@
From daa6d2d58f65b9301b1b1f3c6df07719ecb5c03d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 12 Feb 2016 14:18:02 -0200
Subject: [PATCH 56/56] config/udev: distinguish between real keyboards and
other key devices
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch introduces a new flag ATTR_KEY for hotplugged input devices,
so we can better distinguish between real keyboards (i.e. devices with
udev property ID_INPUT_KEYBOARD="1") and other key input devices like
lid switches, power buttons, etc.
All supported hotplug backends (udev, hal, and wscons) will set both
flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend
will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input
devices (hal and wscons will set both flags in any case). With this
distinction, kdrive input hotplugging mechanism will be allowed to only
grab real keyboards, as other key input devices are currently not
supported.
In order to don't break current behaviour, this patch will replace all
ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c.
[ajax: Just add ATTR_KEY, don't re-number the other attributes]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
config/hal.c | 2 +-
config/udev.c | 4 ++++
config/wscons.c | 2 +-
hw/kdrive/src/kinput.c | 4 +++-
hw/xfree86/common/xf86Xinput.c | 2 +-
include/input.h | 1 +
6 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/config/hal.c b/config/hal.c
index ea574ca..c76eced 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -170,7 +170,7 @@ device_added(LibHalContext * hal_ctx, const char *udi)
free(hal_tags);
if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL))
- attrs.flags |= ATTR_KEYBOARD;
+ attrs.flags |= ATTR_KEY | ATTR_KEYBOARD;
if (libhal_device_query_capability(hal_ctx, udi, "input.mouse", NULL))
attrs.flags |= ATTR_POINTER;
if (libhal_device_query_capability(hal_ctx, udi, "input.joystick", NULL))
diff --git a/config/udev.c b/config/udev.c
index 08a954b..1a6e82a 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -240,6 +240,10 @@ device_added(struct udev_device *udev_device)
}
else if (!strcmp(key, "ID_INPUT_KEY")) {
LOG_PROPERTY(path, key, value);
+ attrs.flags |= ATTR_KEY;
+ }
+ else if (!strcmp(key, "ID_INPUT_KEYBOARD")) {
+ LOG_PROPERTY(path, key, value);
attrs.flags |= ATTR_KEYBOARD;
}
else if (!strcmp(key, "ID_INPUT_MOUSE")) {
diff --git a/config/wscons.c b/config/wscons.c
index fb114bd..ee45675 100644
--- a/config/wscons.c
+++ b/config/wscons.c
@@ -163,7 +163,7 @@ wscons_add_keyboard(void)
}
kbd_config_done:
- attrs.flags |= ATTR_KEYBOARD;
+ attrs.flags |= ATTR_KEY | ATTR_KEYBOARD;
rc = NewInputDeviceRequest(input_options, &attrs, &dev);
if (rc != Success)
goto unwind;
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 836db79..ae19a9d 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2343,7 +2343,9 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
*pdev = ki->dixdev;
}
else {
- ErrorF("unrecognised device identifier!\n");
+ ErrorF("unrecognised device identifier: %s\n",
+ input_option_get_value(input_option_find(optionsdup,
+ "device")));
input_option_free_list(&optionsdup);
return BadValue;
}
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index a9ce62a..4f2e6c8 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -635,7 +635,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
/* MatchIs* booleans */
if (iclass->is_keyboard.set &&
- iclass->is_keyboard.val != ! !(attrs->flags & ATTR_KEYBOARD))
+ iclass->is_keyboard.val != ! !(attrs->flags & ATTR_KEY))
return FALSE;
if (iclass->is_pointer.set &&
iclass->is_pointer.val != ! !(attrs->flags & ATTR_POINTER))
diff --git a/include/input.h b/include/input.h
index d8bd9c6..9662123 100644
--- a/include/input.h
+++ b/include/input.h
@@ -236,6 +236,7 @@ typedef struct _InputAttributes {
#define ATTR_TABLET (1<<3)
#define ATTR_TOUCHPAD (1<<4)
#define ATTR_TOUCHSCREEN (1<<5)
+#define ATTR_KEY (1<<6)
/* Key/Button has been run through all input processing and events sent to clients. */
#define KEY_PROCESSED 1
--
2.6.2

View File

@ -1,75 +0,0 @@
From da69f2f15a9917c3ed04e305061683c41338126e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 11 Dec 2015 11:43:14 -0200
Subject: [PATCH 04/56] ephyr: don't load ephyr input driver if -seat option is
passed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When used for single-GPU multi-seat purposes, there's no need to enable
ephyr virtual input devices, since Xephyr is supposed to handle its own
hardware devices.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/ephyr/ephyrinit.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 9ddf86e..849a4e1 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -91,29 +91,30 @@ InitInput(int argc, char **argv)
KdKeyboardInfo *ki;
KdPointerInfo *pi;
- KdAddKeyboardDriver(&EphyrKeyboardDriver);
#ifdef KDRIVE_EVDEV
KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver);
-#endif
- KdAddPointerDriver(&EphyrMouseDriver);
-#ifdef KDRIVE_EVDEV
KdAddPointerDriver(&LinuxEvdevMouseDriver);
#endif
- if (!kdHasKbd) {
- ki = KdNewKeyboard();
- if (!ki)
- FatalError("Couldn't create Xephyr keyboard\n");
- ki->driver = &EphyrKeyboardDriver;
- KdAddKeyboard(ki);
- }
+ if (!SeatId) {
+ KdAddKeyboardDriver(&EphyrKeyboardDriver);
+ KdAddPointerDriver(&EphyrMouseDriver);
- if (!kdHasPointer) {
- pi = KdNewPointer();
- if (!pi)
- FatalError("Couldn't create Xephyr pointer\n");
- pi->driver = &EphyrMouseDriver;
- KdAddPointer(pi);
+ if (!kdHasKbd) {
+ ki = KdNewKeyboard();
+ if (!ki)
+ FatalError("Couldn't create Xephyr keyboard\n");
+ ki->driver = &EphyrKeyboardDriver;
+ KdAddKeyboard(ki);
+ }
+
+ if (!kdHasPointer) {
+ pi = KdNewPointer();
+ if (!pi)
+ FatalError("Couldn't create Xephyr pointer\n");
+ pi->driver = &EphyrMouseDriver;
+ KdAddPointer(pi);
+ }
}
KdInitInput();
--
2.6.2

View File

@ -1,37 +0,0 @@
From 851ff9ec04b73412c7dbad7b4911a1feac21f354 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 12 Feb 2016 14:18:01 -0200
Subject: [PATCH 55/56] ephyr: enable option -sw-cursor by default in
multi-seat mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Option -seat passed to Xephyr requires -sw-cursor to be passed as well,
otherwise the mouse cursor will remain invisible for the given seat.
This patch takes care of enabling -sw-cursor if -seat is passed.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/ephyr/ephyrinit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 849a4e1..149ea98 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -373,6 +373,9 @@ OsVendorInit(void)
{
EPHYR_DBG("mark");
+ if (SeatId)
+ hostx_use_sw_cursor();
+
if (hostx_want_host_cursor())
ephyrFuncs.initCursor = &ephyrCursorInit;
--
2.6.2

View File

@ -1,43 +0,0 @@
From 7213e99cbc38a60f0076bc2115b144798ea4c3ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 11 Dec 2015 11:43:13 -0200
Subject: [PATCH 03/56] ephyr: ignore Xorg multiseat command line options
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Multi-seat-capable display managers commonly pass command-line options
like "-novtswitch", "-sharevts", or "-layout seatXXXX" to Xorg server,
but Xephyr currently refuses to start if these options are passed to it,
which may break Xephyr-based single-GPU multiseat setups.
[ajax: shortened summary]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/ephyr/ephyrinit.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 6b6c4b1..9ddf86e 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -356,6 +356,13 @@ ddxProcessArgument(int argc, char **argv, int i)
EphyrWantNoHostGrab = 1;
return 1;
}
+ else if (!strcmp(argv[i], "-sharevts") ||
+ !strcmp(argv[i], "-novtswitch")) {
+ return 1;
+ }
+ else if (!strcmp(argv[i], "-layout")) {
+ return 2;
+ }
return KdProcessArgument(argc, argv, i);
}
--
2.6.2

View File

@ -1,413 +0,0 @@
From: Eric Anholt <eric@anholt.net>
Date: Fri Nov 6 12:27:42 2015 -0800
Subject: [PATCH]glamor: Remove the FBO cache.
Patch-mainline: Upstream
Git-repo: git://anongit.freedesktop.org/xorg/xserver
Git-commit: 950ffb8d6fd1480f305e38c571bda44f247f1de2
References: bsc#983743
Signed-off-by: Max Staudt <mstaudt@suse.de>
It is a modest performance improvement (2.7% on Intel), with the
significant downside that it keeps extra pixmap contents laying around
for 1000 BlockHandlers without the ability for the system to purge
them when under memory pressure, and tiled renderers don't know that
we could avoid reading their current contents when beginning to render
again. We could use the FB invalidate functions, but they aren't
always available, aren't hooked up well in Mesa, and would eat into
the performance gains of having the cache.
[ajax: rebased to master]
Reviewed-by: Adam Jackson <ajax@redhat.com>
---
glamor/glamor.c | 5 --
glamor/glamor_fbo.c | 237 ++-------------------------------------------------
glamor/glamor_priv.h | 27 ------
3 files changed, 6 insertions(+), 263 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 9c6a0d1..93c94b9 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -110,7 +110,6 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
ErrorF("XXX fail to create fbo.\n");
return;
}
- fbo->external = TRUE;
glamor_pixmap_attach_fbo(pixmap, fbo);
}
@@ -226,9 +225,7 @@ glamor_block_handler(ScreenPtr screen)
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_make_current(glamor_priv);
- glamor_priv->tick++;
glFlush();
- glamor_fbo_expire(glamor_priv);
}
static void
@@ -675,7 +672,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
ps->Glyphs = glamor_composite_glyphs;
glamor_init_vbo(screen);
- glamor_init_pixmap_fbo(screen);
glamor_init_finish_access_shaders(screen);
#ifdef GLAMOR_GRADIENT_SHADER
@@ -701,7 +697,6 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_priv = glamor_get_screen_private(screen);
glamor_fini_vbo(screen);
- glamor_fini_pixmap_fbo(screen);
glamor_pixmap_fini(screen);
free(glamor_priv);
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index c6ba095..58f7dc4 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -30,107 +30,9 @@
#include "glamor_priv.h"
-#define GLAMOR_CACHE_EXPIRE_MAX 100
-
-#define GLAMOR_CACHE_DEFAULT 0
-#define GLAMOR_CACHE_EXACT_SIZE 1
-
-//#define NO_FBO_CACHE 1
-#define FBO_CACHE_THRESHOLD (256*1024*1024)
-
-/* Loop from the tail to the head. */
-#define xorg_list_for_each_entry_reverse(pos, head, member) \
- for (pos = __container_of((head)->prev, pos, member); \
- &pos->member != (head); \
- pos = __container_of(pos->member.prev, pos, member))
-
-#define xorg_list_for_each_entry_safe_reverse(pos, tmp, head, member) \
- for (pos = __container_of((head)->prev, pos, member), \
- tmp = __container_of(pos->member.prev, pos, member); \
- &pos->member != (head); \
- pos = tmp, tmp = __container_of(pos->member.prev, tmp, member))
-
-inline static int
-cache_wbucket(int size)
-{
- int order = __fls(size / 32);
-
- if (order >= CACHE_BUCKET_WCOUNT)
- order = CACHE_BUCKET_WCOUNT - 1;
- return order;
-}
-
-inline static int
-cache_hbucket(int size)
-{
- int order = __fls(size / 32);
-
- if (order >= CACHE_BUCKET_HCOUNT)
- order = CACHE_BUCKET_HCOUNT - 1;
- return order;
-}
-
-static int
-cache_format(GLenum format)
-{
- switch (format) {
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_RED:
- return 2;
- case GL_RGB:
- return 1;
- case GL_RGBA:
- return 0;
- default:
- return -1;
- }
-}
-
-static glamor_pixmap_fbo *
-glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
- int w, int h, GLenum format)
-{
- struct xorg_list *cache;
- glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
- int n_format;
-
-#ifdef NO_FBO_CACHE
- return NULL;
-#else
- n_format = cache_format(format);
- if (n_format == -1)
- return NULL;
- cache = &glamor_priv->fbo_cache[n_format]
- [cache_wbucket(w)]
- [cache_hbucket(h)];
-
- xorg_list_for_each_entry(fbo_entry, cache, list) {
- if (fbo_entry->width == w && fbo_entry->height == h) {
-
- DEBUGF("Request w %d h %d format %x \n", w, h, format);
- DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n",
- fbo_entry, fbo_entry->width, fbo_entry->height,
- fbo_entry->fb, fbo_entry->tex, fbo_entry->format);
- assert(format == fbo_entry->format);
- xorg_list_del(&fbo_entry->list);
- ret_fbo = fbo_entry;
- break;
- }
- }
-
- if (ret_fbo)
- glamor_priv->fbo_cache_watermark -= ret_fbo->width * ret_fbo->height;
-
- assert(glamor_priv->fbo_cache_watermark >= 0);
-
- return ret_fbo;
-#endif
-}
-
-static void
-glamor_purge_fbo(glamor_screen_private *glamor_priv,
- glamor_pixmap_fbo *fbo)
+void
+glamor_destroy_fbo(glamor_screen_private *glamor_priv,
+ glamor_pixmap_fbo *fbo)
{
glamor_make_current(glamor_priv);
@@ -142,40 +44,6 @@ glamor_purge_fbo(glamor_screen_private *glamor_priv,
free(fbo);
}
-static void
-glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv,
- glamor_pixmap_fbo *fbo)
-{
- struct xorg_list *cache;
- int n_format;
-
-#ifdef NO_FBO_CACHE
- glamor_purge_fbo(fbo);
- return;
-#else
- n_format = cache_format(fbo->format);
-
- if (fbo->fb == 0 || fbo->external || n_format == -1
- || glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
- glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX;
- glamor_fbo_expire(glamor_priv);
- glamor_purge_fbo(glamor_priv, fbo);
- return;
- }
-
- cache = &glamor_priv->fbo_cache[n_format]
- [cache_wbucket(fbo->width)]
- [cache_hbucket(fbo->height)];
- DEBUGF
- ("Put cache entry %p to cache %p w %d h %d format %x fbo %d tex %d \n",
- fbo, cache, fbo->width, fbo->height, fbo->format, fbo->fb, fbo->tex);
-
- glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
- xorg_list_add(&fbo->list, cache);
- fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
-#endif
-}
-
static int
glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv,
glamor_pixmap_fbo *fbo)
@@ -235,20 +103,14 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv,
if (fbo == NULL)
return NULL;
- xorg_list_init(&fbo->list);
-
fbo->tex = tex;
fbo->width = w;
fbo->height = h;
- fbo->external = FALSE;
fbo->format = format;
- if (flag == CREATE_PIXMAP_USAGE_SHARED)
- fbo->external = TRUE;
-
if (flag != GLAMOR_CREATE_FBO_NO_FBO) {
if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) {
- glamor_purge_fbo(glamor_priv, fbo);
+ glamor_destroy_fbo(glamor_priv, fbo);
fbo = NULL;
}
}
@@ -256,79 +118,6 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv,
return fbo;
}
-void
-glamor_fbo_expire(glamor_screen_private *glamor_priv)
-{
- struct xorg_list *cache;
- glamor_pixmap_fbo *fbo_entry, *tmp;
- int i, j, k;
-
- for (i = 0; i < CACHE_FORMAT_COUNT; i++)
- for (j = 0; j < CACHE_BUCKET_WCOUNT; j++)
- for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) {
- cache = &glamor_priv->fbo_cache[i][j][k];
- xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache,
- list) {
- if (GLAMOR_TICK_AFTER(fbo_entry->expire, glamor_priv->tick)) {
- break;
- }
-
- glamor_priv->fbo_cache_watermark -=
- fbo_entry->width * fbo_entry->height;
- xorg_list_del(&fbo_entry->list);
- DEBUGF("cache %p fbo %p expired %d current %d \n", cache,
- fbo_entry, fbo_entry->expire, glamor_priv->tick);
- glamor_purge_fbo(glamor_priv, fbo_entry);
- }
- }
-
-}
-
-void
-glamor_init_pixmap_fbo(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- int i, j, k;
-
- glamor_priv = glamor_get_screen_private(screen);
- for (i = 0; i < CACHE_FORMAT_COUNT; i++)
- for (j = 0; j < CACHE_BUCKET_WCOUNT; j++)
- for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) {
- xorg_list_init(&glamor_priv->fbo_cache[i][j][k]);
- }
- glamor_priv->fbo_cache_watermark = 0;
-}
-
-void
-glamor_fini_pixmap_fbo(ScreenPtr screen)
-{
- struct xorg_list *cache;
- glamor_screen_private *glamor_priv;
- glamor_pixmap_fbo *fbo_entry, *tmp;
- int i, j, k;
-
- glamor_priv = glamor_get_screen_private(screen);
- for (i = 0; i < CACHE_FORMAT_COUNT; i++)
- for (j = 0; j < CACHE_BUCKET_WCOUNT; j++)
- for (k = 0; k < CACHE_BUCKET_HCOUNT; k++) {
- cache = &glamor_priv->fbo_cache[i][j][k];
- xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache,
- list) {
- xorg_list_del(&fbo_entry->list);
- glamor_purge_fbo(glamor_priv, fbo_entry);
- }
- }
-}
-
-void
-glamor_destroy_fbo(glamor_screen_private *glamor_priv,
- glamor_pixmap_fbo *fbo)
-{
- xorg_list_del(&fbo->list);
- glamor_pixmap_fbo_cache_put(glamor_priv, fbo);
-
-}
-
static int
_glamor_create_tex(glamor_screen_private *glamor_priv,
int w, int h, GLenum format)
@@ -368,22 +157,8 @@ glamor_pixmap_fbo *
glamor_create_fbo(glamor_screen_private *glamor_priv,
int w, int h, GLenum format, int flag)
{
- glamor_pixmap_fbo *fbo;
- GLint tex = 0;
-
- if (flag == GLAMOR_CREATE_FBO_NO_FBO || flag == CREATE_PIXMAP_USAGE_SHARED)
- goto new_fbo;
-
- fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format);
- if (fbo)
- return fbo;
- new_fbo:
- tex = _glamor_create_tex(glamor_priv, w, h, format);
- if (!tex)
- return NULL;
- fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag);
-
- return fbo;
+ GLint tex = _glamor_create_tex(glamor_priv, w, h, format);
+ return glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag);
}
/**
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index a70f10e..78346bf 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -184,16 +184,7 @@ struct glamor_saved_procs {
ScreenBlockHandlerProcPtr block_handler;
};
-#define CACHE_FORMAT_COUNT 3
-
-#define CACHE_BUCKET_WCOUNT 4
-#define CACHE_BUCKET_HCOUNT 4
-
-#define GLAMOR_TICK_AFTER(t0, t1) \
- (((int)(t1) - (int)(t0)) < 0)
-
typedef struct glamor_screen_private {
- unsigned int tick;
enum glamor_gl_flavor gl_flavor;
int glsl_version;
Bool has_pack_invert;
@@ -213,10 +204,6 @@ typedef struct glamor_screen_private {
GLuint one_channel_format;
- struct xorg_list
- fbo_cache[CACHE_FORMAT_COUNT][CACHE_BUCKET_WCOUNT][CACHE_BUCKET_HCOUNT];
- unsigned long fbo_cache_watermark;
-
/* glamor point shader */
glamor_program point_prog;
@@ -330,21 +317,10 @@ enum glamor_fbo_state {
};
typedef struct glamor_pixmap_fbo {
- struct xorg_list list; /**< linked list pointers when in the fbo cache */
- /** glamor_priv->tick number when this FBO will be expired from the cache. */
- unsigned int expire;
GLuint tex; /**< GL texture name */
GLuint fb; /**< GL FBO name */
int width; /**< width in pixels */
int height; /**< height in pixels */
- /**
- * Flag for when texture contents might be shared with a
- * non-glamor user.
- *
- * This is used to avoid putting textures used by other clients
- * into the FBO cache.
- */
- Bool external;
GLenum format; /**< GL format used to create the texture. */
GLenum type; /**< GL type used to create the texture. */
} glamor_pixmap_fbo;
@@ -588,10 +564,7 @@ glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w,
void glamor_destroy_fbo(glamor_screen_private *glamor_priv,
glamor_pixmap_fbo *fbo);
void glamor_pixmap_destroy_fbo(PixmapPtr pixmap);
-void glamor_init_pixmap_fbo(ScreenPtr screen);
-void glamor_fini_pixmap_fbo(ScreenPtr screen);
Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap);
-void glamor_fbo_expire(glamor_screen_private *glamor_priv);
/* Return whether 'picture' is alpha-only */
static inline Bool glamor_picture_is_alpha(PicturePtr picture)

View File

@ -1,138 +0,0 @@
From 40e32e9fc9f3a1bd8287ee03dd399d8161cb98dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 12 Feb 2016 14:18:00 -0200
Subject: [PATCH 54/56] kdrive: add options to set default XKB properties
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch introduces convenient command-line options -xkb-rules,
-xkb-model, -xkb-layout, -xkb-variant, and -xkb-options, to set default
values for these properties.
These options can be handful for cases in which compile-time default
values don't match user locale, since kdrive doesn't support InputClass
matching rules yet and not all Linux distros provide default rules to
store these values in udev properties (which by the way is a discouraged
practice).
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/src/kdrive.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
hw/kdrive/src/kinput.c | 16 +++++++++++-----
2 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 269b609..52bea5a 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -89,6 +89,11 @@ char *kdSwitchCmd;
DDXPointRec kdOrigin;
Bool kdHasPointer = FALSE;
Bool kdHasKbd = FALSE;
+const char *kdGlobalXkbRules = NULL;
+const char *kdGlobalXkbModel = NULL;
+const char *kdGlobalXkbLayout = NULL;
+const char *kdGlobalXkbVariant = NULL;
+const char *kdGlobalXkbOptions = NULL;
static Bool kdCaughtSignal = FALSE;
@@ -455,6 +460,11 @@ KdUseMsg(void)
("-mouse driver [,n,,options] Specify the pointer driver and its options (n is the number of buttons)\n");
ErrorF
("-keybd driver [,,options] Specify the keyboard driver and its options\n");
+ ErrorF("-xkb-rules Set default XkbRules value (can be overriden by -keybd options)\n");
+ ErrorF("-xkb-model Set default XkbModel value (can be overriden by -keybd options)\n");
+ ErrorF("-xkb-layout Set default XkbLayout value (can be overriden by -keybd options)\n");
+ ErrorF("-xkb-variant Set default XkbVariant value (can be overriden by -keybd options)\n");
+ ErrorF("-xkb-options Set default XkbOptions value (can be overriden by -keybd options)\n");
ErrorF("-zaphod Disable cursor screen switching\n");
ErrorF("-2button Emulate 3 button mouse\n");
ErrorF("-3button Disable 3 button mouse emulation\n");
@@ -563,6 +573,46 @@ KdProcessArgument(int argc, char **argv, int i)
sscanf(argv[i], "vt%2d", &kdVirtualTerminal) == 1) {
return 1;
}
+ if (!strcmp(argv[i], "-xkb-rules")) {
+ if (i + 1 >= argc) {
+ UseMsg();
+ FatalError("Missing argument for option -xkb-rules.\n");
+ }
+ kdGlobalXkbRules = argv[i + 1];
+ return 2;
+ }
+ if (!strcmp(argv[i], "-xkb-model")) {
+ if (i + 1 >= argc) {
+ UseMsg();
+ FatalError("Missing argument for option -xkb-model.\n");
+ }
+ kdGlobalXkbModel = argv[i + 1];
+ return 2;
+ }
+ if (!strcmp(argv[i], "-xkb-layout")) {
+ if (i + 1 >= argc) {
+ UseMsg();
+ FatalError("Missing argument for option -xkb-layout.\n");
+ }
+ kdGlobalXkbLayout = argv[i + 1];
+ return 2;
+ }
+ if (!strcmp(argv[i], "-xkb-variant")) {
+ if (i + 1 >= argc) {
+ UseMsg();
+ FatalError("Missing argument for option -xkb-variant.\n");
+ }
+ kdGlobalXkbVariant = argv[i + 1];
+ return 2;
+ }
+ if (!strcmp(argv[i], "-xkb-options")) {
+ if (i + 1 >= argc) {
+ UseMsg();
+ FatalError("Missing argument for option -xkb-options.\n");
+ }
+ kdGlobalXkbOptions = argv[i + 1];
+ return 2;
+ }
if (!strcmp(argv[i], "-mouse") || !strcmp(argv[i], "-pointer")) {
if (i + 1 >= argc)
UseMsg();
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index fd6a952..836db79 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -102,6 +102,12 @@ static int kdNumInputFds;
extern Bool kdRawPointerCoordinates;
+extern const char *kdGlobalXkbRules;
+extern const char *kdGlobalXkbModel;
+extern const char *kdGlobalXkbLayout;
+extern const char *kdGlobalXkbVariant;
+extern const char *kdGlobalXkbOptions;
+
static void
KdSigio(int sig)
{
@@ -909,11 +915,11 @@ KdNewKeyboard(void)
ki->options = NULL;
ki->name = strdup("Generic Keyboard");
ki->path = NULL;
- ki->xkbRules = strdup(XKB_DFLT_RULES);
- ki->xkbModel = strdup(XKB_DFLT_MODEL);
- ki->xkbLayout = strdup(XKB_DFLT_LAYOUT);
- ki->xkbVariant = strdup(XKB_DFLT_VARIANT);
- ki->xkbOptions = strdup(XKB_DFLT_OPTIONS);
+ ki->xkbRules = strdup(kdGlobalXkbRules ? kdGlobalXkbRules : XKB_DFLT_RULES);
+ ki->xkbModel = strdup(kdGlobalXkbModel ? kdGlobalXkbModel : XKB_DFLT_MODEL);
+ ki->xkbLayout = strdup(kdGlobalXkbLayout ? kdGlobalXkbLayout : XKB_DFLT_LAYOUT);
+ ki->xkbVariant = strdup(kdGlobalXkbVariant ? kdGlobalXkbVariant :XKB_DFLT_VARIANT);
+ ki->xkbOptions = strdup(kdGlobalXkbOptions ? kdGlobalXkbOptions : XKB_DFLT_OPTIONS);
return ki;
}
--
2.6.2

View File

@ -1,47 +0,0 @@
From edd443f69ea385a957b8eae0b066ad8e77fb947b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 11 Dec 2015 11:43:11 -0200
Subject: [PATCH 02/56] kdrive: don't let evdev driver overwrite existing
device names
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
KDrive evdev driver deliberately name grabbed devices as "Evdev mouse"
or "Evdev keyboard". This patch will make it skip this step if grabbed
devices are already named (i.e. from udev).
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/linux/evdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index 63e8409..cdd45e7 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -220,7 +220,8 @@ EvdevPtrInit(KdPointerInfo * pi)
close(fd);
- pi->name = strdup("Evdev mouse");
+ if (!pi->name)
+ pi->name = strdup("Evdev mouse");
return Success;
}
@@ -390,7 +391,8 @@ EvdevKbdInit(KdKeyboardInfo * ki)
close(fd);
- ki->name = strdup("Evdev keyboard");
+ if (!ki->name)
+ ki->name = strdup("Evdev keyboard");
readMapping(ki);
--
2.6.2

View File

@ -1,151 +0,0 @@
From 6d6fd688ecf95f2e84f2af276d681ff42f9d5610 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 11 Dec 2015 11:43:06 -0200
Subject: [PATCH 01/58] kdrive: fix up NewInputDeviceRequest() implementation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch simplifies NewInputDeviceRequest() implementation in
kinput.c, making use of improved KdParseKbdOptions() /
KdParsePointerOptions() and merging several "if (ki)"/"if (pi)" clauses.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/src/kinput.c | 76 ++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 46 deletions(-)
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 1fdaa52..980fd3e 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1091,6 +1091,8 @@ KdParseKbdOptions(KdKeyboardInfo * ki)
ki->xkbOptions = strdup(value);
else if (!strcasecmp(key, "device"))
ki->path = strdup(value);
+ else if (!strcasecmp(key, "driver"))
+ ki->driver = KdFindKeyboardDriver(value);
else
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
key, value);
@@ -1171,18 +1173,20 @@ KdParsePointerOptions(KdPointerInfo * pi)
const char *key = input_option_get_key(option);
const char *value = input_option_get_value(option);
- if (!strcmp(key, "emulatemiddle"))
+ if (!strcasecmp(key, "emulatemiddle"))
pi->emulateMiddleButton = TRUE;
- else if (!strcmp(key, "noemulatemiddle"))
+ else if (!strcasecmp(key, "noemulatemiddle"))
pi->emulateMiddleButton = FALSE;
- else if (!strcmp(key, "transformcoord"))
+ else if (!strcasecmp(key, "transformcoord"))
pi->transformCoordinates = TRUE;
- else if (!strcmp(key, "rawcoord"))
+ else if (!strcasecmp(key, "rawcoord"))
pi->transformCoordinates = FALSE;
else if (!strcasecmp(key, "device"))
pi->path = strdup(value);
else if (!strcasecmp(key, "protocol"))
pi->protocol = strdup(value);
+ else if (!strcasecmp(key, "driver"))
+ pi->driver = KdFindPointerDriver(value);
else
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
key, value);
@@ -2152,68 +2156,48 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
#endif
}
- if (!ki && !pi) {
- ErrorF("unrecognised device identifier!\n");
- return BadValue;
- }
-
- /* FIXME: change this code below to use KdParseKbdOptions and
- * KdParsePointerOptions */
- nt_list_for_each_entry(option, options, list.next) {
- const char *key = input_option_get_key(option);
- const char *value = input_option_get_value(option);
+ if (pi) {
+ pi->options = options;
+ KdParsePointerOptions(pi);
- if (strcmp(key, "device") == 0) {
- if (pi && value)
- pi->path = strdup(value);
- else if (ki && value)
- ki->path = strdup(value);
- }
- else if (strcmp(key, "driver") == 0) {
- if (pi) {
- pi->driver = KdFindPointerDriver(value);
- if (!pi->driver) {
- ErrorF("couldn't find driver!\n");
- KdFreePointer(pi);
- return BadValue;
- }
- pi->options = options;
- }
- else if (ki) {
- ki->driver = KdFindKeyboardDriver(value);
- if (!ki->driver) {
- ErrorF("couldn't find driver!\n");
- KdFreeKeyboard(ki);
- return BadValue;
- }
- ki->options = options;
- }
+ if (!pi->driver) {
+ ErrorF("couldn't find driver!\n");
+ KdFreePointer(pi);
+ return BadValue;
}
- }
- if (pi) {
if (KdAddPointer(pi) != Success ||
ActivateDevice(pi->dixdev, TRUE) != Success ||
EnableDevice(pi->dixdev, TRUE) != TRUE) {
ErrorF("couldn't add or enable pointer\n");
return BadImplementation;
}
+
+ *pdev = pi->dixdev;
}
else if (ki) {
+ ki->options = options;
+ KdParseKbdOptions(ki);
+
+ if (!ki->driver) {
+ ErrorF("couldn't find driver!\n");
+ KdFreeKeyboard(ki);
+ return BadValue;
+ }
+
if (KdAddKeyboard(ki) != Success ||
ActivateDevice(ki->dixdev, TRUE) != Success ||
EnableDevice(ki->dixdev, TRUE) != TRUE) {
ErrorF("couldn't add or enable keyboard\n");
return BadImplementation;
}
- }
- if (pi) {
- *pdev = pi->dixdev;
- }
- else if (ki) {
*pdev = ki->dixdev;
}
+ else {
+ ErrorF("unrecognised device identifier!\n");
+ return BadValue;
+ }
return Success;
}
--
2.6.2

View File

@ -1,437 +0,0 @@
From 0cf3d72be6bd99cd2c66b7885339322c7e5bf73d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 12 Feb 2016 14:17:59 -0200
Subject: [PATCH 53/56] kdrive: introduce input hot-plugging support for udev
and hal backends (#33140)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch introduces input hot-plugging support for kdrive-based
applications in multi-seat context. This feature is enabled by passing
-seat option with desired seat name. All keyboard/mouse devices assigned
to that seat will be automatically grabbed by kdrive.
It supports udev and hal backends for input hot-plugging support.
Another patches may be required for wscons backend.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33140
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/src/Makefile.am | 8 +++
hw/kdrive/src/kdrive.c | 46 +++++++++++++
hw/kdrive/src/kinfo.c | 4 ++
hw/kdrive/src/kinput.c | 162 +++++++++++++++++++++++++++++++++++++++-------
4 files changed, 198 insertions(+), 22 deletions(-)
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index d69f0dd..b7f94b0 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -23,3 +23,11 @@ libkdrive_la_SOURCES = \
kshadow.c \
$(KDRIVE_XV_SOURCES) \
$(top_srcdir)/mi/miinitext.c
+
+if CONFIG_UDEV
+libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la
+else
+if CONFIG_HAL
+libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la
+endif
+endif
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 582ff66..269b609 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -45,6 +45,14 @@
#include <signal.h>
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+#include <hotplug.h>
+#endif
+
+/* This stub can be safely removed once we can
+ * split input and GPU parts in hotplug.h et al. */
+#include <systemd-logind.h>
+
typedef struct _kdDepths {
CARD8 depth;
CARD8 bpp;
@@ -1125,6 +1133,11 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
KdAddScreen(pScreenInfo, screen, argc, argv);
OsRegisterSigWrapper(KdSignalWrapper);
+
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ if (SeatId) /* Enable input hot-plugging */
+ config_pre_init();
+#endif
}
void
@@ -1143,3 +1156,36 @@ DPMSSupported(void)
{
return FALSE;
}
+
+/* These stubs can be safely removed once we can
+ * split input and GPU parts in hotplug.h et al. */
+#ifdef CONFIG_UDEV_KMS
+void
+NewGPUDeviceRequest(struct OdevAttributes *attribs)
+{
+}
+
+void
+DeleteGPUDeviceRequest(struct OdevAttributes *attribs)
+{
+}
+#endif
+
+struct xf86_platform_device *
+xf86_find_platform_device_by_devnum(int major, int minor)
+{
+ return NULL;
+}
+
+#ifdef SYSTEMD_LOGIND
+void
+systemd_logind_vtenter(void)
+{
+}
+
+void
+systemd_logind_release_fd(int major, int minor, int fd)
+{
+ close(fd);
+}
+#endif
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c
index 01ae1e4..f91d575 100644
--- a/hw/kdrive/src/kinfo.c
+++ b/hw/kdrive/src/kinfo.c
@@ -134,6 +134,7 @@ KdFreePointer(KdPointerInfo * pi)
free(pi->name);
free(pi->path);
input_option_free_list(&pi->options);
+ pi->next = NULL;
free(pi);
}
@@ -145,6 +146,9 @@ KdFreeKeyboard(KdKeyboardInfo * ki)
free(ki->xkbRules);
free(ki->xkbModel);
free(ki->xkbLayout);
+ free(ki->xkbVariant);
+ free(ki->xkbOptions);
+ input_option_free_list(&ki->options);
ki->next = NULL;
free(ki);
}
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 3a1c6a0..fd6a952 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -51,6 +51,10 @@
#include "inpututils.h"
#include "optionstr.h"
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+#include <hotplug.h>
+#endif
+
#ifdef KDRIVE_EVDEV
#define DEV_INPUT_EVENT_PREFIX "/dev/input/event"
#define DEV_INPUT_EVENT_PREFIX_LEN (sizeof(DEV_INPUT_EVENT_PREFIX) - 1)
@@ -407,7 +411,8 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
#endif
if (!pi->driver) {
if (!pi->driverPrivate) {
- ErrorF("no driver specified for %s\n", pi->name);
+ ErrorF("no driver specified for pointer device \"%s\" (%s)\n",
+ pi->name ? pi->name : "(unnamed)", pi->path);
return BadImplementation;
}
@@ -727,7 +732,8 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
#endif
if (!ki->driver) {
if (!ki->driverPrivate) {
- ErrorF("no driver specified!\n");
+ ErrorF("no driver specified for keyboard device \"%s\" (%s)\n",
+ ki->name ? ki->name : "(unnamed)", ki->path);
return BadImplementation;
}
@@ -901,6 +907,8 @@ KdNewKeyboard(void)
ki->bellDuration = 200;
ki->next = NULL;
ki->options = NULL;
+ ki->name = strdup("Generic Keyboard");
+ ki->path = NULL;
ki->xkbRules = strdup(XKB_DFLT_RULES);
ki->xkbModel = strdup(XKB_DFLT_MODEL);
ki->xkbLayout = strdup(XKB_DFLT_LAYOUT);
@@ -1084,18 +1092,52 @@ KdParseKbdOptions(KdKeyboardInfo * ki)
const char *key = input_option_get_key(option);
const char *value = input_option_get_value(option);
- if (strcasecmp(key, "XkbRules") == 0)
+ if (
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ strcasecmp(key, "xkb_rules") == 0 ||
+#endif
+ strcasecmp(key, "XkbRules") == 0)
ki->xkbRules = strdup(value);
- else if (strcasecmp(key, "XkbModel") == 0)
+ else if (
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ strcasecmp(key, "xkb_model") == 0 ||
+#endif
+ strcasecmp(key, "XkbModel") == 0)
ki->xkbModel = strdup(value);
- else if (strcasecmp(key, "XkbLayout") == 0)
+ else if (
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ strcasecmp(key, "xkb_layout") == 0 ||
+#endif
+ strcasecmp(key, "XkbLayout") == 0)
ki->xkbLayout = strdup(value);
- else if (strcasecmp(key, "XkbVariant") == 0)
+ else if (
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ strcasecmp(key, "xkb_variant") == 0 ||
+#endif
+ strcasecmp(key, "XkbVariant") == 0)
ki->xkbVariant = strdup(value);
- else if (strcasecmp(key, "XkbOptions") == 0)
+ else if (
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ strcasecmp(key, "xkb_options") == 0 ||
+#endif
+ strcasecmp(key, "XkbOptions") == 0)
ki->xkbOptions = strdup(value);
- else if (!strcasecmp(key, "device"))
+ else if (!strcasecmp(key, "device")) {
+ if (ki->path != NULL)
+ free(ki->path);
ki->path = strdup(value);
+ }
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ else if (!strcasecmp(key, "path")) {
+ if (ki->path != NULL)
+ free(ki->path);
+ ki->path = strdup(value);
+ }
+ else if (!strcasecmp(key, "name")) {
+ free(ki->name);
+ ki->name = strdup(value);
+ }
+#endif
else if (!strcasecmp(key, "driver"))
ki->driver = KdFindKeyboardDriver(value);
else
@@ -1196,8 +1238,22 @@ KdParsePointerOptions(KdPointerInfo * pi)
pi->transformCoordinates = TRUE;
else if (!strcasecmp(key, "rawcoord"))
pi->transformCoordinates = FALSE;
- else if (!strcasecmp(key, "device"))
+ else if (!strcasecmp(key, "device")) {
+ if (pi->path != NULL)
+ free(pi->path);
+ pi->path = strdup(value);
+ }
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ else if (!strcasecmp(key, "path")) {
+ if (pi->path != NULL)
+ free(pi->path);
pi->path = strdup(value);
+ }
+ else if (!strcasecmp(key, "name")) {
+ free(pi->name);
+ pi->name = strdup(value);
+ }
+#endif
else if (!strcasecmp(key, "protocol"))
pi->protocol = strdup(value);
else if (!strcasecmp(key, "driver"))
@@ -1320,11 +1376,21 @@ KdInitInput(void)
}
mieqInit();
+
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ if (SeatId) /* Enable input hot-plugging */
+ config_init();
+#endif
}
void
KdCloseInput(void)
{
+#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
+ if (SeatId) /* Input hot-plugging is enabled */
+ config_fini();
+#endif
+
mieqFini();
}
@@ -2141,24 +2207,29 @@ int
NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
DeviceIntPtr *pdev)
{
- InputOption *option = NULL;
+ InputOption *option = NULL, *optionsdup = NULL;
KdPointerInfo *pi = NULL;
KdKeyboardInfo *ki = NULL;
nt_list_for_each_entry(option, options, list.next) {
const char *key = input_option_get_key(option);
const char *value = input_option_get_value(option);
+ optionsdup = input_option_new(optionsdup, key, value);
if (strcmp(key, "type") == 0) {
if (strcmp(value, "pointer") == 0) {
pi = KdNewPointer();
- if (!pi)
+ if (!pi) {
+ input_option_free_list(&optionsdup);
return BadAlloc;
+ }
}
else if (strcmp(value, "keyboard") == 0) {
ki = KdNewKeyboard();
- if (!ki)
+ if (!ki) {
+ input_option_free_list(&optionsdup);
return BadAlloc;
+ }
}
else {
ErrorF("unrecognised device type!\n");
@@ -2168,25 +2239,66 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
#ifdef CONFIG_HAL
else if (strcmp(key, "_source") == 0 &&
strcmp(value, "server/hal") == 0) {
- ErrorF("Ignoring device from HAL.\n");
- return BadValue;
+ if (SeatId) {
+ /* Input hot-plugging is enabled */
+ if (attrs->flags & ATTR_POINTER) {
+ pi = KdNewPointer();
+ if (!pi) {
+ input_option_free_list(&optionsdup);
+ return BadAlloc;
+ }
+ }
+ else if (attrs->flags & ATTR_KEYBOARD) {
+ ki = KdNewKeyboard();
+ if (!ki) {
+ input_option_free_list(&optionsdup);
+ return BadAlloc;
+ }
+ }
+ }
+ else {
+ ErrorF("Ignoring device from HAL.\n");
+ input_option_free_list(&optionsdup);
+ return BadValue;
+ }
}
#endif
#ifdef CONFIG_UDEV
else if (strcmp(key, "_source") == 0 &&
strcmp(value, "server/udev") == 0) {
- ErrorF("Ignoring device from udev.\n");
- return BadValue;
+ if (SeatId) {
+ /* Input hot-plugging is enabled */
+ if (attrs->flags & ATTR_POINTER) {
+ pi = KdNewPointer();
+ if (!pi) {
+ input_option_free_list(&optionsdup);
+ return BadAlloc;
+ }
+ }
+ else if (attrs->flags & ATTR_KEYBOARD) {
+ ki = KdNewKeyboard();
+ if (!ki) {
+ input_option_free_list(&optionsdup);
+ return BadAlloc;
+ }
+ }
+ }
+ else {
+ ErrorF("Ignoring device from udev.\n");
+ input_option_free_list(&optionsdup);
+ return BadValue;
+ }
}
#endif
}
if (pi) {
- pi->options = options;
+ pi->options = optionsdup;
KdParsePointerOptions(pi);
if (!pi->driver) {
- ErrorF("couldn't find driver!\n");
+ ErrorF("couldn't find driver for pointer device \"%s\" (%s)\n",
+ pi->name ? pi->name : "(unnamed)", pi->path);
KdFreePointer(pi);
return BadValue;
}
@@ -2194,18 +2306,21 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
if (KdAddPointer(pi) != Success ||
ActivateDevice(pi->dixdev, TRUE) != Success ||
EnableDevice(pi->dixdev, TRUE) != TRUE) {
- ErrorF("couldn't add or enable pointer\n");
+ ErrorF("couldn't add or enable pointer \"%s\" (%s)\n",
+ pi->name ? pi->name : "(unnamed)", pi->path);
+ KdFreePointer(pi);
return BadImplementation;
}
*pdev = pi->dixdev;
}
else if (ki) {
- ki->options = options;
+ ki->options = optionsdup;
KdParseKbdOptions(ki);
if (!ki->driver) {
- ErrorF("couldn't find driver!\n");
+ ErrorF("couldn't find driver for keyboard device \"%s\" (%s)\n",
+ ki->name ? ki->name : "(unnamed)", ki->path);
KdFreeKeyboard(ki);
return BadValue;
}
@@ -2213,7 +2328,9 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
if (KdAddKeyboard(ki) != Success ||
ActivateDevice(ki->dixdev, TRUE) != Success ||
EnableDevice(ki->dixdev, TRUE) != TRUE) {
- ErrorF("couldn't add or enable keyboard\n");
+ ErrorF("couldn't add or enable keyboard \"%s\" (%s)\n",
+ ki->name ? ki->name : "(unnamed)", ki->path);
+ KdFreeKeyboard(ki);
return BadImplementation;
}
@@ -2221,6 +2338,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
}
else {
ErrorF("unrecognised device identifier!\n");
+ input_option_free_list(&optionsdup);
return BadValue;
}
--
2.6.2

View File

@ -1,74 +0,0 @@
From 0b80da0d18713df4712c05973388b6226bb0227f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=
<laerciosousa@sme-mogidascruzes.sp.gov.br>
Date: Fri, 11 Dec 2015 11:43:07 -0200
Subject: [PATCH 01/56] kdrive: set "evdev" driver for input devices
automatically, if available.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If kdrive input driver "evdev" is available, no other driver was
explicitly set for a given input device, and its kernel device node is
/dev/input/event*, this patch will make kdrive set "evdev" driver
automatically for such device.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
---
hw/kdrive/src/kinput.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 980fd3e..3a1c6a0 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -51,6 +51,11 @@
#include "inpututils.h"
#include "optionstr.h"
+#ifdef KDRIVE_EVDEV
+#define DEV_INPUT_EVENT_PREFIX "/dev/input/event"
+#define DEV_INPUT_EVENT_PREFIX_LEN (sizeof(DEV_INPUT_EVENT_PREFIX) - 1)
+#endif
+
#define AtomFromName(x) MakeAtom(x, strlen(x), 1)
struct KdConfigDevice {
@@ -1097,6 +1102,16 @@ KdParseKbdOptions(KdKeyboardInfo * ki)
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
key, value);
}
+
+#ifdef KDRIVE_EVDEV
+ if (!ki->driver && ki->path != NULL &&
+ strncasecmp(ki->path,
+ DEV_INPUT_EVENT_PREFIX,
+ DEV_INPUT_EVENT_PREFIX_LEN) == 0) {
+ ki->driver = KdFindKeyboardDriver("evdev");
+ ki->options = input_option_new(ki->options, "driver", "evdev");
+ }
+#endif
}
KdKeyboardInfo *
@@ -1191,6 +1206,16 @@ KdParsePointerOptions(KdPointerInfo * pi)
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
key, value);
}
+
+#ifdef KDRIVE_EVDEV
+ if (!pi->driver && pi->path != NULL &&
+ strncasecmp(pi->path,
+ DEV_INPUT_EVENT_PREFIX,
+ DEV_INPUT_EVENT_PREFIX_LEN) == 0) {
+ pi->driver = KdFindPointerDriver("evdev");
+ pi->options = input_option_new(pi->options, "driver", "evdev");
+ }
+#endif
}
KdPointerInfo *
--
2.6.2

View File

@ -22,7 +22,7 @@ index 1e95061..c58fd2b 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -361,6 +361,16 @@ xf86CreateRootWindow(WindowPtr pWin)
return ret;
return privsElevated;
}
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
@ -46,7 +46,7 @@ index 1e95061..c58fd2b 100644
+
xf86VGAarbiterWrapFunctions();
if (sigio_blocked)
OsReleaseSIGIO();
input_unlock();
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 33b2b7d..be3bdd9 100644
--- a/hw/xfree86/common/xf86platformBus.c

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:278459b2c31d61a15655d95a72fb79930c480a6bb8cf9226e48a07df8b1d31c8
size 6009508

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:149a708b50befc2d5a40b98d45ddd2ebe0beec018e6d0c663c43bad6210e4da3
size 6051462

View File

@ -1,4 +1,4 @@
Provides: X11_ABI_XINPUT = 22.1
Provides: X11_ABI_VIDEODRV = 20.0
Provides: X11_ABI_XINPUT = 24.1
Provides: X11_ABI_VIDEODRV = 23.0
Provides: X11_ABI_ANSIC = 0.4
Provides: X11_ABI_EXTENSION = 9.0
Provides: X11_ABI_EXTENSION = 10.0

View File

@ -6,6 +6,11 @@ Mon Dec 12 17:20:06 UTC 2016 - fbui@suse.com
Nowadays pkgconfig(libsystemd) replaces all libsystemd-* libs, which
are obsolete.
-------------------------------------------------------------------
Wed Nov 16 00:28:00 UTC 2016 - tobias.johannes.klausmann@mni.thm.de
- Update to final 1.19.0
-------------------------------------------------------------------
Sat Nov 5 21:40:57 UTC 2016 - zaitor@opensuse.org
@ -13,6 +18,29 @@ Sat Nov 5 21:40:57 UTC 2016 - zaitor@opensuse.org
corefonts and cursors are not strickly required as long as one
have a substitute such as Adwaita installed.
-------------------------------------------------------------------
Mon Sep 19 19:29:36 UTC 2016 - tobias.johannes.klausmann@mni.thm.de
- Update to version 1.18.99.901:
- Remove upstream pachtes:
+ U_glamor-Remove-the-FBO-cache.patch
+ U_kdrive-fix-up-NewInputDeviceRequest-implementation.patch
+ U_kdrive-set-evdev-driver-for-input-devices-automatica.patch
+ U_ephyr-don-t-load-ephyr-input-driver-if-seat-option-i.patch
+ U_kdrive-don-t-let-evdev-driver-overwrite-existing-dev.patch
+ U_ephyr-ignore-Xorg-multiseat-command-line-options.patch
+ U_ephyr-enable-option-sw-cursor-by-default-in-multi-se.patch
+ U_kdrive-introduce-input-hot-plugging-support-for-udev.patch
+ U_kdrive-add-options-to-set-default-XKB-properties.patch
+ U_config-udev-distinguish-between-real-keyboards-and-o.patch
- Disable u_os-connections-Check-for-stale-FDs.patch (not applicable anymore)
- Adapt patches to work with the new release:
+ n_xserver-optimus-autoconfig-hack.patch (disabled for now as it causes
problems)
- Remove X.org stack version prefix.
We are already atleast at verion 7.7. Plus we are updating individual
components anyway. So the stack version is misleading.
-------------------------------------------------------------------
Tue Jul 19 22:44:59 UTC 2016 - tobias.johannes.klausmann@mni.thm.de

View File

@ -41,14 +41,16 @@
%endif
Name: xorg-x11-server
%define dirsuffix 1.18.4
Version: 1.19.0
Release: 0
Url: http://xorg.freedesktop.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: X
# Source URL: http://xorg.freedesktop.org/archive/individual/xserver/
License: MIT
Group: System/X11/Servers/XF86_4
Source0: xorg-server-%{dirsuffix}.tar.bz2
Source0: xorg-server-%{version}.tar.bz2
Source1: sysconfig.displaymanager.template
Source2: README.updates
Source3: xorgcfg.tar.bz2
@ -77,6 +79,7 @@ BuildRequires: pkgconfig(dri3proto)
BuildRequires: pkgconfig(epoxy) >= 1.1
%if 0%{?have_wayland} == 1
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-protocols)
%endif
BuildRequires: pkgconfig(fixesproto) >= 4.1
BuildRequires: pkgconfig(fontconfig)
@ -114,7 +117,7 @@ BuildRequires: pkgconfig(xextproto) >= 7.1.99
BuildRequires: pkgconfig(xf86dgaproto)
BuildRequires: pkgconfig(xf86driproto)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xfont) >= 1.4.2
BuildRequires: pkgconfig(xfont2)
BuildRequires: pkgconfig(xi) >= 1.2.99.1
BuildRequires: pkgconfig(xineramaproto)
BuildRequires: pkgconfig(xkbfile)
@ -136,10 +139,6 @@ BuildRequires: pkgconfig(xv)
BuildRequires: pkgconfig(libudev) >= 143
%endif
Version: 7.6_%{dirsuffix}
Release: 0
Url: http://xorg.freedesktop.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%ifnarch s390 s390x
Requires(pre): %fillup_prereq
%endif
@ -163,10 +162,16 @@ Obsoletes: xorg-x11-server-glx
Provides: glamor = %{version}
Provides: glamor-egl = %{version}
Obsoletes: glamor < %{version}
Obsoletes: glamor < 7.6_%{version}
Obsoletes: glamor-egl < %{version}
Obsoletes: glamor-egl < 7.6_%{version}
Provides: xf86-video-modesetting = %{version}
Obsoletes: xf86-video-modesetting < %{version}
Obsoletes: xf86-video-modesetting < 7.6_%{version}
Provides: xorg-x11-server = 7.6_%{version}
Obsoletes: xorg-x11-server < 7.6_%{version}
# Remove (also from depending driver(s)) when updating X11_ABI_VIDEODRV by updating the server package - NOTE: also remove from xorg-x11-server.macros.in !
Provides: X11_ABI_HAS_DPMS_GET_CAPABILITIES
@ -200,24 +205,12 @@ Patch208: u_Panning-Set-panning-state-in-xf86RandR12ScreenSetSize.patch
Patch209: u_pci-primary-Fix-up-primary-PCI-device-detection-for-the-platfrom-bus.patch
Patch210: u_os-connections-Check-for-stale-FDs.patch
Patch600: U_glamor-Remove-the-FBO-cache.patch
Patch1000: n_xserver-optimus-autoconfig-hack.patch
Patch1162: b_cache-xkbcomp-output-for-fast-start-up.patch
Patch1211: b_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
Patch1222: b_sync-fix.patch
Patch1223: U_kdrive-fix-up-NewInputDeviceRequest-implementation.patch
Patch1224: U_kdrive-set-evdev-driver-for-input-devices-automatica.patch
Patch1225: U_ephyr-don-t-load-ephyr-input-driver-if-seat-option-i.patch
Patch1226: U_kdrive-don-t-let-evdev-driver-overwrite-existing-dev.patch
Patch1227: U_ephyr-ignore-Xorg-multiseat-command-line-options.patch
Patch1228: U_ephyr-enable-option-sw-cursor-by-default-in-multi-se.patch
Patch1229: U_kdrive-introduce-input-hot-plugging-support-for-udev.patch
Patch1230: U_kdrive-add-options-to-set-default-XKB-properties.patch
Patch1232: U_config-udev-distinguish-between-real-keyboards-and-o.patch
%description
This package contains the X.Org Server.
@ -252,6 +245,8 @@ Summary: Xserver SUID Wrapper
Group: System/X11/Servers/XF86_4
PreReq: permissions
Requires: xorg-x11-server == %{version}
Provides: xorg-x11-server-wayland = 7.6_%{version}
Obsoletes: xorg-x11-server-wayland < 7.6_%{version}
%description wrapper
This package contains an SUID wrapper for the Xserver.
@ -293,6 +288,9 @@ Provides: xorg-x11-sdk
Obsoletes: xorg-x11-sdk
Provides: glamor-devel = %{version}
Obsoletes: glamor-devel < %{version}
Obsoletes: glamor-devel < 7.6_%{version}
Provides: xorg-x11-server-sdk = 7.6_%{version}
Obsoletes: xorg-x11-server-sdk < 7.6_%{version}
%description sdk
This package contains the X.Org Server SDK.
@ -305,7 +303,7 @@ Group: Development/Sources
This package contains patched sources of X.Org Server.
%prep
%setup -q -n xorg-server-%{dirsuffix} -a3
%setup -q -n xorg-server-%{version} -a3
# Early verification if the ABI Defines are correct. Let's not waste build cycles if the Provides are wrong at the end.
sh %{SOURCE92} --verify . %{SOURCE91}
@ -335,11 +333,12 @@ sh %{SOURCE92} --verify . %{SOURCE91}
%patch206 -p1
%patch208 -p1
%patch209 -p1
%patch210 -p1
%patch600 -p1
### not applicable anymore
#%patch210 -p1
%patch1000 -p1
### disabled for now
#%patch1000 -p1
### disabled for now
#%patch1162 -p1
@ -348,17 +347,6 @@ sh %{SOURCE92} --verify . %{SOURCE91}
### patch222 might not be applicable anymore
#%patch1222 -p1
%patch1223 -p1
%patch1224 -p1
%patch1225 -p1
%patch1226 -p1
%patch1227 -p1
%patch1228 -p1
%patch1229 -p1
%patch1230 -p1
%patch1232 -p1
%build
test -e source-file-list || \
find -L . -type f \! -name '*.orig' \! -path ./source-file-list > \