diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 5de092eab0fa..0c07df72743c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -1272,16 +1272,12 @@ int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, | |||
1272 | { | 1272 | { |
1273 | union drm_amdgpu_wait_cs *wait = data; | 1273 | union drm_amdgpu_wait_cs *wait = data; |
1274 | struct amdgpu_device *adev = dev->dev_private; | 1274 | struct amdgpu_device *adev = dev->dev_private; |
1275 | struct amdgpu_fpriv *fpriv = filp->driver_priv; | ||
1276 | unsigned long timeout = amdgpu_gem_timeout(wait->in.timeout); | 1275 | unsigned long timeout = amdgpu_gem_timeout(wait->in.timeout); |
1277 | struct amdgpu_ring *ring = NULL; | 1276 | struct amdgpu_ring *ring = NULL; |
1278 | struct amdgpu_ctx *ctx; | 1277 | struct amdgpu_ctx *ctx; |
1279 | struct dma_fence *fence; | 1278 | struct dma_fence *fence; |
1280 | long r; | 1279 | long r; |
1281 | 1280 | ||
1282 | if (amdgpu_kms_vram_lost(adev, fpriv)) | ||
1283 | return -ENODEV; | ||
1284 | |||
1285 | ctx = amdgpu_ctx_get(filp->driver_priv, wait->in.ctx_id); | 1281 | ctx = amdgpu_ctx_get(filp->driver_priv, wait->in.ctx_id); |
1286 | if (ctx == NULL) | 1282 | if (ctx == NULL) |
1287 | return -EINVAL; | 1283 | return -EINVAL; |
@@ -1350,16 +1346,12 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data, | |||
1350 | struct drm_file *filp) | 1346 | struct drm_file *filp) |
1351 | { | 1347 | { |
1352 | struct amdgpu_device *adev = dev->dev_private; | 1348 | struct amdgpu_device *adev = dev->dev_private; |
1353 | struct amdgpu_fpriv *fpriv = filp->driver_priv; | ||
1354 | union drm_amdgpu_fence_to_handle *info = data; | 1349 | union drm_amdgpu_fence_to_handle *info = data; |
1355 | struct dma_fence *fence; | 1350 | struct dma_fence *fence; |
1356 | struct drm_syncobj *syncobj; | 1351 | struct drm_syncobj *syncobj; |
1357 | struct sync_file *sync_file; | 1352 | struct sync_file *sync_file; |
1358 | int fd, r; | 1353 | int fd, r; |
1359 | 1354 | ||
1360 | if (amdgpu_kms_vram_lost(adev, fpriv)) | ||
1361 | return -ENODEV; | ||
1362 | |||
1363 | fence = amdgpu_cs_get_fence(adev, filp, &info->in.fence); | 1355 | fence = amdgpu_cs_get_fence(adev, filp, &info->in.fence); |
1364 | if (IS_ERR(fence)) | 1356 | if (IS_ERR(fence)) |
1365 | return PTR_ERR(fence); | 1357 | return PTR_ERR(fence); |
@@ -1521,15 +1513,12 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, | |||
1521 | struct drm_file *filp) | 1513 | struct drm_file *filp) |
1522 | { | 1514 | { |
1523 | struct amdgpu_device *adev = dev->dev_private; | 1515 | struct amdgpu_device *adev = dev->dev_private; |
1524 | struct amdgpu_fpriv *fpriv = filp->driver_priv; | ||
1525 | union drm_amdgpu_wait_fences *wait = data; | 1516 | union drm_amdgpu_wait_fences *wait = data; |
1526 | uint32_t fence_count = wait->in.fence_count; | 1517 | uint32_t fence_count = wait->in.fence_count; |
1527 | struct drm_amdgpu_fence *fences_user; | 1518 | struct drm_amdgpu_fence *fences_user; |
1528 | struct drm_amdgpu_fence *fences; | 1519 | struct drm_amdgpu_fence *fences; |
1529 | int r; | 1520 | int r; |
1530 | 1521 | ||
1531 | if (amdgpu_kms_vram_lost(adev, fpriv)) | ||
1532 | return -ENODEV; | ||
1533 | /* Get the fences from userspace */ | 1522 | /* Get the fences from userspace */ |
1534 | fences = kmalloc_array(fence_count, sizeof(struct drm_amdgpu_fence), | 1523 | fences = kmalloc_array(fence_count, sizeof(struct drm_amdgpu_fence), |
1535 | GFP_KERNEL); | 1524 | GFP_KERNEL); |