nvc0: add missing compute parameters required by clover
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 3 Nov 2015 18:33:08 +0000 (19:33 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 3 Nov 2015 21:17:00 +0000 (22:17 +0100)
This fixes crashes with some piglit OpenCL tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c

index 52ce2d5831d320162be8f9fd59ff82728a77a3ce..6ad3980911ddb57eb0add6471ca5292494e0318b 100644 (file)
@@ -353,7 +353,8 @@ static int
 nvc0_screen_get_compute_param(struct pipe_screen *pscreen,
                               enum pipe_compute_cap param, void *data)
 {
-   const uint16_t obj_class = nvc0_screen(pscreen)->compute->oclass;
+   struct nvc0_screen *screen = nvc0_screen(pscreen);
+   const uint16_t obj_class = screen->compute->oclass;
 
 #define RET(x) do {                  \
    if (data)                         \
@@ -384,6 +385,14 @@ nvc0_screen_get_compute_param(struct pipe_screen *pscreen,
       RET((uint64_t []) { 4096 });
    case PIPE_COMPUTE_CAP_SUBGROUP_SIZE:
       RET((uint32_t []) { 32 });
+   case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE:
+      RET((uint64_t []) { 1ULL << 40 });
+   case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED:
+      RET((uint32_t []) { 0 });
+   case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS:
+      RET((uint32_t []) { screen->mp_count_compute });
+   case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY:
+      RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */
    default:
       return 0;
    }