xf86-video-intel: src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Mon Jun 2 08:05:12 PDT 2014
src/sna/sna_accel.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
New commits:
commit 4cafd1fbb1a2441a9ba5dac7f2a0e1b3f5957c62
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jun 2 16:01:10 2014 +0100
sna: Fix early return in download using the GPU
In commit 961139f5878572ebea268a0bbf47caf05af9093f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri May 30 09:45:15 2014 +0100
sna: Use manual detiling for downloads
the code for deciding when to use the GPU was refactored into a new
function that also performed the transfer, but failed to notice the
early return.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a02c5eb..2513b8b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1738,22 +1738,18 @@ static inline bool cpu_bo_download(struct sna *sna,
if (priv->cpu_bo == NULL || !sna->kgem.can_blt_cpu)
return false;
- if (kgem_bo_is_busy(priv->gpu_bo) || kgem_bo_is_busy(priv->cpu_bo)) {
- DBG(("%s: yes, either bo is busy, so use GPU for readback\n",
- __FUNCTION__));
- return true;
- }
-
- /* Is it worth detiling? */
- assert(box[0].y1 < box[n-1].y2);
- if (kgem_bo_can_map(&sna->kgem, priv->gpu_bo) &&
- (box[n-1].y2 - box[0].y1 - 1) * priv->gpu_bo->pitch < 4096) {
- DBG(("%s: no, tiny transfer (height=%d, pitch=%d) expect to read inplace\n",
- __FUNCTION__, box[n-1].y2-box[0].y1, priv->gpu_bo->pitch));
- return false;
+ if (!kgem_bo_is_busy(priv->gpu_bo) && !kgem_bo_is_busy(priv->cpu_bo)) {
+ /* Is it worth detiling? */
+ assert(box[0].y1 < box[n-1].y2);
+ if (kgem_bo_can_map(&sna->kgem, priv->gpu_bo) &&
+ (box[n-1].y2 - box[0].y1 - 1) * priv->gpu_bo->pitch < 4096) {
+ DBG(("%s: no, tiny transfer (height=%d, pitch=%d) expect to read inplace\n",
+ __FUNCTION__, box[n-1].y2-box[0].y1, priv->gpu_bo->pitch));
+ return false;
+ }
}
- DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__));
+ DBG(("%s: using GPU write to CPU bo for download from GPU\n", __FUNCTION__));
return sna->render.copy_boxes(sna, GXcopy,
priv->pixmap, priv->gpu_bo, 0, 0,
priv->pixmap, priv->cpu_bo, 0, 0,
More information about the xorg-commit
mailing list