diff mbox

[7/7] sna: add an assert in the lengthy sna_drawable_use_bo

Message ID 1455294689-29249-8-git-send-email-martin.peres@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Peres Feb. 12, 2016, 4:31 p.m. UTC
I got lost in all the changes done on priv->flush and gpu_bo enough
not to be able to guarantee that if flush is non-null, so is gpu_bo.

Caught by Klockwork.

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
---
 src/sna/sna_accel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Wilson Feb. 12, 2016, 4:45 p.m. UTC | #1
On Fri, Feb 12, 2016 at 06:31:29PM +0200, Martin Peres wrote:
> I got lost in all the changes done on priv->flush and gpu_bo enough
> not to be able to guarantee that if flush is non-null, so is gpu_bo.
> 
> Caught by Klockwork.

Nope, impossible.
-Chris
diff mbox

Patch

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index f1c136a..595faa6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4074,6 +4074,7 @@  prefer_gpu_bo:
 	}
 	if (priv->flush) {
 		assert(!priv->shm);
+		assert(priv->gpu_bo);
 		sna_add_flush_pixmap(sna, priv, priv->gpu_bo);
 	}