Skip to content

Commit 709ef39

Browse files
Lang Yualexdeucher
authored andcommitted
drm/amdgpu/vpe: add multi instance VPE support
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>
1 parent 79698b1 commit 709ef39

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,15 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
13201320
}
13211321
}
13221322

1323+
if (le16_to_cpu(ip->hw_id) == VPE_HWID) {
1324+
if (adev->vpe.num_instances < AMDGPU_MAX_VPE_INSTANCES)
1325+
adev->vpe.num_instances++;
1326+
else
1327+
dev_err(adev->dev, "Too many VPE instances: %d vs %d\n",
1328+
adev->vpe.num_instances + 1,
1329+
AMDGPU_MAX_VPE_INSTANCES);
1330+
}
1331+
13231332
if (le16_to_cpu(ip->hw_id) == UMC_HWID) {
13241333
adev->gmc.num_umc++;
13251334
adev->umc.node_inst_num++;

drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "amdgpu_irq.h"
2828
#include "vpe_6_1_fw_if.h"
2929

30+
#define AMDGPU_MAX_VPE_INSTANCES 2
31+
3032
struct amdgpu_vpe;
3133

3234
struct vpe_funcs {
@@ -74,6 +76,8 @@ struct amdgpu_vpe {
7476
uint32_t *cmdbuf_cpu_addr;
7577
struct delayed_work idle_work;
7678
bool context_started;
79+
80+
uint32_t num_instances;
7781
};
7882

7983
int amdgpu_vpe_psp_update_sram(struct amdgpu_device *adev);

0 commit comments

Comments
 (0)