drm/amdgpu: keep fbdev buffers pinned during suspend
Subsystems (3)
Alex Deucher
maintainerPATCH 1/2 drm/amdgpu: keep fbdev buffers pinned during suspend
Was dropped when we converted to the generic helpers.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 25 +++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +21 -4
@@ -1560,6 +1560,21 @@ bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc, stime, etime, mode); } +static bool +amdgpu_display_robj_is_fb (struct amdgpu_device *adev,struct amdgpu_bo *robj) +{ +struct drm_device *dev =adev_to_drm (adev); +struct drm_fb_helper *fb_helper = dev->fb_helper; + +if (!fb_helper || !fb_helper->buffer) +return false; + +if (gem_to_amdgpu_bo (fb_helper->buffer->gem) != robj) +return false; + +return true; +} +int amdgpu_display_suspend_helper (struct amdgpu_device *adev) {struct drm_device *dev =adev_to_drm (adev);
@@ -1595,10 +1610,12 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)continue ; } robj =gem_to_amdgpu_bo (fb->obj[0 ]); - r =amdgpu_bo_reserve (robj, true); -if (r ==0 ) { -amdgpu_bo_unpin (robj); -amdgpu_bo_unreserve (robj); +if (!amdgpu_display_robj_is_fb (adev, robj)) { + r =amdgpu_bo_reserve (robj, true); +if (r ==0 ) { +amdgpu_bo_unpin (robj); +amdgpu_bo_unreserve (robj); + } } }return 0 ;
Signature · 1 line
2.35.3
Alex Deucher
maintainerPATCH 2/2 drm/amdgpu/display: disable prefer_shadow for generic fb helpers
Seems to break hibernation. Disable for now until we can root cause it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 ++- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -1
@@ -496,7 +496,8 @@ static int amdgpu_vkms_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =YRES_MAX ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_base = adev->gmc.aper_base;
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +2 -1
@@ -2796,7 +2796,8 @@ static int dce_v10_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +2 -1
@@ -2914,7 +2914,8 @@ static int dce_v11_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +2 -1
@@ -2673,7 +2673,8 @@ static int dce_v6_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_width =16384 ;adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;adev_to_drm (adev)->mode_config.fb_base = adev->gmc.aper_base;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +2 -1
@@ -2693,7 +2693,8 @@ static int dce_v8_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -3818,7 +3818,8 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;/* indicates support for immediate flip */ adev_to_drm (adev)->mode_config.async_page_flip = true;
Signature · 1 line
2.35.3
RE: [PATCH 2/2] drm/amdgpu/display: disable prefer_shadow for generic fb helpers
[AMD Official Use Only - General]
Thanks for the fixes! Series is acked-by: Evan Quan <[email protected]>
Evan
Quoted 130 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, June 29, 2022 10:16 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/display: disableprefer_shadowfor generic fb helpersSeems to break hibernation. Disable for now until we can root cause it.
Fixes 087451f372bf ("drm/amdgpu: use generic fb helpers instead of settingup AMD own's.")
Bug:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz
illa.kernel.org%2Fshow_bug.cgi%3Fid%3D216119&data=05%7C01%7Cev an.quan%40amd.com%7C1f2762736c244dadb6ea08da59d9f0e6%7C3dd8961f e4884e608e11a82d994e183d%7C0%7C0%7C637921089829876781%7CUnknow n%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha WwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WJLd3ZXE1URnAW n3CyX%2BaBdzVB4T66oun7lA7X9KPbw%3D&reserved=0Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 ++- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2
-1@@ -496,7 +496,8 @@ static int amdgpu_vkms_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =YRES_MAX ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_base = adev- >gmc.aper_base;drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +2
-1@@ -2796,7 +2796,8 @@ static int dce_v10_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +2
-1@@ -2914,7 +2914,8 @@ static int dce_v11_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +2
-1@@ -2673,7 +2673,8 @@ static int dce_v6_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_width =16384 ;adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true; adev_to_drm(adev)->mode_config.fb_base = adev-Quoted 1 line
gmc.aper_base;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +2
-1@@ -2693,7 +2693,8 @@ static int dce_v8_0_sw_init(void *handle)adev_to_drm (adev)->mode_config.max_height =16384 ;adev_to_drm (adev)->mode_config.preferred_depth =24 ; -adev_to_drm (adev)->mode_config.prefer_shadow =1 ; +/* disable prefer shadow for now due to hibernation issues */ +adev_to_drm (adev)->mode_config.prefer_shadow =0 ;adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-2@@ -3818,7 +3818,8 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) adev_to_drm(adev)->mode_config.max_height = 16384; adev_to_drm(adev)->mode_config.preferred_depth = 24; - adev_to_drm(adev)->mode_config.prefer_shadow = 1; + /* disable prefer shadow for now due to hibernation issues */ + adev_to_drm(adev)->mode_config.prefer_shadow = 0; /* indicates support for immediate flip */ adev_to_drm(adev)->mode_config.async_page_flip = true; --2.35.3