summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_ioctl.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c30
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);