Mesa (master): radeon/compute: Always report at least 1 compute unit

Tom Stellard tstellar at kemper.freedesktop.org
Sat Jun 14 01:39:05 UTC 2014


Module: Mesa
Branch: master
Commit: ac26a562edc8b249de083a766eeac9ce1678cfa2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac26a562edc8b249de083a766eeac9ce1678cfa2

Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Fri Jun 13 12:58:13 2014 -0400

radeon/compute: Always report at least 1 compute unit

Some apps will abort if they detect 0 compute units.  This fixes
crashes in some OpenCV tests.

---

 src/gallium/drivers/radeon/r600_pipe_common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 4b9d31c..1911cde 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -523,7 +523,7 @@ static int r600_get_compute_param(struct pipe_screen *screen,
 	case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS:
 		if (ret) {
 			uint32_t *max_compute_units = ret;
-			*max_compute_units = rscreen->info.max_compute_units;
+			*max_compute_units = MAX2(rscreen->info.max_compute_units, 1);
 		}
 		return sizeof(uint32_t);
 




More information about the mesa-commit mailing list