Skip to content

Commit 7de9636

Browse files
committed
Merge tag 'amd-drm-fixes-5.19-2022-07-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.19-2022-07-06: amdgpu: - Hibernation fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 3234649 + 3a4b1cc commit 7de9636

File tree

7 files changed

+33
-10
lines changed

7 files changed

+33
-10
lines changed

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,21 @@ bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc,
15281528
stime, etime, mode);
15291529
}
15301530

1531+
static bool
1532+
amdgpu_display_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj)
1533+
{
1534+
struct drm_device *dev = adev_to_drm(adev);
1535+
struct drm_fb_helper *fb_helper = dev->fb_helper;
1536+
1537+
if (!fb_helper || !fb_helper->buffer)
1538+
return false;
1539+
1540+
if (gem_to_amdgpu_bo(fb_helper->buffer->gem) != robj)
1541+
return false;
1542+
1543+
return true;
1544+
}
1545+
15311546
int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
15321547
{
15331548
struct drm_device *dev = adev_to_drm(adev);
@@ -1563,10 +1578,12 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
15631578
continue;
15641579
}
15651580
robj = gem_to_amdgpu_bo(fb->obj[0]);
1566-
r = amdgpu_bo_reserve(robj, true);
1567-
if (r == 0) {
1568-
amdgpu_bo_unpin(robj);
1569-
amdgpu_bo_unreserve(robj);
1581+
if (!amdgpu_display_robj_is_fb(adev, robj)) {
1582+
r = amdgpu_bo_reserve(robj, true);
1583+
if (r == 0) {
1584+
amdgpu_bo_unpin(robj);
1585+
amdgpu_bo_unreserve(robj);
1586+
}
15701587
}
15711588
}
15721589
return 0;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ static int amdgpu_vkms_sw_init(void *handle)
496496
adev_to_drm(adev)->mode_config.max_height = YRES_MAX;
497497

498498
adev_to_drm(adev)->mode_config.preferred_depth = 24;
499-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
499+
/* disable prefer shadow for now due to hibernation issues */
500+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
500501

501502
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
502503

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2796,7 +2796,8 @@ static int dce_v10_0_sw_init(void *handle)
27962796
adev_to_drm(adev)->mode_config.max_height = 16384;
27972797

27982798
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2799-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2799+
/* disable prefer shadow for now due to hibernation issues */
2800+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
28002801

28012802
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
28022803

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,8 @@ static int dce_v11_0_sw_init(void *handle)
29142914
adev_to_drm(adev)->mode_config.max_height = 16384;
29152915

29162916
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2917-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2917+
/* disable prefer shadow for now due to hibernation issues */
2918+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
29182919

29192920
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
29202921

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,8 @@ static int dce_v6_0_sw_init(void *handle)
26732673
adev_to_drm(adev)->mode_config.max_width = 16384;
26742674
adev_to_drm(adev)->mode_config.max_height = 16384;
26752675
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2676-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2676+
/* disable prefer shadow for now due to hibernation issues */
2677+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
26772678
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
26782679
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
26792680

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2693,7 +2693,8 @@ static int dce_v8_0_sw_init(void *handle)
26932693
adev_to_drm(adev)->mode_config.max_height = 16384;
26942694

26952695
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2696-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2696+
/* disable prefer shadow for now due to hibernation issues */
2697+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
26972698

26982699
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
26992700

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,8 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
38223822
adev_to_drm(adev)->mode_config.max_height = 16384;
38233823

38243824
adev_to_drm(adev)->mode_config.preferred_depth = 24;
3825-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
3825+
/* disable prefer shadow for now due to hibernation issues */
3826+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
38263827
/* indicates support for immediate flip */
38273828
adev_to_drm(adev)->mode_config.async_page_flip = true;
38283829

0 commit comments

Comments
 (0)