sna/dri: Avoid using the BLT for DRI2CopyRegion if no semaphores
We expect mesa nowadays to preferentially use the render pipeline for doing its clears and so want to avoid handing it back an active BLT bo if we don't have semaphores (as that would cause a sync). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
61d2baa430
commit
f00599f971
|
|
@ -2684,6 +2684,9 @@ static inline bool prefer_blt_copy(struct sna *sna,
|
|||
if (sna->kgem.ring == KGEM_BLT)
|
||||
return true;
|
||||
|
||||
if (flags & COPY_DRI && !sna->kgem.has_semaphores)
|
||||
return false;
|
||||
|
||||
if ((flags & COPY_SMALL || src_bo == dst_bo) &&
|
||||
can_switch_to_blt(sna, dst_bo, flags))
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -2890,6 +2890,9 @@ prefer_blt_copy(struct sna *sna,
|
|||
untiled_tlb_miss(dst_bo))
|
||||
return true;
|
||||
|
||||
if (flags & COPY_DRI && !sna->kgem.has_semaphores)
|
||||
return false;
|
||||
|
||||
if (force_blt_ring(sna))
|
||||
return true;
|
||||
|
||||
|
|
@ -2903,6 +2906,7 @@ prefer_blt_copy(struct sna *sna,
|
|||
return false;
|
||||
|
||||
if (flags & COPY_LAST &&
|
||||
sna->render_state.gt < 3 &&
|
||||
can_switch_to_blt(sna, dst_bo, flags))
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -2713,6 +2713,9 @@ prefer_blt_copy(struct sna *sna,
|
|||
untiled_tlb_miss(dst_bo))
|
||||
return true;
|
||||
|
||||
if (flags & COPY_DRI && !sna->kgem.has_semaphores)
|
||||
return false;
|
||||
|
||||
if (force_blt_ring(sna))
|
||||
return true;
|
||||
|
||||
|
|
@ -2726,6 +2729,7 @@ prefer_blt_copy(struct sna *sna,
|
|||
return false;
|
||||
|
||||
if (flags & COPY_LAST &&
|
||||
sna->render_state.gt < 3 &&
|
||||
can_switch_to_blt(sna, dst_bo, flags))
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ sna_dri2_get_back(struct sna *sna,
|
|||
if (sna->render.copy_boxes(sna, GXcopy,
|
||||
draw, get_private(back)->bo, 0, 0,
|
||||
draw, bo, 0, 0,
|
||||
&box, 1, 0))
|
||||
&box, 1, COPY_LAST | COPY_DRI))
|
||||
flags = back->flags;
|
||||
}
|
||||
}
|
||||
|
|
@ -1155,7 +1155,7 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
|
|||
boxes[0].x2, boxes[0].y2,
|
||||
n, sx, sy, dx, dy));
|
||||
|
||||
hint = COPY_LAST;
|
||||
hint = COPY_LAST | COPY_DRI;
|
||||
if (flags & DRI2_SYNC)
|
||||
hint |= COPY_SYNC;
|
||||
if (!sna->render.copy_boxes(sna, GXcopy,
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ struct sna_render {
|
|||
#define COPY_SYNC 0x2
|
||||
#define COPY_NO_OVERLAP 0x4
|
||||
#define COPY_SMALL 0x8
|
||||
#define COPY_DRI 0x10
|
||||
|
||||
bool (*copy)(struct sna *sna, uint8_t alu,
|
||||
PixmapPtr src, struct kgem_bo *src_bo,
|
||||
|
|
|
|||
Loading…
Reference in New Issue