* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
**************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
+#include <sched.h>
#include "mtypes.h"
#include "context.h"
static int intelEmitIrqLocked( intelContextPtr intel )
{
drmI830IrqEmit ie;
- int ret, seq;
+ int ret, seq = 0;
assert(((*(int *)intel->driHwLock) & ~DRM_LOCK_CONT) ==
(DRM_LOCK_HELD|intel->hHWContext));
fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count);
for (i = 0; i < count/4; i += 4)
fprintf(stderr, "\t0x%x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
- offset + i*4, ptr[i], ptr[i+1], ptr[i+2], ptr[i+3]);
+ (unsigned int)offset + i*4, ptr[i], ptr[i+1], ptr[i+2], ptr[i+3]);
fprintf(stderr, "END BATCH\n\n\n");
}
fprintf(stderr, "%s: now using half %d\n", __FUNCTION__, buf);
intel->batch.start_offset = intel->alloc.offset + buf * half;
- intel->batch.ptr = (char *)intel->alloc.ptr + buf * half;
+ intel->batch.ptr = (GLubyte *)intel->alloc.ptr + buf * half;
intel->batch.size = half - 8;
intel->batch.space = half - 8;
assert(intel->batch.space >= 0);
* single buffer.
*/
if (intel->numClipRects == 0 && !ignore_cliprects) {
- intel->batch.space = intel->batch.size;
/* Without this yeild, an application with no cliprects can hog
* the hardware. Without unlocking, the effect is much worse -
/* Note that any state thought to have been emitted actually
* hasn't:
*/
+ intel->batch.ptr -= (intel->batch.size - intel->batch.space);
+ intel->batch.space = intel->batch.size;
intel->vtbl.lost_hardware( intel );
}
}
} else {
drmI830CmdBuffer cmd;
- cmd.buf = intel->alloc.ptr + batch.start;
+ cmd.buf = (char *)intel->alloc.ptr + batch.start;
cmd.sz = batch.used;
cmd.DR1 = batch.DR1;
cmd.DR4 = batch.DR4;
*/
intelFlush( &intel->ctx );
- if (mask & DD_FRONT_LEFT_BIT) {
+ if (mask & BUFFER_BIT_FRONT_LEFT) {
if (colorMask == ~0) {
- blit_mask |= DD_FRONT_LEFT_BIT;
+ blit_mask |= BUFFER_BIT_FRONT_LEFT;
}
else {
- tri_mask |= DD_FRONT_LEFT_BIT;
+ tri_mask |= BUFFER_BIT_FRONT_LEFT;
}
}
- if (mask & DD_BACK_LEFT_BIT) {
+ if (mask & BUFFER_BIT_BACK_LEFT) {
if (colorMask == ~0) {
- blit_mask |= DD_BACK_LEFT_BIT;
+ blit_mask |= BUFFER_BIT_BACK_LEFT;
}
else {
- tri_mask |= DD_BACK_LEFT_BIT;
+ tri_mask |= BUFFER_BIT_BACK_LEFT;
}
}
- if (mask & DD_DEPTH_BIT) {
- blit_mask |= DD_DEPTH_BIT;
+ if (mask & BUFFER_BIT_DEPTH) {
+ blit_mask |= BUFFER_BIT_DEPTH;
}
- if (mask & DD_STENCIL_BIT) {
+ if (mask & BUFFER_BIT_STENCIL) {
if (!intel->hw_stencil) {
- swrast_mask |= DD_STENCIL_BIT;
+ swrast_mask |= BUFFER_BIT_STENCIL;
}
else if (ctx->Stencil.WriteMask[0] != 0xff) {
- tri_mask |= DD_STENCIL_BIT;
+ tri_mask |= BUFFER_BIT_STENCIL;
}
else {
- blit_mask |= DD_STENCIL_BIT;
+ blit_mask |= BUFFER_BIT_STENCIL;
}
}
- swrast_mask |= (mask & DD_ACCUM_BIT);
+ swrast_mask |= (mask & BUFFER_BIT_ACCUM);
if (blit_mask)
intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
void *intelAllocateAGP( intelContextPtr intel, GLsizei size )
{
- int region_offset;
+ int region_offset = 0;
drmI830MemAlloc alloc;
int ret;
if (offset < 0 || offset > intel->intelScreen->tex.size)
return ~0;
else
- return intel->intelScreen->textureOffset + offset;
+ return intel->intelScreen->tex.offset + offset;
}