xserver: Branch 'master' - 4 commits
Adam Jackson
ajax at kemper.freedesktop.org
Tue Mar 1 14:51:50 UTC 2016
dri3/dri3_request.c | 4 +++
present/present.c | 53 ++++++++++++++++++++++++++++++----------------------
2 files changed, 35 insertions(+), 22 deletions(-)
New commits:
commit 1bee4e254ca0305cb23e574b4c8b250d276ee998
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Thu Feb 18 17:33:19 2016 +0900
present: Call present_restore_screen_pixmap from present_set_abort_flip
After present_set_abort_flip, the screen pixmap will be used for all
screen drawing, so we need to restore the current flip pixmap contents
to the screen pixmap here as well.
Improves flashing / stutter e.g. when something like a popup menu appears
on top of a flipping fullscreen window or when switching out of
fullscreen.
Note that this means present_set_abort_flip now relies on screen->root
being non-NULL, but that's already the case in other present code.
Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/present/present.c b/present/present.c
index ffb7a4a..1ce16af 100644
--- a/present/present.c
+++ b/present/present.c
@@ -418,8 +418,16 @@ present_restore_screen_pixmap(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
PixmapPtr screen_pixmap = (*screen->GetScreenPixmap)(screen);
- PixmapPtr flip_pixmap = screen_priv->flip_pixmap;
- WindowPtr flip_window = screen_priv->flip_window;
+ PixmapPtr flip_pixmap;
+ WindowPtr flip_window;
+
+ if (screen_priv->flip_pending) {
+ flip_window = screen_priv->flip_pending->window;
+ flip_pixmap = screen_priv->flip_pending->pixmap;
+ } else {
+ flip_window = screen_priv->flip_window;
+ flip_pixmap = screen_priv->flip_pixmap;
+ }
assert (flip_pixmap);
@@ -430,6 +438,9 @@ present_restore_screen_pixmap(ScreenPtr screen)
if (screen->GetWindowPixmap(screen->root) == flip_pixmap)
present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0);
+ /* Switch back to using the screen pixmap now to avoid
+ * 2D applications drawing to the wrong pixmap.
+ */
if (flip_window)
present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap);
present_set_tree_pixmap(screen->root, NULL, screen_pixmap);
@@ -439,19 +450,8 @@ static void
present_set_abort_flip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- PixmapPtr pixmap = (*screen->GetScreenPixmap)(screen);
- /* Switch back to using the screen pixmap now to avoid
- * 2D applications drawing to the wrong pixmap.
- */
-
- if (screen_priv->flip_window)
- present_set_tree_pixmap(screen_priv->flip_window,
- screen_priv->flip_pixmap,
- pixmap);
-
- if (screen->root)
- present_set_tree_pixmap(screen->root, NULL, pixmap);
+ present_restore_screen_pixmap(screen);
screen_priv->flip_pending->abort_flip = TRUE;
}
commit 4611e902c291b8a789f374cff3300f74645bc2b2
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Thu Feb 18 17:20:45 2016 +0900
present: Factor code for restoring screen pixmap out of present_unflip (v2)
The following fix will use the refactored function.
The logic in the refactored function is slightly simplified, exploiting
the fact that this function is only ever called with a valid flip
pixmap.
v2: Assert that flip_pixmap is non-NULL instead of testing and bailing
on NULL, preserve test for flip_window being non-NULL before calling
present_set_tree_pixmap for it (Keith Packard)
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk> (v1)
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/present/present.c b/present/present.c
index a9241d2..ffb7a4a 100644
--- a/present/present.c
+++ b/present/present.c
@@ -414,6 +414,28 @@ present_set_tree_pixmap(WindowPtr window,
}
static void
+present_restore_screen_pixmap(ScreenPtr screen)
+{
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+ PixmapPtr screen_pixmap = (*screen->GetScreenPixmap)(screen);
+ PixmapPtr flip_pixmap = screen_priv->flip_pixmap;
+ WindowPtr flip_window = screen_priv->flip_window;
+
+ assert (flip_pixmap);
+
+ /* Update the screen pixmap with the current flip pixmap contents
+ * Only do this the first time for a particular unflip operation, or
+ * we'll probably scribble over other windows
+ */
+ if (screen->GetWindowPixmap(screen->root) == flip_pixmap)
+ present_copy_region(&screen_pixmap->drawable, flip_pixmap, NULL, 0, 0);
+
+ if (flip_window)
+ present_set_tree_pixmap(flip_window, flip_pixmap, screen_pixmap);
+ present_set_tree_pixmap(screen->root, NULL, screen_pixmap);
+}
+
+static void
present_set_abort_flip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -438,26 +460,11 @@ static void
present_unflip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- PixmapPtr pixmap = (*screen->GetScreenPixmap)(screen);
assert (!screen_priv->unflip_event_id);
assert (!screen_priv->flip_pending);
- /* Update the screen pixmap with the current flip pixmap contents
- * Only do this the first time for a particular unflip operation, or
- * we'll probably scribble over other windows
- */
- if (screen->GetWindowPixmap(screen->root) == screen_priv->flip_pixmap) {
- present_copy_region(&pixmap->drawable, screen_priv->flip_pixmap,
- NULL, 0, 0);
- }
-
- if (screen_priv->flip_pixmap && screen_priv->flip_window)
- present_set_tree_pixmap(screen_priv->flip_window,
- screen_priv->flip_pixmap,
- pixmap);
-
- present_set_tree_pixmap(screen->root, NULL, pixmap);
+ present_restore_screen_pixmap(screen);
screen_priv->unflip_event_id = ++present_event_id;
DebugPresent(("u %lld\n", screen_priv->unflip_event_id));
commit 72328e5eb98a3f27e1f0a0e17beae6db447bd87c
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Thu Feb 18 18:23:47 2016 +0900
present: Only update screen pixmap from flip pixmap once per unflip
present_unflip may be called several times from present_check_flip_window
during the same unflip. We can only copy to the screen pixmap the first
time, otherwise we may scribble over other windows. The flip pixmap
contents don't get updated after the first time anyway.
Fixes at least the following problems, which were introduced by commit
806470b9 ("present: Copy unflip contents back to the Screen Pixmap"):
On xfwm4 without compositing, run glxgears and put its window into
fullscreen mode to start flipping. While in fullscreen, open the xfwm4
window menu by pressing Alt-Space. The window menu was invisible most
of the time because it was getting scribbled over by a repeated unflip
copy.
When switching a flipping window out of fullscreen, a repeated unflip
copy could leave artifacts of the flip pixmap on the desktop.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325
Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/present/present.c b/present/present.c
index 62865be..a9241d2 100644
--- a/present/present.c
+++ b/present/present.c
@@ -443,6 +443,15 @@ present_unflip(ScreenPtr screen)
assert (!screen_priv->unflip_event_id);
assert (!screen_priv->flip_pending);
+ /* Update the screen pixmap with the current flip pixmap contents
+ * Only do this the first time for a particular unflip operation, or
+ * we'll probably scribble over other windows
+ */
+ if (screen->GetWindowPixmap(screen->root) == screen_priv->flip_pixmap) {
+ present_copy_region(&pixmap->drawable, screen_priv->flip_pixmap,
+ NULL, 0, 0);
+ }
+
if (screen_priv->flip_pixmap && screen_priv->flip_window)
present_set_tree_pixmap(screen_priv->flip_window,
screen_priv->flip_pixmap,
@@ -450,13 +459,6 @@ present_unflip(ScreenPtr screen)
present_set_tree_pixmap(screen->root, NULL, pixmap);
- /* Update the screen pixmap with the current flip pixmap contents
- */
- if (screen_priv->flip_pixmap && screen_priv->flip_window) {
- present_copy_region(&pixmap->drawable,
- screen_priv->flip_pixmap,
- NULL, 0, 0);
- }
screen_priv->unflip_event_id = ++present_event_id;
DebugPresent(("u %lld\n", screen_priv->unflip_event_id));
(*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id);
commit 43eb5b6047c9b35c337e553ec054f08bdc835abb
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Tue Dec 8 12:52:17 2015 +0900
dri3: Refuse to work for remote clients (v2)
Prevents clients forwarded via SSH from hanging while waiting for the
reply from the DRI3Open request.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261
v2: Return BadMatch instead of BadRequest (Keith Packard)
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 2d75588..2b36221 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -312,6 +312,8 @@ int
proc_dri3_dispatch(ClientPtr client)
{
REQUEST(xReq);
+ if (!client->local)
+ return BadMatch;
if (stuff->data >= DRI3NumberRequests || !proc_dri3_vector[stuff->data])
return BadRequest;
return (*proc_dri3_vector[stuff->data]) (client);
@@ -405,6 +407,8 @@ int
sproc_dri3_dispatch(ClientPtr client)
{
REQUEST(xReq);
+ if (!client->local)
+ return BadMatch;
if (stuff->data >= DRI3NumberRequests || !sproc_dri3_vector[stuff->data])
return BadRequest;
return (*sproc_dri3_vector[stuff->data]) (client);
More information about the xorg-commit
mailing list