Repository navigation
drm/amdgpu: fix non-posted dumb-buffer SIGBUS and spurious HDMI vendor infoframe warning - #4068
Draft
RyanTheTide wants to merge 3 commits into
Draft
RyanTheTide wants to merge 3 commits into
RyanTheTide wants to merge 3 commits into
Conversation
Behind a non-posted VRAM BAR (IORESOURCE_MEM_NONPOSTED), amdgpu_bo_fault_reserve_notify() moves unpinned CPU-faulted VRAM BOs to GTT and returns VM_FAULT_SIGBUS if the BO is pinned. On discrete GPUs where display scanout requires VRAM (amdgpu_display_supported_domains() excludes GTT), a userspace DRM dumb buffer pinned for scanout cannot be safely CPU-mapped: clients such as plymouthd succeed at DRM_IOCTL_MODE_MAP_DUMB and then crash with SIGBUS (BUS_ADRERR) in flush_head() memcpy. Return -EPERM from amdgpu_mode_dumb_mmap() when BAR 0 is non-posted and display scanout does not support GTT, matching the existing AMDGPU_GEM_CREATE_NO_CPU_ACCESS refusal. Kernel fbdev (drm_fbdev_ttm vmap), Mesa (amdgpu_gem_mmap_ioctl), APUs with GTT scanout, and posted PCIe hosts are unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…oframe drm_hdmi_vendor_infoframe_from_display_mode() returns -EINVAL whenever connector->display_info.has_hdmi_infoframe is false (for example, HDMI sinks whose EDID does not advertise an HDMI 1.4 VSDB). fill_stream_properties_from_drm_display_mode() calls it unconditionally for HDMI signals and emits a spurious 'Failed to setup vendor infoframe on connector ...: -22' warning. Guard the call on info->has_hdmi_infoframe; timing_out->hdmi_vic is already initialized to 0. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Contributor
Author
|
Draft sweep 12-05: merged main @ f02bd68 (a89e7ea, clean; main has not touched either file). arm64 LLVM W=1 builds of amdgpu_gem.o and amdgpu_dm_connector.o clean. No review asks open. Still a draft only for the exact-head hardware row, which needs the RX 7900 XTX physically back in the EG02 on the J413/J713 (the enclosure currently holds the GTX 1080 for the Pascal work); the row is queued in HWROWS-QUEUE. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs observed on J413 (
7.3.0-aurora-fleet94) with the EG02 RX 7900 XTX (1002:744c) attached:plymouth-start.service(plymouthd)SIGBUS(BUS_ADRERR) on boot:core.plymouthd.0.c4a4833a...) showedflush_head()(drm.so) callingmemcpy()into/dev/dri/card2(x0=0xffff425a93c0inside0xffff41bd0000-0xffff429e0000).IORESOURCE_MEM_NONPOSTED),amdgpu_bo_fault_reserve_notify()moves unpinned CPU-faulted VRAM BOs to GTT and returnsVM_FAULT_SIGBUSif the BO is pinned. On discrete GPUs where display scanout requires VRAM (!(amdgpu_display_supported_domains() & AMDGPU_GEM_DOMAIN_GTT)), a dumb buffer pinned for scanout can never be safely CPU-mapped.-EPERMfromamdgpu_mode_dumb_mmap()when BAR 0 is non-posted and display scanout cannot use GTT, matching the existingAMDGPU_GEM_CREATE_NO_CPU_ACCESSrefusal. Plymouth logsCould not map GEM object ...: Operation not permitted, skipscard2cleanly, and keeps the boot splash alive onappledrm. Kernel fbdev (drm_fbdev_ttmvmap), Mesa (amdgpu_gem_mmap_ioctl), APUs with GTT scanout, and posted PCIe hosts are unaffected.Spurious
Failed to setup vendor infoframe on connector HDMI-A-1: -22warning:drm_hdmi_vendor_infoframe_from_display_mode()returns-EINVALwhenever!connector->display_info.has_hdmi_infoframe(e.g. HDMI sinks without an HDMI 1.4 VSDB).fill_stream_properties_from_drm_display_mode()oninfo->has_hdmi_infoframe;timing_out->hdmi_vicis already initialized to0.Risk
Low, two-way: isolated to
amdgpu_mode_dumb_mmap()underIORESOURCE_MEM_NONPOSTED(VRAM-only scanout) and the HDMI vendor infoframe call when!info->has_hdmi_infoframe. Revert cleanly restores prior behavior.Testing
scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks on both commits (6bc6d238e75c,381bbc470bb2).LLVM=1 W=1build ofdrivers/gpu/drm/amd/amdgpu/amdgpu_gem.oanddrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.o: clean (0 warnings).plymouthdcoredumps and 0Failed to setup vendor infoframewarnings).