AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset
@ 2025-05-09  9:34 Jesse.Zhang
  2025-05-09 11:10 ` Lazar, Lijo
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse.Zhang @ 2025-05-09  9:34 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Christian Koenig, Asad Kamal, Jesse Zhang

From: Asad Kamal <asad.kamal@amd.com>

This patch enables per-queue and per-pipe reset functionality for
GFX IP v9.5.0 when using MEC firmware version 21 (0x15) or later.

Changes include:
1. Added IP_VERSION(9,5,0) case in gfx_v9_4_3_sw_init() to enable
   per-queue and per-pipe reset flags when MEC FW >= 21
2. Extended pipe reset support check in gfx_v9_4_3_pipe_reset_support()
   to include GFX 9.5.0 with MEC FW >= 0x15 requirement

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 9db2bde5c59d..a832639c07b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1153,6 +1153,12 @@ static int gfx_v9_4_3_sw_init(struct amdgpu_ip_block *ip_block)
 			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
 		}
 		break;
+	case IP_VERSION(9, 5, 0):
+		if (adev->gfx.mec_fw_version >= 21) {
+			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
+			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
+		}
+		break;
 	default:
 		break;
 	}
@@ -3453,8 +3459,10 @@ static int gfx_v9_4_3_unmap_done(struct amdgpu_device *adev, uint32_t me,
 static bool gfx_v9_4_3_pipe_reset_support(struct amdgpu_device *adev)
 {
 	/*TODO: Need check gfx9.4.4 mec fw whether supports pipe reset as well.*/
-	if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
-			adev->gfx.mec_fw_version >= 0x0000009b)
+	if ((amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
+			adev->gfx.mec_fw_version >= 0x0000009b) ||
+			(amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 5, 0) &&
+			adev->gfx.mec_fw_version >= 0x15))
 		return true;
 	else
 		dev_warn_once(adev->dev, "Please use the latest MEC version to see whether support pipe reset\n");
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset
  2025-05-09  9:34 [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset Jesse.Zhang
@ 2025-05-09 11:10 ` Lazar, Lijo
  0 siblings, 0 replies; 4+ messages in thread
From: Lazar, Lijo @ 2025-05-09 11:10 UTC (permalink / raw)
  To: Jesse.Zhang, amd-gfx; +Cc: Alexander.Deucher, Christian Koenig, Asad Kamal



On 5/9/2025 3:04 PM, Jesse.Zhang wrote:
> From: Asad Kamal <asad.kamal@amd.com>
> 
> This patch enables per-queue and per-pipe reset functionality for
> GFX IP v9.5.0 when using MEC firmware version 21 (0x15) or later.
> 
> Changes include:
> 1. Added IP_VERSION(9,5,0) case in gfx_v9_4_3_sw_init() to enable
>    per-queue and per-pipe reset flags when MEC FW >= 21
> 2. Extended pipe reset support check in gfx_v9_4_3_pipe_reset_support()
>    to include GFX 9.5.0 with MEC FW >= 0x15 requirement
> 
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 9db2bde5c59d..a832639c07b8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1153,6 +1153,12 @@ static int gfx_v9_4_3_sw_init(struct amdgpu_ip_block *ip_block)
>  			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
>  		}
>  		break;
> +	case IP_VERSION(9, 5, 0):
> +		if (adev->gfx.mec_fw_version >= 21) {
> +			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
> +			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
> +		}
> +		break;
>  	default:
>  		break;
>  	}
> @@ -3453,8 +3459,10 @@ static int gfx_v9_4_3_unmap_done(struct amdgpu_device *adev, uint32_t me,
>  static bool gfx_v9_4_3_pipe_reset_support(struct amdgpu_device *adev)
>  {
>  	/*TODO: Need check gfx9.4.4 mec fw whether supports pipe reset as well.*/
> -	if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
> -			adev->gfx.mec_fw_version >= 0x0000009b)
> +	if ((amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
> +			adev->gfx.mec_fw_version >= 0x0000009b) ||
> +			(amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 5, 0) &&
> +			adev->gfx.mec_fw_version >= 0x15))

I think this can be replaced with !!(adev->gfx.compute_supported_reset &
AMDGPU_RESET_TYPE_PER_PIPE).

Thanks,
Lijo

>  		return true;
>  	else
>  		dev_warn_once(adev->dev, "Please use the latest MEC version to see whether support pipe reset\n");


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset
@ 2025-05-12  1:14 Jesse.Zhang
  2025-05-12 14:44 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse.Zhang @ 2025-05-12  1:14 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, lijo.lazar, Jesse.Zhang,
	Asad Kamal, Jesse Zhang

This patch enables per-queue and per-pipe reset functionality for
GFX IP v9.5.0 when using MEC firmware version 21 (0x15) or later.

This change:
1. Refactors the pipe reset support check in gfx_v9_4_3_pipe_reset_support()
   to use the compute_supported_reset flags instead of hardcoding
   version checks.
2. Adds support for GFX9.5.0 (IP 9.5.0) with MEC firmware version >= 21
   to enable per-queue and per-pipe reset capabilities.

v2: Replaced mec version check with !!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE) (Lijo)

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 9db2bde5c59d..e6d516b1efd9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1153,6 +1153,12 @@ static int gfx_v9_4_3_sw_init(struct amdgpu_ip_block *ip_block)
 			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
 		}
 		break;
+	case IP_VERSION(9, 5, 0):
+		if (adev->gfx.mec_fw_version >= 21) {
+			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
+			adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
+		}
+		break;
 	default:
 		break;
 	}
@@ -3452,9 +3458,7 @@ static int gfx_v9_4_3_unmap_done(struct amdgpu_device *adev, uint32_t me,
 
 static bool gfx_v9_4_3_pipe_reset_support(struct amdgpu_device *adev)
 {
-	/*TODO: Need check gfx9.4.4 mec fw whether supports pipe reset as well.*/
-	if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
-			adev->gfx.mec_fw_version >= 0x0000009b)
+	if (!!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE))
 		return true;
 	else
 		dev_warn_once(adev->dev, "Please use the latest MEC version to see whether support pipe reset\n");
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset
  2025-05-12  1:14 Jesse.Zhang
@ 2025-05-12 14:44 ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2025-05-12 14:44 UTC (permalink / raw)
  To: Jesse.Zhang
  Cc: amd-gfx, Alexander.Deucher, Christian Koenig, lijo.lazar,
	Asad Kamal

On Sun, May 11, 2025 at 9:23 PM Jesse.Zhang <Jesse.Zhang@amd.com> wrote:
>
> This patch enables per-queue and per-pipe reset functionality for
> GFX IP v9.5.0 when using MEC firmware version 21 (0x15) or later.
>
> This change:
> 1. Refactors the pipe reset support check in gfx_v9_4_3_pipe_reset_support()
>    to use the compute_supported_reset flags instead of hardcoding
>    version checks.
> 2. Adds support for GFX9.5.0 (IP 9.5.0) with MEC firmware version >= 21
>    to enable per-queue and per-pipe reset capabilities.
>
> v2: Replaced mec version check with !!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE) (Lijo)
>
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 9db2bde5c59d..e6d516b1efd9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1153,6 +1153,12 @@ static int gfx_v9_4_3_sw_init(struct amdgpu_ip_block *ip_block)
>                         adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
>                 }
>                 break;
> +       case IP_VERSION(9, 5, 0):
> +               if (adev->gfx.mec_fw_version >= 21) {
> +                       adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
> +                       adev->gfx.compute_supported_reset |= AMDGPU_RESET_TYPE_PER_PIPE;
> +               }
> +               break;
>         default:
>                 break;
>         }
> @@ -3452,9 +3458,7 @@ static int gfx_v9_4_3_unmap_done(struct amdgpu_device *adev, uint32_t me,
>
>  static bool gfx_v9_4_3_pipe_reset_support(struct amdgpu_device *adev)
>  {
> -       /*TODO: Need check gfx9.4.4 mec fw whether supports pipe reset as well.*/
> -       if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) &&
> -                       adev->gfx.mec_fw_version >= 0x0000009b)
> +       if (!!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE))
>                 return true;
>         else
>                 dev_warn_once(adev->dev, "Please use the latest MEC version to see whether support pipe reset\n");
> --
> 2.49.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-12 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09  9:34 [PATCH] drm/amdgpu: Add GFX 9.5.0 support for per-queue/pipe reset Jesse.Zhang
2025-05-09 11:10 ` Lazar, Lijo
  -- strict thread matches above, loose matches on Subject: below --
2025-05-12  1:14 Jesse.Zhang
2025-05-12 14:44 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox