summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_state2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r600/r600_state2.c')
-rw-r--r--src/gallium/drivers/r600/r600_state2.c47
1 files changed, 11 insertions, 36 deletions
diff --git a/src/gallium/drivers/r600/r600_state2.c b/src/gallium/drivers/r600/r600_state2.c
index 63cc19708b..5269e6db91 100644
--- a/src/gallium/drivers/r600/r600_state2.c
+++ b/src/gallium/drivers/r600/r600_state2.c
@@ -40,7 +40,6 @@
#include <util/u_memory.h>
#include <util/u_inlines.h>
#include <pipebuffer/pb_buffer.h>
-#include "state_tracker/drm_driver.h"
#include "r600.h"
#include "r600d.h"
#include "r700_sq.h"
@@ -57,12 +56,6 @@ uint32_t r600_translate_texformat(enum pipe_format format,
#include "r600_state_inlines.h"
-enum chip_class {
- R600,
- R700,
- EVERGREEN,
-};
-
enum r600_pipe_state_id {
R600_PIPE_STATE_BLEND = 0,
R600_PIPE_STATE_BLEND_COLOR,
@@ -86,7 +79,6 @@ enum r600_pipe_state_id {
struct r600_screen {
struct pipe_screen screen;
struct radeon *radeon;
- unsigned chip_class;
};
struct r600_pipe_sampler_view {
@@ -206,7 +198,7 @@ static void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shade
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_028894_SQ_PGM_START_FS,
0x00000000, 0xFFFFFFFF, shader->bo);
- rctx->vs_rebuild = false;
+ rctx->vs_rebuild = FALSE;
}
static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
@@ -276,7 +268,7 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_0288CC_SQ_PGM_CF_OFFSET_PS,
0x00000000, 0xFFFFFFFF, NULL);
- rctx->ps_rebuild = false;
+ rctx->ps_rebuild = FALSE;
}
static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
@@ -685,8 +677,10 @@ static void r600_flush2(struct pipe_context *ctx, unsigned flags,
struct pipe_fence_handle **fence)
{
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+#if 0
static int dc = 0;
char dname[256];
+#endif
if (!rctx->ctx.pm4_cdwords)
return;
@@ -1081,10 +1075,10 @@ static void r600_bind_rs_state(struct pipe_context *ctx, void *state)
return;
if (rctx->flatshade != rs->flatshade) {
- rctx->ps_rebuild = true;
+ rctx->ps_rebuild = TRUE;
}
if (rctx->sprite_coord_enable != rs->sprite_coord_enable) {
- rctx->ps_rebuild = true;
+ rctx->ps_rebuild = TRUE;
}
rctx->flatshade = rs->flatshade;
rctx->sprite_coord_enable = rs->sprite_coord_enable;
@@ -1217,8 +1211,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
bo[1] = radeon_ws_bo_incref(rscreen->rw, tmp->uncompressed);
#endif
}
- pitch = (tmp->pitch[0] / tmp->bpt);
- pitch = (pitch + 0x7) & ~0x7;
+ pitch = align(tmp->pitch[0] / tmp->bpt, 8);
/* FIXME properly handle first level != 0 */
r600_pipe_state_add_reg(rstate, R600_GROUP_RESOURCE, R_038000_RESOURCE0_WORD0,
@@ -1371,7 +1364,7 @@ static void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
rctx->vertex_elements = v;
if (v) {
v->refcount++;
- rctx->vs_rebuild = true;
+ rctx->vs_rebuild = TRUE;
}
}
@@ -1607,6 +1600,9 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
/* unreference old buffer and reference new one */
rstate->id = R600_PIPE_STATE_FRAMEBUFFER;
for (int i = 0; i < rctx->framebuffer.nr_cbufs; i++) {
+ pipe_surface_reference(&rctx->framebuffer.cbufs[i], NULL);
+ }
+ for (int i = 0; i < state->nr_cbufs; i++) {
pipe_surface_reference(&rctx->framebuffer.cbufs[i], state->cbufs[i]);
}
pipe_surface_reference(&rctx->framebuffer.zsbuf, state->zsbuf);
@@ -2189,27 +2185,6 @@ struct pipe_screen *r600_screen_create2(struct radeon *radeon)
return NULL;
}
- switch (family) {
- case CHIP_R600:
- case CHIP_RV610:
- case CHIP_RV630:
- case CHIP_RV670:
- case CHIP_RV620:
- case CHIP_RV635:
- case CHIP_RS780:
- case CHIP_RS880:
- rscreen->chip_class = R600;
- break;
- case CHIP_RV770:
- case CHIP_RV730:
- case CHIP_RV710:
- case CHIP_RV740:
- rscreen->chip_class = R700;
- break;
- default:
- FREE(rscreen);
- return NULL;
- }
rscreen->radeon = radeon;
rscreen->screen.winsys = (struct pipe_winsys*)radeon;
rscreen->screen.destroy = r600_destroy_screen;