summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-06-04 13:25:38 +0800
committerChia-I Wu <[email protected]>2013-06-07 11:28:20 +0800
commit7cbf0a410e565b6a02c4b45f73364d3537780105 (patch)
treeb9859773aefe89936df8b2bd9b49c5929fece37c
parent27804b2fc705bdcd3ff3d4ffd12534bc42f70805 (diff)
ilo: unmap cp bo before destroying it
The BOs are mapped in their entire life times for the chipsets we support so do not forget to unmap it.
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c
index 1fd47410bcd..b29a014591c 100644
--- a/src/gallium/drivers/ilo/ilo_cp.c
+++ b/src/gallium/drivers/ilo/ilo_cp.c
@@ -256,8 +256,13 @@ ilo_cp_flush(struct ilo_cp *cp)
void
ilo_cp_destroy(struct ilo_cp *cp)
{
- if (cp->bo)
+ if (cp->bo) {
+ if (!cp->sys)
+ cp->bo->unmap(cp->bo);
+
cp->bo->unreference(cp->bo);
+ }
+
if (cp->render_ctx)
cp->winsys->destroy_context(cp->winsys, cp->render_ctx);