diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-06-21 19:26:42 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-06-21 19:26:42 -0400 |
commit | 203983f842a889b279698fdea46e83ee4450a1db (patch) | |
tree | fa0c3a8f2a6af942a6ef54a5dc56077c3c4c8dbf | |
parent | 97be70b45eccc37e98a1cecf360593f36956ea42 (diff) |
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>
-rw-r--r-- | nouveau/pushbuf.c | 4 |
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, bkref = cli_kref_get(push->client, bo); krel = &krec->reloc[krec->nr_reloc++]; + assert(pkref); + assert(bkref); krel->reloc_bo_index = pkref - krec->buffer; krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4; krel->bo_index = bkref - krec->buffer; @@ -721,6 +723,7 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, if (bo) { kref = cli_kref_get(push->client, bo); + assert(kref); kpsh = &krec->push[krec->nr_push++]; kpsh->bo_index = kref - krec->buffer; kpsh->offset = offset; @@ -757,6 +760,7 @@ nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) if (cli_push_get(push->client, bo) == push) { kref = cli_kref_get(push->client, bo); + assert(kref); if (kref->read_domains) flags |= NOUVEAU_BO_RD; if (kref->write_domains) |