summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/r600/drm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-09-17 13:56:09 +0200
committerMarek Olšák <[email protected]>2011-09-30 23:19:52 +0200
commit518557d74abd4ce035dae079ff6eb1b08cc639d0 (patch)
treed080bff97deb7653a9f22dff8c8c9d711452ba23 /src/gallium/winsys/r600/drm
parent6101b6d442b06a347c001fe85848d636ab7df260 (diff)
r600g: move family and chip_class from struct radeon to r600_screen
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/winsys/r600/drm')
-rw-r--r--src/gallium/winsys/r600/drm/evergreen_hw_context.c5
-rw-r--r--src/gallium/winsys/r600/drm/r600_drm.c39
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c24
-rw-r--r--src/gallium/winsys/r600/drm/r600_priv.h2
4 files changed, 15 insertions, 55 deletions
diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c b/src/gallium/winsys/r600/drm/evergreen_hw_context.c
index 66d0db5a2aa..c9e3c9e27b2 100644
--- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c
+++ b/src/gallium/winsys/r600/drm/evergreen_hw_context.c
@@ -25,6 +25,7 @@
*/
#include "r600.h"
#include "r600_priv.h"
+#include "r600_pipe.h"
#include "evergreend.h"
#include "util/u_memory.h"
#include <errno.h>
@@ -919,7 +920,7 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen,
}
/* add blocks */
- if (radeon->family == CHIP_CAYMAN)
+ if (ctx->screen->family == CHIP_CAYMAN)
r = r600_context_add_block(ctx, cayman_config_reg_list,
Elements(cayman_config_reg_list), PKT3_SET_CONFIG_REG, EVERGREEN_CONFIG_REG_OFFSET);
else
@@ -927,7 +928,7 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen,
Elements(evergreen_config_reg_list), PKT3_SET_CONFIG_REG, EVERGREEN_CONFIG_REG_OFFSET);
if (r)
goto out_err;
- if (radeon->family == CHIP_CAYMAN)
+ if (ctx->screen->family == CHIP_CAYMAN)
r = r600_context_add_block(ctx, cayman_context_reg_list,
Elements(cayman_context_reg_list), PKT3_SET_CONTEXT_REG, EVERGREEN_CONTEXT_REG_OFFSET);
else
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c
index 64c353cf20a..eb2a3514f5d 100644
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ b/src/gallium/winsys/r600/drm/r600_drm.c
@@ -30,27 +30,6 @@
#include "util/u_memory.h"
#include <errno.h>
-enum radeon_family r600_get_family(struct radeon *r600)
-{
- return r600->family;
-}
-
-enum chip_class r600_get_family_class(struct radeon *radeon)
-{
- return radeon->chip_class;
-}
-
-static unsigned radeon_family_from_device(unsigned device)
-{
- switch (device) {
-#define CHIPSET(pciid, name, family) case pciid: return CHIP_##family;
-#include "pci_ids/r600_pci_ids.h"
-#undef CHIPSET
- default:
- return CHIP_UNKNOWN;
- }
-}
-
struct radeon *radeon_create(struct radeon_winsys *ws)
{
struct radeon *radeon = CALLOC_STRUCT(radeon);
@@ -61,24 +40,6 @@ struct radeon *radeon_create(struct radeon_winsys *ws)
radeon->ws = ws;
ws->query_info(ws, &radeon->info);
- radeon->family = radeon_family_from_device(radeon->info.pci_id);
- if (radeon->family == CHIP_UNKNOWN) {
- fprintf(stderr, "Unknown chipset 0x%04X\n", radeon->info.pci_id);
- radeon_destroy(radeon);
- return NULL;
- }
-
- /* setup class */
- if (radeon->family == CHIP_CAYMAN) {
- radeon->chip_class = CAYMAN;
- } else if (radeon->family >= CHIP_CEDAR) {
- radeon->chip_class = EVERGREEN;
- } else if (radeon->family >= CHIP_RV770) {
- radeon->chip_class = R700;
- } else {
- radeon->chip_class = R600;
- }
-
return radeon;
}
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index d4f7eff6fc5..cea62e88841 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -45,7 +45,7 @@ void r600_get_backend_mask(struct r600_context *ctx)
unsigned backend_map = ctx->radeon->info.r600_backend_map;
unsigned item_width, item_mask;
- if (ctx->radeon->chip_class >= EVERGREEN) {
+ if (ctx->screen->chip_class >= EVERGREEN) {
item_width = 4;
item_mask = 0x7;
} else {
@@ -130,7 +130,7 @@ static inline void r600_context_ps_partial_flush(struct r600_context *ctx)
void r600_init_cs(struct r600_context *ctx)
{
/* R6xx requires this packet at the start of each command buffer */
- if (ctx->radeon->family < CHIP_RV770) {
+ if (ctx->screen->family < CHIP_RV770) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_START_3D_CMDBUF, 0, 0);
ctx->pm4[ctx->pm4_cdwords++] = 0x00000000;
}
@@ -198,8 +198,8 @@ static void r600_init_block(struct r600_context *ctx,
}
block->reloc[block->nbo].bo_pm4_index = block->pm4_ndwords - 1;
}
- if ((ctx->radeon->family > CHIP_R600) &&
- (ctx->radeon->family < CHIP_RV770) && reg[i+j].flags & REG_FLAG_RV6XX_SBU) {
+ if ((ctx->screen->family > CHIP_R600) &&
+ (ctx->screen->family < CHIP_RV770) && reg[i+j].flags & REG_FLAG_RV6XX_SBU) {
block->pm4[block->pm4_ndwords++] = PKT3(PKT3_SURFACE_BASE_UPDATE, 0, 0);
block->pm4[block->pm4_ndwords++] = reg[i+j].flush_flags;
}
@@ -228,7 +228,7 @@ int r600_context_add_block(struct r600_context *ctx, const struct r600_reg *reg,
}
/* ignore regs not on R600 on R600 */
- if ((reg[i].flags & REG_FLAG_NOT_R600) && ctx->radeon->family == CHIP_R600) {
+ if ((reg[i].flags & REG_FLAG_NOT_R600) && ctx->screen->family == CHIP_R600) {
n = 1;
continue;
}
@@ -960,16 +960,16 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
return;
}
- if ((ctx->radeon->family < CHIP_RV770) &&
+ if ((ctx->screen->family < CHIP_RV770) &&
(G_0085F0_CB_ACTION_ENA(flush_flags) ||
G_0085F0_DB_ACTION_ENA(flush_flags))) {
if (ctx->flags & R600_CONTEXT_CHECK_EVENT_FLUSH) {
/* the rv670 seems to fail fbo-generatemipmap unless we flush the CB1 dest base ena */
if ((bo->cs_buf->binding & BO_BOUND_TEXTURE) &&
(flush_flags & S_0085F0_CB_ACTION_ENA(1))) {
- if ((ctx->radeon->family == CHIP_RV670) ||
- (ctx->radeon->family == CHIP_RS780) ||
- (ctx->radeon->family == CHIP_RS880)) {
+ if ((ctx->screen->family == CHIP_RV670) ||
+ (ctx->screen->family == CHIP_RS780) ||
+ (ctx->screen->family == CHIP_RS880)) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SURFACE_SYNC, 3, ctx->predicate_drawing);
ctx->pm4[ctx->pm4_cdwords++] = S_0085F0_CB1_DEST_BASE_ENA(1); /* CP_COHER_CNTL */
ctx->pm4[ctx->pm4_cdwords++] = 0xffffffff; /* CP_COHER_SIZE */
@@ -1100,7 +1100,7 @@ static void r600_context_dirty_resource_block(struct r600_context *ctx,
void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, struct r600_block *block)
{
int dirty;
- int num_regs = ctx->radeon->chip_class >= EVERGREEN ? 8 : 7;
+ int num_regs = ctx->screen->chip_class >= EVERGREEN ? 8 : 7;
boolean is_vertex;
if (state == NULL) {
@@ -1423,7 +1423,7 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw)
/* queries need some special values */
if (ctx->num_query_running) {
- if (ctx->radeon->family >= CHIP_RV770) {
+ if (ctx->screen->family >= CHIP_RV770) {
r600_context_reg(ctx,
R_028D0C_DB_RENDER_CONTROL,
S_028D0C_R700_PERFECT_ZPASS_COUNTS(1),
@@ -1495,7 +1495,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
/* suspend queries */
r600_context_queries_suspend(ctx);
- if (ctx->radeon->chip_class >= EVERGREEN)
+ if (ctx->screen->chip_class >= EVERGREEN)
evergreen_context_flush_dest_caches(ctx);
else
r600_context_flush_dest_caches(ctx);
diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h
index 9294d9ea2c6..6ca8f7bccc6 100644
--- a/src/gallium/winsys/r600/drm/r600_priv.h
+++ b/src/gallium/winsys/r600/drm/r600_priv.h
@@ -37,8 +37,6 @@
struct radeon {
struct radeon_winsys *ws;
struct radeon_info info;
- unsigned family;
- enum chip_class chip_class;
};
/* these flags are used in register flags and added into block flags */