summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm/vmware/xorg/vmw_video.c')
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_video.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
index 5674e4f352..c0a7ac9e45 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
@@ -273,11 +273,17 @@ vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
XF86VideoAdaptorPtr *overlayAdaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr newAdaptor = NULL;
int numAdaptors;
+ unsigned int ntot, nfree;
debug_printf("%s: enter\n", __func__);
- if (vmw_ioctl_supports_overlay(vmw) != 0) {
- debug_printf("No overlay ioctl support\n");
+ if (vmw_ioctl_num_streams(vmw, &ntot, &nfree) != 0) {
+ debug_printf("No stream ioctl support\n");
+ return FALSE;
+ }
+
+ if (nfree == 0) {
+ debug_printf("No free streams\n");
return FALSE;
}
@@ -353,6 +359,7 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
/* make sure the port is stoped as well */
vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
+ vmw_ioctl_unref_stream(vmw, video->port[i].streamId);
}
/* XXX: I'm sure this function is missing code for turning off Xv */
@@ -448,7 +455,7 @@ vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
adaptor->pPortPrivates = video->port_ptr;
for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
- video->port[i].streamId = i;
+ vmw_ioctl_claim_stream(vmw, &video->port[i].streamId);
video->port[i].play = vmw_video_port_init;
video->port[i].flags = SVGA_VIDEO_FLAG_COLORKEY;
video->port[i].colorKey = VMWARE_VIDEO_COLORKEY;