Mesa (mesa_7_7_branch): vmware/xorg: Stop video ports on leave vt

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Tue Dec 8 06:53:36 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 124f4bc97712acfe7d08807b013a101a4d6276e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=124f4bc97712acfe7d08807b013a101a4d6276e1

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Fri Dec  4 16:25:59 2009 +0100

vmware/xorg: Stop video ports on leave vt

---

 src/gallium/winsys/drm/vmware/xorg/vmw_driver.h |    2 +
 src/gallium/winsys/drm/vmware/xorg/vmw_screen.c |   22 +++++++++++++++
 src/gallium/winsys/drm/vmware/xorg/vmw_video.c  |   32 +++++++++++++++++++++++
 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 db6b89b..85c21ca 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 18cb509..7c9757c 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 d62c3b7..ef1e2f1 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



More information about the mesa-commit mailing list