diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-11 10:46:06 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-11 11:08:00 +0000 |
commit | d31569455ca25b7050a240cad58bea492c58194a (patch) | |
tree | 6f28a0f64f96b9bf040320eb5d060bd823469346 | |
parent | 8c5593037f31159532da992ae3b503c3b4a42f8e (diff) |
sna: Avoid using the wrong pitch for comparing replacement sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 2 | ||||
-rw-r--r-- | src/sna/sna_io.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index acb2d56b..716a9fe2 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1555,7 +1555,7 @@ static inline bool pixmap_inplace(struct sna *sna, return false; } - return (pixmap->devKind * pixmap->drawable.height >> 12) > + return (priv->stride * pixmap->drawable.height >> 12) > sna->kgem.half_cpu_cache_pages; } diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 0aac61eb..2e9204fb 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -1730,10 +1730,10 @@ indirect_replace(struct sna *sna, DBG(("%s: size=%d vs %d\n", __FUNCTION__, - (int)pixmap->devKind * pixmap->drawable.height >> 12, + stride * pixmap->drawable.height >> 12, kgem->half_cpu_cache_pages)); - if ((int)pixmap->devKind * pixmap->drawable.height >> 12 > kgem->half_cpu_cache_pages) + if (stride * pixmap->drawable.height >> 12 > kgem->half_cpu_cache_pages) return false; if (!kgem_bo_can_blt(kgem, bo) && |