drm/amdgpu: don't free conflicting apertures for accelerators
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: don't free conflicting apertures for accelerators
PCI_CLASS_ACCELERATOR_PROCESSING devices won't ever be the sysfb, so there is no need to free conflicting apertures. This could lead to the sysfb aperture being freed while we still need it for the platform fb.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -4
@@ -4290,10 +4290,16 @@ int amdgpu_device_init(struct amdgpu_device *adev,if (r)return r; -/* Get rid of things like offb */ - r =drm_aperture_remove_conflicting_pci_framebuffers (adev->pdev, &amdgpu_kms_driver); -if (r) -return r; +/* +* No need to remove conflicting FBs for accelerator class devices. +* This prevents the sysfb from being freed accidently. +*/ +if ((adev->pdev->class >>8 ) !=PCI_CLASS_ACCELERATOR_PROCESSING ) { +/* Get rid of things like offb */ + r =drm_aperture_remove_conflicting_pci_framebuffers (adev->pdev, &amdgpu_kms_driver); +if (r) +return r; + }/* Enable TMZ based on IP_VERSION */ amdgpu_gmc_tmz_set (adev);
Signature · 1 line
2.47.0