Bug 24383

Summary: [KMS] Black screen when xserver is reset (KDE logout)
Product: xorg Reporter: Albert Damen <albrt>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: tobias.hain
Version: unspecifiedKeywords: patch
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
URL: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/432521
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
X log after logging out
none
Possible fix none

Description Albert Damen 2009-10-07 14:59:50 UTC
Bug description:
When logging out from KDE (Kubuntu Karmic), the login screen does not appear. Instead the screen stays black, only showing the mouse cursor.

System environment:
-- chipset: GM965
-- system architecture: 64-bit
-- xf86-video-intel: 2.9.0
-- xserver: 1.6.3
-- mesa: 7.6.0~git20090817 (up to git commit 7c4223876b4f)
-- libdrm: 2.4.13
-- kernel: 2.6.31-12-generic (based on 2.6.31.2)
-- Linux distribution: Kubuntu Karmic (development release)
-- Machine or mobo model: Compal laptop IFL91
-- Display connector: LVDS

Reproducing steps:
Make sure TerminateServer is false (or not set) in /etc/kde4/kdm/kdmrc, so the xserver is reset instead of restarted at logout (default in Kubuntu).
Logout from the session and wait for the login screen. Notice the screen stays black, only the mouse cursor is visible and changes shape if it is moved over the (invisible) password entry box.

Additional info:
With UMS the problem does not exist. The login screen is shown properly after logging out with UMS.

Debugging with gdb shows:
- pI830->front-buffer has got a new value after the logout
- drmmode_set_mode_major is called but drmModeAddFB is not called because drmmode->fb_id is not 0.

Attached patch solves the problem for me, by setting drmmode->fb_id=0 in I830CloseScreen, so drmModeAddFB is called with the new frontbuffer. It also seemed cleaner to call drmModeRmFB at the same time to drop the old frontbuffer from the crtc.
Comment 1 Albert Damen 2009-10-07 15:01:12 UTC
Created attachment 30146 [details]
X log after logging out
Comment 2 Albert Damen 2009-10-07 15:03:24 UTC
Created attachment 30147 [details] [review]
Possible fix

I had to add a new public function in drmmode_display.c to set drmmode->fb_id=0 and call drmModeRmFB. I am not sure if that was really needed; there may be a better place to do this.
Comment 3 Jesse Barnes 2009-10-13 10:52:54 UTC
Pushed this to xf86-video-intel:

commit fcc2ee48b866b81c79315ff10189b56fc201539d
Author: Albert Damen <albrt@gmx.net>
Date:   Wed Oct 7 21:55:42 2009 +0200

    Drop frontbuffer from crtc in I830CloseScreen

Thanks.

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.