summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-01-16 16:59:17 -0800
committerEric Anholt <eric@anholt.net>2009-01-21 11:44:25 -0800
commit12ad7f650a01916fd05e0aee9a72f70b112e50a0 (patch)
tree54976867e85661361aeb03c3226e3117625d5b3a
parent6b299ffac73e7f2069f8207bda677a82e6a60c81 (diff)
Protect i915 textured video against batchbuffer wrapping.
(cherry picked from commit d89de6d60a86105a198d904821853e6ed7de3305)
-rw-r--r--src/i915_video.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/i915_video.c b/src/i915_video.c
index 7761a454..b903b5ec 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -49,8 +49,9 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
{
I830Ptr pI830 = I830PTR(pScrn);
uint32_t format, ms3, s5;
- BoxPtr pbox;
- int nbox, dxo, dyo, pix_xoff, pix_yoff;
+ BoxPtr pbox = REGION_RECTS(dstRegion);
+ int nbox = REGION_NUM_RECTS(dstRegion);
+ int dxo, dyo, pix_xoff, pix_yoff;
Bool planar;
#if 0
@@ -72,6 +73,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
return;
}
+ intel_batch_start_atomic(pScrn, 200 + 20 * nbox);
+
IntelEmitInvarientState(pScrn);
*pI830->last_3d = LAST_3D_VIDEO;
@@ -362,8 +365,6 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
dxo = dstRegion->extents.x1;
dyo = dstRegion->extents.y1;
- pbox = REGION_RECTS(dstRegion);
- nbox = REGION_NUM_RECTS(dstRegion);
while (nbox--)
{
int box_x1 = pbox->x1;
@@ -412,6 +413,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
ADVANCE_BATCH();
}
+ intel_batch_end_atomic(pScrn);
+
i830MarkSync(pScrn);
}