Skip to contentSkip to conversation

Revert "drm/i915: Check live status before reading edid"

PATCH Applied David Weinehall 4 participants 7 messages Aug 17, 2016 – Sep 7, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/i915: Check live status before reading edid"

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

---
 drivers/gpu/drm/i915/intel_dp.c   |  2 +-
 drivers/gpu/drm/i915/intel_drv.h  |  2 --
 drivers/gpu/drm/i915/intel_hdmi.c | 43 +++++++++------------------------------
 3 files changed, 11 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index 364db908c191..dcd8359111be 100644
@@ -4171,7 +4171,7 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv,
  *
  * Return %true if @port is connected, %false otherwise.
  */
-bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
+static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
 					 struct intel_digital_port *port)
 {
 	if (HAS_PCH_IBX(dev_priv))
drivers/gpu/drm/i915/intel_drv.h +0 -2
index 1c700b0c3cea..a81ba75d23f3 100644
@@ -1400,8 +1400,6 @@ void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
 			       unsigned int frontbuffer_bits);
 void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
 			  unsigned int frontbuffer_bits);
-bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
-				  struct intel_digital_port *port);
 
 void
 intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
drivers/gpu/drm/i915/intel_hdmi.c +10 -33

78 lines not on this page · raw message

Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · David Weinehall

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

Quoted 1 line
Fixes 237ed86c693d ("drm/i915: Check live status before reading edid")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#2 lore raw
Quoted 13 lines · Chris Wilson
Quoted 12 lines · David Weinehall

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

Quoted 6 lines
Quoted 1 line
Fixes 237ed86c693d ("drm/i915: Check live status before reading edid")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139

And we've come full circle on live status. Again.

References: https://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 16 lines · Jani Nikula
Quoted 15 lines · Chris Wilson
Quoted 13 lines · David Weinehall

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

Quoted 8 lines
Quoted 4 lines
Fixes 237ed86c693d ("drm/i915: Check live status before reading edid")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139

And we've come full circle on live status. Again.

References: https://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg

Actually, we might have to take (at least) one more lap around the circle.

I did some more benchmarks, this time on Cherryview, and two different Skylake models (one ThinkPad 13, one NUC i5).

The results are rather frustrating:

On Skylake gmbus_wait_hw_status() seems to be really expensive[1].

So expensive that unless we can figure out how to get it down, the live status check is still the lesser of two evils. In a scenario with only sensible displays and no displays, the solution would be simple enough -- just eliminate the retries, keep the live status check, since it seems to work as it should on Skylake (haven't tried on Broxton or Kabylake yet, so I'm not sure whether it's all gen9 platforms, or only Skylake).

Reality, however, indicates that not all displays are sensible, so where (almost) back on square one.

Clearly we can optimise away the live status checks completely on < (INTEL_GEN(dev_priv) < 7 || IS_IVYBRIDGE(dev_priv))[2]. My testing on Broadwell suggests that this might even be possible to extend to < (INTEL_GEN(dev_priv) < 9).

That leaves gen9+ though, and seeing as those platforms are the current and future, respectively, priorities, we clearly need a solution for those too.

So, anyone with any theory why gmbus_wait_hw_status() is horribly slow on Skylake?

Kind regards, David

[1] More than the live_status loop, *if* msleep(10) only sleeps 10ms. If we keep that loop we might want to consider using usleep_range() instead, to get better precision -- I've experienced msleep(10) taking up to 20ms.

[2] As in the patch I already submitted earlier.
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 29 lines · David Weinehall
Quoted 16 lines · Jani Nikula
Quoted 15 lines · Chris Wilson
Quoted 13 lines · David Weinehall

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

Quoted 8 lines
Quoted 4 lines
Fixes 237ed86c693d ("drm/i915: Check live status before reading edid")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139

And we've come full circle on live status. Again.

References: https://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg

Actually, we might have to take (at least) one more lap around the circle.

Quoted 8 lines

I did some more benchmarks, this time on Cherryview, and two different Skylake models (one ThinkPad 13, one NUC i5).

The results are rather frustrating:

On Skylake gmbus_wait_hw_status() seems to be
really expensive[1].

[snip]

Actually, I think it's safe to do the revert.
A bit more testing yields that it's not a generic issue for Skylake, it seems to be specific to ThinkPads (or even a subset of them; I haven't got more than one model to test on).

The gmbus never sends a NAK if there's nothing connected, so eventually gmbus_wait_for_status() gives up and we fall back to using the bitbanging method instead.

Since things still work (albeit with reduced performance) on ThinkPads, and other platforms don't exhibit this behaviour, I suggest we move forward and revert the live status check.

Chris has a partial fix for the problem; it fixes the first port (which is purely an HDMI-port), but the second port -- which I believe is routed through the dock connector and/or the type C USB-port, still remains problematic.

Kind regards, David Weinehall
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Applied
#5 lore raw
Quoted 56 lines · David Weinehall
Quoted 29 lines · David Weinehall
Quoted 16 lines · Jani Nikula
Quoted 15 lines · Chris Wilson
Quoted 13 lines · David Weinehall

This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.

Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".

Quoted 8 lines
Quoted 4 lines
Fixes 237ed86c693d ("drm/i915: Check live status before reading edid")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139

And we've come full circle on live status. Again.

References: https://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg

Actually, we might have to take (at least) one more lap around the circle.

Quoted 8 lines

I did some more benchmarks, this time on Cherryview, and two different Skylake models (one ThinkPad 13, one NUC i5).

The results are rather frustrating:

On Skylake gmbus_wait_hw_status() seems to be
really expensive[1].

[snip]

Actually, I think it's safe to do the revert.
A bit more testing yields that it's not a generic issue for Skylake, it seems to be specific to ThinkPads (or even a subset of them; I haven't got more than one model to test on).

The gmbus never sends a NAK if there's nothing connected, so eventually gmbus_wait_for_status() gives up and we fall back to using the bitbanging method instead.

Since things still work (albeit with reduced performance) on ThinkPads, and other platforms don't exhibit this behaviour, I suggest we move forward and revert the live status check.

Quoted 5 lines

Chris has a partial fix for the problem; it fixes the first port (which is purely an HDMI-port), but the second port -- which I believe is routed through the dock connector and/or the type C USB-port, still remains problematic.

Pushed to drm-intel-next-queued after procrastination, thanks for the patch.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

✗ Ro.CI.BAT: failure for Revert "drm/i915: Check live status before reading edid"

In reply to David Weinehall
== Series Details ==

== Series Details ==

Series: Revert "drm/i915: Check live status before reading edid"
URL : https://patchwork.freedesktop.org/series/11210/
State : failure

== Summary ==

Series 11210v1 Revert "drm/i915: Check live status before reading edid"
http://patchwork.freedesktop.org/api/1.0/series/11210/revisions/1/mbox

Test kms_cursor_legacy:

        Subgroup basic-flip-vs-cursor-legacy:
                fail       -> PASS       (ro-byt-n2820)
                pass       -> FAIL       (ro-skl3-i5-6260u)
        Subgroup basic-flip-vs-cursor-varying-size:
                pass       -> FAIL       (ro-byt-n2820)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                skip       -> DMESG-WARN (ro-bdw-i7-5557U)
                skip       -> DMESG-WARN (ro-bdw-i5-5250u)
fi-hsw-i7-4770k  total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-qkkr      total:244  pass:185  dwarn:29  dfail:0   fail:3   skip:27 
fi-skl-i7-6700k  total:244  pass:208  dwarn:4   dfail:2   fail:2   skip:28 
fi-snb-i7-2600   total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
ro-bdw-i5-5250u  total:240  pass:219  dwarn:2   dfail:0   fail:1   skip:18 
ro-bdw-i7-5557U  total:240  pass:220  dwarn:3   dfail:0   fail:0   skip:17 
ro-bdw-i7-5600u  total:240  pass:207  dwarn:0   dfail:0   fail:1   skip:32 
ro-bsw-n3050     total:240  pass:194  dwarn:0   dfail:0   fail:4   skip:42 
ro-byt-n2820     total:240  pass:198  dwarn:0   dfail:0   fail:2   skip:40 
ro-hsw-i3-4010u  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-hsw-i7-4770r  total:240  pass:185  dwarn:0   dfail:0   fail:0   skip:55 
ro-ilk1-i5-650   total:235  pass:174  dwarn:0   dfail:0   fail:1   skip:60 
ro-ivb-i7-3770   total:240  pass:205  dwarn:0   dfail:0   fail:0   skip:35 
ro-ivb2-i7-3770  total:240  pass:209  dwarn:0   dfail:0   fail:0   skip:31 
ro-skl3-i5-6260u total:240  pass:222  dwarn:0   dfail:0   fail:4   skip:14 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1904/

e45fdef drm-intel-nightly: 2016y-08m-17d-13h-26m-04s UTC integration manifest 1ccf84e Revert "drm/i915: Check live status before reading edid"

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx