diff options
| author | Michel Dänzer <michel.daenzer@amd.com> | 2014-07-14 02:58:03 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2014-07-17 09:01:32 -0400 |
| commit | 306f98d9a1079cc78567b1a6a5e94c272c163e47 (patch) | |
| tree | 22ca6ee39c545b1f9060888d5c111442a4a56970 | |
| parent | c60381bd82a54233bb46f93be00a4154bd0cf95d (diff) | |
drm/radeon: Complete page flip even if waiting on the BO fence fails
Otherwise the DRM core and userspace will be confused about which BO the
CRTC is scanning out.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 8de579473645..97ea46597bea 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
| @@ -390,20 +390,22 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
| 390 | int r; | 390 | int r; |
| 391 | 391 | ||
| 392 | down_read(&rdev->exclusive_lock); | 392 | down_read(&rdev->exclusive_lock); |
| 393 | while (work->fence) { | 393 | if (work->fence) { |
| 394 | r = radeon_fence_wait(work->fence, false); | 394 | r = radeon_fence_wait(work->fence, false); |
| 395 | if (r == -EDEADLK) { | 395 | if (r == -EDEADLK) { |
| 396 | up_read(&rdev->exclusive_lock); | 396 | up_read(&rdev->exclusive_lock); |
| 397 | r = radeon_gpu_reset(rdev); | 397 | r = radeon_gpu_reset(rdev); |
| 398 | down_read(&rdev->exclusive_lock); | 398 | down_read(&rdev->exclusive_lock); |
| 399 | } | 399 | } |
| 400 | if (r) | ||
| 401 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", r); | ||
| 400 | 402 | ||
| 401 | if (r) { | 403 | /* We continue with the page flip even if we failed to wait on |
| 402 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", | 404 | * the fence, otherwise the DRM core and userspace will be |
| 403 | r); | 405 | * confused about which BO the CRTC is scanning out |
| 404 | goto cleanup; | 406 | */ |
| 405 | } else | 407 | |
| 406 | radeon_fence_unref(&work->fence); | 408 | radeon_fence_unref(&work->fence); |
| 407 | } | 409 | } |
| 408 | 410 | ||
| 409 | /* do the flip (mmio) */ | 411 | /* do the flip (mmio) */ |
| @@ -418,14 +420,6 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
| 418 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; | 420 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; |
| 419 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | 421 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); |
| 420 | up_read(&rdev->exclusive_lock); | 422 | up_read(&rdev->exclusive_lock); |
| 421 | |||
| 422 | return; | ||
| 423 | |||
| 424 | cleanup: | ||
| 425 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | ||
| 426 | radeon_fence_unref(&work->fence); | ||
| 427 | kfree(work); | ||
| 428 | up_read(&rdev->exclusive_lock); | ||
| 429 | } | 423 | } |
| 430 | 424 | ||
| 431 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, | 425 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, |
