[PATCH] drm/amdgpu: Fix error with dev_info_once usage
Lazar, Lijo
lijo.lazar at amd.com
Mon Jun 30 03:23:41 UTC 2025
On 6/29/2025 1:16 PM, Zhang, Hawking wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)
> +bool amdgpu_device_asic_has_dc_support(struct pci_dev *pdev,
> + enum amd_asic_type asic_type)
>
> You may also consider using amdgpu_device * as input parameter. either way works for me. The patch is
>
This function gets called once in probe as well before adev is created,
hence used pci_dev.
Thanks,
Lijo
> Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
>
> Regards,
> Hawking
>
> -----Original Message-----
> From: Lazar, Lijo <Lijo.Lazar at amd.com>
> Sent: Saturday, June 28, 2025 15:32
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Kamal, Asad <Asad.Kamal at amd.com>; kernel test robot <lkp at intel.com>
> Subject: [PATCH] drm/amdgpu: Fix error with dev_info_once usage
>
> Fixes error with dev_info_once usage in amdgpu_device_asic_has_dc_support.
>
> Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
> Reported-by: kernel test robot <lkp at intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202506281140.mXfWT3EN-lkp@intel.com/
> Fixes: f408cc771c33 ("drm/amdgpu: Convert from DRM_* to dev_*")
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
> 3 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 7427986992d6..1b61e0d27ce2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1390,7 +1390,8 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev, void amdgpu_device_indirect_wreg64_ext(struct amdgpu_device *adev,
> u64 reg_addr, u64 reg_data);
> u32 amdgpu_device_get_rev_id(struct amdgpu_device *adev); -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type);
> +bool amdgpu_device_asic_has_dc_support(struct pci_dev *pdev,
> + enum amd_asic_type asic_type);
> bool amdgpu_device_has_dc_support(struct amdgpu_device *adev);
>
> void amdgpu_device_set_sriov_virtual_display(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 334e442c95ef..95e9f7285351 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -4099,12 +4099,14 @@ static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
> /**
> * amdgpu_device_asic_has_dc_support - determine if DC supports the asic
> *
> + * @pdev : pci device context
> * @asic_type: AMD asic type
> *
> * Check if there is DC (new modesetting infrastructre) support for an asic.
> * returns true if DC has support, false if not.
> */
> -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)
> +bool amdgpu_device_asic_has_dc_support(struct pci_dev *pdev,
> + enum amd_asic_type asic_type)
> {
> switch (asic_type) {
> #ifdef CONFIG_DRM_AMDGPU_SI
> @@ -4148,7 +4150,7 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)
> default:
> if (amdgpu_dc > 0)
> dev_info_once(
> - adev->dev,
> + &pdev->dev,
> "Display Core has been requested via kernel parameter but isn't supported by ASIC, ignoring\n");
> return false;
> #endif
> @@ -4168,7 +4170,7 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev)
> (adev->harvest_ip_mask & AMD_HARVEST_IP_DMU_MASK))
> return false;
>
> - return amdgpu_device_asic_has_dc_support(adev->asic_type);
> + return amdgpu_device_asic_has_dc_support(adev->pdev, adev->asic_type);
> }
>
> static void amdgpu_device_xgmi_reset_func(struct work_struct *__work) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 2bb02fe9c880..b299e15bb5e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2327,7 +2327,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> amdgpu_aspm = 0;
>
> if (amdgpu_virtual_display ||
> - amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
> + amdgpu_device_asic_has_dc_support(pdev, flags & AMD_ASIC_MASK))
> supports_atomic = true;
>
> if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) {
> --
> 2.49.0
>
More information about the amd-gfx
mailing list