summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-11-10 21:48:03 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-11-11 23:24:43 +0200
commit8976e9766edfb33f5cf3f6d54f09e46d29bc4ec5 (patch)
tree28e6c9e70ec2200a4d206fa920dc4e18604a1cab /include
parentbfe9cdd11bcb60cf33dc48136ebee028001a737e (diff)
dix: adds support for none root window background
It lets the driver notify the server whether it can draw a background when '-background none' option is used by the system platform. Use cases for that could be video drivers performing mode-setting in kernel time, before X is up, so a seamless transition would happen until X clients start to show up. If the driver can copy the framebuffer cleanly then it can set the flag (canDoBGNoneRoot), otherwise the server will fallback to the normal behaviour. The system must explicit indicates willingness of doing so through '-background none'. We could do this option as default; in such case, malicious users would be able to steal the framebuffer with a bit of tricks. For instance, I can see the content of my nVidia Quadro FX 580 framebuffer old X session modifying a bit nv driver: xf86DPMSInit(pScreen, xf86DPMSSet, 0); - /* Clear the screen */ - if(pNv->xaa) { - /* Use the acceleration engine */ - pNv->xaa->SetupForSolidFill(pScrn, 0, GXcopy, ~0); - pNv->xaa->SubsequentSolidFillRect(pScrn, - 0, 0, pScrn->displayWidth, pNv->offscreenHeight); - G80DmaKickoff(pNv); - } else { - /* Use a slow software clear path */ - memset(pNv->mem, 0, pitch * pNv->offscreenHeight); - } + pScreen->canDoBGNoneRoot = TRUE; The commit is originally based on discussions happened on xorg-devel: http://lists.freedesktop.org/archives/xorg-devel/2010-June/009755.html Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Acked-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'include')
-rw-r--r--include/opaque.h1
-rw-r--r--include/scrnintstr.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/opaque.h b/include/opaque.h
index abaee453f..5c707172c 100644
--- a/include/opaque.h
+++ b/include/opaque.h
@@ -69,6 +69,7 @@ extern _X_EXPORT Bool defeatAccessControl;
extern _X_EXPORT long maxBigRequestSize;
extern _X_EXPORT Bool party_like_its_1989;
extern _X_EXPORT Bool whiteRoot;
+extern _X_EXPORT Bool bgNoneRoot;
extern _X_EXPORT Bool CoreDump;
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index e36b15f5e..cd4fb70b1 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -601,6 +601,12 @@ typedef struct _Screen {
/* Device cursor procedures */
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ /* set it in driver side if X server can copy the framebuffer content.
+ * Meant to be used together with '-background none' option, avoiding
+ * malicious users to steal framebuffer's content if that would be the
+ * default */
+ Bool canDoBGNoneRoot;
} ScreenRec;
static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) {