1 |
From 1923bc5a56daeeabd7e9093bad2febcd6af2416a Mon Sep 17 00:00:00 2001 |
2 |
From: Mario Limonciello <mario.limonciello@amd.com> |
3 |
Date: Tue, 27 Dec 2022 15:49:17 -0600 |
4 |
Subject: drm/amd: Delay removal of the firmware framebuffer |
5 |
|
6 |
From: Mario Limonciello <mario.limonciello@amd.com> |
7 |
|
8 |
commit 1923bc5a56daeeabd7e9093bad2febcd6af2416a upstream. |
9 |
|
10 |
Removing the firmware framebuffer from the driver means that even |
11 |
if the driver doesn't support the IP blocks in a GPU it will no |
12 |
longer be functional after the driver fails to initialize. |
13 |
|
14 |
This change will ensure that unsupported IP blocks at least cause |
15 |
the driver to work with the EFI framebuffer. |
16 |
|
17 |
Cc: stable@vger.kernel.org |
18 |
Suggested-by: Alex Deucher <alexander.deucher@amd.com> |
19 |
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> |
20 |
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> |
21 |
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> |
22 |
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
23 |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
24 |
--- |
25 |
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++++ |
26 |
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ------ |
27 |
2 files changed, 8 insertions(+), 6 deletions(-) |
28 |
|
29 |
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |
30 |
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |
31 |
@@ -36,6 +36,7 @@ |
32 |
#include <generated/utsrelease.h> |
33 |
#include <linux/pci-p2pdma.h> |
34 |
|
35 |
+#include <drm/drm_aperture.h> |
36 |
#include <drm/drm_atomic_helper.h> |
37 |
#include <drm/drm_probe_helper.h> |
38 |
#include <drm/amdgpu_drm.h> |
39 |
@@ -89,6 +90,8 @@ MODULE_FIRMWARE("amdgpu/navi12_gpu_info. |
40 |
#define AMDGPU_MAX_RETRY_LIMIT 2 |
41 |
#define AMDGPU_RETRY_SRIOV_RESET(r) ((r) == -EBUSY || (r) == -ETIMEDOUT || (r) == -EINVAL) |
42 |
|
43 |
+static const struct drm_driver amdgpu_kms_driver; |
44 |
+ |
45 |
const char *amdgpu_asic_name[] = { |
46 |
"TAHITI", |
47 |
"PITCAIRN", |
48 |
@@ -3677,6 +3680,11 @@ int amdgpu_device_init(struct amdgpu_dev |
49 |
if (r) |
50 |
return r; |
51 |
|
52 |
+ /* Get rid of things like offb */ |
53 |
+ r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver); |
54 |
+ if (r) |
55 |
+ return r; |
56 |
+ |
57 |
/* Enable TMZ based on IP_VERSION */ |
58 |
amdgpu_gmc_tmz_set(adev); |
59 |
|
60 |
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |
61 |
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |
62 |
@@ -23,7 +23,6 @@ |
63 |
*/ |
64 |
|
65 |
#include <drm/amdgpu_drm.h> |
66 |
-#include <drm/drm_aperture.h> |
67 |
#include <drm/drm_drv.h> |
68 |
#include <drm/drm_gem.h> |
69 |
#include <drm/drm_vblank.h> |
70 |
@@ -2123,11 +2122,6 @@ static int amdgpu_pci_probe(struct pci_d |
71 |
} |
72 |
#endif |
73 |
|
74 |
- /* Get rid of things like offb */ |
75 |
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &amdgpu_kms_driver); |
76 |
- if (ret) |
77 |
- return ret; |
78 |
- |
79 |
adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev); |
80 |
if (IS_ERR(adev)) |
81 |
return PTR_ERR(adev); |