Skip to content

Commit 393d9e3

Browse files
Sasha Levingregkh
authored andcommitted
drm/amd: Delay removal of the firmware framebuffer
[ Upstream commit 1923bc5 ] 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: [email protected] Suggested-by: Alex Deucher <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 865e244 commit 393d9e3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <linux/slab.h>
3333
#include <linux/pci.h>
3434

35+
#include <drm/drm_aperture.h>
3536
#include <drm/drm_atomic_helper.h>
3637
#include <drm/drm_probe_helper.h>
3738
#include <drm/amdgpu_drm.h>
@@ -89,6 +90,8 @@ MODULE_FIRMWARE("amdgpu/yellow_carp_gpu_info.bin");
8990

9091
#define AMDGPU_RESUME_MS 2000
9192

93+
static const struct drm_driver amdgpu_kms_driver;
94+
9295
const char *amdgpu_asic_name[] = {
9396
"TAHITI",
9497
"PITCAIRN",
@@ -3637,6 +3640,11 @@ int amdgpu_device_init(struct amdgpu_device *adev,
36373640
if (r)
36383641
return r;
36393642

3643+
/* Get rid of things like offb */
3644+
r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver);
3645+
if (r)
3646+
return r;
3647+
36403648
/* doorbell bar mapping and doorbell index init*/
36413649
amdgpu_device_doorbell_init(adev);
36423650

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424

2525
#include <drm/amdgpu_drm.h>
26-
#include <drm/drm_aperture.h>
2726
#include <drm/drm_drv.h>
2827
#include <drm/drm_gem.h>
2928
#include <drm/drm_vblank.h>
@@ -2067,11 +2066,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
20672066
size = pci_resource_len(pdev, 0);
20682067
is_fw_fb = amdgpu_is_fw_framebuffer(base, size);
20692068

2070-
/* Get rid of things like offb */
2071-
ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &amdgpu_kms_driver);
2072-
if (ret)
2073-
return ret;
2074-
20752069
adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev);
20762070
if (IS_ERR(adev))
20772071
return PTR_ERR(adev);

0 commit comments

Comments
 (0)