aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-10-09 08:45:09 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-19 15:27:03 -0400
commit396bcb41e035df7b98fb150ca950bf213e70ae7b (patch)
tree09ec736839cc47c275c6dd677271af1520b11cc9 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parent6ed4e2e673d348df6623012a628a8ab8624e3222 (diff)
drm/amdgpu: partial revert VRAM lost handling v2
Keep blocking the CS, but revert everything else. Mapping BOs and info IOCTL are harmless and can still happen even when VRAM content ist lost. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 82e8d43b235a..f759836d10ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -270,7 +270,6 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
270static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) 270static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
271{ 271{
272 struct amdgpu_device *adev = dev->dev_private; 272 struct amdgpu_device *adev = dev->dev_private;
273 struct amdgpu_fpriv *fpriv = filp->driver_priv;
274 struct drm_amdgpu_info *info = data; 273 struct drm_amdgpu_info *info = data;
275 struct amdgpu_mode_info *minfo = &adev->mode_info; 274 struct amdgpu_mode_info *minfo = &adev->mode_info;
276 void __user *out = (void __user *)(uintptr_t)info->return_pointer; 275 void __user *out = (void __user *)(uintptr_t)info->return_pointer;
@@ -283,8 +282,6 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
283 282
284 if (!info->return_size || !info->return_pointer) 283 if (!info->return_size || !info->return_pointer)
285 return -EINVAL; 284 return -EINVAL;
286 if (amdgpu_kms_vram_lost(adev, fpriv))
287 return -ENODEV;
288 285
289 switch (info->query) { 286 switch (info->query) {
290 case AMDGPU_INFO_ACCEL_WORKING: 287 case AMDGPU_INFO_ACCEL_WORKING:
@@ -792,10 +789,19 @@ void amdgpu_driver_lastclose_kms(struct drm_device *dev)
792 vga_switcheroo_process_delayed_switch(); 789 vga_switcheroo_process_delayed_switch();
793} 790}
794 791
792/**
793 * amdgpu_kms_vram_lost - check if VRAM was lost for this client
794 *
795 * @adev: amdgpu device
796 * @fpriv: client private
797 *
798 * Check if all CS is blocked for the client because of lost VRAM
799 */
795bool amdgpu_kms_vram_lost(struct amdgpu_device *adev, 800bool amdgpu_kms_vram_lost(struct amdgpu_device *adev,
796 struct amdgpu_fpriv *fpriv) 801 struct amdgpu_fpriv *fpriv)
797{ 802{
798 return fpriv->vram_lost_counter != atomic_read(&adev->vram_lost_counter); 803 return fpriv->vram_lost_counter !=
804 atomic_read(&adev->vram_lost_counter);
799} 805}
800 806
801/** 807/**