From 97a89227b0edd3ef51d3ef9fd015bff12dc9b97b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 01:11:54 +0000 Subject: [PATCH] r300: Document registers 0x2220 to 0x2230. These registers are per-pixel and per-vertex X and Y clipping planes. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 4 ++-- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 10 ++++++++++ src/mesa/drivers/dri/r300/r300_state.c | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0351989b2e4..0bc3be8880c 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -318,8 +318,8 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); ALLOC_STATE(unk221C, always, 2, 0); r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); - ALLOC_STATE(unk2220, always, 5, 0); - r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); + ALLOC_STATE(vap_clip, always, 5, 0); + r300->hw.vap_clip.cmd[0] = cmdpacket0(R300_VAP_CLIP_X_0, 4); ALLOC_STATE(unk2288, always, 2, 0); r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 6bd74fe9cd8..076bb49a006 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -452,7 +452,7 @@ struct r300_hw_state { struct r300_state_atom vic; /* vap input control (2180) */ struct r300_state_atom unk21DC; /* (21DC) */ struct r300_state_atom unk221C; /* (221C) */ - struct r300_state_atom unk2220; /* (2220) */ + struct r300_state_atom vap_clip; struct r300_state_atom unk2288; /* (2288) */ struct r300_state_atom pvs; /* pvs_cntl (22D0) */ struct r300_state_atom gb_enable; /* (4008) */ diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 3f14dafc70a..6f0ed4d74ee 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -299,6 +299,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_221C_NORMAL 0x00000000 # define R300_221C_CLEAR 0x0001C000 +/* These seem to be per-pixel and per-vertex X and Y clipping planes. The first + * plane is per-pixel and the second plane is per-vertex. + * + * This was determined by experimentation alone but I believe it is correct. + */ +#define R300_VAP_CLIP_X_0 0x2220 +#define R300_VAP_CLIP_X_1 0x2224 +#define R300_VAP_CLIP_Y_0 0x2228 +#define R300_VAP_CLIP_Y_1 0x2230 + /* gap */ /* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a9b20622e4c..38cf9d29a73 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1882,10 +1882,10 @@ static void r300ResetHwState(r300ContextPtr r300) r300->hw.unk221C.cmd[1] = R300_221C_NORMAL; - r300->hw.unk2220.cmd[1] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[2] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[3] = r300PackFloat32(1.0); - r300->hw.unk2220.cmd[4] = r300PackFloat32(1.0); + r300->hw.vap_clip.cmd[1] = r300PackFloat32(1.0); /* X */ + r300->hw.vap_clip.cmd[2] = r300PackFloat32(1.0); /* X */ + r300->hw.vap_clip.cmd[3] = r300PackFloat32(1.0); /* Y */ + r300->hw.vap_clip.cmd[4] = r300PackFloat32(1.0); /* Y */ /* XXX: Other families? */ switch (r300->radeon.radeonScreen->chip_family) { -- 2.30.2