Bug 31367 - Black screen after switching to fullscreen...
Summary: Black screen after switching to fullscreen...
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Carl Worth
QA Contact: Xorg Project Team
Keywords: patch, regression
Depends on:
Reported: 2010-11-03 15:32 UTC by Christian Henz
Modified: 2013-02-25 10:49 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

Small test case program using SDL (633 bytes, text/x-csrc)
2010-11-03 15:32 UTC, Christian Henz
no flags Details
Disabling put_image as a temporary workaround (1.25 KB, patch)
2010-12-30 06:54 UTC, Bjørn Mork
no flags Details | Splinter Review
Avoid bo replacement on scanout and other bound buffers. (3.78 KB, patch)
2010-12-30 07:35 UTC, Chris Wilson
no flags Details | Splinter Review

Description Christian Henz 2010-11-03 15:32:21 UTC
Created attachment 40027 [details]
Small test case program using SDL

This seems to be a regression in version 2.12.0 and later (which cannot be selected in Bugzilla btw.)

Original bug report against Debian:


* When switching to fullscreen in SDL applications, the screen goes black
* Applications/server keep running
* Mouse pointer is the only thing still visible, keeps working (ie it changes it's shape when hovering over text entry fields, you can click on stuff etc.)
* Problem seems to only occur when the window that is switching to fullscreen already has the native resolution
* Test case program is supplied
* Please see downstream bug report for further details
Comment 1 Bjørn Mork 2010-11-04 05:10:12 UTC
I tried to bisect this, but end up skipping a number of commits around the point where the bug appears partly because of build failures and partly because of server crashes.  Anyway, the bug first appears somewhere between 

# bad: [6729b508c44bfca0b0dbef238a8732adbed6d4c9] uxa: Initialise lists for private pixmap structure.
# good: [917f9bb2435ba36bb99ef4d4f7b380d7f265e862] Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES

which I guess should narrow the problem down for anyone familiar with the code.

Comment 2 Bjørn Mork 2010-11-04 08:07:16 UTC
I've now narrowed it down to:

commit 19d8c0cf50e98909c533ebfce3a0dd3f72b755c1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Nov 29 21:16:49 2009 +0000

    uxa: PutImage acceleration

This cannot be reverted cleanly on newer versions, but this patch will have the same effect (and is verified to fix the problem, although it of course has unwanted side effects like leaving dead code and impacting performance):

diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index 61e857f..c34ba18 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -1157,7 +1157,6 @@ Bool i830_uxa_init(ScreenPtr screen)
        /* PutImage */
-       intel->uxa_driver->put_image = i830_uxa_put_image;
        intel->uxa_driver->get_image = i830_uxa_get_image;
        intel->uxa_driver->prepare_access = i830_uxa_prepare_access;
Comment 3 Christian Henz 2010-11-09 01:21:03 UTC
* Problem seems to only occur when the window that is switching to fullscreen
already has the native resolution

This is actually not true.

The application that gets switched to fullscreen does not show an image, but after that application exits, the image comes back when the desktop resolution is restored. When the application was running at desktop resolution, the image does not come back.
Comment 4 Bjørn Mork 2010-12-30 06:54:22 UTC
Created attachment 41527 [details] [review]
Disabling put_image as a temporary workaround

This is the same patch as I've previously posted as a comment, now added as an attachment as well
Comment 5 Chris Wilson 2010-12-30 07:35:05 UTC
Created attachment 41528 [details] [review]
Avoid bo replacement on scanout and other bound buffers.
Comment 6 Bjørn Mork 2010-12-30 08:47:08 UTC
(In reply to comment #5)
> Created an attachment (id=41528) [details]
> Avoid bo replacement on scanout and other bound buffers.

Thanks.  I can confirm that this patch fixes the problem for me.

Comment 7 Chris Wilson 2010-12-30 08:49:45 UTC
Pushed to master, will be in 2.14.
Comment 8 Anonymous Helper 2011-01-01 09:11:39 UTC
I think this change makes X segfault when I fullscreen a flash video. 

Commit 7667ad84 does not crash. Commit 53fbc9f176 of xf86-video-intel-git does crash.
Comment 9 Anonymous Helper 2011-01-01 09:13:23 UTC
Sorry I forgot to add little information I do have. From the Xorg.log: 

[  3723.555]
[  3723.555] 0: /usr/bin/X (xorg_backtrace+0x3b) [0x80e60fb]
[  3723.555] 1: /usr/bin/X (0x8048000+0x5cd05) [0x80a4d05]
[  3723.555] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0xb77a540c]
[  3723.555] 3: /usr/lib/xorg/modules/drivers/intel_drv.so (0xb733f000+0x1f78b) [0xb735e78b]
[  3723.555] 4: /usr/lib/xorg/modules/extensions/libdri2.so (0xb73a1000+0x1050) [0xb73a2050]
[  3723.555] 5: /usr/lib/xorg/modules/extensions/libdri2.so (0xb73a1000+0x1b2b) [0xb73a2b2b]
[  3723.555] 6: /usr/lib/xorg/modules/extensions/libdri2.so (0xb73a1000+0x3817) [0xb73a4817]
[  3723.555] 7: /usr/bin/X (0x8048000+0x27177) [0x806f177]
[  3723.555] 8: /usr/bin/X (0x8048000+0x1a1b5) [0x80621b5]
[  3723.555] 9: /lib/libc.so.6 (__libc_start_main+0xe6) [0xb74d1c76]
[  3723.555] 10: /usr/bin/X (0x8048000+0x19d91) [0x8061d91]
[  3723.555] Segmentation fault at address 0x10
[  3723.555]
Fatal server error:
[  3723.555] Caught signal 11 (Segmentation fault). Server aborting
[  3723.555]

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.