Skip to contentSkip to conversation

drm/radeon/benchmark: make sure bo blit copy exists before using it

PATCH In review [email protected] 3 participants 7 messages Mar 13, 2013 – Mar 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Alex Deucher <[email protected]>

Fixes a segfault on asics without a blit callback.

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

---
 drivers/gpu/drm/radeon/radeon_benchmark.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_benchmark.c +9 -7
index bedda9c..a2f0c24 100644
@@ -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) {
Signature · 1 line
1.7.7.5
#1 lore raw

PATCH 2/2 drm/radeon/benchmark: allow same domains for dma copy

From: Alex Deucher <[email protected]>

Remove old comment and allow benchmarking moves within the same memory domain for both dma and blit methods.

---
 drivers/gpu/drm/radeon/radeon_benchmark.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_benchmark.c +1 -4
index a2f0c24..6e05a2e 100644
@@ -122,10 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
 		goto out_cleanup;
 	}
 
-	/* r100 doesn't have dma engine so skip the test */
-	/* also, VRAM-to-VRAM test doesn't make much sense for DMA */
-	/* skip it as well if domains are the same */
-	if ((rdev->asic->copy.dma) && (sdomain != ddomain)) {
+	if (rdev->asic->copy.dma) {
 		time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
 						RADEON_BENCHMARK_COPY_DMA, n);
 		if (time < 0)
Signature · 1 line
1.7.7.5
Reviewed-by on v1 1/2
#4 lore raw
In reply to [email protected]
Quoted 9 lines · On Mit, 2013-03-13 at 12:38 -0400, [email protected] wrote:

From: Alex Deucher <[email protected]>

Fixes a segfault on asics without a blit callback.

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

For the series:

Signature · 2 lines
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
#5 lore raw
In reply to [email protected]

Dear Alex,

Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb [email protected]:

Quoted 3 lines

From: Alex Deucher <[email protected]>

Fixes a segfault on asics without a blit callback.

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

Quoted 8 lines

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

---
 drivers/gpu/drm/radeon/radeon_benchmark.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

[…]

Thanks,

Paul

#2 lore raw

Re: [PATCH 2/2] drm/radeon/benchmark: allow same domains for dma copy

In reply to [email protected]

Dear Alex,

Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb [email protected]:

Quoted 15 lines

From: Alex Deucher <[email protected]>

Remove old comment and allow benchmarking moves within the same memory domain for both dma and blit methods.

---
 drivers/gpu/drm/radeon/radeon_benchmark.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_benchmark.c +0 -0
index a2f0c24..6e05a2e 100644

drivers/gpu/drm/radeon/radeon_benchmark.c static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, · line 125

Quoted 8 lines
drivers/gpu/drm/radeon/radeon_benchmark.c +1 -4
@@ -122,10 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
 		goto out_cleanup;
 	}
 
-	/* r100 doesn't have dma engine so skip the test */
-	/* also, VRAM-to-VRAM test doesn't make much sense for DMA */
-	/* skip it as well if domains are the same */
-	if ((rdev->asic->copy.dma) && (sdomain != ddomain)) {
+	if (rdev->asic->copy.dma) {

why is the comment not valid anymore? What changed?

drivers/gpu/drm/radeon/radeon_benchmark.c static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, · line 128

Quoted 3 lines
drivers/gpu/drm/radeon/radeon_benchmark.c +0 -0
 		time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
 						RADEON_BENCHMARK_COPY_DMA, n);
 		if (time < 0)

Thanks,

Paul

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Paul Menzel
Quoted 9 lines · Paul Menzel

Dear Alex,

Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb [email protected]:

Quoted 3 lines

From: Alex Deucher <[email protected]>

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

#3 lore raw

Re: [PATCH 2/2] drm/radeon/benchmark: allow same domains for dma copy

In reply to Paul Menzel
Quoted 22 lines · Paul Menzel

Dear Alex,

Am Mittwoch, den 13.03.2013, 12:38 -0400 schrieb [email protected]:

Quoted 18 lines

From: Alex Deucher <[email protected]>

Remove old comment and allow benchmarking moves within the same memory domain for both dma and blit methods.

---
 drivers/gpu/drm/radeon/radeon_benchmark.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_benchmark.c +0 -0
index a2f0c24..6e05a2e 100644
@@ -122,10 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
              goto out_cleanup;
      }
 
Quoted 7 lines

drivers/gpu/drm/radeon/radeon_benchmark.c static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, · line 125

Quoted 5 lines
drivers/gpu/drm/radeon/radeon_benchmark.c +1 -4
-     /* r100 doesn't have dma engine so skip the test */
-     /* also, VRAM-to-VRAM test doesn't make much sense for DMA */
-     /* skip it as well if domains are the same */
-     if ((rdev->asic->copy.dma) && (sdomain != ddomain)) {
+     if (rdev->asic->copy.dma) {

why is the comment not valid anymore? What changed?

In my opinion it was never valid.

Alex