diff mbox

[1/2] drm/radeon/benchmark: make sure bo blit copy exists before using it

Message ID 1363192725-5902-1-git-send-email-alexdeucher@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Deucher March 13, 2013, 4:38 p.m. UTC
From: Alex Deucher <alexander.deucher@amd.com>

Fixes a segfault on asics without a blit callback.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=62239

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_benchmark.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

Comments

Michel Dänzer March 13, 2013, 4:56 p.m. UTC | #1
On Mit, 2013-03-13 at 12:38 -0400, alexdeucher@gmail.com wrote: 
> From: Alex Deucher <alexander.deucher@amd.com>
> 
> Fixes a segfault on asics without a blit callback.
> 
> Fixes:
> https://bugs.freedesktop.org/show_bug.cgi?id=62239
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org

For the series:

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Paul Menzel March 14, 2013, 1:06 p.m. UTC | #2
Dear Alex,


Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb alexdeucher@gmail.com:
> From: Alex Deucher <alexander.deucher@amd.com>
> 
> Fixes a segfault on asics without a blit callback.

so as a result this is not benchmarked for these ASICS, right?

> Fixes:
> https://bugs.freedesktop.org/show_bug.cgi?id=62239
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/gpu/drm/radeon/radeon_benchmark.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)

[…]


Thanks,

Paul
Alex Deucher March 14, 2013, 1:15 p.m. UTC | #3
On Thu, Mar 14, 2013 at 9:06 AM, Paul Menzel
<paulepanter@users.sourceforge.net> wrote:
> Dear Alex,
>
>
> Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb alexdeucher@gmail.com:
>> From: Alex Deucher <alexander.deucher@amd.com>
>>
>> Fixes a segfault on asics without a blit callback.
>
> so as a result this is not benchmarked for these ASICS, right?

Yes.  it's not benchmarked, but there nothing to benchmark if the
callback doesn't exist :)

Alex
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c
index bedda9c..a2f0c24 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,
 						     sdomain, ddomain, "dma");
 	}
 
-	time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
-					RADEON_BENCHMARK_COPY_BLIT, n);
-	if (time < 0)
-		goto out_cleanup;
-	if (time > 0)
-		radeon_benchmark_log_results(n, size, time,
-					     sdomain, ddomain, "blit");
+	if (rdev->asic->copy.blit) {
+		time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
+						RADEON_BENCHMARK_COPY_BLIT, n);
+		if (time < 0)
+			goto out_cleanup;
+		if (time > 0)
+			radeon_benchmark_log_results(n, size, time,
+						     sdomain, ddomain, "blit");
+	}
 
 out_cleanup:
 	if (sobj) {