New issue
Advanced search Search tips

Issue 721195 link

Starred by 1 user

Issue metadata

Status: Available
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Disconnecting external display in docked mode shouldn't activate internal display

Project Member Reported by osh...@chromium.org, May 11 2017

Issue description

chrome:60.0.3096.0
cros: 9524.0.0

caroline

Repro step:
1) boot & login
2) connect external display
3) close lid
4) disconnect external display.

at the 4) step, DisplayManager::OnNativeDisplayCHanged gets empty
display list first, but then got the internal display.

This will change the desktop state, and may result in unexpected
window layout when resumed. I believe this was working before (at least in x11 era)

kylechar@, can you look into this?


 
I took a quick look just now. I ran into another bug which I filled under  crbug.com/721452 .

When disconnecting the external display sometimes I find that DisplayManager::OnNativeDisplayChanged() gets run. If there are 0 in |updated_displays| and there was an active display before then it should immediately return here:

https://cs.chromium.org/chromium/src/ui/display/manager/display_manager.cc?sq=package:chromium&dr=CSs&l=574

I think that is the code you mentioned oshima? That code seems to work correctly. When it gets hit we don't wake up the internal display.

I'm finding that sometimes when I remove/insert the cable for an external display I'm not getting any events from Ozone DRM. I'm not sure if this is a problem with my machine or another bug in Ozone somewhere.
I was able to reproduce the bug where when removing an external display with the lid closed the following happens:

1. DisplayManager::OnNativeDisplayChanged() called with updated_displays.size() == 0
2. DisplayManager::OnNativeDisplayChanged() called with updated_displays.size() == 1 (internal display)
3. DisplayManager::OnNativeDisplayChanged() called with updated_displays.size() == 0

Comment 3 by osh...@chromium.org, May 11 2017

Thank you for looking into this. Yes, 2 should not happen.

Comment 4 by wutao@chromium.org, May 11 2017

Blocking: 718232

Comment 5 by wutao@chromium.org, May 11 2017

Right before 2 in #2 happens, the status was wrong:
new_display_state=SINGLE new_power_state=ALL_ON
It should be new_power_state=ALL_OFF, what should be the status of new_display_state when lid is close and no external?


[11185:11195:0511/140005.395611:WARNING:screen_manager.cc(114)] Display controller (crtc=19) already present.
[11144:11144:0511/140005.397744:VERBOSE1:display_configurator.cc(947)] Display snapshots invalidated.
[11144:11144:0511/140005.398511:VERBOSE1:update_display_configuration_task.cc(76)] OnDisplaysUpdated: new_display_state=SINGLE new_power_state=INTERNAL_OFF_EXTERNAL_ON flags=0 force_configure=1 display_count=1
[11144:11144:0511/140005.398852:VERBOSE1:display_configurator.cc(213)] EnterState: display=SINGLE power=INTERNAL_OFF_EXTERNAL_ON
[11185:11195:0511/140005.400413:VERBOSE1:drm_display.cc(102)] DRM configuring: device=/sys/devices/pci0000:00/0000:00:02.0/drm/card0 crtc=19 connector=30 origin=0,0 size=0x0
[11144:11144:0511/140005.402390:VERBOSE1:display_configurator.cc(1056)] OnConfigured: success=1 new_display_state=SINGLE new_power_state=INTERNAL_OFF_EXTERNAL_ON
[11144:11144:0511/140005.404472:ERROR:display_manager.cc(551)] updated_displays_____0
[11144:11144:0511/140005.406073:VERBOSE1:display_configurator.cc(899)] SetDisplayPower: power_state=ALL_ON flags=0, configure timer=Stopped
[11185:11195:0511/140005.438184:WARNING:screen_manager.cc(114)] Display controller (crtc=19) already present.
[11144:11144:0511/140005.440721:VERBOSE1:display_configurator.cc(947)] Display snapshots invalidated.
[11144:11144:0511/140005.441342:VERBOSE1:update_display_configuration_task.cc(76)] OnDisplaysUpdated: new_display_state=SINGLE new_power_state=ALL_ON flags=0 force_configure=0 display_count=1
[11144:11144:0511/140005.441630:VERBOSE1:display_configurator.cc(213)] EnterState: display=SINGLE power=ALL_ON
[11185:11195:0511/140005.443306:VERBOSE1:drm_display.cc(102)] DRM configuring: device=/sys/devices/pci0000:00/0000:00:02.0/drm/card0 crtc=19 connector=30 origin=0,0 size=2560x1700
[11144:11144:0511/140006.602834:VERBOSE1:display_configurator.cc(1056)] OnConfigured: success=1 new_display_state=SINGLE new_power_state=ALL_ON
[11144:11144:0511/140006.603565:ERROR:display_manager.cc(551)] updated_displays_____1
[11144:11144:0511/140006.603646:ERROR:display_manager.cc(553)] dis____________13761487533244416
Received signal 11 SEGV_MAPERR 000000000018

I've looked into it a bit further. When the external display is removed there are three rounds of display configuration that happen using UpdateDisplayConfigurationTask. The power state is what changes between each run UpdateDisplayConfigurationTask.

1. After the external display is removed, UpdateDisplayConfigurationTask runs with the power state INTERNAL_OFF_EXTERNAL_ON. I think this is power state from before the external display is removed. DisplayManager::OnNativeDisplayChanged() exits early here.
2. Something sets the power state to ALL_ON and UpdateDisplayConfigurationTask runs again. This causes DisplayManager::OnNativeDisplayChanged() to actually run and is the problem.
3. Something sets the power state to ALL_OFF. UpdateDisplayConfigurationTask runs for the third time. DisplayManager::OnNativeDisplayChanged() exists early here.

Comment 7 by wutao@chromium.org, May 12 2017

Blocking: -718232
I'm OOO for the next two weeks. If this needs to get resolved before I get back please reassign oshima, otherwise I'll fix it then.

Comment 9 by wutao@chromium.org, May 12 2017

Cc: kylec...@chromium.org
Owner: wutao@chromium.org
#8, I can look this.
Labels: -M-60 M-65
Labels: -M-65 M-67

Comment 12 by wutao@chromium.org, May 30 2018

Owner: warx@chromium.org
Hi warx@, do you have time to look this. This is old one, maybe already have been fixed.

Comment 13 by warx@chromium.org, Jun 26 2018

Owner: ----
Status: Untriaged (was: Assigned)
Cc: -wutao@chromium.org afakhry@chromium.org
Owner: wutao@chromium.org
Status: Assigned (was: Untriaged)
wutao, can you own this now that warx is gone?
Cc: osh...@chromium.org wutao@chromium.org
Owner: ----
Status: Available (was: Assigned)
Hi oshima@, is there still happening?
Cc: -afakhry@chromium.org
Owner: afakhry@chromium.org
Ahmed, can you check this behavior with tot?
Labels: -M-67 M-72

Sign in to add a comment