blob: d358ef62dc7ccb39bb3bc0f1fea9db9ed23995f1 [file] [log] [blame]
Alan Hourihane0f2e1862003-09-30 11:13:31 +00001/**************************************************************************
2
3Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
4Copyright 2003 Eric Anholt
5All Rights Reserved.
6
7Permission is hereby granted, free of charge, to any person obtaining a
8copy of this software and associated documentation files (the "Software"),
9to deal in the Software without restriction, including without limitation
10on the rights to use, copy, modify, merge, publish, distribute, sub
11license, and/or sell copies of the Software, and to permit persons to whom
12the Software is furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice (including the next
15paragraph) shall be included in all copies or substantial portions of the
16Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
Alan Hourihanee78dd782003-12-04 18:17:32 +000021ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
Alan Hourihane0f2e1862003-09-30 11:13:31 +000022DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26**************************************************************************/
Alan Hourihane0f2e1862003-09-30 11:13:31 +000027
28/*
29 * Authors:
30 * Sung-Ching Lin <sclin@sis.com.tw>
31 * Eric Anholt <anholt@FreeBSD.org>
32 */
33
34#include "sis_context.h"
35#include "sis_state.h"
36#include "sis_lock.h"
Alan Hourihane0f2e1862003-09-30 11:13:31 +000037
Alan Hourihanee78dd782003-12-04 18:17:32 +000038#include "swrast/swrast.h"
Brian Paulecadb512008-09-18 15:17:05 -060039#include "main/macros.h"
Alan Hourihanee78dd782003-12-04 18:17:32 +000040
Alan Hourihane0f2e1862003-09-30 11:13:31 +000041static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask,
42 GLint x, GLint y, GLint width,
43 GLint height );
Alan Hourihane0f2e1862003-09-30 11:13:31 +000044static void sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x,
45 GLint y, GLint width, GLint height );
46static void sis_clear_z_stencil_buffer( GLcontext * ctx,
47 GLbitfield mask, GLint x,
48 GLint y, GLint width,
49 GLint height );
50
51static void
52set_color_pattern( sisContextPtr smesa, GLubyte red, GLubyte green,
53 GLubyte blue, GLubyte alpha )
54{
55 /* XXX only RGB565 and ARGB8888 */
Alan Hourihanee78dd782003-12-04 18:17:32 +000056 switch (smesa->colorFormat)
Alan Hourihane0f2e1862003-09-30 11:13:31 +000057 {
58 case DST_FORMAT_ARGB_8888:
59 smesa->clearColorPattern = (alpha << 24) +
60 (red << 16) + (green << 8) + (blue);
61 break;
62 case DST_FORMAT_RGB_565:
63 smesa->clearColorPattern = ((red >> 3) << 11) +
64 ((green >> 2) << 5) + (blue >> 3);
65 smesa->clearColorPattern |= smesa->clearColorPattern << 16;
66 break;
67 default:
Eric Anholtbbd557f2004-05-24 20:48:27 +000068 sis_fatal_error("Bad dst color format\n");
Alan Hourihane0f2e1862003-09-30 11:13:31 +000069 }
70}
71
72void
73sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil )
74{
75 GLuint zPattern;
76
Alan Hourihane0f2e1862003-09-30 11:13:31 +000077 switch (smesa->zFormat)
78 {
79 case SiS_ZFORMAT_Z16:
Brian Paula8717182005-11-09 16:30:50 +000080 CLAMPED_FLOAT_TO_USHORT(zPattern, z);
Alan Hourihane0f2e1862003-09-30 11:13:31 +000081 zPattern |= zPattern << 16;
82 break;
83 case SiS_ZFORMAT_S8Z24:
Alan Hourihanee78dd782003-12-04 18:17:32 +000084 zPattern = FLOAT_TO_UINT(z) >> 8;
Alan Hourihane0f2e1862003-09-30 11:13:31 +000085 zPattern |= stencil << 24;
86 break;
87 case SiS_ZFORMAT_Z32:
Alan Hourihanee78dd782003-12-04 18:17:32 +000088 zPattern = FLOAT_TO_UINT(z);
Alan Hourihane0f2e1862003-09-30 11:13:31 +000089 break;
90 default:
Eric Anholtbbd557f2004-05-24 20:48:27 +000091 sis_fatal_error("Bad Z format\n");
Alan Hourihane0f2e1862003-09-30 11:13:31 +000092 }
93 smesa->clearZStencilPattern = zPattern;
94}
95
96void
Brian Paula5676792006-11-01 19:35:22 +000097sisDDClear( GLcontext * ctx, GLbitfield mask )
Alan Hourihane0f2e1862003-09-30 11:13:31 +000098{
Brian Paul446972b2006-10-18 20:02:42 +000099 sisContextPtr smesa = SIS_CONTEXT(ctx);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000100
Brian Paul446972b2006-10-18 20:02:42 +0000101 GLint x1, y1, width1, height1;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000102
Brian Paul446972b2006-10-18 20:02:42 +0000103 /* get region after locking: */
104 x1 = ctx->DrawBuffer->_Xmin;
105 y1 = ctx->DrawBuffer->_Ymin;
106 width1 = ctx->DrawBuffer->_Xmax - x1;
107 height1 = ctx->DrawBuffer->_Ymax - y1;
108 y1 = Y_FLIP(y1 + height1 - 1);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000109
Alan Hourihanee78dd782003-12-04 18:17:32 +0000110 /* Mask out any non-existent buffers */
111 if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask)
Brian Paule4b23562005-05-04 20:11:35 +0000112 mask &= ~BUFFER_BIT_DEPTH;
Alan Hourihanee78dd782003-12-04 18:17:32 +0000113 if (ctx->Visual.stencilBits == 0)
Brian Paule4b23562005-05-04 20:11:35 +0000114 mask &= ~BUFFER_BIT_STENCIL;
Alan Hourihanee78dd782003-12-04 18:17:32 +0000115
Eric Anholt59b0db32004-06-09 04:59:30 +0000116 LOCK_HARDWARE();
117
118 /* The 3d clear code is use for masked clears because apparently the SiS
119 * 300-series can't do write masks for 2d blits. 3d isn't used in general
120 * because it's slower, even in the case of clearing multiple buffers.
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000121 */
Eric Anholt59b0db32004-06-09 04:59:30 +0000122 /* XXX: Appears to be broken with stencil. */
123 if ((smesa->current.hwCapEnable2 & (MASK_AlphaMaskWriteEnable |
124 MASK_ColorMaskWriteEnable) &&
Brian Paule4b23562005-05-04 20:11:35 +0000125 (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0) ||
Keith Whitwell71b25042006-05-08 09:03:35 +0000126 ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff &&
127 (mask & BUFFER_BIT_STENCIL) != 0) )
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000128 {
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000129 mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 );
130 }
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000131
Brian Paule4b23562005-05-04 20:11:35 +0000132 if ( mask & BUFFER_BIT_FRONT_LEFT || mask & BUFFER_BIT_BACK_LEFT) {
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000133 sis_clear_color_buffer( ctx, mask, x1, y1, width1, height1 );
Brian Paule4b23562005-05-04 20:11:35 +0000134 mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000135 }
136
Brian Paule4b23562005-05-04 20:11:35 +0000137 if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) {
Eric Anholt005070a2005-10-24 22:38:11 +0000138 if (smesa->depth.offset != 0)
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000139 sis_clear_z_stencil_buffer( ctx, mask, x1, y1, width1, height1 );
Brian Paule4b23562005-05-04 20:11:35 +0000140 mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000141 }
142
143 UNLOCK_HARDWARE();
144
145 if (mask != 0)
Brian Paula5676792006-11-01 19:35:22 +0000146 _swrast_Clear( ctx, mask);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000147}
148
149
150void
151sisDDClearColor( GLcontext * ctx, const GLfloat color[4] )
152{
153 sisContextPtr smesa = SIS_CONTEXT(ctx);
154 GLubyte c[4];
155
156 CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
157 CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
158 CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
159 CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
160
161 set_color_pattern( smesa, c[0], c[1], c[2], c[3] );
162}
163
164void
165sisDDClearDepth( GLcontext * ctx, GLclampd d )
166{
167 sisContextPtr smesa = SIS_CONTEXT(ctx);
168
169 sisUpdateZStencilPattern( smesa, d, ctx->Stencil.Clear );
170}
171
172void
173sisDDClearStencil( GLcontext * ctx, GLint s )
174{
175 sisContextPtr smesa = SIS_CONTEXT(ctx);
176
177 sisUpdateZStencilPattern( smesa, ctx->Depth.Clear, s );
178}
179
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000180static GLbitfield
181sis_3D_Clear( GLcontext * ctx, GLbitfield mask,
182 GLint x, GLint y, GLint width, GLint height )
183{
184 sisContextPtr smesa = SIS_CONTEXT(ctx);
185
186 __GLSiSHardware *current = &smesa->current;
187
188 float left, top, right, bottom, zClearVal;
189 GLboolean bClrColor, bClrDepth, bClrStencil;
190 GLint dwPrimitiveSet;
Alan Hourihanee78dd782003-12-04 18:17:32 +0000191 GLint dwEnable1 = 0, dwEnable2 = MASK_ColorMaskWriteEnable;
192 GLint dwDepthMask = 0, dwSten1 = 0, dwSten2 = 0;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000193 GLint dirtyflags = GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 |
194 GFLAG_CLIPPING | GFLAG_DESTSETTING;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000195 int count;
Jon Smirlae4a1cc2004-03-11 20:35:38 +0000196 drm_clip_rect_t *pExtents;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000197
Brian Paule4b23562005-05-04 20:11:35 +0000198 bClrColor = (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0;
199 bClrDepth = (mask & BUFFER_BIT_DEPTH) != 0;
200 bClrStencil = (mask & BUFFER_BIT_STENCIL) != 0;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000201
202 if (smesa->GlobalFlag & GFLAG_RENDER_STATES)
203 sis_update_render_state( smesa );
204
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000205 if (bClrStencil) {
206 dwSten1 = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS |
Keith Whitwell71b25042006-05-08 09:03:35 +0000207 ((ctx->Stencil.Clear & 0xff) << 8) | 0xff;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000208 dwSten2 = SiS_SFAIL_REPLACE | SiS_SPASS_ZFAIL_REPLACE |
209 SiS_SPASS_ZPASS_REPLACE;
Eric Anholt59b0db32004-06-09 04:59:30 +0000210 dwEnable1 = MASK_ZWriteEnable | MASK_StencilWriteEnable |
211 MASK_StencilTestEnable;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000212 dwEnable2 |= MASK_ZMaskWriteEnable;
Keith Whitwell71b25042006-05-08 09:03:35 +0000213 dwDepthMask |= (ctx->Stencil.WriteMask[0] & 0xff) << 24;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000214 } else if (bClrDepth) {
215 dwEnable1 = MASK_ZWriteEnable;
216 dwEnable2 |= MASK_ZMaskWriteEnable;
217 }
218
219 if (bClrDepth) {
220 zClearVal = ctx->Depth.Clear;
221 if (ctx->Visual.depthBits != 32)
222 dwDepthMask |= 0x00ffffff;
223 else
224 dwDepthMask = 0xffffffff;
225 } else
226 zClearVal = 0.0;
227
228 mWait3DCmdQueue(9);
229 MMIO(REG_3D_TEnable, dwEnable1);
230 MMIO(REG_3D_TEnable2, dwEnable2);
231 if (bClrDepth || bClrStencil) {
232 MMIO(REG_3D_ZSet, (current->hwZ & ~MASK_ZTestMode) | SiS_Z_COMP_ALWAYS);
233 dirtyflags |= GFLAG_ZSETTING;
234 }
235 if (bClrColor) {
236 MMIO(REG_3D_DstSet, (current->hwDstSet & ~MASK_ROP2) | LOP_COPY);
237 } else {
238 MMIO(REG_3D_DstAlphaWriteMask, 0L);
239 }
240 if (bClrStencil) {
241 MMIO(REG_3D_StencilSet, dwSten1);
242 MMIO(REG_3D_StencilSet2, dwSten2);
243 dirtyflags |= GFLAG_STENCILSETTING;
244 }
245
Brian Paule4b23562005-05-04 20:11:35 +0000246 if (mask & BUFFER_BIT_FRONT_LEFT) {
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000247 pExtents = smesa->driDrawable->pClipRects;
248 count = smesa->driDrawable->numClipRects;
249 } else {
250 pExtents = NULL;
251 count = 1;
252 }
253
254 while(count--) {
255 left = x;
256 right = x + width;
257 top = y;
258 bottom = y + height;
259
260 if (pExtents != NULL) {
261 GLuint x1, y1, x2, y2;
262
263 x1 = pExtents->x1 - smesa->driDrawable->x;
264 y1 = pExtents->y1 - smesa->driDrawable->y;
265 x2 = pExtents->x2 - smesa->driDrawable->x - 1;
266 y2 = pExtents->y2 - smesa->driDrawable->y - 1;
267
268 left = (left > x1) ? left : x1;
269 right = (right > x2) ? x2 : right;
270 top = (top > y1) ? top : y1;
271 bottom = (bottom > y2) ? y2 : bottom;
272 pExtents++;
273 if (left > right || top > bottom)
274 continue;
275 }
276
277 mWait3DCmdQueue(20);
278
279 MMIO(REG_3D_ClipTopBottom, ((GLint)top << 13) | (GLint)bottom);
280 MMIO(REG_3D_ClipLeftRight, ((GLint)left << 13) | (GLint)right);
281
282 /* the first triangle */
283 dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc |
284 SHADE_FLAT_VertexC;
285 MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet);
286
287 MMIO(REG_3D_TSZa, *(GLint *) &zClearVal);
288 MMIO(REG_3D_TSXa, *(GLint *) &right);
289 MMIO(REG_3D_TSYa, *(GLint *) &top);
290 MMIO(REG_3D_TSARGBa, smesa->clearColorPattern);
291
292 MMIO(REG_3D_TSZb, *(GLint *) &zClearVal);
293 MMIO(REG_3D_TSXb, *(GLint *) &left);
294 MMIO(REG_3D_TSYb, *(GLint *) &top);
295 MMIO(REG_3D_TSARGBb, smesa->clearColorPattern);
296
297 MMIO(REG_3D_TSZc, *(GLint *) &zClearVal);
298 MMIO(REG_3D_TSXc, *(GLint *) &left);
299 MMIO(REG_3D_TSYc, *(GLint *) &bottom);
300 MMIO(REG_3D_TSARGBc, smesa->clearColorPattern);
301
302 /* second triangle */
303 dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBb |
304 SHADE_FLAT_VertexB;
305 MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet);
306
307 MMIO(REG_3D_TSZb, *(GLint *) &zClearVal);
308 MMIO(REG_3D_TSXb, *(GLint *) &right);
309 MMIO(REG_3D_TSYb, *(GLint *) &bottom);
310 MMIO(REG_3D_TSARGBb, smesa->clearColorPattern);
Alan Hourihanee78dd782003-12-04 18:17:32 +0000311 }
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000312
313 mEndPrimitive();
314
Brian Paule4b23562005-05-04 20:11:35 +0000315 /* If BUFFER_BIT_FRONT_LEFT is set, we've only cleared the front buffer so far */
316 if ((mask & BUFFER_BIT_FRONT_LEFT) != 0 && (mask & BUFFER_BIT_BACK_LEFT) != 0)
317 sis_3D_Clear( ctx, BUFFER_BIT_BACK_LEFT, x, y, width, height );
Alan Hourihanee78dd782003-12-04 18:17:32 +0000318
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000319 smesa->GlobalFlag |= dirtyflags;
320
Brian Paule4b23562005-05-04 20:11:35 +0000321 return mask & ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL | BUFFER_BIT_BACK_LEFT |
322 BUFFER_BIT_FRONT_LEFT);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000323}
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000324
325static void
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000326sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y,
327 GLint width, GLint height )
328{
329 sisContextPtr smesa = SIS_CONTEXT(ctx);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000330 int count;
Jon Smirlae4a1cc2004-03-11 20:35:38 +0000331 drm_clip_rect_t *pExtents = NULL;
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000332 GLint xx, yy;
333 GLint x0, y0, width0, height0;
334
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000335 /* Clear back buffer */
Brian Paule4b23562005-05-04 20:11:35 +0000336 if (mask & BUFFER_BIT_BACK_LEFT) {
Eric Anholt005070a2005-10-24 22:38:11 +0000337 mWait3DCmdQueue (8);
338 MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ?
339 BLIT_DEPTH_32 : BLIT_DEPTH_16);
340 MMIO(REG_DST_X_Y, (x << 16) | y);
341 MMIO(REG_DST_ADDR, smesa->back.offset);
342 MMIO(REG_DST_PITCH_HEIGHT, (smesa->virtualY << 16) | smesa->back.pitch);
343 MMIO(REG_WIDTH_HEIGHT, (height << 16) | width);
344 MMIO(REG_PATFG, smesa->clearColorPattern);
345 MMIO(REG_BLIT_CMD, CMD_DIR_X_INC | CMD_DIR_Y_INC | CMD_ROP_PAT);
346 MMIO(REG_CommandQueue, -1);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000347 }
348
Brian Paule4b23562005-05-04 20:11:35 +0000349 if ((mask & BUFFER_BIT_FRONT_LEFT) == 0)
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000350 return;
351
352 /* Clear front buffer */
353 x0 = x;
354 y0 = y;
355 width0 = width;
356 height0 = height;
357
358 pExtents = smesa->driDrawable->pClipRects;
359 count = smesa->driDrawable->numClipRects;
360
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000361 while (count--) {
362 GLint x2 = pExtents->x1 - smesa->driDrawable->x;
363 GLint y2 = pExtents->y1 - smesa->driDrawable->y;
364 GLint xx2 = pExtents->x2 - smesa->driDrawable->x;
365 GLint yy2 = pExtents->y2 - smesa->driDrawable->y;
366
367 x = (x0 > x2) ? x0 : x2;
368 y = (y0 > y2) ? y0 : y2;
369 xx = ((x0 + width0) > (xx2)) ? xx2 : x0 + width0;
370 yy = ((y0 + height0) > (yy2)) ? yy2 : y0 + height0;
371 width = xx - x;
372 height = yy - y;
373 pExtents++;
374
375 if (width <= 0 || height <= 0)
376 continue;
377
Eric Anholt005070a2005-10-24 22:38:11 +0000378 mWait3DCmdQueue (8);
379 MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ?
380 BLIT_DEPTH_32 : BLIT_DEPTH_16);
381 MMIO(REG_DST_X_Y, (x << 16) | y);
382 MMIO(REG_DST_ADDR, smesa->front.offset);
383 MMIO(REG_DST_PITCH_HEIGHT, (smesa->virtualY << 16) | smesa->front.pitch);
384 MMIO(REG_WIDTH_HEIGHT, (height << 16) | width);
385 MMIO(REG_PATFG, smesa->clearColorPattern);
386 MMIO(REG_BLIT_CMD, CMD_DIR_X_INC | CMD_DIR_Y_INC | CMD_ROP_PAT);
387 MMIO(REG_CommandQueue, -1);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000388 }
389}
390
391static void
392sis_clear_z_stencil_buffer( GLcontext * ctx, GLbitfield mask,
393 GLint x, GLint y, GLint width, GLint height )
394{
395 sisContextPtr smesa = SIS_CONTEXT(ctx);
396
Eric Anholt005070a2005-10-24 22:38:11 +0000397 mWait3DCmdQueue (8);
398 MMIO(REG_SRC_PITCH, (smesa->zFormat == SiS_ZFORMAT_Z16) ?
399 BLIT_DEPTH_16 : BLIT_DEPTH_32);
400 MMIO(REG_DST_X_Y, (x << 16) | y);
401 MMIO(REG_DST_ADDR, smesa->depth.offset);
402 MMIO(REG_DST_PITCH_HEIGHT, (smesa->virtualY << 16) | smesa->depth.pitch);
403 MMIO(REG_WIDTH_HEIGHT, (height << 16) | width);
404 MMIO(REG_PATFG, smesa->clearZStencilPattern);
405 MMIO(REG_BLIT_CMD, CMD_DIR_X_INC | CMD_DIR_Y_INC | CMD_ROP_PAT);
406 MMIO(REG_CommandQueue, -1);
Alan Hourihane0f2e1862003-09-30 11:13:31 +0000407}
408