]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu/vpe: add multi instance VPE support
authorLang Yu <Lang.Yu@amd.com>
Wed, 30 Nov 2022 08:09:35 +0000 (16:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Mar 2024 20:32:48 +0000 (15:32 -0500)
Add support for multi instance VPE processing.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.h

index 8a0be74f2e3fec0d9e815dc91dccdd40051263cb..bad56f9956d04df831248e73b42a56326915ec5e 100644 (file)
@@ -1320,6 +1320,15 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
                                }
                        }
 
+                       if (le16_to_cpu(ip->hw_id) == VPE_HWID) {
+                               if (adev->vpe.num_instances < AMDGPU_MAX_VPE_INSTANCES)
+                                       adev->vpe.num_instances++;
+                               else
+                                       dev_err(adev->dev, "Too many VPE instances: %d vs %d\n",
+                                               adev->vpe.num_instances + 1,
+                                               AMDGPU_MAX_VPE_INSTANCES);
+                       }
+
                        if (le16_to_cpu(ip->hw_id) == UMC_HWID) {
                                adev->gmc.num_umc++;
                                adev->umc.node_inst_num++;
index 1153ddaea64d67cd48382efa8f2b8cf8d09b6c52..ee6db04cf27becfe96347eb5662a437f5d39f76f 100644 (file)
@@ -27,6 +27,8 @@
 #include "amdgpu_irq.h"
 #include "vpe_6_1_fw_if.h"
 
+#define AMDGPU_MAX_VPE_INSTANCES 2
+
 struct amdgpu_vpe;
 
 struct vpe_funcs {
@@ -74,6 +76,8 @@ struct amdgpu_vpe {
        uint32_t                        *cmdbuf_cpu_addr;
        struct delayed_work             idle_work;
        bool                            context_started;
+
+       uint32_t                        num_instances;
 };
 
 int amdgpu_vpe_psp_update_sram(struct amdgpu_device *adev);