Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd: Delay removal of the firmware framebuffer

Removing the firmware framebuffer from the driver means that even
if the driver doesn't support the IP blocks in a GPU it will no
longer be functional after the driver fails to initialize.

This change will ensure that unsupported IP blocks at least cause
the driver to work with the EFI framebuffer.

Cc: stable@vger.kernel.org
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Mario Limonciello and committed by
Alex Deucher
1923bc5a 0be7ed8e

+8 -6
+8
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 36 36 #include <generated/utsrelease.h> 37 37 #include <linux/pci-p2pdma.h> 38 38 39 + #include <drm/drm_aperture.h> 39 40 #include <drm/drm_atomic_helper.h> 40 41 #include <drm/drm_fb_helper.h> 41 42 #include <drm/drm_probe_helper.h> ··· 90 89 #define AMDGPU_RESUME_MS 2000 91 90 #define AMDGPU_MAX_RETRY_LIMIT 2 92 91 #define AMDGPU_RETRY_SRIOV_RESET(r) ((r) == -EBUSY || (r) == -ETIMEDOUT || (r) == -EINVAL) 92 + 93 + static const struct drm_driver amdgpu_kms_driver; 93 94 94 95 const char *amdgpu_asic_name[] = { 95 96 "TAHITI", ··· 3687 3684 3688 3685 /* early init functions */ 3689 3686 r = amdgpu_device_ip_early_init(adev); 3687 + if (r) 3688 + return r; 3689 + 3690 + /* Get rid of things like offb */ 3691 + r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver); 3690 3692 if (r) 3691 3693 return r; 3692 3694
-6
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 23 23 */ 24 24 25 25 #include <drm/amdgpu_drm.h> 26 - #include <drm/drm_aperture.h> 27 26 #include <drm/drm_drv.h> 28 27 #include <drm/drm_fbdev_generic.h> 29 28 #include <drm/drm_gem.h> ··· 2120 2121 } 2121 2122 } 2122 2123 #endif 2123 - 2124 - /* Get rid of things like offb */ 2125 - ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &amdgpu_kms_driver); 2126 - if (ret) 2127 - return ret; 2128 2124 2129 2125 adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev); 2130 2126 if (IS_ERR(adev))