summaryrefslogtreecommitdiff
path: root/src/evergreen_accel.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2011-02-10 13:47:53 -0500
committerAlex Deucher <alexdeucher@gmail.com>2011-02-10 13:47:53 -0500
commit2c5ae1724307e0dba5d0306fe27c1e15a7390a2f (patch)
treed6b7641a08c909ecc03ff342cf06208317332f64 /src/evergreen_accel.c
parentc52d817b51e13447802fe338be2d247ffba2a669 (diff)
evergreen/ni: consolidate CB state handling
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'src/evergreen_accel.c')
-rw-r--r--src/evergreen_accel.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/evergreen_accel.c b/src/evergreen_accel.c
index 4f5a120c..c6c38b2e 100644
--- a/src/evergreen_accel.c
+++ b/src/evergreen_accel.c
@@ -43,6 +43,25 @@
#include "radeon_vbo.h"
#include "radeon_exa_shared.h"
+static const uint32_t EVERGREEN_ROP[16] = {
+ RADEON_ROP3_ZERO, /* GXclear */
+ RADEON_ROP3_DSa, /* Gxand */
+ RADEON_ROP3_SDna, /* GXandReverse */
+ RADEON_ROP3_S, /* GXcopy */
+ RADEON_ROP3_DSna, /* GXandInverted */
+ RADEON_ROP3_D, /* GXnoop */
+ RADEON_ROP3_DSx, /* GXxor */
+ RADEON_ROP3_DSo, /* GXor */
+ RADEON_ROP3_DSon, /* GXnor */
+ RADEON_ROP3_DSxn, /* GXequiv */
+ RADEON_ROP3_Dn, /* GXinvert */
+ RADEON_ROP3_SDno, /* GXorReverse */
+ RADEON_ROP3_Sn, /* GXcopyInverted */
+ RADEON_ROP3_DSno, /* GXorInverted */
+ RADEON_ROP3_DSan, /* GXnand */
+ RADEON_ROP3_ONE, /* GXset */
+};
+
void
evergreen_start_3d(ScrnInfoPtr pScrn)
{
@@ -204,7 +223,7 @@ evergreen_set_render_target(ScrnInfoPtr pScrn, cb_config_t *cb_conf, uint32_t do
RELOC_BATCH(cb_conf->bo, 0, domain);
END_BATCH();
- BEGIN_BATCH(24);
+ BEGIN_BATCH(33);
EREG(CB_COLOR0_PITCH + (0x3c * cb_conf->id), pitch);
EREG(CB_COLOR0_SLICE + (0x3c * cb_conf->id), slice);
EREG(CB_COLOR0_VIEW + (0x3c * cb_conf->id), 0);
@@ -216,7 +235,12 @@ evergreen_set_render_target(ScrnInfoPtr pScrn, cb_config_t *cb_conf, uint32_t do
E32(0);
E32(0);
E32(0);
+ EREG(CB_TARGET_MASK, (cb_conf->pmask << TARGET0_ENABLE_shift));
+ EREG(CB_COLOR_CONTROL, (EVERGREEN_ROP[cb_conf->rop] |
+ (CB_NORMAL << CB_COLOR_CONTROL__MODE_shift)));
+ EREG(CB_BLEND0_CONTROL, cb_conf->blendcntl);
END_BATCH();
+
}
static void