summaryrefslogtreecommitdiffstats
path: root/src/svm
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm')
-rw-r--r--src/svm/svm_fifo.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index b5b26ac479b..ce73be2d0f0 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -45,6 +45,7 @@ typedef enum svm_fifo_tx_ntf_
SVM_FIFO_NO_TX_NOTIF = 0,
SVM_FIFO_WANT_TX_NOTIF = 1,
SVM_FIFO_WANT_TX_NOTIF_IF_FULL = 2,
+ SVM_FIFO_WANT_TX_NOTIF_IF_EMPTY = 4,
} svm_fifo_tx_ntf_t;
typedef struct
@@ -820,15 +821,18 @@ svm_fifo_needs_tx_ntf (svm_fifo_t * f, u32 n_last_deq)
return 0;
else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF)
return 1;
- else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_FULL)
+ if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_FULL)
{
u32 max_deq = svm_fifo_max_dequeue_cons (f);
u32 nitems = f->nitems;
if (!f->has_tx_ntf && max_deq < nitems
&& max_deq + n_last_deq >= nitems)
return 1;
-
- return 0;
+ }
+ if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_EMPTY)
+ {
+ if (!f->has_tx_ntf && svm_fifo_is_empty (f))
+ return 1;
}
return 0;
}