aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
diff options
context:
space:
mode:
authorJames Zhu <James.Zhu@amd.com>2018-05-11 14:56:44 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-18 17:08:13 -0400
commit9181dba670cf0a0e8e3bda9fa66fecfe7c28b535 (patch)
tree73c01d487aee23105725aea726752d53f16597c5 /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
parent3b17c622856299a0b0eef02a409edec366a719a7 (diff)
drm/amdgpu/vg20:Enable the 2nd instance for uvd
For Vega20, set num of uvd instance to 2, to enble 2nd instance. The IB test build-in registers need update for vega20 2nd instance. Signed-off-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index e961492d357a..0772680371a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -72,11 +72,12 @@
72#define FIRMWARE_VEGA12 "amdgpu/vega12_uvd.bin" 72#define FIRMWARE_VEGA12 "amdgpu/vega12_uvd.bin"
73#define FIRMWARE_VEGA20 "amdgpu/vega20_uvd.bin" 73#define FIRMWARE_VEGA20 "amdgpu/vega20_uvd.bin"
74 74
75#define mmUVD_GPCOM_VCPU_DATA0_VEGA10 (0x03c4 + 0x7e00) 75/* These are common relative offsets for all asics, from uvd_7_0_offset.h, */
76#define mmUVD_GPCOM_VCPU_DATA1_VEGA10 (0x03c5 + 0x7e00) 76#define UVD_GPCOM_VCPU_CMD 0x03c3
77#define mmUVD_GPCOM_VCPU_CMD_VEGA10 (0x03c3 + 0x7e00) 77#define UVD_GPCOM_VCPU_DATA0 0x03c4
78#define mmUVD_NO_OP_VEGA10 (0x03ff + 0x7e00) 78#define UVD_GPCOM_VCPU_DATA1 0x03c5
79#define mmUVD_ENGINE_CNTL_VEGA10 (0x03c6 + 0x7e00) 79#define UVD_NO_OP 0x03ff
80#define UVD_BASE_SI 0x3800
80 81
81/** 82/**
82 * amdgpu_uvd_cs_ctx - Command submission parser context 83 * amdgpu_uvd_cs_ctx - Command submission parser context
@@ -990,6 +991,8 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,
990 uint64_t addr; 991 uint64_t addr;
991 long r; 992 long r;
992 int i; 993 int i;
994 unsigned offset_idx = 0;
995 unsigned offset[3] = { UVD_BASE_SI, 0, 0 };
993 996
994 amdgpu_bo_kunmap(bo); 997 amdgpu_bo_kunmap(bo);
995 amdgpu_bo_unpin(bo); 998 amdgpu_bo_unpin(bo);
@@ -1009,17 +1012,16 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,
1009 goto err; 1012 goto err;
1010 1013
1011 if (adev->asic_type >= CHIP_VEGA10) { 1014 if (adev->asic_type >= CHIP_VEGA10) {
1012 data[0] = PACKET0(mmUVD_GPCOM_VCPU_DATA0_VEGA10, 0); 1015 offset_idx = 1 + ring->me;
1013 data[1] = PACKET0(mmUVD_GPCOM_VCPU_DATA1_VEGA10, 0); 1016 offset[1] = adev->reg_offset[UVD_HWIP][0][1];
1014 data[2] = PACKET0(mmUVD_GPCOM_VCPU_CMD_VEGA10, 0); 1017 offset[2] = adev->reg_offset[UVD_HWIP][1][1];
1015 data[3] = PACKET0(mmUVD_NO_OP_VEGA10, 0);
1016 } else {
1017 data[0] = PACKET0(mmUVD_GPCOM_VCPU_DATA0, 0);
1018 data[1] = PACKET0(mmUVD_GPCOM_VCPU_DATA1, 0);
1019 data[2] = PACKET0(mmUVD_GPCOM_VCPU_CMD, 0);
1020 data[3] = PACKET0(mmUVD_NO_OP, 0);
1021 } 1018 }
1022 1019
1020 data[0] = PACKET0(offset[offset_idx] + UVD_GPCOM_VCPU_DATA0, 0);
1021 data[1] = PACKET0(offset[offset_idx] + UVD_GPCOM_VCPU_DATA1, 0);
1022 data[2] = PACKET0(offset[offset_idx] + UVD_GPCOM_VCPU_CMD, 0);
1023 data[3] = PACKET0(offset[offset_idx] + UVD_NO_OP, 0);
1024
1023 ib = &job->ibs[0]; 1025 ib = &job->ibs[0];
1024 addr = amdgpu_bo_gpu_offset(bo); 1026 addr = amdgpu_bo_gpu_offset(bo);
1025 ib->ptr[0] = data[0]; 1027 ib->ptr[0] = data[0];