diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-03-12 12:53:13 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-03-15 18:47:17 -0400 |
commit | fa8d387dc3f62062a6b4afbbb2a3438094fd8584 (patch) | |
tree | c4db110cbbe964966565eb574591aff8034a1950 /drivers/gpu/drm/radeon/radeon_benchmark.c | |
parent | 8f612b23a17dce86fef75407e698de6243cc99a1 (diff) |
drm/radeon/benchmark: make sure bo blit copy exists before using it
Fixes a segfault on asics without a blit callback.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=62239
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_benchmark.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_benchmark.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c index bedda9caadd9..a2f0c243deb2 100644 --- a/drivers/gpu/drm/radeon/radeon_benchmark.c +++ b/drivers/gpu/drm/radeon/radeon_benchmark.c | |||
@@ -135,13 +135,15 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, | |||
135 | sdomain, ddomain, "dma"); | 135 | sdomain, ddomain, "dma"); |
136 | } | 136 | } |
137 | 137 | ||
138 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, | 138 | if (rdev->asic->copy.blit) { |
139 | RADEON_BENCHMARK_COPY_BLIT, n); | 139 | time = radeon_benchmark_do_move(rdev, size, saddr, daddr, |
140 | if (time < 0) | 140 | RADEON_BENCHMARK_COPY_BLIT, n); |
141 | goto out_cleanup; | 141 | if (time < 0) |
142 | if (time > 0) | 142 | goto out_cleanup; |
143 | radeon_benchmark_log_results(n, size, time, | 143 | if (time > 0) |
144 | sdomain, ddomain, "blit"); | 144 | radeon_benchmark_log_results(n, size, time, |
145 | sdomain, ddomain, "blit"); | ||
146 | } | ||
145 | 147 | ||
146 | out_cleanup: | 148 | out_cleanup: |
147 | if (sobj) { | 149 | if (sobj) { |