summaryrefslogtreecommitdiff
path: root/vmwgfx
diff options
context:
space:
mode:
Diffstat (limited to 'vmwgfx')
-rw-r--r--vmwgfx/Makefile.am5
-rw-r--r--vmwgfx/vmwgfx_dri2.c21
-rw-r--r--vmwgfx/vmwgfx_driver.c3
-rw-r--r--vmwgfx/vmwgfx_driver.h7
-rw-r--r--vmwgfx/vmwgfx_overlay.c6
-rw-r--r--vmwgfx/vmwgfx_saa.c5
6 files changed, 21 insertions, 26 deletions
diff --git a/vmwgfx/Makefile.am b/vmwgfx/Makefile.am
index 5efa8cd..db58405 100644
--- a/vmwgfx/Makefile.am
+++ b/vmwgfx/Makefile.am
@@ -1,7 +1,8 @@
vmwgfx_drv_la_LTLIBRARIES = vmwgfx_drv.la
vmwgfx_drv_la_LDFLAGS = -module -avoid-version
-vmwgfx_drv_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) @LIBDRM_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/saa
-vmwgfx_drv_la_LIBADD = @LIBDRM_LIBS@ $(top_srcdir)/saa/.libs/libsaa.la -lxatracker
+vmwgfx_drv_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) @LIBDRM_CFLAGS@ @XATRACKER_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/saa
+vmwgfx_drv_la_LIBADD = @LIBDRM_LIBS@ $(top_srcdir)/saa/.libs/libsaa.la\
+ @XATRACKER_LIBS@
vmwgfx_drv_ladir = @moduledir@/drivers
vmwgfx_drv_la_SOURCES = \
diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
index 748cbc8..b80c813 100644
--- a/vmwgfx/vmwgfx_dri2.c
+++ b/vmwgfx/vmwgfx_dri2.c
@@ -42,14 +42,7 @@
#include "gc.h"
#include "vmwgfx_saa.h"
-struct vmwgfx_dri2_priv {
- unsigned int srf_count;
- struct xa_surface *srf[20];
-};
-
-DevPrivateKeyRec dri2_pixmap_index;
-DevPrivateKeyRec dri2_window_index;
-
+#ifdef DRI2
typedef struct {
int refcount;
PixmapPtr pPixmap;
@@ -322,7 +315,6 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
FreeScratchGC(gc);
}
-
Bool
xorg_dri2_init(ScreenPtr pScreen)
{
@@ -339,16 +331,6 @@ xorg_dri2_init(ScreenPtr pScreen)
minor = 0;
}
- if (!dixRegisterPrivateKey(&dri2_pixmap_index, PRIVATE_PIXMAP, 0)) {
- LogMessage(X_ERROR, "Failed to register vmwgfx dri2 private.\n");
- return FALSE;
- }
-
- if (!dixRegisterPrivateKey(&dri2_window_index, PRIVATE_WINDOW, 0)) {
- LogMessage(X_ERROR, "Failed to register vmwgfx dri2 private.\n");
- return FALSE;
- }
-
dri2info.version = min(DRI2INFOREC_VERSION, 3);
dri2info.fd = ms->fd;
@@ -369,5 +351,6 @@ xorg_dri2_close(ScreenPtr pScreen)
{
DRI2CloseScreen(pScreen);
}
+#endif
/* vim: set sw=4 ts=8 sts=4: */
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index edf384d..048534e 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -457,6 +457,9 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
#ifdef DRI2
if (!xf86LoadSubModule(pScrn, "dri2"))
return FALSE;
+#else
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Driver compiled without dri2 support."
#endif
return TRUE;
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
index 4339fb7..cb92bc9 100644
--- a/vmwgfx/vmwgfx_driver.h
+++ b/vmwgfx/vmwgfx_driver.h
@@ -45,6 +45,13 @@
#include <xf86xv.h>
#include <xa_tracker.h>
+#ifdef DRI2
+#include <dri2.h>
+#if (!defined(DRI2INFOREC_VERSION) || (DRI2INFOREC_VERSION < 3))
+#undef DRI2
+#endif
+#endif
+
#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
#define debug_printf(...)
diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
index d161023..28df983 100644
--- a/vmwgfx/vmwgfx_overlay.c
+++ b/vmwgfx/vmwgfx_overlay.c
@@ -410,13 +410,13 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
drw_w, drw_h, format, buf, width, height, clipBoxes);
- out_bad_size:
- (void) vmwgfx_unref_stream(port->drm_fd, port->streamId);
-
out_no_buffer:
while(i-- != 0) {
vmw_video_buffer_free(&port->bufs[i]);
}
+ out_bad_size:
+ (void) vmwgfx_unref_stream(port->drm_fd, port->streamId);
+
return ret;
}
diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 3122353..5b84409 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -82,10 +82,11 @@ vmwgfx_pixmap_add_damage(PixmapPtr pixmap)
box.y1 = 0;
box.y2 = draw->height;
- if (vpix->hw)
+ if (vpix->hw) {
REGION_INIT(draw->pScreen, &spix->dirty_hw, &box, 1);
- else
+ } else {
REGION_INIT(draw->pScreen, &spix->dirty_shadow, &box, 1);
+ }
return TRUE;
}