Bug 104275 - Stoney Ridge laptop display goes blank after HDMI gets plugged/unplugged in extended mode.
Summary: Stoney Ridge laptop display goes blank after HDMI gets plugged/unplugged in e...
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/AMDgpu (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-15 03:51 UTC by Kai-Heng Feng
Modified: 2018-12-20 07:18 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
lspci (19.36 KB, text/plain)
2017-12-15 03:52 UTC, Kai-Heng Feng
no flags Details
dmesg with drm.debug=0x0e (349.78 KB, text/plain)
2017-12-15 03:52 UTC, Kai-Heng Feng
no flags Details
Garbled display. (2.88 MB, image/jpeg)
2017-12-15 09:59 UTC, Kai-Heng Feng
no flags Details
DC scatter gather patch (1.43 KB, patch)
2017-12-20 14:31 UTC, Harry Wentland
no flags Details | Splinter Review

Description Kai-Heng Feng 2017-12-15 03:51:43 UTC
Hi,

We are enabling a new Stoney Ridge laptop.
The issue can be reproduced on branch drm-next-4.16-wip and amd-staging-drm-next.

Reproduce steps:

1. Plug HDMI monitor.
2. Change to extended mode.
3. Unplug the HDMI monitor
4. Plug the HDMI monitor

Internal display may go blank in step 3.

The internal display may also go blank in step 4. The external one shows desktop correctly though.

I can see lots of message flooding once I plugged HDMI:
[  120.933668] amdgpu 0000:00:01.0: 0000000030e07f1f pin failed
[  120.933859] [drm:amdgpu_crtc_page_flip_target [amdgpu]] *ERROR* failed to pin new abo buffer before flip

These messages stop as soon as the HDMI is unplugged.
Comment 1 Kai-Heng Feng 2017-12-15 03:52:12 UTC
Created attachment 136186 [details]
lspci
Comment 2 Kai-Heng Feng 2017-12-15 03:52:27 UTC
Created attachment 136187 [details]
dmesg with drm.debug=0x0e
Comment 3 Michel Dänzer 2017-12-15 09:25:17 UTC
The fundamental issue here is that only 32 MB of memory are reserved as VRAM for the GPU.

https://patchwork.freedesktop.org/patch/192451/ should fix it (with DC enabled).
Comment 4 Kai-Heng Feng 2017-12-15 09:57:12 UTC
(In reply to Michel Dänzer from comment #3)
> The fundamental issue here is that only 32 MB of memory are reserved as VRAM
> for the GPU.
> 
> https://patchwork.freedesktop.org/patch/192451/ should fix it (with DC
> enabled).

I applied both [1] and [2], also enabled DC for it, now the Unity Desktop is garbled.
Unity Greeter in LightDM is fine though.

[1] https://patchwork.freedesktop.org/patch/192451/
[2] https://patchwork.freedesktop.org/patch/192450/
Comment 5 Kai-Heng Feng 2017-12-15 09:59:57 UTC
Created attachment 136191 [details]
Garbled display.
Comment 6 Michel Dänzer 2017-12-15 10:30:08 UTC
Hmm, maybe a separate DC patch is needed as well. Christian?
Comment 7 Alex_Zhang1 2017-12-20 05:56:55 UTC
Hi Michel,
  Before the buffer been pined to a location, can the buffer be moved to other place? My opinion, this is not about VRAM size, it is the mechanism of buffer move. Is this buffer content of rendering output or source or it is GPU command buffer? Is there any better way we can narrow down or investigate?
Comment 8 Michel Dänzer 2017-12-20 09:58:14 UTC
(In reply to Alex_Zhang1 from comment #7)

Without the patch referenced in comment 3, a buffer must be pinned to VRAM before it can be scanned out (displayed). The problem described in this report happens because pinning to VRAM fails, because there isn't enough space in VRAM. The patch allows buffers to be pinned to GTT instead of VRAM for scanout. Another DC patch is probably needed to fix the garbled display described in comment 4. Maybe try the patch on top of the amd-staging-drm-next branch.
Comment 9 Harry Wentland 2017-12-20 14:31:03 UTC
Created attachment 136321 [details] [review]
DC scatter gather patch

You'll need this DC patch.
Comment 10 AceLan Kao 2017-12-25 06:38:37 UTC
Hi Harry,

I'm wondering if there is also an equivalence method to fix it on v4.13 kernel.
Comment 11 Alex_Zhang1 2017-12-25 08:35:13 UTC
(In reply to Harry Wentland from comment #9)
> Created attachment 136321 [details] [review] [review]
> DC scatter gather patch
> 
> You'll need this DC patch.

Hi Harry,
  As patch below,

+	/*
+	 * TODO debug why this doesn't work on Raven
+	 */
+	if (adev->flags & AMD_IS_APU &&
+	    adev->asic_type >= CHIP_CARRIZO &&
+	    adev->asic_type < CHIP_RAVEN)
+		init_data.flags.gpu_vm_support = true;

  Seems this is just for debug, if I am wrong, please correct me. Do the flags gpu_vm_support has support on 4.13 kernel? Could you please help to confirm if this patch can be used on 4.13 kernel?

Thanks
Comment 12 Kai-Heng Feng 2018-01-02 09:53:00 UTC
(In reply to Harry Wentland from comment #9)
> Created attachment 136321 [details] [review] [review]
> DC scatter gather patch
> 
> You'll need this DC patch.

I can confirm that the issue is fixed by this patch (with the additional two patches above).

Thanks.
Comment 13 Harry Wentland 2018-01-02 16:07:26 UTC
(In reply to AceLan Kao from comment #10)
> Hi Harry,
> 
> I'm wondering if there is also an equivalence method to fix it on v4.13
> kernel.

You could try applying the patches mentioned by Michel, plus my patch. I'm not sure whether they'll apply well or work. The DC patch shouldn't be a problem if it applies but I'm not sure about the other patches Michel mentioned.


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.