From d70be85dc723168a481c1955444afd951c4817bf Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 15 Jan 2013 20:16:45 +0000 Subject: [PATCH] sna: Assert that we never try to mix INPLACE / ASYNC hints for move-to-cpu Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index a6affcfe..0b46218b 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1444,13 +1444,15 @@ static inline bool use_cpu_bo_for_upload(struct sna *sna, static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags) { - if ((priv->create & KGEM_CAN_CREATE_GTT) == 0) { - DBG(("%s: no, not accessible via GTT\n", __FUNCTION__)); + if ((flags & MOVE_INPLACE_HINT) == 0) { + DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__)); return false; } - if ((flags & MOVE_INPLACE_HINT) == 0) { - DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__)); + assert((flags & MOVE_ASYNC_HINT) == 0); + + if ((priv->create & KGEM_CAN_CREATE_GTT) == 0) { + DBG(("%s: no, not accessible via GTT\n", __FUNCTION__)); return false; }