Skip to contentSkip to conversation

drm/amdgpu: Enable uvd and vce gpu re-init for SRIOV gpu reset

PATCH In review Xiangliang.Yu 2 participants 2 messages Jul 25, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/8 drm/amdgpu: Enable uvd and vce gpu re-init for SRIOV gpu reset

From: Frank Min <[email protected]>

Add uvd and vce re-init after gpu reset.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c      | 3 +--
 drivers/gpu/drm/amd/amdgpu/vce_v4_0.c      | 4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
index 9c0f4cc..fe6783e 100644
@@ -1953,7 +1953,8 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)
 		AMD_IP_BLOCK_TYPE_DCE,
 		AMD_IP_BLOCK_TYPE_GFX,
 		AMD_IP_BLOCK_TYPE_SDMA,
-		AMD_IP_BLOCK_TYPE_VCE,
+		AMD_IP_BLOCK_TYPE_UVD,
+		AMD_IP_BLOCK_TYPE_VCE
 	};
 
 	for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +1 -2
index e2b17cb..fbf7b412 100644
@@ -894,9 +894,8 @@ static int uvd_v7_0_sriov_start(struct amdgpu_device *adev)
 		table_size += sizeof(struct mmsch_v1_0_cmd_end) / 4;
 		header->uvd_table_size = table_size;
 
-		return uvd_v7_0_mmsch_start(adev, &adev->virt.mm_table);
 	}
-	return -EINVAL; /* already initializaed ? */
+	return uvd_v7_0_mmsch_start(adev, &adev->virt.mm_table);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1 -3
index 9b1de6b..28532e3 100644
@@ -300,11 +300,9 @@ static int vce_v4_0_sriov_start(struct amdgpu_device *adev)
 		memcpy((void *)init_table, &end, sizeof(struct mmsch_v1_0_cmd_end));
 		table_size += sizeof(struct mmsch_v1_0_cmd_end) / 4;
 		header->vce_table_size = table_size;
-
-		return vce_v4_0_mmsch_start(adev, &adev->virt.mm_table);
 	}
 
-	return -EINVAL; /* already initializaed ? */
+	return vce_v4_0_mmsch_start(adev, &adev->virt.mm_table);
 }
 
 /**
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1500974217-2432-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org

Acked-by
#2 lore raw
Quoted 6 lines · Xiangliang.Yu

From: Frank Min <[email protected]>

Add uvd and vce re-init after gpu reset.

Quoted 55 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c      | 3 +--
 drivers/gpu/drm/amd/amdgpu/vce_v4_0.c      | 4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
index 9c0f4cc..fe6783e 100644
@@ -1953,7 +1953,8 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)
                AMD_IP_BLOCK_TYPE_DCE,
                AMD_IP_BLOCK_TYPE_GFX,
                AMD_IP_BLOCK_TYPE_SDMA,
-               AMD_IP_BLOCK_TYPE_VCE,
+               AMD_IP_BLOCK_TYPE_UVD,
+               AMD_IP_BLOCK_TYPE_VCE
        };
 
        for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +1 -2
index e2b17cb..fbf7b412 100644
@@ -894,9 +894,8 @@ static int uvd_v7_0_sriov_start(struct amdgpu_device *adev)
                table_size += sizeof(struct mmsch_v1_0_cmd_end) / 4;
                header->uvd_table_size = table_size;
 
-               return uvd_v7_0_mmsch_start(adev, &adev->virt.mm_table);
        }
-       return -EINVAL; /* already initializaed ? */
+       return uvd_v7_0_mmsch_start(adev, &adev->virt.mm_table);
 }
 
 /**
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1 -4
index 9b1de6b..28532e3 100644
@@ -300,11 +300,9 @@ static int vce_v4_0_sriov_start(struct amdgpu_device *adev)
                memcpy((void *)init_table, &end, sizeof(struct mmsch_v1_0_cmd_end));
                table_size += sizeof(struct mmsch_v1_0_cmd_end) / 4;
                header->vce_table_size = table_size;
-
-               return vce_v4_0_mmsch_start(adev, &adev->virt.mm_table);
        }
 
-       return -EINVAL; /* already initializaed ? */
+       return vce_v4_0_mmsch_start(adev, &adev->virt.mm_table);
 }
 
 /**
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx