diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 25 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 | 
6 files changed, 31 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 17c9bbe0cbc5..4dfd6724b3ca 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -1528,6 +1528,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); @@ -1563,10 +1578,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; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index 576849e95296..108e8e8a1a36 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -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; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 288fce7dc0ed..9c964cd3b5d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -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; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index cbe5250b31cb..e0ad9f27dc3f 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -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; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 982855e6cf52..3caf6f386042 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -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; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 84440741c60b..7c75df5bffed 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -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;  |