Skip to content

Commit 1923bc5

Browse files
superm1alexdeucher
authored andcommitted
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: [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]>
1 parent 0be7ed8 commit 1923bc5

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
@@ -36,6 +36,7 @@
3636
#include <generated/utsrelease.h>
3737
#include <linux/pci-p2pdma.h>
3838

39+
#include <drm/drm_aperture.h>
3940
#include <drm/drm_atomic_helper.h>
4041
#include <drm/drm_fb_helper.h>
4142
#include <drm/drm_probe_helper.h>
@@ -90,6 +91,8 @@ MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin");
9091
#define AMDGPU_MAX_RETRY_LIMIT 2
9192
#define AMDGPU_RETRY_SRIOV_RESET(r) ((r) == -EBUSY || (r) == -ETIMEDOUT || (r) == -EINVAL)
9293

94+
static const struct drm_driver amdgpu_kms_driver;
95+
9396
const char *amdgpu_asic_name[] = {
9497
"TAHITI",
9598
"PITCAIRN",
@@ -3687,6 +3690,11 @@ int amdgpu_device_init(struct amdgpu_device *adev,
36873690
if (r)
36883691
return r;
36893692

3693+
/* Get rid of things like offb */
3694+
r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver);
3695+
if (r)
3696+
return r;
3697+
36903698
/* Enable TMZ based on IP_VERSION */
36913699
amdgpu_gmc_tmz_set(adev);
36923700

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_fbdev_generic.h>
2928
#include <drm/drm_gem.h>
@@ -2122,11 +2121,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
21222121
}
21232122
#endif
21242123

2125-
/* Get rid of things like offb */
2126-
ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &amdgpu_kms_driver);
2127-
if (ret)
2128-
return ret;
2129-
21302124
adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev);
21312125
if (IS_ERR(adev))
21322126
return PTR_ERR(adev);

0 commit comments

Comments
 (0)