Skip to content

Commit 8a1fbb4

Browse files
Yiqing Yaoalexdeucher
authored andcommitted
drm/amdgpu: Disable MCBP from soc21 for SRIOV
[why] Start from soc21, CP does not support MCBP, so disable it. [how] Used amgpu_mcbp flag alone instead of checking if is in SRIOV to enable/disable MCBP. Only set flag to enable on asic_type prior to soc21 in SRIOV. Signed-off-by: Yiqing Yao <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0cfce24 commit 8a1fbb4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
23972397
adev->ip_blocks[i].status.hw = true;
23982398

23992399
/* right after GMC hw init, we create CSA */
2400-
if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) {
2400+
if (amdgpu_mcbp) {
24012401
r = amdgpu_allocate_static_csa(adev, &adev->virt.csa_obj,
24022402
AMDGPU_GEM_DOMAIN_VRAM,
24032403
AMDGPU_CSA_SIZE);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
796796
dev_info->ids_flags = 0;
797797
if (adev->flags & AMD_IS_APU)
798798
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_FUSION;
799-
if (amdgpu_mcbp || amdgpu_sriov_vf(adev))
799+
if (amdgpu_mcbp)
800800
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION;
801801
if (amdgpu_is_tmz(adev))
802802
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_TMZ;
@@ -1172,7 +1172,7 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
11721172
goto error_vm;
11731173
}
11741174

1175-
if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) {
1175+
if (amdgpu_mcbp) {
11761176
uint64_t csa_addr = amdgpu_csa_vaddr(adev) & AMDGPU_GMC_HOLE_MASK;
11771177

11781178
r = amdgpu_map_static_csa(adev, &fpriv->vm, adev->virt.csa_obj,
@@ -1236,7 +1236,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
12361236
if (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_VCE) != NULL)
12371237
amdgpu_vce_free_handles(adev, file_priv);
12381238

1239-
if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) {
1239+
if (amdgpu_mcbp) {
12401240
/* TODO: how to handle reserve failure */
12411241
BUG_ON(amdgpu_bo_reserve(adev->virt.csa_obj, true));
12421242
amdgpu_vm_bo_del(adev, fpriv->csa_va);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ void amdgpu_virt_init_setting(struct amdgpu_device *adev)
6464
ddev->driver_features &= ~DRIVER_ATOMIC;
6565
adev->cg_flags = 0;
6666
adev->pg_flags = 0;
67+
68+
/* enable mcbp for sriov asic_type before soc21 */
69+
amdgpu_mcbp = (adev->asic_type < CHIP_IP_DISCOVERY) ? 1 : 0;
70+
6771
}
6872

6973
void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8489,7 +8489,7 @@ static void gfx_v10_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
84898489

84908490
control |= ib->length_dw | (vmid << 24);
84918491

8492-
if ((amdgpu_sriov_vf(ring->adev) || amdgpu_mcbp) && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) {
8492+
if (amdgpu_mcbp && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) {
84938493
control |= INDIRECT_BUFFER_PRE_ENB(1);
84948494

84958495
if (flags & AMDGPU_IB_PREEMPTED)
@@ -8664,7 +8664,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct amdgpu_ring *ring,
86648664
{
86658665
uint32_t dw2 = 0;
86668666

8667-
if (amdgpu_mcbp || amdgpu_sriov_vf(ring->adev))
8667+
if (amdgpu_mcbp)
86688668
gfx_v10_0_ring_emit_ce_meta(ring,
86698669
(!amdgpu_sriov_vf(ring->adev) && flags & AMDGPU_IB_PREEMPTED) ? true : false);
86708670

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5326,7 +5326,7 @@ static void gfx_v11_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
53265326

53275327
control |= ib->length_dw | (vmid << 24);
53285328

5329-
if ((amdgpu_sriov_vf(ring->adev) || amdgpu_mcbp) && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) {
5329+
if (amdgpu_mcbp && (ib->flags & AMDGPU_IB_FLAG_PREEMPT)) {
53305330
control |= INDIRECT_BUFFER_PRE_ENB(1);
53315331

53325332
if (flags & AMDGPU_IB_PREEMPTED)

0 commit comments

Comments
 (0)