mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
i915tex: Some additional blit fixes and assertions.
This commit is contained in:
parent
a08c02f1a8
commit
0967e1270d
1 changed files with 24 additions and 8 deletions
|
|
@ -112,8 +112,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
|
|||
for (i = 0; i < nbox; i++, pbox++) {
|
||||
drm_clip_rect_t box;
|
||||
|
||||
if (pbox->x1 > pbox->x2 ||
|
||||
pbox->y1 > pbox->y2 ||
|
||||
if (pbox->x1 >= pbox->x2 ||
|
||||
pbox->y1 >= pbox->y2 ||
|
||||
pbox->x2 > intelScreen->width || pbox->y2 > intelScreen->height)
|
||||
continue;
|
||||
|
||||
|
|
@ -129,19 +129,22 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
|
|||
if (rect->y2 < box.y2)
|
||||
box.y2 = rect->y2;
|
||||
|
||||
if (box.x1 > box.x2 || box.y1 > box.y2)
|
||||
if (box.x1 >= box.x2 || box.y1 >= box.y2)
|
||||
continue;
|
||||
}
|
||||
|
||||
assert(box.x1 < box.x2);
|
||||
assert(box.y1 < box.y2);
|
||||
|
||||
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
|
||||
OUT_BATCH(CMD);
|
||||
OUT_BATCH(BR13);
|
||||
OUT_BATCH((pbox->y1 << 16) | pbox->x1);
|
||||
OUT_BATCH((pbox->y2 << 16) | pbox->x2);
|
||||
OUT_BATCH((box.y1 << 16) | box.x1);
|
||||
OUT_BATCH((box.y2 << 16) | box.x2);
|
||||
|
||||
OUT_RELOC(frontRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
|
||||
DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
|
||||
OUT_BATCH((pbox->y1 << 16) | pbox->x1);
|
||||
OUT_BATCH((box.y1 << 16) | box.x1);
|
||||
OUT_BATCH(BR13 & 0xffff);
|
||||
OUT_RELOC(backRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
|
||||
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
|
||||
|
|
@ -152,7 +155,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
|
|||
if (intel->first_swap_fence)
|
||||
driFenceUnReference(intel->first_swap_fence);
|
||||
intel->first_swap_fence = intel_batchbuffer_flush(intel->batch);
|
||||
driFenceReference(intel->first_swap_fence);
|
||||
if (intel->first_swap_fence)
|
||||
driFenceReference(intel->first_swap_fence);
|
||||
}
|
||||
|
||||
UNLOCK_HARDWARE(intel);
|
||||
|
|
@ -193,6 +197,8 @@ intelEmitFillBlit(struct intel_context *intel,
|
|||
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
|
||||
__FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
|
||||
|
||||
assert(w > 0);
|
||||
assert(h > 0);
|
||||
|
||||
BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
|
||||
OUT_BATCH(CMD);
|
||||
|
|
@ -280,10 +286,11 @@ intelEmitCopyBlit(struct intel_context *intel,
|
|||
return;
|
||||
}
|
||||
|
||||
if (dst_y2 < dst_y || dst_x2 < dst_x) {
|
||||
if (dst_y2 <= dst_y || dst_x2 <= dst_x) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Initial y values don't seem to work with negative pitches. If
|
||||
* we adjust the offsets manually (below), it seems to work fine.
|
||||
*
|
||||
|
|
@ -292,6 +299,9 @@ intelEmitCopyBlit(struct intel_context *intel,
|
|||
* the wrong result.
|
||||
*/
|
||||
if (dst_pitch > 0 && src_pitch > 0) {
|
||||
assert(dst_x < dst_x2);
|
||||
assert(dst_y < dst_y2);
|
||||
|
||||
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
|
||||
OUT_BATCH(CMD);
|
||||
OUT_BATCH(BR13);
|
||||
|
|
@ -306,6 +316,9 @@ intelEmitCopyBlit(struct intel_context *intel,
|
|||
ADVANCE_BATCH();
|
||||
}
|
||||
else {
|
||||
assert(dst_x < dst_x2);
|
||||
assert(h > 0);
|
||||
|
||||
BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS);
|
||||
OUT_BATCH(CMD);
|
||||
OUT_BATCH(BR13);
|
||||
|
|
@ -480,6 +493,9 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
|
|||
*/
|
||||
intel_wait_flips(intel, INTEL_BATCH_NO_CLIPRECTS);
|
||||
|
||||
assert(b.x1 < b.x2);
|
||||
assert(b.y1 < b.y2);
|
||||
|
||||
BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS);
|
||||
OUT_BATCH(CMD);
|
||||
OUT_BATCH(BR13);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue