summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-22 01:20:21 +0100
committerMarek Olšák <[email protected]>2014-01-28 01:39:37 +0100
commit4df3f25fa2c0bcf38be4a4fdcbb37428e4af10bd (patch)
treed34c3e4f2700b9764433e7f2c3b7befbf509bb30
parentf4612105e82834e6f46a70dd90c81e982b6506ca (diff)
r600g,radeonsi: consolidate get_name and get_vendor queries
Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c45
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c50
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c29
3 files changed, 50 insertions, 74 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index abc25b29efe..caed49ccc05 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -310,49 +310,6 @@ fail:
/*
* pipe_screen
*/
-static const char* r600_get_vendor(struct pipe_screen* pscreen)
-{
- return "X.Org";
-}
-
-static const char *r600_get_family_name(enum radeon_family family)
-{
- switch(family) {
- case CHIP_R600: return "AMD R600";
- case CHIP_RV610: return "AMD RV610";
- case CHIP_RV630: return "AMD RV630";
- case CHIP_RV670: return "AMD RV670";
- case CHIP_RV620: return "AMD RV620";
- case CHIP_RV635: return "AMD RV635";
- case CHIP_RS780: return "AMD RS780";
- case CHIP_RS880: return "AMD RS880";
- case CHIP_RV770: return "AMD RV770";
- case CHIP_RV730: return "AMD RV730";
- case CHIP_RV710: return "AMD RV710";
- case CHIP_RV740: return "AMD RV740";
- case CHIP_CEDAR: return "AMD CEDAR";
- case CHIP_REDWOOD: return "AMD REDWOOD";
- case CHIP_JUNIPER: return "AMD JUNIPER";
- case CHIP_CYPRESS: return "AMD CYPRESS";
- case CHIP_HEMLOCK: return "AMD HEMLOCK";
- case CHIP_PALM: return "AMD PALM";
- case CHIP_SUMO: return "AMD SUMO";
- case CHIP_SUMO2: return "AMD SUMO2";
- case CHIP_BARTS: return "AMD BARTS";
- case CHIP_TURKS: return "AMD TURKS";
- case CHIP_CAICOS: return "AMD CAICOS";
- case CHIP_CAYMAN: return "AMD CAYMAN";
- case CHIP_ARUBA: return "AMD ARUBA";
- default: return "AMD unknown";
- }
-}
-
-static const char* r600_get_name(struct pipe_screen* pscreen)
-{
- struct r600_screen *rscreen = (struct r600_screen *)pscreen;
-
- return r600_get_family_name(rscreen->b.family);
-}
static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
{
@@ -848,8 +805,6 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
/* Set functions first. */
rscreen->b.b.context_create = r600_create_context;
rscreen->b.b.destroy = r600_destroy_screen;
- rscreen->b.b.get_name = r600_get_name;
- rscreen->b.b.get_vendor = r600_get_vendor;
rscreen->b.b.get_param = r600_get_param;
rscreen->b.b.get_shader_param = r600_get_shader_param;
rscreen->b.b.get_paramf = r600_get_paramf;
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 7462d43f20b..cabc6ef3259 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -140,6 +140,54 @@ static const struct debug_named_value common_debug_options[] = {
DEBUG_NAMED_VALUE_END /* must be last */
};
+static const char* r600_get_vendor(struct pipe_screen* pscreen)
+{
+ return "X.Org";
+}
+
+static const char* r600_get_name(struct pipe_screen* pscreen)
+{
+ struct r600_common_screen *rscreen = (struct r600_common_screen*)pscreen;
+
+ switch (rscreen->family) {
+ case CHIP_R600: return "AMD R600";
+ case CHIP_RV610: return "AMD RV610";
+ case CHIP_RV630: return "AMD RV630";
+ case CHIP_RV670: return "AMD RV670";
+ case CHIP_RV620: return "AMD RV620";
+ case CHIP_RV635: return "AMD RV635";
+ case CHIP_RS780: return "AMD RS780";
+ case CHIP_RS880: return "AMD RS880";
+ case CHIP_RV770: return "AMD RV770";
+ case CHIP_RV730: return "AMD RV730";
+ case CHIP_RV710: return "AMD RV710";
+ case CHIP_RV740: return "AMD RV740";
+ case CHIP_CEDAR: return "AMD CEDAR";
+ case CHIP_REDWOOD: return "AMD REDWOOD";
+ case CHIP_JUNIPER: return "AMD JUNIPER";
+ case CHIP_CYPRESS: return "AMD CYPRESS";
+ case CHIP_HEMLOCK: return "AMD HEMLOCK";
+ case CHIP_PALM: return "AMD PALM";
+ case CHIP_SUMO: return "AMD SUMO";
+ case CHIP_SUMO2: return "AMD SUMO2";
+ case CHIP_BARTS: return "AMD BARTS";
+ case CHIP_TURKS: return "AMD TURKS";
+ case CHIP_CAICOS: return "AMD CAICOS";
+ case CHIP_CAYMAN: return "AMD CAYMAN";
+ case CHIP_ARUBA: return "AMD ARUBA";
+ case CHIP_TAHITI: return "AMD TAHITI";
+ case CHIP_PITCAIRN: return "AMD PITCAIRN";
+ case CHIP_VERDE: return "AMD CAPE VERDE";
+ case CHIP_OLAND: return "AMD OLAND";
+ case CHIP_HAINAN: return "AMD HAINAN";
+ case CHIP_BONAIRE: return "AMD BONAIRE";
+ case CHIP_KAVERI: return "AMD KAVERI";
+ case CHIP_KABINI: return "AMD KABINI";
+ case CHIP_HAWAII: return "AMD HAWAII";
+ default: return "AMD unknown";
+ }
+}
+
static void r600_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *fence)
@@ -293,6 +341,8 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
{
ws->query_info(ws, &rscreen->info);
+ rscreen->b.get_name = r600_get_name;
+ rscreen->b.get_vendor = r600_get_vendor;
rscreen->b.fence_finish = r600_fence_finish;
rscreen->b.fence_reference = r600_fence_reference;
rscreen->b.fence_signalled = r600_fence_signalled;
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 4879b2ff914..aeccab1dd66 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -218,10 +218,6 @@ fail:
/*
* pipe_screen
*/
-static const char* si_get_vendor(struct pipe_screen* pscreen)
-{
- return "X.Org";
-}
const char *si_get_llvm_processor_name(enum radeon_family family)
{
@@ -243,29 +239,6 @@ const char *si_get_llvm_processor_name(enum radeon_family family)
}
}
-static const char *si_get_family_name(enum radeon_family family)
-{
- switch(family) {
- case CHIP_TAHITI: return "AMD TAHITI";
- case CHIP_PITCAIRN: return "AMD PITCAIRN";
- case CHIP_VERDE: return "AMD CAPE VERDE";
- case CHIP_OLAND: return "AMD OLAND";
- case CHIP_HAINAN: return "AMD HAINAN";
- case CHIP_BONAIRE: return "AMD BONAIRE";
- case CHIP_KAVERI: return "AMD KAVERI";
- case CHIP_KABINI: return "AMD KABINI";
- case CHIP_HAWAII: return "AMD HAWAII";
- default: return "AMD unknown";
- }
-}
-
-static const char* si_get_name(struct pipe_screen* pscreen)
-{
- struct si_screen *sscreen = (struct si_screen *)pscreen;
-
- return si_get_family_name(sscreen->b.family);
-}
-
static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
{
struct si_screen *sscreen = (struct si_screen *)pscreen;
@@ -621,8 +594,6 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
/* Set functions first. */
sscreen->b.b.context_create = si_create_context;
sscreen->b.b.destroy = si_destroy_screen;
- sscreen->b.b.get_name = si_get_name;
- sscreen->b.b.get_vendor = si_get_vendor;
sscreen->b.b.get_param = si_get_param;
sscreen->b.b.get_shader_param = si_get_shader_param;
sscreen->b.b.get_paramf = si_get_paramf;