diff options
author | Marek Olšák <marek.olsak@amd.com> | 2016-07-29 18:48:39 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-08-08 11:33:11 -0400 |
commit | f10379503e2b1814e27957899bcdfd0132a1915e (patch) | |
tree | 5d3c38efc7aa8e0e20dec8d97e0833546ad24a7b /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | a693e050edfe794fea81d7cfe72429a406aa380b (diff) |
drm/amdgpu: print more accurate error messages on IB submission failure
It's useful for debugging.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 0307ff5887c5..8eb93dff69d6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -386,8 +386,10 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, | |||
386 | 386 | ||
387 | r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true, | 387 | r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true, |
388 | &duplicates); | 388 | &duplicates); |
389 | if (unlikely(r != 0)) | 389 | if (unlikely(r != 0)) { |
390 | DRM_ERROR("ttm_eu_reserve_buffers failed.\n"); | ||
390 | goto error_free_pages; | 391 | goto error_free_pages; |
392 | } | ||
391 | 393 | ||
392 | /* Without a BO list we don't have userptr BOs */ | 394 | /* Without a BO list we don't have userptr BOs */ |
393 | if (!p->bo_list) | 395 | if (!p->bo_list) |
@@ -427,9 +429,10 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, | |||
427 | /* Unreserve everything again. */ | 429 | /* Unreserve everything again. */ |
428 | ttm_eu_backoff_reservation(&p->ticket, &p->validated); | 430 | ttm_eu_backoff_reservation(&p->ticket, &p->validated); |
429 | 431 | ||
430 | /* We tried to often, just abort */ | 432 | /* We tried too many times, just abort */ |
431 | if (!--tries) { | 433 | if (!--tries) { |
432 | r = -EDEADLK; | 434 | r = -EDEADLK; |
435 | DRM_ERROR("deadlock in %s\n", __func__); | ||
433 | goto error_free_pages; | 436 | goto error_free_pages; |
434 | } | 437 | } |
435 | 438 | ||
@@ -441,11 +444,13 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, | |||
441 | sizeof(struct page*)); | 444 | sizeof(struct page*)); |
442 | if (!e->user_pages) { | 445 | if (!e->user_pages) { |
443 | r = -ENOMEM; | 446 | r = -ENOMEM; |
447 | DRM_ERROR("calloc failure in %s\n", __func__); | ||
444 | goto error_free_pages; | 448 | goto error_free_pages; |
445 | } | 449 | } |
446 | 450 | ||
447 | r = amdgpu_ttm_tt_get_user_pages(ttm, e->user_pages); | 451 | r = amdgpu_ttm_tt_get_user_pages(ttm, e->user_pages); |
448 | if (r) { | 452 | if (r) { |
453 | DRM_ERROR("amdgpu_ttm_tt_get_user_pages failed.\n"); | ||
449 | drm_free_large(e->user_pages); | 454 | drm_free_large(e->user_pages); |
450 | e->user_pages = NULL; | 455 | e->user_pages = NULL; |
451 | goto error_free_pages; | 456 | goto error_free_pages; |
@@ -462,12 +467,16 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, | |||
462 | p->bytes_moved = 0; | 467 | p->bytes_moved = 0; |
463 | 468 | ||
464 | r = amdgpu_cs_list_validate(p, &duplicates); | 469 | r = amdgpu_cs_list_validate(p, &duplicates); |
465 | if (r) | 470 | if (r) { |
471 | DRM_ERROR("amdgpu_cs_list_validate(duplicates) failed.\n"); | ||
466 | goto error_validate; | 472 | goto error_validate; |
473 | } | ||
467 | 474 | ||
468 | r = amdgpu_cs_list_validate(p, &p->validated); | 475 | r = amdgpu_cs_list_validate(p, &p->validated); |
469 | if (r) | 476 | if (r) { |
477 | DRM_ERROR("amdgpu_cs_list_validate(validated) failed.\n"); | ||
470 | goto error_validate; | 478 | goto error_validate; |
479 | } | ||
471 | 480 | ||
472 | fpriv->vm.last_eviction_counter = | 481 | fpriv->vm.last_eviction_counter = |
473 | atomic64_read(&p->adev->num_evictions); | 482 | atomic64_read(&p->adev->num_evictions); |