]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu: fix check in fbdev init
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Jul 2022 18:56:59 +0000 (14:56 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:55 +0000 (10:53 +0200)
BugLink: https://bugs.launchpad.net/bugs/1981883
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: 84ec374bd580 ("drm/amdgpu: create amdgpu_vkms (v4)")
Cc: stable@vger.kernel.org # 5.15.x
Cc: hgoffin@amazon.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 27f8f5219fe4658537ba28fd01657e1062ac3960 linux-5.15.y)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c

index cd0acbea75da69efaf39f108563352094d5f6182..d58ab9deb02801a2951ced4dc697b2f073670457 100644 (file)
@@ -341,7 +341,8 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
        }
 
        /* disable all the possible outputs/crtcs before entering KMS mode */
-       if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display)
+       if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display &&
+           !amdgpu_sriov_vf(adev))
                drm_helper_disable_unused_functions(adev_to_drm(adev));
 
        drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);