Bug 71151 - i915: connecting VGA1 disables LVDS1 and vice versa
Summary: i915: connecting VGA1 disables LVDS1 and vice versa
Status: RESOLVED OBSOLETE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - Intel) (show other bugs)
Hardware: x86-64 Linux
: P3 normal
Assignee: Chris Wilson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-25 13:09 UTC by Wilhelm Hagemeister
Modified: 2015-10-07 11:28 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.13.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
output of drm.debug=0xe in messages (42.00 KB, application/octet-stream)
2014-02-25 13:09 UTC, Wilhelm Hagemeister
Details
drm/i915/sdvo: Fix LVDS connector status detection (5.43 KB, patch)
2014-03-05 08:30 UTC, Chris Wilson
Details | Diff
kernel-trace after applying patch (4.28 KB, text/plain)
2015-01-07 17:01 UTC, Wilhelm Hagemeister
Details

Description Wilhelm Hagemeister 2014-02-25 13:09:39 UTC
Created attachment 127421 [details]
output of drm.debug=0xe in messages

This IPC has a build in touch screen which is connected to LVDS1. After connecting a second display on port VGA1, LVDS1 is reported (from xrandr) as disconnected. After disconnecting VGA1, LVDS1 is reported as connected again.

Booting with nomodeset (framebuffer): both screens are enabled and running as expected!

IPC-Type: iEi PPC-5170A
chipset: Intel H61
lspci: 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller]), Subsystem: Intel Corporation Device 2111

As drm.debug output also reports a unconnected LVDS1, I assume it is a issue with the i915 driver maybe in combination with a buggy hardware. The debugging output is attached.
Comment 1 Chris Wilson 2014-02-25 13:23:33 UTC
Hmm.

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 825853d..c459e4d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1756,6 +1756,8 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
                ret = connector_status_disconnected;
        else if (IS_TMDS(intel_sdvo_connector))
                ret = intel_sdvo_tmds_sink_detect(connector);
+       else if (IS_LVDS(intel_sdvo_connector))
+               ret = intel_sdvo->sdvo_lvds_fixed_mode ?  connector_status_connected : ret = connector_status_disconnected;
        else {
                struct edid *edid;
Comment 2 Wilhelm Hagemeister 2014-02-25 14:46:19 UTC
(In reply to Chris Wilson from comment #1)
> Hmm.
> 
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c


> +       else if (IS_LVDS(intel_sdvo_connector))
> +               ret = intel_sdvo->sdvo_lvds_fixed_mode ? 
> connector_status_connected : ret = connector_status_disconnected;

doesn't compile...

--> drivers/gpu/drm/i915/intel_sdvo.c:1740:78: error: lvalue required as left operand of assignment

have tried:
else if (IS_LVDS(intel_sdvo_connector))
   ret = intel_sdvo->sdvo_lvds_fixed_mode ? connector_status_connected : connector_status_disconnected;

doesn't work!

have hard set:

else if (IS_LVDS(intel_sdvo_connector))
    ret = connector_status_connected;


does work! ... ?
Comment 3 Chris Wilson 2014-02-25 14:55:21 UTC
After fixing the typo, you also need:

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 825853d..9b528a5 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2622,6 +2622,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
        if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
                goto err;
 
+       intel_sdvo_get_lvds_modes(connector);
        return true;
 
 err:

That should then be equivalent to always setting the LVDS as connected.
Comment 4 Ville Syrjala 2014-02-25 14:57:14 UTC
(In reply to Wilhelm Hagemeister from comment #2)
> have tried:
> else if (IS_LVDS(intel_sdvo_connector))
>    ret = intel_sdvo->sdvo_lvds_fixed_mode ? connector_status_connected :
> connector_status_disconnected;
> 
> doesn't work!

I'm thinking the problem is that we call .detect() before .get_modes(), so the first time around sdvo_lvds_fixed_mode isn't there yet.
Comment 5 Wilhelm Hagemeister 2014-02-25 17:34:40 UTC
(In reply to Chris Wilson from comment #3)
> After fixing the typo, you also need:
> 
>  
> +       intel_sdvo_get_lvds_modes(connector);
>         return true;
>  
>  err:
> 
> That should then be equivalent to always setting the LVDS as connected.

that works! Many thanks.

For the non-i915-expert: is this a workaround or a fix?
Comment 6 Chris Wilson 2014-02-25 20:35:15 UTC
It is a fix for some assumptions we make through the LVDS detection and mode retrieval - in return it bakes in another assumption that the LVDS is connected for the lifetime of the driver. It's another fairly safe assumption - though boards do exist that may break it (but those tend to be hardware development boards, and we can document the workaround for our assumptions as they will affect only a very small minority).

Thank you for your testing.
Comment 7 Daniel Vetter 2014-03-03 09:28:35 UTC
Assigning to Chris for patch submission ...
Comment 8 Chris Wilson 2014-03-05 08:30:33 UTC
Created attachment 128161 [details]
drm/i915/sdvo: Fix LVDS connector status detection

I think I've worked through all the associated issues here.
Comment 9 Jani Nikula 2014-08-14 11:44:26 UTC
(In reply to Chris Wilson from comment #8)
> Created attachment 128161 [details]
> drm/i915/sdvo: Fix LVDS connector status detection
> 
> I think I've worked through all the associated issues here.

Wilhelm, please try Chris' patch on top of a recent kernel and report back.
Comment 10 Wilhelm Hagemeister 2014-08-27 12:56:16 UTC
(In reply to Jani Nikula from comment #9)
> (In reply to Chris Wilson from comment #8)
> > Created attachment 128161 [details]
> > drm/i915/sdvo: Fix LVDS connector status detection
> > 
> > I think I've worked through all the associated issues here.
> 
> Wilhelm, please try Chris' patch on top of a recent kernel and report back.

Jani, I don't have access to this machine right now, so it might take a while for the test and the report.
Comment 11 Jani Nikula 2014-09-12 09:54:12 UTC
Resolved moved, we have another report at fdo bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=63172

Wilhelm, we would still appreciate the testing of Chris' patch.
Comment 12 Wilhelm Hagemeister 2015-01-07 17:01:46 UTC
Created attachment 162761 [details]
kernel-trace after applying patch
Comment 13 Wilhelm Hagemeister 2015-01-07 17:03:04 UTC
(In reply to Jani Nikula from comment #11)
> Resolved moved, we have another report at fdo bugzilla:
> https://bugs.freedesktop.org/show_bug.cgi?id=63172
> 
> Wilhelm, we would still appreciate the testing of Chris' patch.

Jani,

I tested against a 3.14.12-rt9-2.44-desktop based on a vanilla kernel and patched with a PREEMPT-RT-Patch. This patch does NOT affect "intel_lvds.c".

I applied Chris' patch but that does not work. Find attached the kernel log.

I have this machine available another week and can do tests.
Comment 14 Mike Mochamet 2015-09-11 06:43:09 UTC
I am having the exact same problem on a gentoo-3.10.25 system. I tried the patch, but it did not work. 

Are there any further information about this?
Comment 15 Jani Nikula 2015-10-07 11:28:48 UTC
Long time no updates (apart from Mike's comment #14 about v3.10). Closing.

If the problem persists with latest kernels, please file a bug at the freedesktop.org bugzilla [1], referencing this bug. Thank you.

[1] https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel

Note You need to log in before you can comment on or make changes to this bug.