summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_blit.c22
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_blit.h2
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_regions.c5
3 files changed, 24 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i915pipe/intel_blit.c b/src/mesa/drivers/dri/i915pipe/intel_blit.c
index 8e7f294b57..109d4face2 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_blit.c
+++ b/src/mesa/drivers/dri/i915pipe/intel_blit.c
@@ -209,9 +209,11 @@ intelEmitFillBlit(struct intel_context *intel,
GLshort dst_pitch,
struct _DriBufferObject *dst_buffer,
GLuint dst_offset,
- GLshort x, GLshort y, GLshort w, GLshort h, GLuint color)
+ GLshort x, GLshort y, GLshort w, GLshort h,
+ GLuint value, GLuint mask)
{
GLuint BR13, CMD;
+ GLboolean badMask = GL_FALSE;
BATCH_LOCALS;
dst_pitch *= cpp;
@@ -222,16 +224,32 @@ intelEmitFillBlit(struct intel_context *intel,
case 3:
BR13 = dst_pitch | (0xF0 << 16) | (1 << 24);
CMD = XY_COLOR_BLT_CMD;
+ if ((mask & 0xffff) != 0xffff)
+ badMask = GL_TRUE;
break;
case 4:
BR13 = dst_pitch | (0xF0 << 16) | (1 << 24) | (1 << 25);
+#if 0
CMD = (XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA |
XY_COLOR_BLT_WRITE_RGB);
+#else
+ CMD = XY_COLOR_BLT_CMD;
+ if ((mask & 0xff000000) == 0xff000000)
+ CMD |= XY_COLOR_BLT_WRITE_ALPHA;
+ else if (mask & 0xff000000)
+ badMask = GL_TRUE;
+ if ((mask & 0x00ffffff) == 0x00ffffff)
+ CMD |= XY_COLOR_BLT_WRITE_RGB;
+ else if (mask & 0x00ffffff)
+ badMask = GL_TRUE;
+#endif
break;
default:
return;
}
+ assert(!badMask);
+
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
@@ -243,7 +261,7 @@ intelEmitFillBlit(struct intel_context *intel,
OUT_BATCH(((y + h) << 16) | (x + w));
OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, dst_offset);
- OUT_BATCH(color);
+ OUT_BATCH(value);
ADVANCE_BATCH();
}
diff --git a/src/mesa/drivers/dri/i915pipe/intel_blit.h b/src/mesa/drivers/dri/i915pipe/intel_blit.h
index 77686444fa..46c2594477 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_blit.h
+++ b/src/mesa/drivers/dri/i915pipe/intel_blit.h
@@ -56,7 +56,7 @@ extern void intelEmitFillBlit(struct intel_context *intel,
struct _DriBufferObject *dst_buffer,
GLuint dst_offset,
GLshort x, GLshort y,
- GLshort w, GLshort h, GLuint color);
+ GLshort w, GLshort h, GLuint value, GLuint mask);
#endif
diff --git a/src/mesa/drivers/dri/i915pipe/intel_regions.c b/src/mesa/drivers/dri/i915pipe/intel_regions.c
index e95e745adc..bdbc59e7ac 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_regions.c
+++ b/src/mesa/drivers/dri/i915pipe/intel_regions.c
@@ -343,7 +343,8 @@ intel_region_fill(struct pipe_context *pipe,
struct pipe_region *dst,
GLuint dst_offset,
GLuint dstx, GLuint dsty,
- GLuint width, GLuint height, GLuint color)
+ GLuint width, GLuint height,
+ GLuint value, GLuint mask)
{
intelScreenPrivate *intelScreen = pipe_screen(pipe);
struct intel_context *intel = intelScreenContext(intelScreen);
@@ -364,7 +365,7 @@ intel_region_fill(struct pipe_context *pipe,
intelEmitFillBlit(intel,
dst->cpp,
dst->pitch, dst->buffer, dst_offset,
- dstx, dsty, width, height, color);
+ dstx, dsty, width, height, value, mask);
}
/* Attach to a pbo, discarding our data. Effectively zero-copy upload