summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/rbug/rbug_connection.c1
-rw-r--r--src/gallium/drivers/svga/svga_screen_cache.c9
-rw-r--r--src/gallium/drivers/svga/svga_screen_texture.c37
-rw-r--r--src/gallium/drivers/svga/svga_screen_texture.h9
-rw-r--r--src/gallium/drivers/svga/svga_state_constants.c3
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c11
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c14
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h2
-rw-r--r--src/gallium/state_trackers/xorg/xorg_xv.c127
-rw-r--r--src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h6
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_driver.h4
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c31
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_screen.c22
-rw-r--r--src/gallium/winsys/drm/vmware/xorg/vmw_video.c40
14 files changed, 226 insertions, 90 deletions
diff --git a/src/gallium/auxiliary/rbug/rbug_connection.c b/src/gallium/auxiliary/rbug/rbug_connection.c
index 52acb700af..ae4e27f9f6 100644
--- a/src/gallium/auxiliary/rbug/rbug_connection.c
+++ b/src/gallium/auxiliary/rbug/rbug_connection.c
@@ -87,6 +87,7 @@ rbug_get_message(struct rbug_connection *c, uint32_t *serial)
if (!data) {
return NULL;
}
+ data->opcode = 0;
do {
uint8_t *ptr = ((uint8_t*)data) + read;
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c
index 8a06383f61..eff36e0bcc 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.c
+++ b/src/gallium/drivers/svga/svga_screen_cache.c
@@ -277,6 +277,15 @@ svga_screen_surface_create(struct svga_screen *svgascreen,
while(size < key->size.width)
size <<= 1;
key->size.width = size;
+ /* Since we're reusing buffers we're effectively transforming all
+ * of them into dynamic buffers.
+ *
+ * It would be nice to not cache long lived static buffers. But there
+ * is no way to detect the long lived from short lived ones yet. A
+ * good heuristic would be buffer size.
+ */
+ key->flags &= ~SVGA3D_SURFACE_HINT_STATIC;
+ key->flags |= SVGA3D_SURFACE_HINT_DYNAMIC;
}
handle = svga_screen_cache_lookup(svgascreen, key);
diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c
index 3e2cb1a16d..3700a80bf1 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.c
+++ b/src/gallium/drivers/svga/svga_screen_texture.c
@@ -525,7 +525,7 @@ svga_texture_view_surface(struct pipe_context *pipe,
{
struct svga_screen *ss = svga_screen(tex->base.screen);
struct svga_winsys_surface *handle;
- int i, j;
+ uint32_t i, j;
unsigned z_offset = 0;
SVGA_DBG(DEBUG_PERF,
@@ -657,13 +657,11 @@ svga_get_tex_surface(struct pipe_screen *screen,
s->real_level = 0;
s->real_zslice = 0;
} else {
- struct svga_winsys_screen *sws = svga_winsys_screen(screen);
-
SVGA_DBG(DEBUG_VIEWS, "svga: Surface view: no %p, level %u, face %u, z %u, %p\n",
pt, level, face, zslice, s);
memset(&s->key, 0, sizeof s->key);
- sws->surface_reference(sws, &s->handle, tex->handle);
+ s->handle = tex->handle;
s->real_face = face;
s->real_level = level;
s->real_zslice = zslice;
@@ -677,11 +675,14 @@ static void
svga_tex_surface_destroy(struct pipe_surface *surf)
{
struct svga_surface *s = svga_surface(surf);
+ struct svga_texture *t = svga_texture(surf->texture);
struct svga_screen *ss = svga_screen(surf->texture->screen);
- SVGA_DBG(DEBUG_DMA, "unref sid %p (tex surface)\n", s->handle);
- assert(s->key.cachable == 0);
- svga_screen_surface_destroy(ss, &s->key, &s->handle);
+ if(s->handle != t->handle) {
+ SVGA_DBG(DEBUG_DMA, "unref sid %p (tex surface)\n", s->handle);
+ svga_screen_surface_destroy(ss, &s->key, &s->handle);
+ }
+
pipe_texture_reference(&surf->texture, NULL);
FREE(surf);
}
@@ -909,7 +910,6 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt,
unsigned min_lod, unsigned max_lod)
{
struct svga_screen *ss = svga_screen(pt->screen);
- struct svga_winsys_screen *sws = ss->sws;
struct svga_texture *tex = svga_texture(pt);
struct svga_sampler_view *sv = NULL;
SVGA3dSurfaceFormat format = svga_translate_format(pt->format);
@@ -960,7 +960,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt,
sv = CALLOC_STRUCT(svga_sampler_view);
pipe_reference_init(&sv->reference, 1);
- sv->texture = tex;
+ pipe_texture_reference(&sv->texture, pt);
sv->min_lod = min_lod;
sv->max_lod = max_lod;
@@ -975,7 +975,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt,
pt->depth0,
pt->last_level);
sv->key.cachable = 0;
- sws->surface_reference(sws, &sv->handle, tex->handle);
+ sv->handle = tex->handle;
return sv;
}
@@ -998,7 +998,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt,
if (!sv->handle) {
assert(0);
sv->key.cachable = 0;
- sws->surface_reference(sws, &sv->handle, tex->handle);
+ sv->handle = tex->handle;
return sv;
}
@@ -1012,14 +1012,14 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt,
void
svga_validate_sampler_view(struct svga_context *svga, struct svga_sampler_view *v)
{
- struct svga_texture *tex = v->texture;
+ struct svga_texture *tex = svga_texture(v->texture);
unsigned numFaces;
unsigned age = 0;
int i, k;
assert(svga);
- if (v->handle == v->texture->handle)
+ if (v->handle == tex->handle)
return;
age = tex->age;
@@ -1047,11 +1047,14 @@ svga_validate_sampler_view(struct svga_context *svga, struct svga_sampler_view *
void
svga_destroy_sampler_view_priv(struct svga_sampler_view *v)
{
- struct svga_screen *ss = svga_screen(v->texture->base.screen);
-
- SVGA_DBG(DEBUG_DMA, "unref sid %p (sampler view)\n", v->handle);
- svga_screen_surface_destroy(ss, &v->key, &v->handle);
+ struct svga_texture *tex = svga_texture(v->texture);
+ if(v->handle != tex->handle) {
+ struct svga_screen *ss = svga_screen(v->texture->screen);
+ SVGA_DBG(DEBUG_DMA, "unref sid %p (sampler view)\n", v->handle);
+ svga_screen_surface_destroy(ss, &v->key, &v->handle);
+ }
+ pipe_texture_reference(&v->texture, NULL);
FREE(v);
}
diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h
index 727f2c51d2..89ae24219f 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.h
+++ b/src/gallium/drivers/svga/svga_screen_texture.h
@@ -61,7 +61,7 @@ struct svga_sampler_view
{
struct pipe_reference reference;
- struct svga_texture *texture;
+ struct pipe_texture *texture;
int min_lod;
int max_lod;
@@ -94,6 +94,13 @@ struct svga_texture
* operation.
*/
struct svga_host_surface_cache_key key;
+
+ /**
+ * Handle for the host side surface.
+ *
+ * This handle is owned by this texture. Views should hold on to a reference
+ * to this texture and never destroy this handle directly.
+ */
struct svga_winsys_surface *handle;
};
diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c
index 209ed28245..6b0e511cec 100644
--- a/src/gallium/drivers/svga/svga_state_constants.c
+++ b/src/gallium/drivers/svga/svga_state_constants.c
@@ -231,7 +231,8 @@ static int emit_vs_consts( struct svga_context *svga,
struct svga_tracked_state svga_hw_vs_parameters =
{
"hw vs params",
- (SVGA_NEW_VS_CONST_BUFFER |
+ (SVGA_NEW_PRESCALE |
+ SVGA_NEW_VS_CONST_BUFFER |
SVGA_NEW_ZERO_STRIDE |
SVGA_NEW_VS_RESULT),
emit_vs_consts
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
index 03bc6e37c9..82dae194c4 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -256,7 +256,7 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
return;
err_bo_destroy:
- kms_bo_destroy(crtcp->cursor_bo);
+ kms_bo_destroy(&crtcp->cursor_bo);
}
#endif
@@ -304,10 +304,8 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc)
pipe_texture_reference(&crtcp->cursor_tex, NULL);
#ifdef HAVE_LIBKMS
if (crtcp->cursor_bo)
- kms_bo_destroy(crtcp->cursor_bo);
+ kms_bo_destroy(&crtcp->cursor_bo);
#endif
-
- xfree(crtcp);
}
/*
@@ -319,11 +317,12 @@ crtc_destroy(xf86CrtcPtr crtc)
{
struct crtc_private *crtcp = crtc->driver_private;
- if (crtcp->cursor_tex)
- pipe_texture_reference(&crtcp->cursor_tex, NULL);
+ xorg_crtc_cursor_destroy(crtc);
drmModeFreeCrtc(crtcp->drm_crtc);
+
xfree(crtcp);
+ crtc->driver_private = NULL;
}
static const xf86CrtcFuncsRec crtc_funcs = {
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index da86295c31..5391595891 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -260,8 +260,7 @@ drv_close_resource_management(ScrnInfoPtr pScrn)
#ifdef HAVE_LIBKMS
if (ms->kms)
- kms_destroy(ms->kms);
- ms->kms = NULL;
+ kms_destroy(&ms->kms);
#endif
return TRUE;
@@ -688,6 +687,9 @@ drv_leave_vt(int scrnIndex, int flags)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int o;
+ if (ms->winsys_leave_vt)
+ ms->winsys_leave_vt(pScrn);
+
for (o = 0; o < config->num_crtc; o++) {
xf86CrtcPtr crtc = config->crtc[o];
@@ -750,6 +752,9 @@ drv_enter_vt(int scrnIndex, int flags)
if (!xf86SetDesiredModes(pScrn))
return FALSE;
+ if (ms->winsys_enter_vt)
+ ms->winsys_enter_vt(pScrn);
+
return TRUE;
}
@@ -898,8 +903,7 @@ drv_destroy_front_buffer_kms(ScrnInfoPtr pScrn)
return TRUE;
kms_bo_unmap(ms->root_bo);
- kms_bo_destroy(ms->root_bo);
- ms->root_bo = NULL;
+ kms_bo_destroy(&ms->root_bo);
return TRUE;
}
@@ -945,7 +949,7 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn)
return TRUE;
err_destroy:
- kms_bo_destroy(bo);
+ kms_bo_destroy(&bo);
return FALSE;
}
diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h
index d5fc18448e..c0cfbe6061 100644
--- a/src/gallium/state_trackers/xorg/xorg_tracker.h
+++ b/src/gallium/state_trackers/xorg/xorg_tracker.h
@@ -117,6 +117,8 @@ typedef struct _modesettingRec
/* winsys hocks */
Bool (*winsys_screen_init)(ScrnInfoPtr pScr);
Bool (*winsys_screen_close)(ScrnInfoPtr pScr);
+ Bool (*winsys_enter_vt)(ScrnInfoPtr pScr);
+ Bool (*winsys_leave_vt)(ScrnInfoPtr pScr);
void *winsys_priv;
#ifdef DRM_MODE_FEATURE_DIRTYFB
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index c965e4b9b5..92ca5e32ef 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -212,17 +212,67 @@ check_yuv_textures(struct xorg_xv_port_priv *priv, int width, int height)
return Success;
}
+static int
+query_image_attributes(ScrnInfoPtr pScrn,
+ int id,
+ unsigned short *w, unsigned short *h,
+ int *pitches, int *offsets)
+{
+ int size, tmp;
+
+ if (*w > IMAGE_MAX_WIDTH)
+ *w = IMAGE_MAX_WIDTH;
+ if (*h > IMAGE_MAX_HEIGHT)
+ *h = IMAGE_MAX_HEIGHT;
+
+ *w = (*w + 1) & ~1;
+ if (offsets)
+ offsets[0] = 0;
+
+ switch (id) {
+ case FOURCC_YV12:
+ *h = (*h + 1) & ~1;
+ size = (*w + 3) & ~3;
+ if (pitches) {
+ pitches[0] = size;
+ }
+ size *= *h;
+ if (offsets) {
+ offsets[1] = size;
+ }
+ tmp = ((*w >> 1) + 3) & ~3;
+ if (pitches) {
+ pitches[1] = pitches[2] = tmp;
+ }
+ tmp *= (*h >> 1);
+ size += tmp;
+ if (offsets) {
+ offsets[2] = size;
+ }
+ size += tmp;
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ size = *w << 1;
+ if (pitches)
+ pitches[0] = size;
+ size *= *h;
+ break;
+ }
+
+ return size;
+}
+
static void
copy_packed_data(ScrnInfoPtr pScrn,
struct xorg_xv_port_priv *port,
int id,
unsigned char *buf,
- int srcPitch,
int left,
int top,
- int w, int h)
+ unsigned short w, unsigned short h)
{
- unsigned char *src;
int i, j;
struct pipe_texture **dst = port->yuv[port->current_set];
struct pipe_transfer *ytrans, *utrans, *vtrans;
@@ -232,8 +282,6 @@ copy_packed_data(ScrnInfoPtr pScrn,
int yidx, uidx, vidx;
int y_array_size = w * h;
- src = buf + (top * srcPitch) + (left << 1);
-
ytrans = screen->get_tex_transfer(screen, dst[0],
0, 0, 0,
PIPE_TRANSFER_WRITE,
@@ -255,15 +303,22 @@ copy_packed_data(ScrnInfoPtr pScrn,
switch (id) {
case FOURCC_YV12: {
- for (i = 0; i < w; ++i) {
- for (j = 0; j < h; ++j) {
- /*XXX use src? */
- y1 = buf[j*w + i];
- u = buf[(j/2) * (w/2) + i/2 + y_array_size];
- v = buf[(j/2) * (w/2) + i/2 + y_array_size + y_array_size/4];
- ymap[yidx++] = y1;
- umap[uidx++] = u;
- vmap[vidx++] = v;
+ int pitches[3], offsets[3];
+ unsigned char *y, *u, *v;
+ query_image_attributes(pScrn, FOURCC_YV12,
+ &w, &h, pitches, offsets);
+
+ y = buf + offsets[0];
+ v = buf + offsets[1];
+ u = buf + offsets[2];
+ for (i = 0; i < h; ++i) {
+ for (j = 0; j < w; ++j) {
+ int yoffset = (w*i+j);
+ int ii = (i|1), jj = (j|1);
+ int vuoffset = (w/2)*(ii/2) + (jj/2);
+ ymap[yidx++] = y[yoffset];
+ umap[uidx++] = u[vuoffset];
+ vmap[vidx++] = v[vuoffset];
}
}
}
@@ -510,7 +565,6 @@ put_image(ScrnInfoPtr pScrn,
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
PixmapPtr pPixmap;
INT32 x1, x2, y1, y2;
- int srcPitch;
BoxRec dstBox;
int ret;
@@ -529,21 +583,12 @@ put_image(ScrnInfoPtr pScrn,
width, height))
return Success;
- switch (id) {
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- case FOURCC_YV12:
- default:
- srcPitch = width << 1;
- break;
- }
-
ret = check_yuv_textures(pPriv, width, height);
if (ret)
return ret;
- copy_packed_data(pScrn, pPriv, id, buf, srcPitch,
+ copy_packed_data(pScrn, pPriv, id, buf,
src_x, src_y, width, height);
if (pDraw->type == DRAWABLE_WINDOW) {
@@ -561,38 +606,6 @@ put_image(ScrnInfoPtr pScrn,
return Success;
}
-static int
-query_image_attributes(ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets)
-{
- int size;
-
- if (*w > IMAGE_MAX_WIDTH)
- *w = IMAGE_MAX_WIDTH;
- if (*h > IMAGE_MAX_HEIGHT)
- *h = IMAGE_MAX_HEIGHT;
-
- *w = (*w + 1) & ~1;
- if (offsets)
- offsets[0] = 0;
-
- switch (id) {
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- case FOURCC_YV12:
- default:
- size = *w << 1;
- if (pitches)
- pitches[0] = size;
- size *= *h;
- break;
- }
-
- return size;
-}
-
static struct xorg_xv_port_priv *
port_priv_create(struct xorg_renderer *r)
{
diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
index 56070a1ba1..89bbf17ce9 100644
--- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
+++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
@@ -52,14 +52,16 @@
/**
* DRM_VMW_GET_PARAM - get device information.
*
- * Currently we support only one parameter:
- *
* DRM_VMW_PARAM_FIFO_OFFSET:
* Offset to use to map the first page of the FIFO read-only.
* The fifo is mapped using the mmap() system call on the drm device.
+ *
+ * DRM_VMW_PARAM_OVERLAY_IOCTL:
+ * Does the driver support the overlay ioctl.
*/
#define DRM_VMW_PARAM_FIFO_OFFSET 0
+#define DRM_VMW_PARAM_OVERLAY_IOCTL 1
/**
* struct drm_vmw_getparam_arg
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
index db6b89b8bc..7265f767a5 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
@@ -66,11 +66,15 @@ 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
*/
+int vmw_ioctl_supports_overlay(struct vmw_driver *vmw);
+
int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot);
struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw,
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c
index c84368bab7..0d1a0fcee6 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c
@@ -56,6 +56,37 @@ struct vmw_dma_buffer
uint32_t size;
};
+static int
+vmw_ioctl_get_param(struct vmw_driver *vmw, uint32_t param, uint64_t *out)
+{
+ struct drm_vmw_getparam_arg gp_arg;
+ int ret;
+
+ memset(&gp_arg, 0, sizeof(gp_arg));
+ gp_arg.param = param;
+ ret = drmCommandWriteRead(vmw->fd, DRM_VMW_GET_PARAM,
+ &gp_arg, sizeof(gp_arg));
+
+ if (ret == 0) {
+ *out = gp_arg.value;
+ }
+
+ return ret;
+}
+
+int
+vmw_ioctl_supports_overlay(struct vmw_driver *vmw)
+{
+ uint64_t value;
+ int ret;
+
+ ret = vmw_ioctl_get_param(vmw, DRM_VMW_PARAM_OVERLAY_IOCTL, &value);
+ if (ret)
+ return ret;
+
+ return value ? 0 : -ENOSYS;
+}
+
int
vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot)
{
diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
index 18cb509189..7c9757cce9 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 d62c3b7296..5674e4f352 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c
@@ -276,6 +276,11 @@ vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
debug_printf("%s: enter\n", __func__);
+ if (vmw_ioctl_supports_overlay(vmw) != 0) {
+ debug_printf("No overlay ioctl support\n");
+ return FALSE;
+ }
+
numAdaptors = xf86XVListGenericAdaptors(pScrn, &overlayAdaptors);
newAdaptor = vmw_video_init_adaptor(pScrn, vmw);
@@ -346,7 +351,8 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
return TRUE;
for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) {
- vmw_video_port_cleanup(pScrn, &video->port[i]);
+ /* make sure the port is stoped as well */
+ vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
}
/* XXX: I'm sure this function is missing code for turning off Xv */
@@ -361,6 +367,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