} while (0)
#define R300_PACIFY do { \
- OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 15) | (1 << 17) | \
- (1 << 18) | (1 << 31)); \
+ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) | \
+ (1 << 18)); \
} while (0)
#define R300_SCREENDOOR do { \
END_CS;
}
+void r300_emit_scissor_state(struct r300_context* r300,
+ struct r300_scissor_state* scissor)
+{
+ CS_LOCALS(r300);
+ BEGIN_CS(3);
+ OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
+ OUT_CS(scissor->scissor_top_left);
+ OUT_CS(scissor->scissor_bottom_right);
+}
+
+/* Emit all dirty state. */
static void r300_emit_dirty_state(struct r300_context* r300)
{
struct r300_screen* r300screen =
}
if (r300->dirty_state & R300_NEW_SCISSOR) {
- struct r300_scissor_state* scissor = r300->scissor_state;
- /* XXX next two are contiguous regs */
- OUT_CS_REG(R300_SC_SCISSORS_TL, scissor->scissor_top_left);
- OUT_CS_REG(R300_SC_SCISSORS_BR, scissor->scissor_bottom_right);
+ r300_emit_scissor_state(r300, r300->scissor_state);
}
r300->dirty_state = 0;
struct pipe_framebuffer_state* fb);
void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs);
+
+void r300_emit_scissor_state(struct r300_context* r300,
+ struct r300_scissor_state* scissor);
struct r300_context* r300 = r300_context(pipe);
draw_flush(r300->draw);
- uint32_t left, top, right, bottom;
-
- /* So, a bit of info. The scissors are offset by R300_SCISSORS_OFFSET in
- * both directions for all values, and can only be 13 bits wide. Why?
- * We may never know. */
- left = (state->minx + R300_SCISSORS_OFFSET) & 0x1fff;
- top = (state->miny + R300_SCISSORS_OFFSET) & 0x1fff;
- right = (state->maxx + R300_SCISSORS_OFFSET) & 0x1fff;
- bottom = (state->maxy + R300_SCISSORS_OFFSET) & 0x1fff;
-
- r300->scissor_state->scissor_top_left = (left << R300_SCISSORS_X_SHIFT) |
- (top << R300_SCISSORS_Y_SHIFT);
+ r300->scissor_state->scissor_top_left =
+ (state->minx << R300_SCISSORS_X_SHIFT) |
+ (state->miny << R300_SCISSORS_Y_SHIFT);
r300->scissor_state->scissor_bottom_right =
- (right << R300_SCISSORS_X_SHIFT) | (bottom << R300_SCISSORS_Y_SHIFT);
+ (state->maxx << R300_SCISSORS_X_SHIFT) |
+ (state->maxy << R300_SCISSORS_Y_SHIFT);
r300->dirty_state |= R300_NEW_SCISSOR;
}
return;
}
- BEGIN_CS(158 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2));
+ BEGIN_CS(161 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2));
/* Flush PVS. */
OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
}
+ /* The size of the point we're about to draw, in sixths of pixels */
OUT_CS_REG(R300_GA_POINT_SIZE,
((h * 6) & R300_POINTSIZE_Y_MASK) |
((w * 6) << R300_POINTSIZE_X_SHIFT));
+ /* Pixel scissors */
+ OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
+ OUT_CS((x << R300_SCISSORS_X_SHIFT) | (y << R300_SCISSORS_Y_SHIFT));
+ OUT_CS((w << R300_SCISSORS_X_SHIFT) | (h << R300_SCISSORS_Y_SHIFT));
+
/* RS block setup */
if (caps->is_r500) {
/* XXX We seem to be in disagreement about how many of these we have