[PATCH v2 1/6] drm/amdgpu: add lsdma hw ip definition

Yu, Lang Lang.Yu at amd.com
Fri Nov 17 11:56:38 UTC 2023


[Public]

 enum amd_ip_block_type doc is missing for LSDMA.

@@ -85,6 +85,7 @@ enum amd_apu_flags {
 * @AMD_IP_BLOCK_TYPE_JPEG: JPEG Engine
 * @AMD_IP_BLOCK_TYPE_VPE: Video Processing Engine
 * @AMD_IP_BLOCK_TYPE_UMSCH_MM: User Mode Schduler for Multimedia
+* @AMD_IP_BLOCK_TYPE_LSDMA:
 * @AMD_IP_BLOCK_TYPE_NUM: Total number of IP block types
 */
 enum amd_ip_block_type {

With that fixed the series is Reviewed-by: Lang Yu <lang.yu at amd.com>.



________________________________
From: Zhang, Yifan <Yifan1.Zhang at amd.com>
Sent: Friday, November 17, 2023 10:09 AM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; Huang, Tim <Tim.Huang at amd.com>; Yu, Lang <Lang.Yu at amd.com>; Zhang, Yifan <Yifan1.Zhang at amd.com>
Subject: [PATCH v2 1/6] drm/amdgpu: add lsdma hw ip definition

This patch is to add lsdma hw ip definition.

Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
Reviewed-by: Tim Huang <Tim.Huang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c    | 15 +++++++++++++++
 drivers/gpu/drm/amd/include/amd_shared.h   |  1 +
 include/uapi/drm/amdgpu_drm.h              |  3 ++-
 5 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index b49ad7690a8c..bba9e8da2384 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3418,6 +3418,7 @@ static int amdgpu_device_ip_reinit_late_sriov(struct amdgpu_device *adev)
                 AMD_IP_BLOCK_TYPE_DCE,
                 AMD_IP_BLOCK_TYPE_GFX,
                 AMD_IP_BLOCK_TYPE_SDMA,
+               AMD_IP_BLOCK_TYPE_LSDMA,
                 AMD_IP_BLOCK_TYPE_MES,
                 AMD_IP_BLOCK_TYPE_UVD,
                 AMD_IP_BLOCK_TYPE_VCE,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
index b3630ceaff4c..20519ca90fb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
@@ -52,6 +52,7 @@ static const char *amdgpu_ip_name[AMDGPU_HW_IP_NUM] = {
         [AMDGPU_HW_IP_VCN_ENC]  =       "enc",
         [AMDGPU_HW_IP_VCN_JPEG] =       "jpeg",
         [AMDGPU_HW_IP_VPE]      =       "vpe",
+       [AMDGPU_HW_IP_LSDMA]    =       "lsdma",
 };

 void amdgpu_show_fdinfo(struct seq_file *m, struct file *f)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index b5ebafd4a3ad..91ec481377fa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -215,6 +215,9 @@ static enum amd_ip_block_type
         case AMDGPU_HW_IP_DMA:
                 type = AMD_IP_BLOCK_TYPE_SDMA;
                 break;
+       case AMDGPU_HW_IP_LSDMA:
+               type = AMD_IP_BLOCK_TYPE_LSDMA;
+               break;
         case AMDGPU_HW_IP_UVD:
         case AMDGPU_HW_IP_UVD_ENC:
                 type = AMD_IP_BLOCK_TYPE_UVD;
@@ -438,6 +441,13 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
                 ib_start_alignment = 256;
                 ib_size_alignment = 4;
                 break;
+       case AMDGPU_HW_IP_LSDMA:
+               type = AMD_IP_BLOCK_TYPE_LSDMA;
+               if (adev->lsdma.ring.sched.ready)
+                       ++num_rings;
+               ib_start_alignment = 256;
+               ib_size_alignment = 4;
+               break;
         case AMDGPU_HW_IP_UVD:
                 type = AMD_IP_BLOCK_TYPE_UVD;
                 for (i = 0; i < adev->uvd.num_uvd_inst; i++) {
@@ -546,6 +556,10 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
                         result->ip_discovery_version =
                                 IP_VERSION_MAJ_MIN_REV(amdgpu_ip_version(adev, SDMA0_HWIP, 0));
                         break;
+               case AMD_IP_BLOCK_TYPE_LSDMA:
+                       result->ip_discovery_version =
+                               IP_VERSION_MAJ_MIN_REV(amdgpu_ip_version(adev, LSDMA_HWIP, 0));
+                       break;
                 case AMD_IP_BLOCK_TYPE_UVD:
                 case AMD_IP_BLOCK_TYPE_VCN:
                 case AMD_IP_BLOCK_TYPE_JPEG:
@@ -679,6 +693,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                 switch (type) {
                 case AMD_IP_BLOCK_TYPE_GFX:
                 case AMD_IP_BLOCK_TYPE_VCE:
+               case AMD_IP_BLOCK_TYPE_LSDMA:
                         count = 1;
                         break;
                 case AMD_IP_BLOCK_TYPE_SDMA:
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 579977f6ad52..8c03afd4d472 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -95,6 +95,7 @@ enum amd_ip_block_type {
         AMD_IP_BLOCK_TYPE_PSP,
         AMD_IP_BLOCK_TYPE_DCE,
         AMD_IP_BLOCK_TYPE_GFX,
+       AMD_IP_BLOCK_TYPE_LSDMA,
         AMD_IP_BLOCK_TYPE_SDMA,
         AMD_IP_BLOCK_TYPE_UVD,
         AMD_IP_BLOCK_TYPE_VCE,
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index ad21c613fec8..8edae0f56bdd 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -595,7 +595,8 @@ struct drm_amdgpu_gem_va {
 #define AMDGPU_HW_IP_VCN_ENC      7
 #define AMDGPU_HW_IP_VCN_JPEG     8
 #define AMDGPU_HW_IP_VPE          9
-#define AMDGPU_HW_IP_NUM          10
+#define AMDGPU_HW_IP_LSDMA        10
+#define AMDGPU_HW_IP_NUM          11

 #define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1

--
2.37.3

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20231117/343e9776/attachment.htm>


More information about the amd-gfx mailing list