ACK: [SRU][K][PATCH 1/1] drm/amd: Delay removal of the firmware framebuffer

Stefan Bader stefan.bader at canonical.com
Fri Jan 20 10:28:16 UTC 2023


On 20.01.23 11:22, Kleber Sacilotto de Souza wrote:
> From: Mario Limonciello <mario.limonciello at amd.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/2003524
> 
> 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 at vger.kernel.org
> Suggested-by: Alex Deucher <alexander.deucher at amd.com>
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> Reviewed-by: Lijo Lazar <lijo.lazar at amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> (backported from commit 1923bc5a56daeeabd7e9093bad2febcd6af2416a)
> [ kleber: context adjustments ]
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 6 ------
>   2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 72158f3939e3..52c574cc035b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -33,6 +33,7 @@
>   #include <linux/iommu.h>
>   #include <linux/pci.h>
>   
> +#include <drm/drm_aperture.h>
>   #include <drm/drm_atomic_helper.h>
>   #include <drm/drm_probe_helper.h>
>   #include <drm/amdgpu_drm.h>
> @@ -86,6 +87,8 @@ MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin");
>   #define AMDGPU_MAX_RETRY_LIMIT		2
>   #define AMDGPU_RETRY_SRIOV_RESET(r) ((r) == -EBUSY || (r) == -ETIMEDOUT || (r) == -EINVAL)
>   
> +static const struct drm_driver amdgpu_kms_driver;
> +
>   const char *amdgpu_asic_name[] = {
>   	"TAHITI",
>   	"PITCAIRN",
> @@ -3726,6 +3729,11 @@ 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;
> +
>   	/* Enable TMZ based on IP_VERSION */
>   	amdgpu_gmc_tmz_set(adev);
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 5e8ca32bc3a9..2996ec8feab5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -23,7 +23,6 @@
>    */
>   
>   #include <drm/amdgpu_drm.h>
> -#include <drm/drm_aperture.h>
>   #include <drm/drm_drv.h>
>   #include <drm/drm_gem.h>
>   #include <drm/drm_vblank.h>
> @@ -2057,11 +2056,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>   	}
>   #endif
>   
> -	/* Get rid of things like offb */
> -	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &amdgpu_kms_driver);
> -	if (ret)
> -		return ret;
> -
>   	adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev);
>   	if (IS_ERR(adev))
>   		return PTR_ERR(adev);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20230120/6551d661/attachment-0001.sig>


More information about the kernel-team mailing list