diff options
author | Nicolai Haehnle <prefect_@gmx.net> | 2004-10-15 20:52:47 +0000 |
---|---|---|
committer | Nicolai Haehnle <prefect_@gmx.net> | 2004-10-15 20:52:47 +0000 |
commit | 5696710f96f9517d24958208fb90a5a72d145a26 (patch) | |
tree | ece4fcb1b5a2143914637c31cd5be1fd2d53402d /src/mesa/drivers/dri/r300/r300_ioctl.c | |
parent | 06487945186f546094b78cc7021a2bc1e695c17b (diff) |
Huge dumb drop. State:
- Color buffer clear is accelerated, but flickers (possibly caused by a
recent DDX or Mesa change or bad merge)
- Everything else uses software fallback rendering
- There should be no clipping-related artifacts with the
sw-clipspan-fixes.patch against Mesa (posted on dri-devel)
- Multiple clients should be rock solid with a DDX patch that is soon to
come (soon = within the next hour or so)
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_ioctl.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index a59b1efc9e..8463e4eff3 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -1,5 +1,7 @@ /* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. +Copyright (C) The Weather Channel, Inc. 2002. +Copyright (C) 2004 Nicolai Haehnle. +All Rights Reserved. The Weather Channel (TM) funded Tungsten Graphics to develop the initial release of the Radeon 8500 driver under the XFree86 license. @@ -53,7 +55,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" -static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) +static void r300ClearBuffer(r300ContextPtr r300, int buffer) { GLcontext* ctx = r300->radeon.glCtx; __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable; @@ -62,8 +64,9 @@ static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) drm_r300_cmd_header_t* cmd; if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s: %s buffer\n", __FUNCTION__, - buffer ? "back" : "front"); + fprintf(stderr, "%s: %s buffer (%i,%i %ix%i)\n", + __FUNCTION__, buffer ? "back" : "front", + dPriv->x, dPriv->y, dPriv->w, dPriv->h); if (buffer) { cboffset = r300->radeon.radeonScreen->backOffset; @@ -72,7 +75,8 @@ static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) cboffset = r300->radeon.radeonScreen->frontOffset; cbpitch = r300->radeon.radeonScreen->frontPitch; } - cboffset = r300->radeon.radeonScreen->fbLocation; + + cboffset += r300->radeon.radeonScreen->fbLocation; R300_STATECHANGE(r300, vpt); r300->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(1.0); @@ -89,6 +93,11 @@ static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) R300_STATECHANGE(r300, unk221C); r300->hw.unk221C.cmd[1] = R300_221C_CLEAR; + R300_STATECHANGE(r300, ps); + r300->hw.ps.cmd[R300_PS_POINTSIZE] = + ((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) | + ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT); + R300_STATECHANGE(r300, ri); for(i = 1; i <= 8; ++i) r300->hw.ri.cmd[i] = R300_RS_INTERP_USED; @@ -97,6 +106,9 @@ static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) ((drm_r300_cmd_header_t*)r300->hw.rr.cmd)->unchecked_state.count = 1; r300->hw.rr.cmd[1] = 0x00004000; + R300_STATECHANGE(r300, cmk); + r300->hw.cmk.cmd[R300_CMK_COLORMASK] = 0xF; + R300_STATECHANGE(r300, fp); r300->hw.fp.cmd[R300_FP_CNTL0] = 0; /* 1 pass, no textures */ r300->hw.fp.cmd[R300_FP_CNTL1] = 0; /* no temporaries */ @@ -153,7 +165,7 @@ static void r300ClearColorBuffer(r300ContextPtr r300, int buffer) cmd = (drm_r300_cmd_header_t*)r300AllocCmdBuf(r300, 9, __FUNCTION__); cmd[0].packet3.cmd_type = R300_CMD_PACKET3; cmd[0].packet3.packet = R300_CMD_PACKET3_CLEAR; - cmd[1].u = r300PackFloat32(dPriv->w / 2.0); /* my guess is as good as yours */ + cmd[1].u = r300PackFloat32(dPriv->w / 2.0); cmd[2].u = r300PackFloat32(dPriv->h / 2.0); cmd[3].u = r300PackFloat32(0.0); cmd[4].u = r300PackFloat32(1.0); @@ -206,12 +218,12 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all, swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1); if (flags & DD_FRONT_LEFT_BIT) - r300ClearColorBuffer(r300, swapped); + r300ClearBuffer(r300, swapped); if (flags & DD_BACK_LEFT_BIT) - r300ClearColorBuffer(r300, swapped ^ 1); + r300ClearBuffer(r300, swapped ^ 1); - /* Recalculate the hardware set. This could be done more efficiently, + /* Recalculate the hardware state. This could be done more efficiently, * but do keep it like this for now. */ r300ResetHwState(r300); |