diff options
author | Rob Clark <[email protected]> | 2018-02-26 11:29:05 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-03-05 08:05:33 -0500 |
commit | c9b1cc33dfde9123265f87a77d8ba231421f967c (patch) | |
tree | 289c4e13c0ca1f71cf86b31688349857fb029f80 /src/gallium | |
parent | 9630f4df3bc4ae150140420b1be93e4c28e3ad1b (diff) |
freedreno: add some more compute caps
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_screen.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_screen.h | 1 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 7fc3ab5e9ad..f9cafbabeb3 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -40,9 +40,10 @@ #include "util/os_time.h" -#include <stdio.h> #include <errno.h> +#include <stdio.h> #include <stdlib.h> +#include <sys/sysinfo.h> #include "freedreno_screen.h" #include "freedreno_resource.h" @@ -666,21 +667,32 @@ fd_get_compute_param(struct pipe_screen *pscreen, enum pipe_shader_ir ir_type, RET((uint64_t []) { 1024 }); case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: + RET((uint64_t []) { screen->ram_size }); + case PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE: RET((uint64_t []) { 32768 }); case PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE: case PIPE_COMPUTE_CAP_MAX_INPUT_SIZE: - break; + RET((uint64_t []) { 4096 }); + case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: - RET((uint64_t []) { 32768 }); + RET((uint64_t []) { screen->ram_size }); case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: + RET((uint32_t []) { screen->max_freq / 1000000 }); + case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: + RET((uint32_t []) { 9999 }); // TODO + case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED: + RET((uint32_t []) { 1 }); + case PIPE_COMPUTE_CAP_SUBGROUP_SIZE: + RET((uint32_t []) { 32 }); // TODO + case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK: - break; + RET((uint64_t []) { 1024 }); // TODO } return 0; @@ -824,6 +836,10 @@ fd_screen_create(struct fd_device *dev) screen->priority_mask = (1 << val) - 1; } + struct sysinfo si; + sysinfo(&si); + screen->ram_size = si.totalram; + DBG("Pipe Info:"); DBG(" GPU-id: %d", screen->gpu_id); DBG(" Chip-id: 0x%08x", screen->chip_id); diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h index 55537f2d1c4..6be739ae287 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.h +++ b/src/gallium/drivers/freedreno/freedreno_screen.h @@ -64,6 +64,7 @@ struct fd_screen { uint32_t gpu_id; /* 220, 305, etc */ uint32_t chip_id; /* coreid:8 majorrev:8 minorrev:8 patch:8 */ uint32_t max_freq; + uint32_t ram_size; uint32_t max_rts; /* max # of render targets */ uint32_t gmem_alignw, gmem_alignh; uint32_t num_vsc_pipes; |