Bug 105177

Summary: amdgpu wrong colors with rx460 connected via hdmi
Product: DRI Reporter: Reimar Imhof <tuxuser>
Component: DRM/AMDgpuAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg kernel 4.15.4; connected via hdmi; amdgpu.dc=0
none
dmesg kernel 4.15.4; connected via hdmi; amdgpu.dc=1
none
dmesg kernel 4.15.4; connected via dvi; amdgpu.dc=1
none
framebuffer console via hdmi
none
desktop (hdmi) - console should be black but is violet
none
desktop (dvi) - console is black, like expected
none
x.org.log (hdmi)
none
x.org.log (dvi)
none
[PATCH] update infoframe after dig fe is turned on
none
journalctl-boot-4-15-5-with-patch-hdmi-hang.txt
none
dmesg-4-15-5-with-patch-hdmi.txt
none
Xorg.0.log-4.15.5-with-patch-hdmi.txt none

Description Reimar Imhof 2018-02-20 21:04:05 UTC
When monitor is connected via hdmi I get wrong colors. This appears during boot before the gui (x.org) gets started (frame buffer boot animation). Wrong colors (sort of violet instead of black) also appear on frame buffer text console and with x.org gui.
This bug appears with and without "amdgpu.dc=1" kernel parameter.
While running x.org I've turned the monitor off and on again. This gives correct colors but the screen resolution goes to 1024x768. So it's no work around.

The bug does not occur if the monitor is connected via dvi.

System:
Kernel 4.15.4
openSuse 42.3
Comment 1 Reimar Imhof 2018-02-20 21:04:36 UTC
Created attachment 137478 [details]
dmesg kernel 4.15.4; connected via hdmi; amdgpu.dc=0
Comment 2 Reimar Imhof 2018-02-20 21:05:15 UTC
Created attachment 137479 [details]
dmesg kernel 4.15.4; connected via hdmi; amdgpu.dc=1
Comment 3 Reimar Imhof 2018-02-20 21:05:56 UTC
Created attachment 137480 [details]
dmesg kernel 4.15.4; connected via dvi; amdgpu.dc=1
Comment 4 Alex Deucher 2018-02-20 22:02:38 UTC
Can you attach a picture?
Comment 5 Alex Deucher 2018-02-20 22:02:54 UTC
Also please attach your xorg log.
Comment 6 Reimar Imhof 2018-02-21 21:37:05 UTC
Created attachment 137510 [details]
framebuffer console via hdmi

frame buffer console should be black but is violet (hdmi)
Comment 7 Reimar Imhof 2018-02-21 21:38:31 UTC
Created attachment 137511 [details]
desktop (hdmi) - console should be black but is violet
Comment 8 Reimar Imhof 2018-02-21 21:39:21 UTC
Created attachment 137512 [details]
desktop (dvi) - console is black, like expected
Comment 9 Reimar Imhof 2018-02-21 21:39:56 UTC
Created attachment 137513 [details]
x.org.log (hdmi)
Comment 10 Reimar Imhof 2018-02-21 21:40:27 UTC
Created attachment 137514 [details]
x.org.log (dvi)
Comment 11 Reimar Imhof 2018-02-21 21:42:38 UTC
btw, all tests were done with amdgpu.dc=1, because suse configured the kernel that way.
Comment 12 Harry Wentland 2018-02-21 22:04:01 UTC
There's a mismatch in colorspace we program and tell the HDMI receiver because we program the infoframe too early in our sequence. I'll send a patch tomorrow.
Comment 13 Harry Wentland 2018-02-22 20:19:34 UTC
Created attachment 137536 [details] [review]
[PATCH] update infoframe after dig fe is turned on

This patch should fix your issue. Please let me know if you try it.
Comment 14 Reimar Imhof 2018-02-24 10:57:46 UTC
I've build a 4.15.5 kernel incl. your patch and booted with display connected to hdmi.
First boot hang.
In journalctl I found
Feb 24 11:29:28 linux kernel: [drm:drm_atomic_helper_wait_for_flip_done [drm_kms_helper]] *ERROR* [CRTC:42:crtc-0] flip_done timed out
(I'll attach journalctl-boot-4-15-5-with-patch-hdmi-hang.txt)

Second try booted into gui (kde login). The colors where still wrong. But now it was possible to turn of the screen and on again. The screen resolution stayed the same but the colors still were wrong.
(I'll attach dmesg-4-15-5-with-patch-hdmi.txt and Xorg.0.log-4.15.5-with-patch-hdmi.txt)

I'll stay with the dvi connected monitor.
Comment 15 Reimar Imhof 2018-02-24 10:58:41 UTC
Created attachment 137575 [details]
journalctl-boot-4-15-5-with-patch-hdmi-hang.txt
Comment 16 Reimar Imhof 2018-02-24 10:59:22 UTC
Created attachment 137576 [details]
dmesg-4-15-5-with-patch-hdmi.txt
Comment 17 Reimar Imhof 2018-02-24 11:00:18 UTC
Created attachment 137577 [details]
Xorg.0.log-4.15.5-with-patch-hdmi.txt
Comment 18 Harry Wentland 2018-03-27 15:36:55 UTC
Can you try the drm-next-4.17-wip branch from https://cgit.freedesktop.org/~agd5f/linux and see if that fixes the issue?
Comment 19 Reimar Imhof 2018-03-27 16:48:59 UTC
I will wait for suse providing a 4.17 kernel
Comment 20 Reimar Imhof 2018-03-29 13:25:17 UTC
I've tried drm-next-4.17-wip.
What I've seen is the same as described with the initial bug description:
When monitor is connected via hdmi I get wrong colors. This appears during boot before the gui (x.org) gets started (frame buffer boot animation). Wrong colors (sort of violet instead of black) also appear on frame buffer text console and with x.org gui.
This bug appears with "amdgpu.dc=1" kernel parameter.
While running x.org I've turned the monitor off and on again. This gives correct colors but the screen resolution goes to 1024x768. So it's no work around.

What I've seen is: The colors are correct if I run the monitor with a yuv color model instead of rgb.

One thing seems to be better: Every boot manged to get to the graphical login. I've tried about 10 reboots.
Comment 21 Reimar Imhof 2018-03-29 13:34:36 UTC
Btw.: There is a new bug showing up with a 4.16.0-rc7 kernel (I did not test rc1 to rc6): The screen flickers. I can't tell you whats triggers such a flicker but it does.
That bug is still around with the drm-next-4.17-wip kernel.
Comment 22 Harry Wentland 2018-04-17 18:13:36 UTC
Please keep one issue per ticket. Open a new ticket if needed.

That said, a fix for the flickering issue should be in drm-next-4.17 of Alex's git repo at https://cgit.freedesktop.org/~agd5f/linux/?h=drm-next-4.17 and should make it into Linus's tree from there.

That fix should also make it into 4.16 stable.
Comment 23 Martin Peres 2019-11-19 08:29:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/306.

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.