diff mbox series

[1/1,SRU,I/OEM-5.13/OEM-5.14] drm/amd/display: Look at firmware version to determine using dmub on dcn21

Message ID 20211201021759.2486-2-aaron.ma@canonical.com
State New
Headers show
Series Fix USB3.1 hotplug after S3 on AMD renoir | expand

Commit Message

Aaron Ma Dec. 1, 2021, 2:17 a.m. UTC
From: Mario Limonciello <mario.limonciello@amd.com>

BugLink: https://bugs.launchpad.net/bugs/1952817

commit 91adec9e07097e538691daed5d934e7886dd1dc3 upstream.

commit 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21
asics") switched over to using dmub on Renoir to fix Gitlab 1735, but this
implied a new dependency on newer firmware which might not be met on older
kernel versions.

Since sw_init runs before hw_init, there is an opportunity to determine
whether or not the firmware version is new to adjust the behavior.

Cc: Roman.Li@amd.com
BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1772
BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1735
Fixes: 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21 asics")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit af09862cb5661cfdedd114ae50c7aaed94bd185a stable/linux-5.14.y)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Stefan Bader Dec. 2, 2021, 7:45 a.m. UTC | #1
On 01.12.21 03:17, Aaron Ma wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1952817
> 
> commit 91adec9e07097e538691daed5d934e7886dd1dc3 upstream.
> 
> commit 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21
> asics") switched over to using dmub on Renoir to fix Gitlab 1735, but this
> implied a new dependency on newer firmware which might not be met on older
> kernel versions.
> 
> Since sw_init runs before hw_init, there is an opportunity to determine
> whether or not the firmware version is new to adjust the behavior.
> 
> Cc: Roman.Li@amd.com
> BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1772
> BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1735
> Fixes: 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21 asics")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> Reviewed-by: Roman Li <Roman.Li@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> (cherry picked from commit af09862cb5661cfdedd114ae50c7aaed94bd185a stable/linux-5.14.y)
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 9444d395b8ba..d790a7abb40d 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1116,8 +1116,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
>   	case CHIP_RAVEN:
>   	case CHIP_RENOIR:
>   		init_data.flags.gpu_vm_support = true;
> -		if (ASICREV_IS_GREEN_SARDINE(adev->external_rev_id))
> +		switch (adev->dm.dmcub_fw_version) {
> +		case 0: /* development */
> +		case 0x1: /* linux-firmware.git hash 6d9f399 */
> +		case 0x01000000: /* linux-firmware.git hash 9a0b0f4 */
> +			init_data.flags.disable_dmcu = false;
> +			break;
> +		default:
>   			init_data.flags.disable_dmcu = true;
> +		}
>   		break;
>   #if defined(CONFIG_DRM_AMD_DC_DCN)
>   	case CHIP_VANGOGH:
>
Kleber Sacilotto de Souza Dec. 14, 2021, 3:47 p.m. UTC | #2
On 01.12.21 03:17, Aaron Ma wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> BugLink: https://bugs.launchpad.net/bugs/1952817
>
> commit 91adec9e07097e538691daed5d934e7886dd1dc3 upstream.
>
> commit 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21
> asics") switched over to using dmub on Renoir to fix Gitlab 1735, but this
> implied a new dependency on newer firmware which might not be met on older
> kernel versions.
>
> Since sw_init runs before hw_init, there is an opportunity to determine
> whether or not the firmware version is new to adjust the behavior.
>
> Cc: Roman.Li@amd.com
> BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1772
> BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1735
> Fixes: 652de07addd2 ("drm/amd/display: Fully switch to dmub for all dcn21 asics")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> Reviewed-by: Roman Li <Roman.Li@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> (cherry picked from commit af09862cb5661cfdedd114ae50c7aaed94bd185a stable/linux-5.14.y)
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 9444d395b8ba..d790a7abb40d 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1116,8 +1116,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
>   	case CHIP_RAVEN:
>   	case CHIP_RENOIR:
>   		init_data.flags.gpu_vm_support = true;
> -		if (ASICREV_IS_GREEN_SARDINE(adev->external_rev_id))
> +		switch (adev->dm.dmcub_fw_version) {
> +		case 0: /* development */
> +		case 0x1: /* linux-firmware.git hash 6d9f399 */
> +		case 0x01000000: /* linux-firmware.git hash 9a0b0f4 */
> +			init_data.flags.disable_dmcu = false;
> +			break;
> +		default:
>   			init_data.flags.disable_dmcu = true;
> +		}
>   		break;
>   #if defined(CONFIG_DRM_AMD_DC_DCN)
>   	case CHIP_VANGOGH:
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 9444d395b8ba..d790a7abb40d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1116,8 +1116,15 @@  static int amdgpu_dm_init(struct amdgpu_device *adev)
 	case CHIP_RAVEN:
 	case CHIP_RENOIR:
 		init_data.flags.gpu_vm_support = true;
-		if (ASICREV_IS_GREEN_SARDINE(adev->external_rev_id))
+		switch (adev->dm.dmcub_fw_version) {
+		case 0: /* development */
+		case 0x1: /* linux-firmware.git hash 6d9f399 */
+		case 0x01000000: /* linux-firmware.git hash 9a0b0f4 */
+			init_data.flags.disable_dmcu = false;
+			break;
+		default:
 			init_data.flags.disable_dmcu = true;
+		}
 		break;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 	case CHIP_VANGOGH: