summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/mga_drv.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/mga_drv.h b/linux/mga_drv.h
index fffcb89b..7a5a1dcc 100644
--- a/linux/mga_drv.h
+++ b/linux/mga_drv.h
@@ -306,9 +306,14 @@ do { \
#define AGE_BUFFER( buf_priv ) \
do { \
drm_mga_freelist_t *entry = (buf_priv)->list_entry; \
- entry->age.head = (dev_priv->prim.tail + \
- dev_priv->primary->offset); \
- entry->age.wrap = dev_priv->sarea_priv->last_wrap; \
+ if ( (buf_priv)->dispatched ) { \
+ entry->age.head = (dev_priv->prim.tail + \
+ dev_priv->primary->offset); \
+ entry->age.wrap = dev_priv->sarea_priv->last_wrap; \
+ } else { \
+ entry->age.head = 0; \
+ entry->age.wrap = 0; \
+ } \
} while (0)