Bug 81258 - [hsw dp aux] Hardware polling takes over a second due to aux native defer
Summary: [hsw dp aux] Hardware polling takes over a second due to aux native defer
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-12 07:00 UTC by Manuel Schneider
Modified: 2017-07-24 22:53 UTC (History)
2 users (show)

See Also:
i915 platform: HSW
i915 features: display/DP


Attachments
dmesg|grep drm (1.1) (502.03 KB, text/plain)
2014-08-22 12:06 UTC, Manuel Schneider
no flags Details
dmesg|grep drm (1.2) (503.04 KB, text/plain)
2014-08-22 12:06 UTC, Manuel Schneider
no flags Details
journalctl with DP1.1 (1.06 MB, text/plain)
2014-09-24 09:06 UTC, Manuel Schneider
no flags Details
journalctl with DP1.2 (1.07 MB, text/plain)
2014-09-24 09:06 UTC, Manuel Schneider
no flags Details
journalctl with DP1.2 HDMI disconnected (702.42 KB, text/plain)
2014-09-24 12:46 UTC, Manuel Schneider
no flags Details
journalctl with DP1.1 HDMI disconnected (699.26 KB, text/plain)
2014-09-24 12:47 UTC, Manuel Schneider
no flags Details
xrandr --verbose HDMI disconnected (7.90 KB, text/plain)
2014-09-24 12:48 UTC, Manuel Schneider
no flags Details
dmesg (DP1.1a) (508.94 KB, text/plain)
2015-01-30 15:23 UTC, Manuel Schneider
no flags Details
dmesg DP1.2 (503.73 KB, text/plain)
2015-01-30 15:23 UTC, Manuel Schneider
no flags Details

Description Manuel Schneider 2014-07-12 07:00:05 UTC
When I use my Dell U2414H connected via DisplayPort the polling for hardware takes more than a second (using xrandr). Unfortunately this seems to be done by several Gtk applications and every qt application on startup.

This is dmesg with drm.debug=0xe commandline. I cut about a million "drm:drm_dp_i2c_do_msg] native defer" lines to make it cleaner http://pastebin.com/H4Zh9Dny

Environment:
Intel i5-4590, MSI b85i, no dedicated graphics, 8GB, Samsung SSD 840 Evo.
Archlinux, Kernel 3.15.5-1-ARCH, using i915

This happens as well under Ubuntu Live 14.04.

Please contact me if you need more information.
Comment 1 Todd Previte 2014-07-15 17:24:48 UTC
Can you post the raw log? I'd like to see when/where/how many native defers the monitor is issuing. Is your display set up in Displayport 1.2 mode or 1.1a?

-T
Comment 2 Manuel Schneider 2014-07-16 13:50:06 UTC
http://pastebin.com/Hxg4GVwk

Display is set to Displayport 1.2.
Comment 3 Chris Wilson 2014-07-18 06:01:32 UTC
Can you file a bug against any application that is slow as well? XRRGetScreenResourcesCurrent() is the call they should be using (which uses the known configuration rather than forcing the redetection).
Comment 4 Manuel Schneider 2014-07-21 07:32:42 UTC
Does this make sense? This is rather a core problem. I reported a bug at Qt because polling hardware on every program start is not optimal. A Gtk example is the gnome systemsettings, which makes sense though. This bug is flagged with NEEDINFO. Which info do you need?
Comment 5 Chris Wilson 2014-07-21 07:46:23 UTC
Both are issues. At best hardware polling will take ~0.2s (obviously this scales with the number of attached displays). Almost all software doesn't care about forcing the detection of new outputs, but only wants to know the current configuration - the difference is ~0.2s for every single unnecessary call. I am tempted to make all such queries slow to try and teach application developers to use the right interfaces.
Comment 6 Manuel Schneider 2014-07-21 07:51:41 UTC
Yes, I agree, but polling with DisplayPort takes about 2 seconds, even with all other outputs set to ignore in xorg.conf, and it would not be that crucial if the X server would not freeze completely. I gave the Qt developers a hint to use current ressources (https://bugreports.qt-project.org/browse/QTBUG-40207?focusedCommentId=250727&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-250727)
Comment 7 Chris Wilson 2014-07-21 07:55:29 UTC
Don't worry! It is not an excuse for us to try and fix the hw/driver issues. The extra probing are just a nuisance for when we are trying to get down to a few tens of milliseconds startup time.
Comment 8 Todd Previte 2014-07-21 22:35:06 UTC
Can you switch your monitor back to 1.1a and see if it still issues all those defers?

From the log, it looks like we're spending an inordinate amount of time waiting for the display to respond to the EDID request(s). From the beginning to the end of the first block of defers if about 0.65 seconds. That's just for the first EDID read. 

Part of the reason for this is the number of retries and the transaction delays required by the Displayport specification. Each deferred transaction must be reattempted 7 times and each time it waits the normal 400us plus an additional 500-600us to give the sink more time to respond. So each defer costs roughly 1ms of time. A minimum of 8 transactions is required to read an entire 128-byte EDID block (16 bytes maximum per I2C-over-AUX transaction). However, the sink device is not required to reply with all of the data for the transaction. It can ACK with partial data and continue the transaction on the next request. So what should have been a single 16-byte transaction could turn into five 3-byte transactions and one 1-byte transaction. Each of these transactions can also be deferred up to 7 times, so those individual transaction delays that seem somewhat insignificant can really start to add up.

-T
Comment 9 Manuel Schneider 2014-08-22 12:06:11 UTC
Created attachment 105098 [details]
dmesg|grep drm (1.1)
Comment 10 Manuel Schneider 2014-08-22 12:06:37 UTC
Created attachment 105099 [details]
dmesg|grep drm (1.2)
Comment 11 Manuel Schneider 2014-08-22 12:12:26 UTC
Sorry that I abandoned this thread, I had to write my exams.

Meanwhile I use 3.16.1-1-ARCH, xf86-video-intel 2.99.914-4 and intel-dri 10.2.6-1. But I still have this problem. I attached the logs of a boot and login with both configurations of the screen (DP 1.1 and DP 1.2). If you need more info, let me know.
Comment 12 Manuel Schneider 2014-09-23 20:38:26 UTC
Bump
Comment 13 Rodrigo Vivi 2014-09-23 23:02:37 UTC
Todd, any idea?
New logs shows the native defer and along with the message on the code there is the wait 500-600 us you had mentioned.
Comment 14 Jani Nikula 2014-09-24 08:24:54 UTC
Also, any chance for a full dmesg without grepping, and all the way from boot with drm.debug=0xe set.
Comment 15 Manuel Schneider 2014-09-24 09:06:06 UTC
Created attachment 106772 [details]
journalctl with DP1.1
Comment 16 Manuel Schneider 2014-09-24 09:06:21 UTC
Created attachment 106773 [details]
journalctl with DP1.2
Comment 17 Manuel Schneider 2014-09-24 09:07:28 UTC
I added the logs. This time from journalctl since dmesg seemed to display only drm stuff.
Comment 18 Jani Nikula 2014-09-24 11:26:59 UTC
How do you connect the monitor? What kind of adapters do you have? Do you have a dual display setup; can you try with only one display connected?
Comment 19 Manuel Schneider 2014-09-24 11:30:49 UTC
My monitor Dell U2414H is connected to my mainboard MSI B85I directly with a Display Port cable. Normal DP at the mainboard MiniDP at the monitor. No adapters. I use only one monitor, since I read that MST will be supported not until kernel 3.17
Comment 20 Jani Nikula 2014-09-24 11:45:47 UTC
Odd. By the logs it looks like you have a DP branch device and also a HDMI monitor... What does xrandr --verbose say?
Comment 21 Manuel Schneider 2014-09-24 12:46:57 UTC
Created attachment 106789 [details]
journalctl with DP1.2 HDMI disconnected
Comment 22 Manuel Schneider 2014-09-24 12:47:17 UTC
Created attachment 106790 [details]
journalctl with DP1.1 HDMI disconnected
Comment 23 Manuel Schneider 2014-09-24 12:48:49 UTC
Created attachment 106791 [details]
xrandr --verbose HDMI disconnected
Comment 24 Manuel Schneider 2014-09-24 12:50:17 UTC
Damn. Sorry for stealing your time. I had the HDMI cable connected. I have to switch everytime because the KDE desktop is unusable with this two bugs. I added attachments with HDMI disconnected and xrandr --verbose.
Comment 25 Manuel Schneider 2014-10-24 17:40:45 UTC
On linux 3.17.1, mesa-dri 10.3.1, xf86-video-intel 2.99.916 still the same. I hoped that with 3.17 this will change since MST was added... :(
Comment 26 Jani Nikula 2015-01-29 14:09:48 UTC
Is this still an issue with v3.18 or v3.19-rc kernels?

How about with patch
http://mid.gmane.org/1422373429-10137-1-git-send-email-simon.farnsworth@onelan.co.uk
Comment 27 Manuel Schneider 2015-01-30 15:23:03 UTC
Created attachment 112976 [details]
dmesg (DP1.1a)
Comment 28 Manuel Schneider 2015-01-30 15:23:37 UTC
Created attachment 112977 [details]
dmesg DP1.2
Comment 29 Manuel Schneider 2015-01-30 15:26:27 UTC
Yes this is still an issue. KDE is unusable. I experience several freezes at X start. Hangs at start of Qt apps. Login Manager is completely screwed up with DP 1.2. Things are even worse than before.
Comment 30 Jani Nikula 2015-02-04 14:12:58 UTC
Did you try the patch from comment #26?
Comment 31 Manuel Schneider 2015-02-04 14:14:38 UTC
Sorry I am just an average user. I dont know whow to patch. Maybe you can help me?
Comment 32 Jani Nikula 2015-02-04 14:37:42 UTC
(In reply to Manuel Schneider from comment #31)
> Sorry I am just an average user. I dont know whow to patch. Maybe you can
> help me?

Sorry, we pretty much expect the users filing bugs here to be able to try the fixes. Otherwise your best bet is your distro's bug tracker.

In order to patch the kernel, you'd need to learn a bunch of things, like how to download kernel sources (preferrably using git), how to patch the source, how to configure the kernel, how to build the kernel, and how to install the kernel.

Here are a few pointers on how to get started, if you're still interested:

https://wiki.archlinux.org/index.php/Kernels#Patches_and_Patchsets
http://kernelnewbies.org/KernelBuild
Comment 33 Manuel Schneider 2015-07-03 17:24:08 UTC
To be honest I understated the case. I am familiar with git and know how to use compilers although I am always avoiding makefiles. I built a lot of things but I never touched the kernel. I will try as soon I have a bit more time.
Comment 34 Jani Nikula 2015-10-23 12:21:48 UTC
We've fixed plenty of issues with the DP aux/i2c-over-aux code lately; I presume this is fixed upstream too. Please reopen if the problem persists with latest kernels.


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.