Skip to content

Commit 27f8f52

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu: fix check in fbdev init
The new vkms virtual display code is atomic so there is no need to call drm_helper_disable_unused_functions() when it is enabled. Doing so can result in a segfault. When the driver switched from the old virtual display code to the new atomic virtual display code, it was missed that we enable virtual display unconditionally under SR-IOV so the checks here missed that case. Add the missing check for SR-IOV. There is no equivalent of this patch for Linus' tree because the relevant code no longer exists. This patch is only relevant to kernels 5.15 and 5.16. Fixes: 84ec374 ("drm/amdgpu: create amdgpu_vkms (v4)") Cc: [email protected] # 5.15.x Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eb3c69c commit 27f8f52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
341341
}
342342

343343
/* disable all the possible outputs/crtcs before entering KMS mode */
344-
if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display)
344+
if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display &&
345+
!amdgpu_sriov_vf(adev))
345346
drm_helper_disable_unused_functions(adev_to_drm(adev));
346347

347348
drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);

0 commit comments

Comments
 (0)