summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-08-27 12:35:20 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-27 12:35:20 +0200
commit3950a2bd1453ccea4157e3466e827edc21d2087a (patch)
treed7f75235d90ec2bc45f77c14e4e5214cb6b43146
parenta150e6170dd39104d3fc748ad65415a46c74f4fb (diff)
downloadetna_viv-3950a2bd1453ccea4157e3466e827edc21d2087a.tar.gz
etna_viv-3950a2bd1453ccea4157e3466e827edc21d2087a.tar.xz
etna_bo_del: make sure that FREE_VIDEO_MEMORY is sent as event
Right now the kernel will complain when etna_bo_del is called without a queue and the unlock is delayed (async=1 is returned), as the free happens immediately. So make sure that FREE_VIDEO_MEMORY is sent as event even when no queue is passed.
-rw-r--r--src/etnaviv/etna_bo.c2
-rw-r--r--src/etnaviv/viv.c13
-rw-r--r--src/etnaviv/viv.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/src/etnaviv/etna_bo.c b/src/etnaviv/etna_bo.c
index 010b62a..adce6f6 100644
--- a/src/etnaviv/etna_bo.c
+++ b/src/etnaviv/etna_bo.c
@@ -349,7 +349,7 @@ int etna_bo_del(struct viv_conn *conn, struct etna_bo *mem, struct etna_queue *q
fprintf(stderr, "etna: Warning: could not queue free video memory\n");
}
} else {
- if((rv = viv_free_vidmem(conn, mem->node)) != ETNA_OK)
+ if((rv = viv_free_vidmem(conn, mem->node, true)) != ETNA_OK)
{
fprintf(stderr, "etna: Warning: could not free video memory\n");
}
diff --git a/src/etnaviv/viv.c b/src/etnaviv/viv.c
index 177f23b..0393c21 100644
--- a/src/etnaviv/viv.c
+++ b/src/etnaviv/viv.c
@@ -582,7 +582,7 @@ int viv_reset(struct viv_conn *conn)
return viv_invoke(conn, &id);
}
-int viv_free_vidmem(struct viv_conn *conn, viv_node_t node)
+int viv_free_vidmem(struct viv_conn *conn, viv_node_t node, bool submit_as_event)
{
gcsHAL_INTERFACE id = {
.command = gcvHAL_FREE_VIDEO_MEMORY,
@@ -592,7 +592,16 @@ int viv_free_vidmem(struct viv_conn *conn, viv_node_t node)
}
}
};
- return viv_invoke(conn, &id);
+ if(submit_as_event) /* submit as event immediately */
+ {
+ struct _gcsQUEUE queue = {
+ .next = PTR_TO_VIV(NULL),
+ .iface = id
+ };
+ return viv_event_commit(conn, &queue);
+ } else { /* submit as command */
+ return viv_invoke(conn, &id);
+ }
}
int viv_free_contiguous(struct viv_conn *conn, size_t bytes, viv_addr_t physical, void *logical)
diff --git a/src/etnaviv/viv.h b/src/etnaviv/viv.h
index adae7e4..aeec6be 100644
--- a/src/etnaviv/viv.h
+++ b/src/etnaviv/viv.h
@@ -252,7 +252,7 @@ int viv_unlock_vidmem(struct viv_conn *conn, viv_node_t node, enum viv_surf_type
/** Free a block of video memory previously allocated with viv_alloc_linear_vidmem.
*/
-int viv_free_vidmem(struct viv_conn *conn, viv_node_t node);
+int viv_free_vidmem(struct viv_conn *conn, viv_node_t node, bool submit_as_event);
/** Free block of contiguous memory previously allocated with viv_alloc_contiguous.
*/