From 8976e9766edfb33f5cf3f6d54f09e46d29bc4ec5 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Wed, 10 Nov 2010 21:48:03 +0200 Subject: dix: adds support for none root window background MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Rami Ylimäki Acked-by: Pauli Nieminen Reviewed-by: Daniel Stone --- os/utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'os/utils.c') diff --git a/os/utils.c b/os/utils.c index c2158dc72..afdff0c5a 100644 --- a/os/utils.c +++ b/os/utils.c @@ -498,6 +498,7 @@ void UseMsg(void) ErrorF("-nolock disable the locking mechanism\n"); ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); + ErrorF("-background [none] create root window with no background\n"); ErrorF("-reset reset after last client exists\n"); ErrorF("-p # screen-saver pattern duration (minutes)\n"); ErrorF("-pn accept failure to listen on all ports\n"); @@ -828,6 +829,14 @@ ProcessCommandLine(int argc, char *argv[]) defaultBackingStore = WhenMapped; else if ( strcmp( argv[i], "-wr") == 0) whiteRoot = TRUE; + else if ( strcmp( argv[i], "-background") == 0) { + if(++i < argc) { + if (!strcmp ( argv[i], "none")) + bgNoneRoot = TRUE; + else + UseMsg(); + } + } else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { if(++i < argc) { long reqSizeArg = atol(argv[i]); -- cgit v1.2.3