winsys/radeon: Always report at least 1 compute unit
authorTom Stellard <thomas.stellard@amd.com>
Fri, 5 Dec 2014 23:59:10 +0000 (23:59 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 8 Dec 2014 22:20:50 +0000 (17:20 -0500)
All uses of this require that the value be at least one, so it's
easier to report at least one than having to wrap all uses
in MAX2(max_compute_units, 1).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 8aad1782d1db516e4505fe45729120b69078c364..cb17e54e0d7abf0d5f4017ca90ee773c64680168 100644 (file)
@@ -607,7 +607,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 = MAX2(rscreen->info.max_compute_units, 1);
+                       *max_compute_units = rscreen->info.max_compute_units;
                }
                return sizeof(uint32_t);
 
index 3974034c91180db4d61de01e3ae056f8c91de7e0..75fc80feebc0ad22bfeb7d00d45f0165427fc5e9 100644 (file)
@@ -387,6 +387,8 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
     radeon_get_drm_value(ws->fd, RADEON_INFO_MAX_PIPES, NULL,
                          &ws->info.r600_max_pipes);
 
+    /* All GPUs have at least one compute unit */
+    ws->info.max_compute_units = 1;
     radeon_get_drm_value(ws->fd, RADEON_INFO_ACTIVE_CU_COUNT, NULL,
                          &ws->info.max_compute_units);