summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_llvm.c63
-rw-r--r--src/gallium/drivers/r600/r600_llvm.h2
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c74
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h2
4 files changed, 72 insertions, 69 deletions
diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index be8ad155987..127149faefe 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -550,69 +550,6 @@ LLVMModuleRef r600_tgsi_llvm(
return ctx->gallivm.module;
}
-const char * r600_llvm_gpu_string(enum radeon_family family)
-{
- const char * gpu_family;
-
- switch (family) {
- case CHIP_R600:
- case CHIP_RV610:
- case CHIP_RV630:
- case CHIP_RV620:
- case CHIP_RV635:
- case CHIP_RV670:
- case CHIP_RS780:
- case CHIP_RS880:
- gpu_family = "r600";
- break;
- case CHIP_RV710:
- gpu_family = "rv710";
- break;
- case CHIP_RV730:
- gpu_family = "rv730";
- break;
- case CHIP_RV740:
- case CHIP_RV770:
- gpu_family = "rv770";
- break;
- case CHIP_PALM:
- case CHIP_CEDAR:
- gpu_family = "cedar";
- break;
- case CHIP_SUMO:
- case CHIP_SUMO2:
- case CHIP_REDWOOD:
- gpu_family = "redwood";
- break;
- case CHIP_JUNIPER:
- gpu_family = "juniper";
- break;
- case CHIP_HEMLOCK:
- case CHIP_CYPRESS:
- gpu_family = "cypress";
- break;
- case CHIP_BARTS:
- gpu_family = "barts";
- break;
- case CHIP_TURKS:
- gpu_family = "turks";
- break;
- case CHIP_CAICOS:
- gpu_family = "caicos";
- break;
- case CHIP_CAYMAN:
- case CHIP_ARUBA:
- gpu_family = "cayman";
- break;
- default:
- gpu_family = "";
- fprintf(stderr, "Chip not supported by r600 llvm "
- "backend, please file a bug at " PACKAGE_BUGREPORT "\n");
- break;
- }
- return gpu_family;
-}
-
unsigned r600_llvm_compile(
LLVMModuleRef mod,
unsigned char ** inst_bytes,
diff --git a/src/gallium/drivers/r600/r600_llvm.h b/src/gallium/drivers/r600/r600_llvm.h
index 090d909a475..b5e2af2afed 100644
--- a/src/gallium/drivers/r600/r600_llvm.h
+++ b/src/gallium/drivers/r600/r600_llvm.h
@@ -15,8 +15,6 @@ LLVMModuleRef r600_tgsi_llvm(
struct radeon_llvm_context * ctx,
const struct tgsi_token * tokens);
-const char * r600_llvm_gpu_string(enum radeon_family family);
-
unsigned r600_llvm_compile(
LLVMModuleRef mod,
unsigned char ** inst_bytes,
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 1e4c9642a0d..7f308f7d001 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -764,18 +764,84 @@ static int r600_get_video_param(struct pipe_screen *screen,
}
}
+const char * r600_llvm_gpu_string(enum radeon_family family)
+{
+ const char * gpu_family;
+
+ switch (family) {
+ case CHIP_R600:
+ case CHIP_RV610:
+ case CHIP_RV630:
+ case CHIP_RV620:
+ case CHIP_RV635:
+ case CHIP_RV670:
+ case CHIP_RS780:
+ case CHIP_RS880:
+ gpu_family = "r600";
+ break;
+ case CHIP_RV710:
+ gpu_family = "rv710";
+ break;
+ case CHIP_RV730:
+ gpu_family = "rv730";
+ break;
+ case CHIP_RV740:
+ case CHIP_RV770:
+ gpu_family = "rv770";
+ break;
+ case CHIP_PALM:
+ case CHIP_CEDAR:
+ gpu_family = "cedar";
+ break;
+ case CHIP_SUMO:
+ case CHIP_SUMO2:
+ case CHIP_REDWOOD:
+ gpu_family = "redwood";
+ break;
+ case CHIP_JUNIPER:
+ gpu_family = "juniper";
+ break;
+ case CHIP_HEMLOCK:
+ case CHIP_CYPRESS:
+ gpu_family = "cypress";
+ break;
+ case CHIP_BARTS:
+ gpu_family = "barts";
+ break;
+ case CHIP_TURKS:
+ gpu_family = "turks";
+ break;
+ case CHIP_CAICOS:
+ gpu_family = "caicos";
+ break;
+ case CHIP_CAYMAN:
+ case CHIP_ARUBA:
+ gpu_family = "cayman";
+ break;
+ default:
+ gpu_family = "";
+ fprintf(stderr, "Chip not supported by r600 llvm "
+ "backend, please file a bug at " PACKAGE_BUGREPORT "\n");
+ break;
+ }
+ return gpu_family;
+}
+
+
static int r600_get_compute_param(struct pipe_screen *screen,
enum pipe_compute_cap param,
void *ret)
{
+ struct r600_screen *rscreen = (struct r600_screen *)screen;
//TODO: select these params by asic
switch (param) {
- case PIPE_COMPUTE_CAP_IR_TARGET:
+ case PIPE_COMPUTE_CAP_IR_TARGET: {
+ const char *gpu = r600_llvm_gpu_string(rscreen->family);
if (ret) {
- strcpy(ret, "r600--");
+ sprintf(ret, "%s-r600--", gpu);
}
- return 7 * sizeof(char);
-
+ return (8 + strlen(gpu)) * sizeof(char);
+ }
case PIPE_COMPUTE_CAP_GRID_DIMENSION:
if (ret) {
uint64_t * grid_dimension = ret;
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 541d42e7983..de1545e7cdd 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -746,6 +746,8 @@ boolean r600_rings_is_buffer_referenced(struct r600_context *ctx,
void *r600_buffer_mmap_sync_with_rings(struct r600_context *ctx,
struct r600_resource *resource,
unsigned usage);
+const char * r600_llvm_gpu_string(enum radeon_family family);
+
/* r600_query.c */
void r600_init_query_functions(struct r600_context *rctx);