diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-09-25 14:39:38 +0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-10-03 17:19:16 +0400 |
commit | 392a250bd080e296f97ccc7e91b051a6b5da0ff1 (patch) | |
tree | 9c945db20239a93068c5d6d0b26efda883e6ba24 /drivers/gpu/drm/radeon/radeon_fence.c | |
parent | a0e847641cd7239661ff1b39db0afb0e2992026f (diff) | |
download | linux-392a250bd080e296f97ccc7e91b051a6b5da0ff1.tar.xz |
drm/radeon: cope with foreign fences inside the reservation object
Not the whole world is a radeon! :-)
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fence.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fence.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index af9f2d6bd7d0..995167025282 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -541,6 +541,15 @@ int radeon_fence_wait(struct radeon_fence *fence, bool intr) uint64_t seq[RADEON_NUM_RINGS] = {}; long r; + /* + * This function should not be called on !radeon fences. + * If this is the case, it would mean this function can + * also be called on radeon fences belonging to another card. + * exclusive_lock is not held in that case. + */ + if (WARN_ON_ONCE(!to_radeon_fence(&fence->base))) + return fence_wait(&fence->base, intr); + seq[fence->ring] = fence->seq; r = radeon_fence_wait_seq_timeout(fence->rdev, seq, intr, MAX_SCHEDULE_TIMEOUT); if (r < 0) { |