Bug 90447 - [SKL][Audio]cannot refresh the ELD information after xinit
Summary: [SKL][Audio]cannot refresh the ELD information after xinit
Status: CLOSED INVALID
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-14 08:15 UTC by Libin Yang
Modified: 2017-07-24 22:47 UTC (History)
2 users (show)

See Also:
i915 platform: SKL
i915 features: display/audio


Attachments
dmesg (123.58 KB, text/plain)
2015-06-08 08:29 UTC, Libin Yang
no flags Details
full dmesg (357.66 KB, text/plain)
2015-06-09 07:35 UTC, Libin Yang
no flags Details
test patch (8.02 KB, patch)
2015-07-01 06:15 UTC, Libin Yang
no flags Details | Splinter Review

Description Libin Yang 2015-05-14 08:15:57 UTC
Bug detailed description
after running xinit, and unplug the DP/HDMI monitor, the ELD information cannot refresh.
Reproduce Steps
1. initiate X: xinit &
2. keep xinit and open ssh and check the ELD information, will listed(take DP as example):
$ cat /proc/asound/PCH/eld#2.1

gfx driver should call intel_audio_codec_enable/disable to notify audio driver the hotplug of DP/HDMI monitor. But in xinit, these functions are not called. And then there is no interrupt for audio driver to detect the events.
Comment 1 Libin Yang 2015-05-19 08:55:40 UTC
anyone can help on this issue? Thanks.
Comment 2 Libin Yang 2015-06-05 02:11:11 UTC
any update on this issue?
Comment 3 Jani Nikula 2015-06-05 09:05:21 UTC
Please add drm.debug=14 module parameter, reboot and reproduce the problem, attach dmesg all the way from boot to the problem.
Comment 4 Libin Yang 2015-06-08 08:29:35 UTC
Created attachment 116357 [details]
dmesg
Comment 5 Libin Yang 2015-06-08 08:30:56 UTC
Hi Jani,

Please see the attachment.

Thanks,
Libin
Comment 6 Jani Nikula 2015-06-08 08:38:08 UTC
(In reply to Jani Nikula from comment #3)
> Please add drm.debug=14 module parameter, reboot and reproduce the problem,
> attach dmesg all the way from boot to the problem.

All the way from early boot please. Add log_buf_len=4M or similar as needed.
Comment 7 Libin Yang 2015-06-09 07:35:12 UTC
Created attachment 116387 [details]
full dmesg
Comment 8 Libin Yang 2015-06-09 07:35:41 UTC
Hi Jani,

It this one dmesg.xinit.2 OK?

Thanks,
Libin
Comment 9 Libin Yang 2015-06-18 07:39:07 UTC
any update on it?
Comment 10 Libin Yang 2015-07-01 06:15:10 UTC
Test on the latest kernel, but the same result as before.

I'm told to test the attached patch. But I failed applying the patch manually. Seems some functions are missed. Anyone can help on the patch rebasing?
Comment 11 Libin Yang 2015-07-01 06:15:58 UTC
Created attachment 116839 [details] [review]
test patch
Comment 12 Libin Yang 2015-07-01 06:43:25 UTC
Please be noted that this issue only happens after run xinit. In text mode, it is OK.
Comment 13 Jani Nikula 2015-07-01 09:02:32 UTC
The log is slightly cut short. Do you do a modeset after the hotplug? I can only see the hotplug, nothing more. You can't do audio over the DP/HDMI before you have done the modeset and have the link set up. Currently we don't notify the audio driver before you have done the modeset and you can actually enable audio.
Comment 14 Mengdong Lin 2015-07-01 09:33:33 UTC
(In reply to Jani Nikula from comment #13)
> The log is slightly cut short. Do you do a modeset after the hotplug? I can
> only see the hotplug, nothing more. You can't do audio over the DP/HDMI
> before you have done the modeset and have the link set up. Currently we
> don't notify the audio driver before you have done the modeset and you can
> actually enable audio.

HiJani,

Is it X that should trigger the modeset?

And should x always trigger the modeset after a hot-plug in even if the monitor EDID and resolution don't change?
I guess i915 or DRM driver keeps the orignal EDID and resolution.


Thanks!
Comment 15 Jani Nikula 2015-07-01 10:37:34 UTC
(In reply to Mengdong Lin from comment #14)
> Is it X that should trigger the modeset?

Yes. The kernel sends a hotplug uevent the userspace listens to. Please verify that you get the uevent by running 'udevadm monitor' and plugging/unplugging.

> And should x always trigger the modeset after a hot-plug in even if the
> monitor EDID and resolution don't change?

Yes. We don't cache that information, so they are lost on unplug. We don't know if the display is the same or not.

> I guess i915 or DRM driver keeps the orignal EDID and resolution.

No, we don't.

The issue you're probably seeing is that hotplug/hotunplug itself does not set/invalidate the ELD, and therefore does not notify the audio driver. The notification to audio driver happens as part of the modeset sequence, triggered by userspace.

If your userspace does get the hotplug uevent, but does not trigger the modeset, the problem is in your userspace.

If your userspace does not get the uevent, or the subsequent modeset sequence triggered by userspace does not notify the audio driver, the problem is in the kernel display driver.
Comment 16 Libin Yang 2015-07-02 02:10:56 UTC
Hi Jani,

I have run 'udevadm monitor' and do the unplugging/plugging, it shows:
KERNEL[63094.561103] change    /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV  [63094.563084] change    /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[63104.350107] change    /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV  [63104.351986] change    /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)

So it means the userspace got the event. This is the userspace issue, right?

What the right action flow after the hotplug?
Comment 17 Jani Nikula 2015-07-02 08:14:10 UTC
You need a display manager that responds to hotplug notifications.
Comment 18 Libin Yang 2015-07-03 02:27:08 UTC
Hi Jani,

(In reply to Jani Nikula from comment #17)
> You need a display manager that responds to hotplug notifications.

Do you mean such as gdm?

So this means it is a userspace issue, the gfx driver team will not debug this issue, right?

Could you give some info about what the right action flow after the hotplug?
Such as when hotplug, it will call what function in kernel to notify the userspace, how userspace trigger the modeset.

Thanks,
Libin
Comment 19 Chris Wilson 2015-07-03 08:48:16 UTC
The stance we have taken is that userspace is in charge of handling notifications to topology changes - for a couple of reasons, this moves the policy from the kernel to the user, and the other is that it should allow for fast reconnection (often also desirable, but impossible if the kernel acts).

You actually need to run "udevadm monitor --property --tag-match=HOTPLUG" to see if the hotplug event is indeed the uevent being sent. Equally a small X client listening to RR notifications to confirm that they are being received and propagated (X needs to be built with udev support for example). And finally, but not last of all you need a client to respond to the RR notifications and issue a new modeset (and that depends upon your window/desktop/session manager).

As a last resort, an xrandr --auto, should issue the modeset required to confirm that ELD notifications are being sent following a modeset following a hotplug.
Comment 20 Libin Yang 2015-07-06 02:11:33 UTC
Hi Chris,

Thanks for the details.

My test result is:

root@younglee-001:~# udevadm monitor --property --tag-match=HOTPLUG
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[70.693213] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
MAJOR=226
MINOR=0
SEQNUM=2984
SUBSYSTEM=drm

KERNEL[83.786766] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
MAJOR=226
MINOR=0
SEQNUM=2985
SUBSYSTEM=drm

And after I run the xrandr --auto, the audio driver can detect the hotplug and the eld info is updated.

So this is userspace issue and the kernel is OK, right? Thanks for your help.

Regards,
Libin


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.