Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in display doesn't work with AMDGPU on Linux 5.6 Macbook (MacBookPro13,3) #142

Closed
dmarinuswoodwing opened this issue Apr 29, 2020 · 34 comments

Comments

@dmarinuswoodwing
Copy link

When I update to the latest kernel (5.6.6) using Fedora 31 my built-in display shows a (backlighted) black screen.

Could someone please share their experience with a AMDGPU Macbook and linux-5.6?

@roadrunner2
Copy link
Contributor

Yes, the amdgpu driver apparently got broken in the 5.6 kernel - I noticed because the /sys/kernel/debug/vgaswitcheroo/switch entry is missing (which means only the iGPU is being registered - the entry only shows up if there are at least 2 GPU's registered) and therefore I can't power down the dGPU anymore. (Note that I boot with the iGPU enabled and active, so the system would still be usable, just sucking way more power than I'd like).

I haven't had time to file a bug report, but it would be a good idea to do so.

@fannullone
Copy link

I am facing same problem on fc31 after last dnf upgrade which installed kernel-5.6
I can open the bug, but please can you give me some directions as I have never done it before.
I can provide log and such to facilitate the fix

@andyholst
Copy link
Contributor

Linux kernel 5.7.0-050700rc3-generic

My eDP (builtin display) has no modes for 5.6+

xrandr --query | grep '\bconnected\b'

xrandr: Output eDP is not disconnected but has no modes
eDP connected (normal left inverted right x axis y axis)
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm

@fannullone
Copy link

opened bug: https://bugzilla.kernel.org/show_bug.cgi?id=207589

@meeuw
Copy link

meeuw commented May 6, 2020

I've also opened a bug for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1829174

@meeuw
Copy link

meeuw commented May 8, 2020

I've posted a question at [email protected] and got the following reply:
https://lists.freedesktop.org/archives/amd-gfx/2020-May/049363.html

So I'll try to do a bisect in the next days...

@meeuw
Copy link

meeuw commented May 9, 2020

I've bisected the problem to:

b9f1246df179522bc28fda50b720553c845863db is the first bad commit
commit b9f1246df179522bc28fda50b720553c845863db
Author: Noah Abradjian [email protected]
Date: Fri Nov 22 16:07:24 2019 -0500

drm/amd/display: Collapse resource arrays when pipe is disabled

[Why]
Currently, pipe resources are assigned to an index that matches the pipe position.
However, if pipe 1 or 2 is disabled, there will be a gap in the arrays which causes a crash when iterating based on pipe_count.

[How]
Fix resource construct to assign resources to minimum available array index.

Signed-off-by: Noah Abradjian <[email protected]>
Reviewed-by: Yongqiang Sun <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>

.../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b9f1246df179522bc28fda50b720553c845863db

@aunali1
Copy link
Contributor

aunali1 commented May 10, 2020

You guys might have luck with this patch. Its a quick and dirty hack to force all DPCD link rate values to whats expected by Retina panels. Currently, this will prevent externally attached displays from working.

@meeuw
Copy link

meeuw commented May 10, 2020

You guys might have luck with this patch. Its a quick and dirty hack to force all DPCD link rate values to whats expected by Retina panels. Currently, this will prevent externally attached displays from working.

Thanks I'll try that! Could you please report your findings at:
https://bugzilla.kernel.org/show_bug.cgi?id=207589

@andyholst
Copy link
Contributor

I have reported my findings with the bisected kernel commits between v5.5.0 and v5.6.0 at https://bugzilla.kernel.org/show_bug.cgi?id=207589 with the related Xorg and dmesg logs.

@dmarinuswoodwing
Copy link
Author

Hi @aunali1 thanks for posting your patch, that seems to fix it on my system!

Updated URL:
https://github.com/aunali1/linux-mbp-arch/blob/master/2001-drm-amd-display-Force-link_rate-as-LINK_RATE_RBR2-fo.patch

@Dunedan
Copy link
Owner

Dunedan commented Jul 22, 2020

Is somebody currently working to get a fix for that upstreamed? What's the status there?

@aunali1
Copy link
Contributor

aunali1 commented Jul 22, 2020

@dmarinuswoodwing Thanks for testing! Great to see that it works for other models aswell.

@Dunedan Unfortunately, this patch is not upstream ready since it causes issues with 16inch MBPs. Additional testing is also needed for other models.

@dmarinuswoodwing
Copy link
Author

@aunali1 is there an overview of models that need to be tested? What kind of issues do you have with 16" MBP's?
Is there somewhere a discussion/bug that I can track?

@aunali1
Copy link
Contributor

aunali1 commented Jul 22, 2020

It seems that just an hour after I made the last comment, @marcosfad tested it again on his 16inch model and it works without issue!

@dmarinuswoodwing Regarding other models, I would prob say the MacBookPro14,x series.

@andyholst
Copy link
Contributor

andyholst commented Jul 22, 2020

The patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dec9de2ada523b344eb2428abfedf9d6cd0a0029 is included in the upstream as commit 69d3e5a5a66bb59c39f36dcb9cf4e9a4239aa8cd. I am checking out latest commit from Linux kernel master branch and compiling it and I will test it on my Linux Mint distro.

@andyholst
Copy link
Contributor

andyholst commented Jul 23, 2020

I can confirm the built-in display is working for kernel version 5.7.10 where the patch is included in the commit 69d3e5a5a66bb59c39f36dcb9cf4e9a4239aa8cd from the Linux kernel master branch.

@andyholst
Copy link
Contributor

@dmarinuswoodwing time to close the issue? :)

@andyholst
Copy link
Contributor

andyholst commented Jul 23, 2020

I have verified that the MBP 13,3 built-in display is working for Linux version 5.8.0-rc6+ from Linux master branch with commit 8c26c87b05323a7ccdc632820b85253e0bf47fd9 (HEAD -> master, origin/master, origin/HEAD) https://termbin.com/uby9

@andyholst
Copy link
Contributor

andyholst commented Aug 9, 2020

This issue is still open, it should be closed since the fix is in the upstream master branch since kernel v5.7.

@dmarinuswoodwing
Copy link
Author

It might make sense to atleast give some notice about what kernels are impacted on https://github.com/Dunedan/mbp-2016-linux#amd before closing this issue.

@andyholst
Copy link
Contributor

andyholst commented Aug 10, 2020

@dmarinuswoodwing after bisecting the main source tree https://bugzilla.kernel.org/show_bug.cgi?id=207589#c18, the built-in display stopped working for me on commit 4a8ca46bae8affba063aabac85a0b1401ba810a3 and they said it was fixed for commit 473e3f7720f652716eb7a5b8f49628d6f66b1e87 https://bugzilla.kernel.org/show_bug.cgi?id=207589#c21

git describe --contains 4a8ca46bae8affba063aabac85a0b1401ba810a3 gives me the kernel tag version v5.6-rc134^216^2~161
git describe --contains 473e3f7720f652716eb7a5b8f49628d6f66b1e87gives me the kernel tag version v5.7-rc123^216^2~39

So built-in display stopped working for kernel version v5.6 and started to work again for version v5.7 (since they include the release candidates tags)

@Dunedan
Copy link
Owner

Dunedan commented Aug 10, 2020

Does one of you want to open a PR for that? If not I can do it as well.
I suggest not to add that information to the graphics section, as it only affected a single kernel version which is already outdated again, but to the kernel history section: https://github.com/Dunedan/mbp-2016-linux#history-of-improvements-per-kernel-version

@andyholst
Copy link
Contributor

andyholst commented Aug 10, 2020

I can do it to keep track of history kernel changes that have made impact of the built-in display for MBP model 13,3 unless anyone else is up for it. Just be sure to involve as reviewers before merge.

@andyholst
Copy link
Contributor

andyholst commented Aug 12, 2020

I will test Linux kernel v5.7 from upstream and report my findings for commit 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 (HEAD, tag: v5.7) and if it is working I will create new PR and update the README.md accordingly if no one else has done it by then and verified what commit works.

@andyholst
Copy link
Contributor

andyholst commented Aug 12, 2020

Ok, after a few testing, the kernel version 5.7.8 was the one where the built-in display started to work again for MBP model 13,3, however the command git tag --contains 69d3e5a5a66bb59c39f36dcb9cf4e9a4239aa8cd gives

  • v5.6
  • v5.6-rc7
  • v5.7
  • v5.7-rc1
  • v5.7-rc2
  • v5.7-rc3
  • v5.7-rc4
  • v5.7-rc5
  • v5.7-rc6
  • v5.7-rc7
  • v5.8
  • v5.8-rc1
  • v5.8-rc2
  • v5.8-rc3
  • v5.8-rc4
  • v5.8-rc5
  • v5.8-rc6
  • v5.8-rc7

I know I tried compiling v5.6 before, the commit hash mentioned above that is included in that specific tag does not seems to fix the problem even if the developers says it does https://bugzilla.kernel.org/show_bug.cgi?id=207589#c21 what am I missing? I just want to be sure we pinpoint the actual proper fix tag versions before mentioning it in the README.md

@andyholst
Copy link
Contributor

It seems like commit 639e0db2d70fb84833d96e782cc4a01825e03b13 is actually the commit that fixes the built-in display issue for MBP model 13,3.

git tag --contains 639e0db2d70fb84833d96e782cc4a01825e03b13 gives

v5.8
v5.8-rc1
v5.8-rc2
v5.8-rc3
v5.8-rc4
v5.8-rc5
v5.8-rc6
v5.8-rc7

`commit 639e0db2d70fb84833d96e782cc4a01825e03b13
Author: Mario Kleiner [email protected]
Date: Mon Mar 16 05:23:40 2020 +0100

drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v3)

This fixes a problem found on the MacBookPro 2017 Retina panel.

The panel reports 10 bpc color depth in its EDID, and the
firmware chooses link settings at boot which support enough
bandwidth for 10 bpc (324000 kbit/sec = multiplier 0xc),
but the DP_MAX_LINK_RATE dpcd register only reports
2.7 Gbps (multiplier value 0xa) as possible, in direct
contradiction of what the firmware successfully set up.

This restricts the panel to 8 bpc, not providing the full
color depth of the panel.

This patch adds a quirk specific to the MBP 2017 15" Retina
panel to add the additiional 324000 kbps link rate during
edp setup.

Link to previous discussion of a different attempted fix
with Ville and Jani:

https://patchwork.kernel.org/patch/11325935/

v2: Follow Jani's proposal of defining quirk_rates[] instead
    of just appending 324000. This for better clarity.

v3: Rebased onto current drm-tip, as of 16-March-2020. Adapt
    to new edid_quirks parameter of drm_dp_has_quirk().

Signed-off-by: Mario Kleiner <[email protected]>
Tested-by: Mario Kleiner <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]

`

So the kernel version 5.7.10 I am currently running must include that patch somehow.

Will try compiling that specific commit and the one before.

@andyholst
Copy link
Contributor

andyholst commented Aug 13, 2020

@Dunedan I created a PR #158 with proper README.md documentation about the MBP 13,3 built-in display kernel issue.

@andyholst
Copy link
Contributor

@fannullone you should close the bug report at https://bugzilla.kernel.org/show_bug.cgi?id=207589

@cristianmiranda
Copy link

I'm on a MacBook Pro 13,3 and can confirm that built-in display works fine on 5.8.0-050800-generic.

@andyholst quick question, I can no longer run sudo modprobe amdgpu. I got the following when installing the new kernel (I was on 5.0.0 and amdgpu worked fine. I loaded it to switch the dedicated gpu off using echo OFF > /sys/kernel/debug/vgaswitcheroo/switch, but apparently on 5.8 there's no vgaswitcheroo anymore).

I don't understand what Possible missing firmware /lib/firmware/ means. Any ideas?.
Thank you for all the hard work so far!

DKMS: install completed.
   ...done.
Setting up linux-modules-5.8.0-050800-generic (5.8.0-050800.202008022230) ...
Setting up linux-image-unsigned-5.8.0-050800-generic (5.8.0-050800.202008022230) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.0.0-32-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-5.8.0-050800-generic
I: /initrd.img is now a symlink to boot/initrd.img-5.8.0-050800-generic
Processing triggers for linux-image-unsigned-5.8.0-050800-generic (5.8.0-050800.202008022230) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.8.0-050800-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.8.0-050800-generic
W: Possible missing firmware /lib/firmware/amdgpu/navi12_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/raven_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/raven2_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/picasso_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_sos.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega20_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/raven_kicker_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_mec2_wks.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_mec_wks.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_me_wks.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_pfp_wks.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_ce_wks.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_vcn.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_vcn.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_vcn.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_vcn.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_vcn.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_smc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi14_smc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_smc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/arcturus_smc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_dmcu.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/renoir_dmcub.bin for module amdgpu
W: Possible missing firmware /lib/firmware/i915/skl_huc_2.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_huc_2.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_huc_4.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_huc_4.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_huc_4.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cml_huc_4.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cml_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_huc_9.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_huc_9.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_33.0.4.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_huc_7.0.12.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_35.2.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_dmc_ver1_09.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_dmc_ver2_06.bin for module i915
I: The initramfs will attempt to resume from /dev/nvme0n1p3
I: (UUID=d6cab994-b144-43a3-a412-100ce59aa599)
I: Set the RESUME variable to override this.

@andyholst
Copy link
Contributor

andyholst commented Aug 15, 2020

@cristianmiranda create a new issue of the details you are having problem with the amdgpu driver. I am currently running Linux kernel version 5.7.14 and sudo modprobe amdgpu didn't give me any issues, not any I know of. The reason for creating a new issue is to relate that issue with an new bug report if it is really an issue so we can resolve it properly. This bug has been resolved, but the dual gpu part might still remain.

@cristianmiranda
Copy link

@andyholst You're right. I've opened a new issue for this. Thanks. #159

@andyholst
Copy link
Contributor

@Dunedan time to finally close this issue?

@Dunedan
Copy link
Owner

Dunedan commented Sep 7, 2020

Yes 👍

@Dunedan Dunedan closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants