[PATCH] fb: Remove screen extents check, fix GetImage/GetSpans on Xwayland.
Emmanuel Gil Peyrot
emmanuel.peyrot at collabora.com
Tue Apr 4 09:45:08 UTC 2017
Screenshotting is currently broken when using Xwayland’s non-GLAMOR
code path headless, due to the screen extents being unknown and thus
initialised to zero.
This patch doesn’t seem to introduce any regression on GetImage when
using e.g. the modesetting DDX and switching away to another VT,
contrary to what the comment was saying, but I would welcome a more
experienced pair of eyes for that.
---
fb/fb.h | 12 ------------
fb/fbgetsp.c | 7 -------
fb/fbimage.c | 7 -------
3 files changed, 26 deletions(-)
diff --git a/fb/fb.h b/fb/fb.h
index 7d1e443dd..194c5efed 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -488,18 +488,6 @@ typedef struct {
fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
}
-/*
- * XFree86 empties the root BorderClip when the VT is inactive,
- * here's a macro which uses that to disable GetImage and GetSpans
- */
-
-#define fbWindowEnabled(pWin) \
- RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip)
-
-#define fbDrawableEnabled(pDrawable) \
- ((pDrawable)->type == DRAWABLE_PIXMAP ? \
- TRUE : fbWindowEnabled((WindowPtr) pDrawable))
-
#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
/*
* Accelerated tiles are power of 2 width <= FB_UNIT
diff --git a/fb/fbgetsp.c b/fb/fbgetsp.c
index 445a4e385..149b82ab0 100644
--- a/fb/fbgetsp.c
+++ b/fb/fbgetsp.c
@@ -37,13 +37,6 @@ fbGetSpans(DrawablePtr pDrawable,
int srcXoff, srcYoff;
int xoff;
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!fbDrawableEnabled(pDrawable))
- return;
-
fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
while (nspans--) {
diff --git a/fb/fbimage.c b/fb/fbimage.c
index bd24728fd..d49d6dc44 100644
--- a/fb/fbimage.c
+++ b/fb/fbimage.c
@@ -215,13 +215,6 @@ fbGetImage(DrawablePtr pDrawable,
FbStip *dst;
FbStride dstStride;
- /*
- * XFree86 DDX empties the root borderClip when the VT is
- * switched away; this checks for that case
- */
- if (!fbDrawableEnabled(pDrawable))
- return;
-
fbGetDrawable(pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);
x += pDrawable->x;
--
2.12.2
More information about the xorg-devel
mailing list