}
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
+
/* Copy BitBlt
*/
void
struct _DriBufferObject *dst_buffer,
GLuint dst_offset,
GLshort src_x, GLshort src_y,
- GLshort dst_x, GLshort dst_y, GLshort w, GLshort h)
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
{
GLuint CMD, BR13;
int dst_y2 = dst_y + h;
case 1:
case 2:
case 3:
- BR13 = (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24);
+ BR13 = (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 16) | (1 << 24);
CMD = XY_SRC_COPY_BLT_CMD;
break;
case 4:
BR13 =
- (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24) | (1 <<
- 25);
+ (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 16) | (1 << 24) | (1 << 25);
CMD =
(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
XY_SRC_COPY_BLT_WRITE_RGB);
GLuint dst_offset,
GLshort srcx, GLshort srcy,
GLshort dstx, GLshort dsty,
- GLshort w, GLshort h);
+ GLshort w, GLshort h,
+ GLenum logicop );
extern void intelEmitFillBlit(struct intel_context *intel,
GLuint cpp,
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled);
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
}
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
ctx->Texture._EnabledUnits ||
- ctx->FragmentProgram._Enabled);
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
}
/* Doesn't work for overlapping regions. Could do a double copy or
intelEmitCopyBlit(intel, dst->cpp,
src->pitch, src->buffer, 0,
dst->pitch, dst->buffer, 0,
- rect.x1 + delta_x, rect.y1 + delta_y, /* srcx, srcy */
+ rect.x1 + delta_x,
+ rect.y1 + delta_y, /* srcx, srcy */
rect.x1, rect.y1, /* dstx, dsty */
- rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
}
out:
return GL_FALSE;
}
- if (!intel_check_meta_tex_fragment_ops(ctx)) {
+ if (!intel_check_blit_fragment_ops(ctx)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s - bad GL fragment state for meta tex\n",
+ _mesa_printf("%s - bad GL fragment state for blitter\n",
__FUNCTION__);
return GL_FALSE;
}
rect.x1 - dest_rect.x1,
rect.y2 - dest_rect.y2,
rect.x1,
- rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
}
fence = intel_batchbuffer_flush(intel->batch);
driFenceReference(fence);
}
UNLOCK_HARDWARE(intel);
- if (intel->driDrawable->numClipRects)
+ if (fence) {
driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
-
- driFenceUnReference(fence);
+ driFenceUnReference(fence);
+ }
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
rect.y1,
rect.x1 - src_rect.x1,
rect.y2 - src_rect.y2,
- rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ GL_COPY);
}
fence = intel_batchbuffer_flush(intel->batch);
}
UNLOCK_HARDWARE(intel);
- if (intel->driDrawable->numClipRects)
+ if (fence) {
driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
GL_FALSE);
+ driFenceUnReference(fence);
+ }
- driFenceUnReference(fence);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
dst->cpp,
src->pitch, src->buffer, src_offset,
dst->pitch, dst->buffer, dst_offset,
- srcx, srcy, dstx, dsty, width, height);
+ srcx, srcy, dstx, dsty, width, height,
+ GL_COPY);
}
/* Fill a rectangular sub-region. Need better logic about when to
region->buffer, 0,
region->pitch,
pbo->buffer, 0,
- 0, 0, 0, 0, region->pitch, region->height);
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
UNLOCK_HARDWARE(intel);
region->buffer, 0,
region->pitch,
pbo->buffer, 0,
- 0, 0, 0, 0, region->pitch, region->height);
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
}
intelImage->mt->pitch,
intelImage->mt->region->buffer,
image_offset,
- x, y + height, dstx, dsty, width, height);
+ x, y + height, dstx, dsty, width, height,
+ GL_COPY); /* ? */
intel_batchbuffer_flush(intel->batch);
}
intelImage->mt->cpp,
src_stride, src_buffer, src_offset,
dst_stride, dst_buffer, dst_offset,
- 0, 0, 0, 0, width, height);
+ 0, 0, 0, 0, width, height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
}