aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin2015-06-21 18:26:42 -0500
committerIlia Mirkin2015-06-21 18:26:42 -0500
commit203983f842a889b279698fdea46e83ee4450a1db (patch)
treefa0c3a8f2a6af942a6ef54a5dc56077c3c4c8dbf /nouveau
parent97be70b45eccc37e98a1cecf360593f36956ea42 (diff)
downloadexternal-libgbm-203983f842a889b279698fdea46e83ee4450a1db.tar.gz
external-libgbm-203983f842a889b279698fdea46e83ee4450a1db.tar.xz
external-libgbm-203983f842a889b279698fdea46e83ee4450a1db.zip
nouveau: add asserts to make sure krefs are there
This should help catch odd bugs at the callsites rather than much later on with completely bogus bo indices. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/pushbuf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c
index 4f77881b..8e7dcdfa 100644
--- a/nouveau/pushbuf.c
+++ b/nouveau/pushbuf.c
@@ -234,6 +234,8 @@ pushbuf_krel(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
234 bkref = cli_kref_get(push->client, bo); 234 bkref = cli_kref_get(push->client, bo);
235 krel = &krec->reloc[krec->nr_reloc++]; 235 krel = &krec->reloc[krec->nr_reloc++];
236 236
237 assert(pkref);
238 assert(bkref);
237 krel->reloc_bo_index = pkref - krec->buffer; 239 krel->reloc_bo_index = pkref - krec->buffer;
238 krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4; 240 krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4;
239 krel->bo_index = bkref - krec->buffer; 241 krel->bo_index = bkref - krec->buffer;
@@ -721,6 +723,7 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
721 723
722 if (bo) { 724 if (bo) {
723 kref = cli_kref_get(push->client, bo); 725 kref = cli_kref_get(push->client, bo);
726 assert(kref);
724 kpsh = &krec->push[krec->nr_push++]; 727 kpsh = &krec->push[krec->nr_push++];
725 kpsh->bo_index = kref - krec->buffer; 728 kpsh->bo_index = kref - krec->buffer;
726 kpsh->offset = offset; 729 kpsh->offset = offset;
@@ -757,6 +760,7 @@ nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo)
757 760
758 if (cli_push_get(push->client, bo) == push) { 761 if (cli_push_get(push->client, bo) == push) {
759 kref = cli_kref_get(push->client, bo); 762 kref = cli_kref_get(push->client, bo);
763 assert(kref);
760 if (kref->read_domains) 764 if (kref->read_domains)
761 flags |= NOUVEAU_BO_RD; 765 flags |= NOUVEAU_BO_RD;
762 if (kref->write_domains) 766 if (kref->write_domains)