summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2017-02-12 16:52:48 +0000
committerRussell King <rmk@armlinux.org.uk>2017-02-12 16:52:48 +0000
commit9159fe0933c26a9c6a708a23601827538a415148 (patch)
tree51a8605976d2f8961444c56732725c73d38a8cfc
parenteb406e9ade0f19be6bf80bfeab1dea404db9ecf6 (diff)
etnaviv: factor out batch retirement code
Factor out the batch retirement code: xorg_list_del(&vpix->batch_node); vpix->batch_state = B_NONE; into a common function. This is called when we know that the GPU has finished with the etnaviv pixmap buffer, and we are ready to take it off the batch and fence lists. Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--etnaviv/etnaviv.c11
-rw-r--r--etnaviv/etnaviv_accel.c23
-rw-r--r--etnaviv/etnaviv_accel.h2
3 files changed, 19 insertions, 17 deletions
diff --git a/etnaviv/etnaviv.c b/etnaviv/etnaviv.c
index 99a7944..a4e303f 100644
--- a/etnaviv/etnaviv.c
+++ b/etnaviv/etnaviv.c
@@ -88,6 +88,12 @@ void etnaviv_free_busy_vpix(struct etnaviv *etnaviv)
}
}
+void etnaviv_retire_vpix(struct etnaviv *etnaviv, struct etnaviv_pixmap *vpix)
+{
+ xorg_list_del(&vpix->batch_node);
+ vpix->batch_state = B_NONE;
+}
+
void etnaviv_finish_fences(struct etnaviv *etnaviv, uint32_t fence)
{
struct etnaviv_pixmap *i, *n;
@@ -102,8 +108,7 @@ void etnaviv_finish_fences(struct etnaviv *etnaviv, uint32_t fence)
break;
etnaviv->last_fence = fence;
}
- xorg_list_del(&i->batch_node);
- i->batch_state = B_NONE;
+ etnaviv_retire_vpix(etnaviv, i);
}
}
@@ -162,7 +167,7 @@ static void etnaviv_free_pixmap(PixmapPtr pixmap)
* operations. Check whether it has completed.
*/
if (VIV_FENCE_BEFORE_EQ(vPix->fence, etnaviv->last_fence)) {
- xorg_list_del(&vPix->batch_node);
+ etnaviv_retire_vpix(etnaviv, vPix);
etnaviv_free_vpix(etnaviv, vPix);
break;
}
diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c
index fd9da7d..7177d21 100644
--- a/etnaviv/etnaviv_accel.c
+++ b/etnaviv/etnaviv_accel.c
@@ -56,8 +56,7 @@ void etnaviv_batch_wait_commit(struct etnaviv *etnaviv,
case B_FENCED:
if (VIV_FENCE_BEFORE_EQ(vPix->fence, etnaviv->last_fence)) {
/* The pixmap has already completed. */
- xorg_list_del(&vPix->batch_node);
- vPix->batch_state = B_NONE;
+ etnaviv_retire_vpix(etnaviv, vPix);
break;
}
@@ -217,10 +216,8 @@ void etnaviv_commit(struct etnaviv *etnaviv, Bool stall, uint32_t *fence)
* the GPU.
*/
xorg_list_for_each_entry_safe(i, n, &etnaviv->batch_head,
- batch_node) {
- xorg_list_del(&i->batch_node);
- i->batch_state = B_NONE;
- }
+ batch_node)
+ etnaviv_retire_vpix(etnaviv, i);
/*
* Reap the previously submitted pixmaps, now that we know
@@ -1069,15 +1066,13 @@ void etnaviv_accel_shutdown(struct etnaviv *etnaviv)
TimerFree(etnaviv->cache_timer);
etna_finish(etnaviv->ctx);
xorg_list_for_each_entry_safe(i, n, &etnaviv->batch_head,
- batch_node) {
- xorg_list_del(&i->batch_node);
- i->batch_state = B_NONE;
- }
+ batch_node)
+ etnaviv_retire_vpix(etnaviv, i);
+
xorg_list_for_each_entry_safe(i, n, &etnaviv->fence_head,
- batch_node) {
- xorg_list_del(&i->batch_node);
- i->batch_state = B_NONE;
- }
+ batch_node)
+ etnaviv_retire_vpix(etnaviv, i);
+
etnaviv_free_busy_vpix(etnaviv);
if (etnaviv->gc320_etna_bo)
diff --git a/etnaviv/etnaviv_accel.h b/etnaviv/etnaviv_accel.h
index ba66447..671f37c 100644
--- a/etnaviv/etnaviv_accel.h
+++ b/etnaviv/etnaviv_accel.h
@@ -183,6 +183,8 @@ struct etnaviv_usermem_node {
void etnaviv_add_freemem(struct etnaviv *etnaviv,
struct etnaviv_usermem_node *n);
+void etnaviv_retire_vpix(struct etnaviv *etnaviv, struct etnaviv_pixmap *vpix);
+
static inline void etnaviv_enable_bugfix(struct etnaviv *etnaviv,
unsigned int bug)
{