From: Rob Clark Date: Mon, 26 Feb 2018 16:29:05 +0000 (-0500) Subject: freedreno: add some more compute caps X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9b1cc33dfde9123265f87a77d8ba231421f967c;p=mesa.git freedreno: add some more compute caps Signed-off-by: Rob Clark --- 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 #include +#include #include +#include #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;