Skip to content

Commit 0d6f374

Browse files
jiadozhualexdeucher
authored andcommitted
drm/amdgpu: disable mcbp if parameter zero is set
The parameter amdgpu_mcbp shall have priority against the default value calculated from the chip version. User could disable mcbp by setting the parameter mcbp as zero. v2: do not trigger preemption in sw ring muxer when mcbp is disabled. Signed-off-by: Jiadong Zhu <Jiadong.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent b6360a5 commit 0d6f374

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,10 +3722,11 @@ static void amdgpu_device_set_mcbp(struct amdgpu_device *adev)
37223722
{
37233723
if (amdgpu_mcbp == 1)
37243724
adev->gfx.mcbp = true;
3725-
3726-
if ((adev->ip_versions[GC_HWIP][0] >= IP_VERSION(9, 0, 0)) &&
3727-
(adev->ip_versions[GC_HWIP][0] < IP_VERSION(10, 0, 0)) &&
3728-
adev->gfx.num_gfx_rings)
3725+
else if (amdgpu_mcbp == 0)
3726+
adev->gfx.mcbp = false;
3727+
else if ((adev->ip_versions[GC_HWIP][0] >= IP_VERSION(9, 0, 0)) &&
3728+
(adev->ip_versions[GC_HWIP][0] < IP_VERSION(10, 0, 0)) &&
3729+
adev->gfx.num_gfx_rings)
37293730
adev->gfx.mcbp = true;
37303731

37313732
if (amdgpu_sriov_vf(adev))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ void amdgpu_sw_ring_ib_begin(struct amdgpu_ring *ring)
397397
struct amdgpu_ring_mux *mux = &adev->gfx.muxer;
398398

399399
WARN_ON(!ring->is_sw_ring);
400-
if (ring->hw_prio > AMDGPU_RING_PRIO_DEFAULT) {
400+
if (adev->gfx.mcbp && ring->hw_prio > AMDGPU_RING_PRIO_DEFAULT) {
401401
if (amdgpu_mcbp_scan(mux) > 0)
402402
amdgpu_mcbp_trigger_preempt(mux);
403403
return;

0 commit comments

Comments
 (0)