Skip to content

Commit efea0c1

Browse files
committed
Merge tag 'amd-drm-fixes-5.13-2021-06-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.13-2021-06-21: amdgpu: - Revert GFX9, 10 doorbell fixes, we just end up trading one bug for another - Potential memory corruption fix in framebuffer handling Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 13311e7 + ee5468b commit efea0c1

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,12 @@ int amdgpu_display_gem_fb_init(struct drm_device *dev,
10471047

10481048
rfb->base.obj[0] = obj;
10491049
drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
1050-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1050+
1051+
ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
10511052
if (ret)
10521053
goto err;
10531054

1054-
ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
1055+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
10551056
if (ret)
10561057
goto err;
10571058

@@ -1071,9 +1072,6 @@ int amdgpu_display_gem_fb_verify_and_init(
10711072

10721073
rfb->base.obj[0] = obj;
10731074
drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
1074-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1075-
if (ret)
1076-
goto err;
10771075
/* Verify that the modifier is supported. */
10781076
if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
10791077
mode_cmd->modifier[0])) {
@@ -1092,6 +1090,10 @@ int amdgpu_display_gem_fb_verify_and_init(
10921090
if (ret)
10931091
goto err;
10941092

1093+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1094+
if (ret)
1095+
goto err;
1096+
10951097
return 0;
10961098
err:
10971099
drm_dbg_kms(dev, "Failed to verify and init gem fb: %d\n", ret);

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6871,12 +6871,8 @@ static int gfx_v10_0_kiq_init_register(struct amdgpu_ring *ring)
68716871
if (ring->use_doorbell) {
68726872
WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_LOWER,
68736873
(adev->doorbell_index.kiq * 2) << 2);
6874-
/* If GC has entered CGPG, ringing doorbell > first page doesn't
6875-
* wakeup GC. Enlarge CP_MEC_DOORBELL_RANGE_UPPER to workaround
6876-
* this issue.
6877-
*/
68786874
WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER,
6879-
(adev->doorbell.size - 4));
6875+
(adev->doorbell_index.userqueue_end * 2) << 2);
68806876
}
68816877

68826878
WREG32_SOC15(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL,

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,12 +3673,8 @@ static int gfx_v9_0_kiq_init_register(struct amdgpu_ring *ring)
36733673
if (ring->use_doorbell) {
36743674
WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_LOWER,
36753675
(adev->doorbell_index.kiq * 2) << 2);
3676-
/* If GC has entered CGPG, ringing doorbell > first page doesn't
3677-
* wakeup GC. Enlarge CP_MEC_DOORBELL_RANGE_UPPER to workaround
3678-
* this issue.
3679-
*/
36803676
WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER,
3681-
(adev->doorbell.size - 4));
3677+
(adev->doorbell_index.userqueue_end * 2) << 2);
36823678
}
36833679

36843680
WREG32_SOC15_RLC(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL,

0 commit comments

Comments
 (0)