1 diff --git a/configure.ac b/configure.ac
2 index 0631bcc..123356c 100644
5 @@ -118,7 +118,15 @@ if test x$BUILD_VMWGFX = xyes; then
6 PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
8 if test x$BUILD_VMWGFX = xyes; then
9 - PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],[],[BUILD_VMWGFX=no])
11 +# Early versions of mesa 10 forgot to bump the XA major version number in
12 +# the xa_tracker.h header
14 + PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
15 + [PKG_CHECK_EXISTS([xatracker = 2.0.0],
16 + [AC_DEFINE([HAVE_XA_2], 1,
17 + [Has version 2 of XA])])],
18 + [],[BUILD_VMWGFX=no])
22 diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
23 index ea5be19..bb58325 100644
24 --- a/src/vmware_bootstrap.c
25 +++ b/src/vmware_bootstrap.c
26 @@ -256,7 +256,6 @@ VMwarePciProbe (DriverPtr drv,
29 ScrnInfoPtr scrn = NULL;
30 - EntityInfoPtr entity;
32 scrn = xf86ConfigPciEntity(scrn, 0, entity_num, VMWAREPciChipsets,
33 NULL, NULL, NULL, NULL, NULL);
34 @@ -267,7 +266,6 @@ VMwarePciProbe (DriverPtr drv,
38 - entity = xf86GetEntityInfo(entity_num);
39 switch (DEVICE_ID(device)) {
40 case PCI_DEVICE_ID_VMWARE_SVGA2:
41 case PCI_DEVICE_ID_VMWARE_SVGA:
42 diff --git a/src/vmwarevideo.c b/src/vmwarevideo.c
43 index 745c71f..8d7d171 100644
44 --- a/src/vmwarevideo.c
45 +++ b/src/vmwarevideo.c
47 #define VMWARE_VID_MAX_HEIGHT 2048
49 #define VMWARE_VID_NUM_ENCODINGS 1
50 -static XF86VideoEncodingRec vmwareVideoEncodings[] =
51 +static const XF86VideoEncodingRec vmwareVideoEncodings[] =
55 @@ -108,7 +108,7 @@ static XF86ImageRec vmwareVideoImages[] =
58 #define VMWARE_VID_NUM_ATTRIBUTES 2
59 -static XF86AttributeRec vmwareVideoAttributes[] =
60 +static const XF86AttributeRec vmwareVideoAttributes[] =
63 XvGettable | XvSettable,
64 diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
65 index 7de0772..4c74a6b 100644
66 --- a/vmwgfx/vmwgfx_dri2.c
67 +++ b/vmwgfx/vmwgfx_dri2.c
68 @@ -138,6 +138,8 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
70 case DRI2BufferStencil:
71 case DRI2BufferDepthStencil:
75 depth = (format) ? vmwgfx_zs_format_to_depth(format) : 32;
77 @@ -155,6 +157,9 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
84 depth = (format) ? vmwgfx_z_format_to_depth(format) :
87 @@ -201,7 +206,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
91 - if (xa_surface_handle(srf, &buffer->name, &buffer->pitch) != 0)
92 + if (_xa_surface_handle(srf, &buffer->name, &buffer->pitch) != 0)
95 buffer->cpp = xa_format_depth(xa_surface_format(srf)) / 8;
96 @@ -290,6 +295,14 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
100 + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
103 + * This is a fragile protection against HW operations when not master.
104 + * Needs to be blocked higher up in the dri2 code.
106 + if (!pScrn->vtSema)
110 * In driCreateBuffers we dewrap windows into the
111 diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
112 index 7863ba2..4e28097 100644
113 --- a/vmwgfx/vmwgfx_driver.c
114 +++ b/vmwgfx/vmwgfx_driver.c
115 @@ -79,7 +79,7 @@ typedef uint8_t uint8;
117 #define XA_VERSION_MINOR_REQUIRED 0
118 #define XA_VERSION_MAJOR_REQUIRED 1
119 -#define XA_VERSION_MAJOR_COMPAT 1
120 +#define XA_VERSION_MAJOR_COMPAT 2
122 #define DRM_VERSION_MAJOR_REQUIRED 2
123 #define DRM_VERSION_MINOR_REQUIRED 3
124 @@ -617,7 +617,7 @@ vmwgfx_scanout_present(ScreenPtr pScreen, int drm_fd,
128 - if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0) {
129 + if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0) {
130 LogMessage(X_ERROR, "Could not get present surface handle.\n");
133 @@ -657,7 +657,6 @@ void xorg_flush(ScreenPtr pScreen)
135 pixmap = crtc_get_scanout(crtc);
141 @@ -1115,6 +1114,7 @@ drv_leave_vt(VT_FUNC_ARGS_DECL)
143 vmwgfx_cursor_bypass(ms->fd, 0, 0);
144 vmwgfx_disable_scanout(pScrn);
145 + vmwgfx_saa_drop_master(pScrn->pScreen);
147 if (drmDropMaster(ms->fd))
148 xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
149 @@ -1135,6 +1135,8 @@ drv_enter_vt(VT_FUNC_ARGS_DECL)
150 if (!drv_set_master(pScrn))
153 + vmwgfx_saa_set_master(pScrn->pScreen);
155 if (!xf86SetDesiredModes(pScrn))
158 diff --git a/vmwgfx/vmwgfx_output.c b/vmwgfx/vmwgfx_output.c
159 index 4f52f1d..f9e4263 100644
160 --- a/vmwgfx/vmwgfx_output.c
161 +++ b/vmwgfx/vmwgfx_output.c
162 @@ -60,7 +60,7 @@ struct output_private
166 -static char *output_enum_list[] = {
167 +static const char *output_enum_list[] = {
171 diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
172 index 6624a10..986dd06 100644
173 --- a/vmwgfx/vmwgfx_overlay.c
174 +++ b/vmwgfx/vmwgfx_overlay.c
175 @@ -84,7 +84,7 @@ typedef uint8_t uint8;
176 #define VMWARE_VID_MAX_HEIGHT 2048
178 #define VMWARE_VID_NUM_ENCODINGS 1
179 -static XF86VideoEncodingRec vmwareVideoEncodings[] =
180 +static const XF86VideoEncodingRec vmwareVideoEncodings[] =
184 @@ -110,7 +110,7 @@ static XF86ImageRec vmwareVideoImages[] =
187 #define VMWARE_VID_NUM_ATTRIBUTES 2
188 -static XF86AttributeRec vmwareVideoAttributes[] =
189 +static const XF86AttributeRec vmwareVideoAttributes[] =
192 XvGettable | XvSettable,
193 diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
194 index 63df3a1..e76bd09 100644
195 --- a/vmwgfx/vmwgfx_saa.c
196 +++ b/vmwgfx/vmwgfx_saa.c
200 #include <xorg-server.h>
201 +#include <xorgVersion.h>
204 #include <xf86drmMode.h>
205 @@ -76,7 +77,12 @@ vmwgfx_pixmap_remove_damage(PixmapPtr pixmap)
206 if (!spix->damage || vpix->hw || vpix->gmr || vpix->malloc)
209 +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
210 + DamageUnregister(spix->damage);
212 DamageUnregister(&pixmap->drawable, spix->damage);
215 DamageDestroy(spix->damage);
218 @@ -286,7 +292,7 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
219 if (vpix->gmr && vsaa->can_optimize_dma) {
220 uint32_t handle, dummy;
222 - if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
223 + if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
225 if (vmwgfx_dma(0, 0, reg, vpix->gmr, pixmap->devKind, handle,
227 @@ -305,6 +311,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
229 (struct xa_box *) REGION_RECTS(reg),
230 REGION_NUM_RECTS(reg));
232 + xa_context_flush(vsaa->xa_ctx);
234 vmwgfx_dmabuf_unmap(vpix->gmr);
236 @@ -420,6 +428,7 @@ vmwgfx_create_pixmap(struct saa_driver *driver, struct saa_pixmap *spix,
238 WSBMINITLISTHEAD(&vpix->sync_x_head);
239 WSBMINITLISTHEAD(&vpix->scanout_list);
240 + WSBMINITLISTHEAD(&vpix->pixmap_list);
244 @@ -496,6 +505,7 @@ vmwgfx_destroy_pixmap(struct saa_driver *driver, PixmapPtr pixmap)
247 vmwgfx_pixmap_remove_present(vpix);
248 + WSBMLISTDELINIT(&vpix->pixmap_list);
249 WSBMLISTDELINIT(&vpix->sync_x_head);
251 if (vpix->hw_is_dri2_fronts)
252 @@ -624,6 +634,8 @@ vmwgfx_modify_pixmap_header (PixmapPtr pixmap, int w, int h, int depth,
253 int bpp, int devkind, void *pixdata)
255 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap);
256 + ScreenPtr pScreen = pixmap->drawable.pScreen;
257 + struct vmwgfx_saa *vsaa = to_vmwgfx_saa(saa_get_driver(pScreen));
258 unsigned int old_height;
259 unsigned int old_width;
260 unsigned int old_pitch;
261 @@ -667,6 +679,8 @@ vmwgfx_modify_pixmap_header (PixmapPtr pixmap, int w, int h, int depth,
263 vmwgfx_pix_resize(pixmap, old_pitch, old_height, old_width);
264 vmwgfx_pixmap_free_storage(vpix);
265 + WSBMLISTADDTAIL(&vpix->pixmap_list, &vsaa->pixmaps);
270 @@ -683,7 +697,7 @@ vmwgfx_present_prepare(struct vmwgfx_saa *vsaa,
273 if (src_vpix == dst_vpix || !src_vpix->hw ||
274 - xa_surface_handle(src_vpix->hw, &vsaa->src_handle, &dummy) != 0)
275 + _xa_surface_handle(src_vpix->hw, &vsaa->src_handle, &dummy) != 0)
278 REGION_NULL(pScreen, &vsaa->present_region);
279 @@ -856,7 +870,7 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
282 if (!vsaa->xat || !SAA_PM_IS_SOLID(&dst_pixmap->drawable, plane_mask) ||
284 + alu != GXcopy || !vsaa->is_master)
287 src_vpix = vmwgfx_saa_pixmap(src_pixmap);
288 @@ -929,6 +943,7 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
290 if (!vmwgfx_hw_validate(src_pixmap, src_reg)) {
291 xa_copy_done(vsaa->xa_ctx);
292 + xa_context_flush(vsaa->xa_ctx);
296 @@ -1029,6 +1044,7 @@ vmwgfx_copy_done(struct saa_driver *driver)
299 xa_copy_done(vsaa->xa_ctx);
300 + xa_context_flush(vsaa->xa_ctx);
304 @@ -1051,6 +1067,9 @@ vmwgfx_composite_prepare(struct saa_driver *driver, CARD8 op,
306 struct xa_composite *xa_comp;
308 + if (!vsaa->is_master)
311 REGION_NULL(pScreen, &empty);
314 @@ -1175,6 +1194,7 @@ vmwgfx_composite_done(struct saa_driver *driver)
315 struct vmwgfx_saa *vsaa = to_vmwgfx_saa(driver);
317 xa_composite_done(vsaa->xa_ctx);
318 + xa_context_flush(vsaa->xa_ctx);
322 @@ -1209,7 +1229,7 @@ vmwgfx_operation_complete(struct saa_driver *driver,
325 if (vpix->hw && vpix->hw_is_dri2_fronts) {
326 - if (1 && pScrn->vtSema &&
327 + if (pScrn->vtSema &&
328 vmwgfx_upload_to_hw(driver, pixmap, &spix->dirty_shadow)) {
330 REGION_EMPTY(vsaa->pScreen, &spix->dirty_shadow);
331 @@ -1360,7 +1380,9 @@ vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat,
332 vsaa->use_present_opt = direct_presents;
333 vsaa->only_hw_presents = only_hw_presents;
334 vsaa->rendercheck = rendercheck;
335 + vsaa->is_master = TRUE;
336 WSBMINITLISTHEAD(&vsaa->sync_x_list);
337 + WSBMINITLISTHEAD(&vsaa->pixmaps);
339 vsaa->driver = vmwgfx_saa_driver;
340 vsaa->vcomp = vmwgfx_alloc_composite();
341 @@ -1436,7 +1458,7 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_entry *entry)
343 if (!vmwgfx_hw_accel_validate(pixmap, 0, XA_FLAG_SCANOUT, 0, NULL))
345 - if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
346 + if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
348 depth = xa_format_depth(xa_surface_format(vpix->hw));
350 @@ -1510,3 +1532,34 @@ vmwgfx_scanout_unref(struct vmwgfx_screen_entry *entry)
351 entry->pixmap = NULL;
352 pixmap->drawable.pScreen->DestroyPixmap(pixmap);
356 +vmwgfx_saa_set_master(ScreenPtr pScreen)
358 + struct vmwgfx_saa *vsaa = to_vmwgfx_saa(saa_get_driver(pScreen));
360 + vsaa->is_master = TRUE;
364 +vmwgfx_saa_drop_master(ScreenPtr pScreen)
366 + struct vmwgfx_saa *vsaa = to_vmwgfx_saa(saa_get_driver(pScreen));
367 + struct _WsbmListHead *list;
368 + struct vmwgfx_saa_pixmap *vpix;
369 + struct saa_pixmap *spix;
371 + WSBMLISTFOREACH(list, &vsaa->pixmaps) {
372 + vpix = WSBMLISTENTRY(list, struct vmwgfx_saa_pixmap, pixmap_list);
373 + spix = &vpix->base;
378 + (void) vmwgfx_download_from_hw(&vsaa->driver, spix->pixmap,
380 + REGION_EMPTY(draw->pScreen, &spix->dirty_hw);
383 + vsaa->is_master = FALSE;
385 diff --git a/vmwgfx/vmwgfx_saa.h b/vmwgfx/vmwgfx_saa.h
386 index bb8ec96..5e1f40c 100644
387 --- a/vmwgfx/vmwgfx_saa.h
388 +++ b/vmwgfx/vmwgfx_saa.h
389 @@ -54,6 +54,7 @@ struct vmwgfx_saa_pixmap {
390 int hw_is_dri2_fronts;
391 struct _WsbmListHead sync_x_head;
392 struct _WsbmListHead scanout_list;
393 + struct _WsbmListHead pixmap_list;
396 uint32_t staging_add_flags;
397 @@ -107,4 +108,23 @@ Bool
398 vmwgfx_hw_accel_validate(PixmapPtr pixmap, unsigned int depth,
399 uint32_t add_flags, uint32_t remove_flags,
403 +vmwgfx_saa_set_master(ScreenPtr pScreen);
406 +vmwgfx_saa_drop_master(ScreenPtr pScreen);
408 +#if (XA_TRACKER_VERSION_MAJOR <= 1) && !defined(HAVE_XA_2)
410 +#define _xa_surface_handle(_a, _b, _c) xa_surface_handle(_a, _b, _c)
411 +#define xa_context_flush(_a)
415 +#define xa_surface_destroy(_a) xa_surface_unref(_a)
416 +#define _xa_surface_handle(_a, _b, _c) \
417 + xa_surface_handle(_a, xa_handle_type_shared, _b, _c)
419 +#endif /* (XA_TRACKER_VERSION_MAJOR <= 1) */
421 diff --git a/vmwgfx/vmwgfx_saa_priv.h b/vmwgfx/vmwgfx_saa_priv.h
422 index 5f46dee..16583b0 100644
423 --- a/vmwgfx/vmwgfx_saa_priv.h
424 +++ b/vmwgfx/vmwgfx_saa_priv.h
425 @@ -54,8 +54,10 @@ struct vmwgfx_saa {
426 Bool use_present_opt;
427 Bool only_hw_presents;
430 void (*present_flush) (ScreenPtr pScreen);
431 struct _WsbmListHead sync_x_list;
432 + struct _WsbmListHead pixmaps;
433 struct vmwgfx_composite *vcomp;
436 diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
437 index 449266b..9fd8f22 100644
438 --- a/vmwgfx/vmwgfx_tex_video.c
439 +++ b/vmwgfx/vmwgfx_tex_video.c
440 @@ -70,11 +70,11 @@ static const float bt_709[] = {
441 static Atom xvBrightness, xvContrast, xvSaturation, xvHue;
443 #define NUM_TEXTURED_ATTRIBUTES 4
444 -static XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = {
445 - {XvSettable | XvGettable, -1000, 1000, "XV_BRIGHTNESS"},
446 - {XvSettable | XvGettable, -1000, 1000, "XV_CONTRAST"},
447 - {XvSettable | XvGettable, -1000, 1000, "XV_SATURATION"},
448 - {XvSettable | XvGettable, -1000, 1000, "XV_HUE"}
449 +static const XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = {
450 + {XvSettable | XvGettable, -1000, 1000, "XV_BRIGHTNESS"},
451 + {XvSettable | XvGettable, -1000, 1000, "XV_CONTRAST"},
452 + {XvSettable | XvGettable, -1000, 1000, "XV_SATURATION"},
453 + {XvSettable | XvGettable, -1000, 1000, "XV_HUE"}
456 #define NUM_FORMATS 3
457 @@ -82,7 +82,7 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {
458 {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
461 -static XF86VideoEncodingRec DummyEncoding[1] = {
462 +static const XF86VideoEncodingRec DummyEncoding[1] = {
466 @@ -111,8 +111,7 @@ struct xorg_xv_port_priv {
470 - struct vmwgfx_dmabuf *bounce[2][3];
471 - struct xa_surface *yuv[3];
472 + struct xa_surface *yuv[2][3];
476 @@ -198,14 +197,10 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
479 for (i=0; i<3; ++i) {
480 - if (priv->yuv[i]) {
481 - xa_surface_destroy(priv->yuv[i]);
482 - priv->yuv[i] = NULL;
484 for (j=0; j<2; ++j) {
485 - if (priv->bounce[j][i]) {
486 - vmwgfx_dmabuf_destroy(priv->bounce[j][i]);
487 - priv->bounce[0][i] = NULL;
488 + if (priv->yuv[i]) {
489 + xa_surface_destroy(priv->yuv[j][i]);
490 + priv->yuv[j][i] = NULL;
494 @@ -297,11 +292,9 @@ static int
495 check_yuv_surfaces(struct xorg_xv_port_priv *priv, int id,
496 int width, int height)
498 - struct xa_surface **yuv = priv->yuv;
499 - struct vmwgfx_dmabuf **bounce = priv->bounce[priv->current_set];
500 + struct xa_surface **yuv = priv->yuv[priv->current_set];
505 for (i=0; i<3; ++i) {
507 @@ -334,19 +327,6 @@ check_yuv_surfaces(struct xorg_xv_port_priv *priv, int id,
511 - size = width * height;
513 - if (bounce[i] && (bounce[i]->size < size ||
514 - bounce[i]->size > 2*size)) {
515 - vmwgfx_dmabuf_destroy(bounce[i]);
520 - bounce[i] = vmwgfx_dmabuf_alloc(priv->drm_fd, size);
527 @@ -413,28 +393,20 @@ copy_packed_data(ScrnInfoPtr pScrn,
528 unsigned short w, unsigned short h)
531 - struct vmwgfx_dmabuf **bounce = port->bounce[port->current_set];
532 + struct xa_surface **yuv = port->yuv[port->current_set];
533 char *ymap, *vmap, *umap;
534 unsigned char y1, y2, u, v;
535 int yidx, uidx, vidx;
536 int y_array_size = w * h;
540 - * Here, we could use xa_surface_[map|unmap], but given the size of
541 - * the yuv textures, that could stress the xa tracker dma buffer pool,
542 - * particularaly with multiple videos rendering simultaneously.
544 - * Instead, cheat and allocate vmwgfx dma buffers directly.
547 - ymap = (char *)vmwgfx_dmabuf_map(bounce[0]);
548 + ymap = xa_surface_map(port->r, yuv[0], XA_MAP_WRITE);
551 - umap = (char *)vmwgfx_dmabuf_map(bounce[1]);
552 + umap = xa_surface_map(port->r, yuv[1], XA_MAP_WRITE);
555 - vmap = (char *)vmwgfx_dmabuf_map(bounce[2]);
556 + vmap = xa_surface_map(port->r, yuv[2], XA_MAP_WRITE);
560 @@ -444,16 +416,16 @@ copy_packed_data(ScrnInfoPtr pScrn,
563 int pitches[3], offsets[3];
564 - unsigned char *y, *u, *v;
565 + unsigned char *yp, *up, *vp;
566 query_image_attributes(pScrn, FOURCC_YV12,
567 &w, &h, pitches, offsets);
569 - y = buf + offsets[0];
570 - v = buf + offsets[1];
571 - u = buf + offsets[2];
572 - memcpy(ymap, y, w*h);
573 - memcpy(vmap, v, w*h/4);
574 - memcpy(umap, u, w*h/4);
575 + yp = buf + offsets[0];
576 + vp = buf + offsets[1];
577 + up = buf + offsets[2];
578 + memcpy(ymap, yp, w*h);
579 + memcpy(vmap, vp, w*h/4);
580 + memcpy(umap, up, w*h/4);
584 @@ -493,64 +465,11 @@ copy_packed_data(ScrnInfoPtr pScrn,
588 - vmwgfx_dmabuf_unmap(bounce[2]);
589 + xa_surface_unmap(yuv[2]);
591 - vmwgfx_dmabuf_unmap(bounce[1]);
592 + xa_surface_unmap(yuv[1]);
594 - vmwgfx_dmabuf_unmap(bounce[0]);
596 - if (ret == Success) {
597 - struct xa_surface *srf;
598 - struct vmwgfx_dmabuf *buf;
600 - unsigned int stride;
609 - REGION_INIT(pScrn->pScreen, ®, &box, 1);
611 - for (i=0; i<3; ++i) {
612 - srf = port->yuv[i];
633 - REGION_RESET(pScrn->pScreen, ®, &box);
636 - if (xa_surface_handle(srf, &handle, &stride) != 0) {
641 - if (vmwgfx_dma(0, 0, ®, buf, w, handle, 1) != 0) {
646 - REGION_UNINIT(pScrn->pScreen, ®);
648 + xa_surface_unmap(yuv[0]);
652 @@ -609,7 +528,8 @@ display_video(ScreenPtr pScreen, struct xorg_xv_port_priv *pPriv, int id,
653 (struct xa_box *)REGION_RECTS(dstRegion),
654 REGION_NUM_RECTS(dstRegion),
656 - vpix->hw, pPriv->yuv);
658 + pPriv->yuv[pPriv->current_set ]);
660 saa_pixmap_dirty(pPixmap, TRUE, dstRegion);
661 DamageRegionProcessPending(&pPixmap->drawable);
662 diff --git a/vmwgfx/vmwgfx_xa_surface.c b/vmwgfx/vmwgfx_xa_surface.c
663 index 8b30e45..2f23c57 100644
664 --- a/vmwgfx/vmwgfx_xa_surface.c
665 +++ b/vmwgfx/vmwgfx_xa_surface.c
666 @@ -362,6 +362,12 @@ vmwgfx_hw_accel_validate(PixmapPtr pixmap, unsigned int depth,
668 vmwgfx_hw_dri2_validate(PixmapPtr pixmap, unsigned int depth)
670 + struct vmwgfx_saa *vsaa =
671 + to_vmwgfx_saa(saa_get_driver(pixmap->drawable.pScreen));
673 + if (!vsaa->is_master)
676 return (vmwgfx_hw_dri2_stage(pixmap, depth) &&
677 vmwgfx_hw_commit(pixmap) &&
678 vmwgfx_hw_validate(pixmap, NULL));