summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-07-15 14:37:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-07-16 10:31:58 +0100
commitd48d584a822ae5adae64f6d5f09faa4ac9b8de73 (patch)
tree8a91bbb98afa10d9dfe5bf8ee507614b413272cf /src
parent24bdfe0d5eb4e890e9c63bbb4617efaa0768ab7f (diff)
video: Free the buffers immediately after turning off.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/intel_video.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/src/intel_video.c b/src/intel_video.c
index 1fe3a377..197cb795 100644
--- a/src/intel_video.c
+++ b/src/intel_video.c
@@ -78,14 +78,10 @@
#include "intel_hwmc.h"
#endif
-#define OFF_DELAY 250 /* milliseconds */
-#define FREE_DELAY 15000
+#define OFF_DELAY 250 /* milliseconds */
-#define OFF_TIMER 0x01
-#define FREE_TIMER 0x02
-#define CLIENT_VIDEO_ON 0x04
-
-#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
+#define OFF_TIMER 0x01
+#define CLIENT_VIDEO_ON 0x02
static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr);
static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr);
@@ -1774,28 +1770,13 @@ intel_video_block_handler(intel_screen_private *intel)
return;
adaptor_priv = intel_get_adaptor_private(intel);
-
- if (adaptor_priv->videoStatus & TIMER_MASK) {
-#if 1
+ if (adaptor_priv->videoStatus & OFF_TIMER) {
Time now = currentTime.milliseconds;
-#else
- UpdateCurrentTime();
-#endif
- if (adaptor_priv->videoStatus & OFF_TIMER) {
- if (adaptor_priv->offTime < now) {
- /* Turn off the overlay */
- OVERLAY_DEBUG("BLOCKHANDLER\n");
-
- drmmode_overlay_off(intel);
-
- adaptor_priv->videoStatus = FREE_TIMER;
- adaptor_priv->freeTime = now + FREE_DELAY;
- }
- } else { /* FREE_TIMER */
- if (adaptor_priv->freeTime < now) {
- intel_free_video_buffers(adaptor_priv);
- adaptor_priv->videoStatus = 0;
- }
+ if (adaptor_priv->offTime < now) {
+ /* Turn off the overlay */
+ drmmode_overlay_off(intel);
+ intel_free_video_buffers(adaptor_priv);
+ adaptor_priv->videoStatus = 0;
}
}
}