Bug 98141 - [SKL] Can not choose correct refresh rate when using docking station
Summary: [SKL] Can not choose correct refresh rate when using docking station
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Dhinakaran Pandiyan
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-07 09:05 UTC by Phidias Chiang
Modified: 2016-12-13 08:51 UTC (History)
4 users (show)

See Also:
i915 platform: SKL
i915 features: display/DP MST


Attachments
dmesg when monitor plug in (37.54 KB, text/plain)
2016-10-07 09:05 UTC, Phidias Chiang
no flags Details
xrandr --verbose (15.99 KB, text/plain)
2016-10-07 09:06 UTC, Phidias Chiang
no flags Details
dmesg when booting (115.55 KB, text/plain)
2016-10-07 09:18 UTC, Phidias Chiang
no flags Details
testpatch to pass the dock based on intel_dp_mode_valid function (2.26 KB, patch)
2016-11-11 09:14 UTC, rich.chen
no flags Details | Splinter Review
attachment-22249-0.html (2.83 KB, text/html)
2016-12-13 08:51 UTC, Cooper Chiou
no flags Details

Description Phidias Chiang 2016-10-07 09:05:36 UTC
Created attachment 127089 [details]
dmesg when monitor plug in

kernel: drm-intel-nightly/2016-10-07 [1]
distro: Ubuntu Linux 16.04
connector: mDP
VGA: [8086:591b]

We have a usb docking station only supports up to 30Hz with 4K resolution when using mDP. And when we connect monitors that support 4K@60Hz to docking station, the system choose 60Hz and the monitor gives blank screen. We have to manually set the refresh rate to 30Hz to use the external monitor.

The attachment is dmesg with drm.debug=0xe, after plugging monitor to the docking station.

[1]: http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-nightly/2016-10-07/
Comment 1 Phidias Chiang 2016-10-07 09:06:13 UTC
Created attachment 127090 [details]
xrandr --verbose
Comment 2 Phidias Chiang 2016-10-07 09:18:57 UTC
Created attachment 127092 [details]
dmesg when booting
Comment 4 Ville Syrjala 2016-10-07 09:21:58 UTC
intel_dp_mst_compute_config() calculates tu size as 96:
[   73.890269] [drm:intel_dump_pipe_config [i915]] dp: 1, lanes: 2, gmch_m: 12425625, gmch_n: 8388608, link_m: 1035468, link_n: 1048576, tu: 96

But when we read it out we get 32 apparently:
[   79.467108] [drm:intel_pipe_config_compare [i915]] *ERROR* mismatch in dp_m_n (expected tu 96 gmch 12425625/8388608 link 1035468/1048576, or tu 0 gmch 0/0 link 0/0, found tu 32, gmch 12425625/8388608 link 1035468/1048576)

Bspec says
"Restriction : In DisplayPort MST mode the Virtual Channel payload size must not be programmed greater than 62 (resulting payload size of 63)."

which means our computed VC payload size would seem to be invalid. Someone should look into this.
Comment 5 Phidias Chiang 2016-10-07 10:09:34 UTC
I just applied the patch and compiled the kernel, it still failed and shows the same message ("mismatch in dp_m_n (expected tu 96 gmch 12425625/8388608 link 1035468/1048576, or tu 0 gmch 0/0 link 0/0, found tu 32, gmch 12425625/8388608 link 1035468/1048576)")
Comment 6 Dhinakaran Pandiyan 2016-11-08 04:13:10 UTC
Apart from that mismatch, there are underruns when the encoder is being enabled. 

...
[   75.266521] [drm:intel_cpu_fifo_underrun_irq_handler [i915]] *ERROR* CPU pipe B FIFO underrun
[   75.266550] [drm:intel_fbc_underrun_work_fn [i915]] Disabling FBC due to FIFO underrun.
...


@Phidias Chiang 
There were watermark fixes that got merged after this bug was created. Can you retest with the latest -nightly?
Comment 7 Dhinakaran Pandiyan 2016-11-10 00:43:03 UTC
As Ville pointed out, the TU size is definitely incorrect here.

Not just that, there is simply not enough bandwidth for that mode with the config that is being setup.

The stream bandwidth for 4k @60Hz, 24 bpp is 1599.75 MBps whereas with just 2 lanes and link clock at 540MHz, we can support only 1080 MBps. This configuration should have been rejected.
Comment 8 Dhinakaran Pandiyan 2016-11-10 20:07:28 UTC
Can you give this a try - https://patchwork.freedesktop.org/series/15084/ ?
Comment 9 Dhinakaran Pandiyan 2016-11-10 20:08:33 UTC
(In reply to Dhinakaran Pandiyan from comment #7)
> As Ville pointed out, the TU size is definitely incorrect here.
> 
> Not just that, there is simply not enough bandwidth for that mode with the
> config that is being setup.
> 
> The stream bandwidth for 4k @60Hz, 24 bpp is 1599.75 MBps whereas with just
> 2 lanes and link clock at 540MHz, we can support only 1080 MBps. This
> configuration should have been rejected.

mode should have been rejected*
Comment 10 rich.chen 2016-11-11 09:14:41 UTC
Created attachment 127913 [details] [review]
testpatch to pass the dock based on intel_dp_mode_valid function

The test patch is workable based on the feedback of Canonical.com as the below:
    We applied the said patch to 4.9.x kernel and tried it with the Dell IE dock.
    With it, the Dell 4K monitor was correctly.

But, the test patch is based on DP function(intel_dp_mode_valid),so we need to wait for official DP-MST function(intel_dp_mst_mode_valid) to be delivered.

Thanks.
Comment 11 rich.chen 2016-11-11 09:20:00 UTC
echo comment#10
  Some modes from sink edid should be filtered based on DPCD - Sink capability.
  In this case, 4k@60HZ is over the sink capability.
Comment 12 Dhinakaran Pandiyan 2016-11-15 16:00:41 UTC
I have resubmitted the series here - https://patchwork.freedesktop.org/series/15305/ .
Comment 13 rich.chen 2016-11-16 02:42:43 UTC
Hi Dell team:
   Backend team has submitted the patch(@comment 12) which is similar with my test patch.
   It should be workable and it is under review.
   Please kindly help to have test and wait for the patch to review and merge.

Thanks.
Comment 14 Cooper Chiou 2016-11-17 02:22:10 UTC
Update test result from Canonical team for this patch(https://patchwork.freedesktop.org/series/15305/):

After applied this patch set on top of current drm-intel-nightly (2016-11-14) and it works, xrandr shows correct refresh rate and the monitor using mDP works fine.
Comment 15 yann 2016-11-21 08:11:58 UTC
Reference to latest Dhinakaran's patchset (including the one fixing issue): https://patchwork.freedesktop.org/series/15528/
Comment 16 Jari Tahvanainen 2016-12-08 16:11:48 UTC
Marking as resolved+fixe based on comment 14.
Comment 17 Jani Nikula 2016-12-12 14:55:47 UTC
(In reply to Jari Tahvanainen from comment #16)
> Marking as resolved+fixe based on comment 14.

Jari, we only resolve bugs when the patches have been pushed to our repo.
Comment 18 Dhinakaran Pandiyan 2016-12-12 19:32:11 UTC
(In reply to yann from comment #15)
> Reference to latest Dhinakaran's patchset (including the one fixing issue):
> https://patchwork.freedesktop.org/series/15528/

^Not the right series.

The correct one is - https://patchwork.freedesktop.org/series/15305/ and this is the one tested in comment 14.
Comment 19 Dhinakaran Pandiyan 2016-12-12 19:34:21 UTC
(In reply to Jani Nikula from comment #17)
> (In reply to Jari Tahvanainen from comment #16)
> > Marking as resolved+fixe based on comment 14.
> 
> Jari, we only resolve bugs when the patches have been pushed to our repo.


The patches (https://patchwork.freedesktop.org/series/15305/) that fix this issue are in drm-tip/drm-tip

22a2c8e drm/i915: Validate mode against max. link data rate for DP MST
fd81c44 drm/i915: Fix DP link rate math
Comment 20 Jani Nikula 2016-12-13 08:51:14 UTC
(In reply to Dhinakaran Pandiyan from comment #19)
> (In reply to Jani Nikula from comment #17)
> > (In reply to Jari Tahvanainen from comment #16)
> > > Marking as resolved+fixe based on comment 14.
> > 
> > Jari, we only resolve bugs when the patches have been pushed to our repo.
> 
> 
> The patches (https://patchwork.freedesktop.org/series/15305/) that fix this
> issue are in drm-tip/drm-tip
> 
> 22a2c8e drm/i915: Validate mode against max. link data rate for DP MST
> fd81c44 drm/i915: Fix DP link rate math

Thanks. It would be good policy in general to reference the commits when closing the bugs, if the commit ids are known.
Comment 21 Cooper Chiou 2016-12-13 08:51:32 UTC
Created attachment 128450 [details]
attachment-22249-0.html

Hi Sender,

Many thanks for your mail, I'm OOO from WW51.2 to WW52.2
Please contact my deputy during my absence.
YunOS GFx: Rich.Chen
YunOS HDMI: Shawn C, Lee
Chrome/Ubuntu GFx: Gary C.Wang
All others: Ivan Y.Chou

If any urgent please call my cell +886 953-018-982
Sorry for the inconvenience.
Cooper


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.