summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-12-04 16:25:59 +0100
committerJakob Bornecrantz <[email protected]>2009-12-04 16:50:20 +0100
commit124f4bc97712acfe7d08807b013a101a4d6276e1 (patch)
tree2c64ffffe147d10e96af03e1753b1a163c2fb634
parentf2e3fc18141d29ede2b711d7ddbb225145be35e3 (diff)
vmware/xorg: Stop video ports on leave vt
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_driver.h2
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_screen.c22
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_video.c32
3 files changed, 56 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
index db6b89b8bcd..85c21ca60e3 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
@@ -66,6 +66,8 @@ Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
+void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
+
/***********************************************************************
* vmw_ioctl.c
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
index 18cb509189a..7c9757cce95 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
@@ -124,6 +124,26 @@ vmw_screen_close(ScrnInfoPtr pScrn)
return TRUE;
}
+static Bool
+vmw_screen_enter_vt(ScrnInfoPtr pScrn)
+{
+ debug_printf("%s: enter\n", __func__);
+
+ return TRUE;
+}
+
+static Bool
+vmw_screen_leave_vt(ScrnInfoPtr pScrn)
+{
+ struct vmw_driver *vmw = vmw_driver(pScrn);
+
+ debug_printf("%s: enter\n", __func__);
+
+ vmw_video_stop_all(pScrn, vmw);
+
+ return TRUE;
+}
+
/*
* Functions for setting up hooks into the xorg state tracker
*/
@@ -142,6 +162,8 @@ vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
ms = modesettingPTR(pScrn);
ms->winsys_screen_init = vmw_screen_init;
ms->winsys_screen_close = vmw_screen_close;
+ ms->winsys_enter_vt = vmw_screen_enter_vt;
+ ms->winsys_leave_vt = vmw_screen_leave_vt;
return TRUE;
}
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
index d62c3b7296f..ef1e2f1e731 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
@@ -361,6 +361,38 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
/*
*-----------------------------------------------------------------------------
*
+ * vmw_video_stop_all --
+ *
+ * Stop all video streams from playing.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All buffers are freed.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
+{
+ struct vmw_video_private *video = vmw->video_priv;
+ int i;
+
+ debug_printf("%s: enter\n", __func__);
+
+ if (!video)
+ return;
+
+ for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
+ vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
+ }
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
* vmw_video_init_adaptor --
*
* Initializes a XF86VideoAdaptor structure with the capabilities and