Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fb6d9c

Browse files
OkabeRintarouYang Wang
authored and
Yang Wang
committed
drm/amdgpu: fix incorrect VCN revision in SRIOV
Guest OS will setup VCN instance 1 which is disabled as an enabled instance andexecute initialization work on it, but this causes VCN ib ring test failureon the disabled VCN instance during modprobe:amdgpu 0000:00:08.0: amdgpu: ring vcn_enc_1.0 uses VM inv eng 5 on hub 1amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_dec_0 (-110).amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_enc_0.0 (-110).[drm:amdgpu_device_delayed_init_work_handler [amdgpu]] *ERROR* ib ring test failed (-110).v2: drop amdgpu_discovery_get_vcn_version and rename sriov_config tovcn_configv3: modify VCN's revision in SR-IOV and bare-metalFixes: 36b7d5646476 ("drm/amdgpu: handle SRIOV VCN revision parsing")Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>Reviewed-by: Guchun Chen <guchun.chen@amd.com>
1 parent4756617 commit5fb6d9c

File tree

4 files changed

+14
-34
lines changed

4 files changed

+14
-34
lines changed

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,15 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
380380
ip->revision);
381381

382382
if (le16_to_cpu(ip->hw_id)==VCN_HWID) {
383-
if (amdgpu_sriov_vf(adev)) {
384-
/* SR-IOV modifies each VCN’s revision (uint8)
385-
* Bit [5:0]: original revision value
386-
* Bit [7:6]: en/decode capability:
387-
* 0b00 : VCN function normally
388-
* 0b10 : encode is disabled
389-
* 0b01 : decode is disabled
390-
*/
391-
adev->vcn.sriov_config[adev->vcn.num_vcn_inst]=
392-
(ip->revision&0xc0) >>6;
393-
ip->revision &= ~0xc0;
394-
}
383+
/* Bit [5:0]: original revision value
384+
* Bit [7:6]: en/decode capability:
385+
* 0b00 : VCN function normally
386+
* 0b10 : encode is disabled
387+
* 0b01 : decode is disabled
388+
*/
389+
adev->vcn.vcn_config[adev->vcn.num_vcn_inst]=
390+
ip->revision&0xc0;
391+
ip->revision &= ~0xc0;
395392
adev->vcn.num_vcn_inst++;
396393
}
397394
if (le16_to_cpu(ip->hw_id)==SDMA0_HWID||
@@ -485,14 +482,6 @@ int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id, int n
485482
return-EINVAL;
486483
}
487484

488-
489-
intamdgpu_discovery_get_vcn_version(structamdgpu_device*adev,intvcn_instance,
490-
int*major,int*minor,int*revision)
491-
{
492-
returnamdgpu_discovery_get_ip_version(adev,VCN_HWID,
493-
vcn_instance,major,minor,revision);
494-
}
495-
496485
voidamdgpu_discovery_harvest_ip(structamdgpu_device*adev)
497486
{
498487
structbinary_header*bhdr;

‎drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev);
3333
intamdgpu_discovery_get_ip_version(structamdgpu_device*adev,inthw_id,intnumber_instance,
3434
int*major,int*minor,int*revision);
3535

36-
intamdgpu_discovery_get_vcn_version(structamdgpu_device*adev,intvcn_instance,
37-
int*major,int*minor,int*revision);
3836
intamdgpu_discovery_get_gfx_info(structamdgpu_device*adev);
3937
intamdgpu_discovery_set_ip_blocks(structamdgpu_device*adev);
4038

‎drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,20 +284,13 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
284284
boolamdgpu_vcn_is_disabled_vcn(structamdgpu_device*adev,enumvcn_ring_typetype,uint32_tvcn_instance)
285285
{
286286
boolret= false;
287+
intvcn_config=adev->vcn.vcn_config[vcn_instance];
287288

288-
intmajor;
289-
intminor;
290-
intrevision;
291-
292-
/* if cannot find IP data, then this VCN does not exist */
293-
if (amdgpu_discovery_get_vcn_version(adev,vcn_instance,&major,&minor,&revision)!=0)
294-
return true;
295-
296-
if ((type==VCN_ENCODE_RING)&& (revision&VCN_BLOCK_ENCODE_DISABLE_MASK)) {
289+
if ((type==VCN_ENCODE_RING)&& (vcn_config&VCN_BLOCK_ENCODE_DISABLE_MASK)) {
297290
ret= true;
298-
}elseif ((type==VCN_DECODE_RING)&& (revision&VCN_BLOCK_DECODE_DISABLE_MASK)) {
291+
}elseif ((type==VCN_DECODE_RING)&& (vcn_config&VCN_BLOCK_DECODE_DISABLE_MASK)) {
299292
ret= true;
300-
}elseif ((type==VCN_UNIFIED_RING)&& (revision&VCN_BLOCK_QUEUE_DISABLE_MASK)) {
293+
}elseif ((type==VCN_UNIFIED_RING)&& (vcn_config&VCN_BLOCK_QUEUE_DISABLE_MASK)) {
301294
ret= true;
302295
}
303296

‎drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ struct amdgpu_vcn {
235235

236236
uint8_tnum_vcn_inst;
237237
structamdgpu_vcn_instinst[AMDGPU_MAX_VCN_INSTANCES];
238-
uint8_tsriov_config[AMDGPU_MAX_VCN_INSTANCES];
238+
uint8_tvcn_config[AMDGPU_MAX_VCN_INSTANCES];
239239
structamdgpu_vcn_reginternal;
240240
structmutexvcn_pg_lock;
241241
structmutexvcn1_jpeg1_workaround;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp