Bug 26864

Summary: Green Screen in LG Projector using HDMI output
Product: DRI Reporter: George Tavares ( www.sabiax.com ) <tavares.george>
Component: DRM/IntelAssignee: Chris Wilson <chris>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: high CC: michael.fu, zhenyu.z.wang
Version: DRI git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
xorg
none
xrandr
none
regdump (the projector is not green this time)
none
try the debug patch that dumps more EDID info
none
Here is the output that you request
none
Add one function to check whether the audio is supported in HDMI sink
none
[Patch 2/2]: configure audio bit correctly for HDMI monitor
none
Set sync polarity from mode.
none
edid from BenQ G2400W
none
edid from digital port none

Description George Tavares ( www.sabiax.com ) 2010-03-03 06:57:29 UTC
When using HDMI output, The screen is tinted Green. If I power up/off the projector sometimes the output is right, other times is not. The LG logo is always fine.

Chipset:
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
 

Architecture: i686
LibDRM: 2.4.18
Intel driver = 2.10.0


Kernel Version: 2.6.32.8-58.fc12.i686

Linux Distribution: Fedora 12

Model: Motherboard DG45FC , with onboard graphic chipset , with a DVI and a HDMI output 

Display connectors: one DVI and another HDMI. The HDMI is plugged in a LG projector

Xorg says that LG projector is a 

(II) intel(0): EDID vendor "GSM", prod id 257
(II) intel(0): Using hsync ranges from config file
(II) intel(0): Using vrefresh ranges from config file
(II) intel(0): Printing DDC gathered Modelines:
Comment 1 George Tavares ( www.sabiax.com ) 2010-03-03 06:58:25 UTC
Created attachment 33723 [details]
dmesg
Comment 2 George Tavares ( www.sabiax.com ) 2010-03-03 06:58:45 UTC
Created attachment 33724 [details]
xorg
Comment 3 George Tavares ( www.sabiax.com ) 2010-03-03 06:59:15 UTC
Created attachment 33725 [details]
xrandr
Comment 4 George Tavares ( www.sabiax.com ) 2010-03-03 07:01:03 UTC
Created attachment 33726 [details]
regdump (the projector is not green this time)
Comment 5 George Tavares ( www.sabiax.com ) 2010-03-03 07:04:48 UTC
I found a workaround , modifying drivers/gpu/drm/i915/intel_hdmi.c, editing the function intel_hdmi_mode_set, and commenting these lines :

static void intel_hdmi_mode_set(struct drm_encoder *encoder,
                                struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
{
        struct drm_device *dev = encoder->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_crtc *crtc = encoder->crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_output *intel_output = enc_to_intel_output(encoder);
        struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
        u32 sdvox;

        sdvox = SDVO_ENCODING_HDMI |
                SDVO_BORDER_ENABLE |
                SDVO_VSYNC_ACTIVE_HIGH |
                SDVO_HSYNC_ACTIVE_HIGH;

//        if (hdmi_priv->has_hdmi_sink)
//                sdvox |= SDVO_AUDIO_ENABLE;

        if (intel_crtc->pipe == 1)
                sdvox |= SDVO_PIPE_B_SELECT;

        I915_WRITE(hdmi_priv->sdvox_reg, sdvox);
        POSTING_READ(hdmi_priv->sdvox_reg);
}


The projector maybe stay tinted green sometimes, if the audio initialization is started. I suggest do some kind of quirks to avoid audio initialization in some devices (LG Projectors)
Comment 6 Jesse Barnes 2010-04-06 11:42:02 UTC
Yakui, can you take a look and maybe add a quirk?
Comment 7 ykzhao 2010-04-06 19:21:26 UTC
(In reply to comment #6)
> Yakui, can you take a look and maybe add a quirk?

Ok. I will look at this issue and try to find why AUDIO enable is not required on this HDMI monitor.

Thanks.
Comment 8 ykzhao 2010-04-06 19:30:13 UTC
Created attachment 34747 [details] [review]
try the debug patch that dumps more EDID info

Hi, George
    Thanks for the you work. It is very interesting that the issue can be workaround by avoiding audio initialization. It is a great progress.
    Will you please try the attached debug patch and attach the output of dmesg?

Thanks.
Comment 9 George Tavares ( www.sabiax.com ) 2010-04-09 12:35:44 UTC
Created attachment 34852 [details]
Here is the output that you request
Comment 10 Michael Fu 2010-05-05 01:41:19 UTC
copying fengguang, who owns the audio enabling. Is there a way to check if audio is supported on the sink device?
Comment 11 ykzhao 2010-05-06 08:34:51 UTC
Created attachment 35459 [details] [review]
Add one function to check whether the audio is supported in HDMI sink
Comment 12 ykzhao 2010-05-06 08:36:14 UTC
Created attachment 35460 [details] [review]
[Patch 2/2]: configure audio bit correctly for HDMI monitor
Comment 13 ykzhao 2010-05-06 08:38:27 UTC
HI, George
    Sorry for the late response.
    Will you please try the two patches in comment #11/12 on 2.6.33 kernel and see whether the issue still exists?
   
Thanks.
   Yakui
Comment 14 Jesse Barnes 2010-07-15 11:04:16 UTC
George, have you had a chance to try those patches?
Comment 15 Chris Wilson 2010-07-22 10:51:52 UTC
Let's have a looksee:

xrandr =>
  1280_720 (0x121)   95.7MHz -HSync +VSync *current
        h: width  1280 start 1352 end 1488 total 1696 skew    0 clock   56.4KHz
        v: height  720 start  721 end  724 total  752           clock   75.0Hz

So I think your workaround was off by a couple of lines...

        sdvox = SDVO_ENCODING_HDMI |
                SDVO_BORDER_ENABLE |
                SDVO_VSYNC_ACTIVE_HIGH |
                SDVO_HSYNC_ACTIVE_HIGH;

So can you try Adam Jackson's patch:

commit b5e2a2f66488fbd43cdb100951413aab435910a8
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Jul 16 18:46:32 2010 +0000

    drm/i915/sdvo: Set sync polarity based on actual mode
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

However, Yakui's patches look good.
Comment 16 Chris Wilson 2010-07-22 10:53:20 UTC
Created attachment 37319 [details] [review]
Set sync polarity from mode.
Comment 17 Chris Wilson 2010-08-21 04:56:09 UTC
Rewrote Yakui's patches for HEAD - forgot he had already written some code to check for audio capability in the EDID! I'll push these upstream at the next opportunity.
Comment 18 Chris Wilson 2010-09-06 11:12:49 UTC
* wry smile.

I too have a green TV from using DVI -> HDMI due to unwanted audio.
Comment 19 Dag Bakke 2010-11-04 14:47:48 UTC
I have raised the importance of this bug one notch. The 'Set sync polarity from mode' patch hit Linus' kernel tree somewhere between 2.6.35 and .36, and renders my LCD panel unable to sync.

BenQ G2400W connected to G35 via HDMI.

git bisect leads to:

dagb@dagb-home ~/kernelbug/linux-git $ (22:38) git bisect bad
81a14b46846fea0741902e8d8dfcc6c6c78154c8 is the first bad commit
commit 81a14b46846fea0741902e8d8dfcc6c6c78154c8
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Jul 16 14:46:32 2010 -0400

    drm/i915/sdvo: Set sync polarity based on actual mode
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Eric Anholt <eric@anholt.net>

:040000 040000 14d1cbdc13c728833820e7f971589e7a8e10bc16 d8b0939bd85186d4b1860deb9853517d22563f09 M      drivers
Comment 20 Dag Bakke 2010-11-04 14:49:44 UTC
Also see #30888 , which also ends up giving the commit in question a nasty look.
Comment 21 Dag Bakke 2010-11-04 15:13:00 UTC
Created attachment 40052 [details]
edid from BenQ G2400W

edid from my LCD monitor
Comment 22 Dag Bakke 2010-11-04 15:35:25 UTC
Comment on attachment 40052 [details]
edid from BenQ G2400W

bad edid
Comment 23 Dag Bakke 2010-11-04 15:36:03 UTC
Created attachment 40054 [details]
edid from digital port

the right edid from my BenQ G2400W
Comment 24 Chris Wilson 2010-12-01 03:59:15 UTC
The HDMI audio detect is upstream. Dag you have a different bug due to your hardware misreporting the EDID.

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.