Skip to content

Commit f9a8911

Browse files
committed
drm/amdgpu: keep fbdev buffers pinned during suspend
Was dropped when we converted to the generic helpers. Fixes: 087451f ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Acked-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b8f0009 commit f9a8911

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
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;

0 commit comments

Comments
 (0)