diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-06-16 21:21:25 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-06-16 21:31:44 +0200 |
commit | d28613e557fcdc4fc69f9a138a8c5fc909a719f5 (patch) | |
tree | 1b4971d9c34a8eed7a6861071ae5167e1df5bd0e | |
parent | 84166d4b457244bcc2f5ace63702d594d602d0c2 (diff) |
vmwgfx: Fix up driver build process for Xserver >= 1.7.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | saa/saa.c | 1 | ||||
-rw-r--r-- | saa/saa_accel.c | 7 | ||||
-rw-r--r-- | saa/saa_priv.h | 4 | ||||
-rw-r--r-- | saa/saa_render.c | 6 | ||||
-rw-r--r-- | vmwgfx/Makefile.am | 5 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_dri2.c | 21 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_driver.c | 3 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_driver.h | 7 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_overlay.c | 6 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_saa.c | 5 |
12 files changed, 56 insertions, 35 deletions
diff --git a/Makefile.am b/Makefile.am index fff57f6..3208a23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -SUBDIRS = src man vmwarectrl saa vmwgfx +SUBDIRS = src man vmwarectrl @VMWGFX_DIRS@ MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index bbb530a..d4580ee 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,8 @@ PKG_CHECK_EXISTS([xorg-server >= 1.4.99], PKG_CHECK_EXISTS([xorg-server >= 1.7.0], [AC_DEFINE([HAVE_XORG_SERVER_1_7_0], 1, - [Has version 1.7.0 or greater of the Xserver])]) + [Has version 1.7.0 or greater of the Xserver]) + BUILD_VMWGFX=yes],[BUILD_VMWGFX=yes]) # Obtain compiler/linker options for the vmwarectrl client tool PKG_CHECK_MODULES(X11, x11 xext) @@ -113,15 +114,32 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) AC_SUBST([moduledir]) +if test x$BUILD_VMWGFX = xyes; then + PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.1.0],[],[BUILD_VMWGFX=no]) +fi + DRIVER_NAME=vmware AC_SUBST([DRIVER_NAME]) + +VMWGFX_DIRS= +if test x$BUILD_VMWGFX = xyes; then + VMWGFX_DIRS="vmwgfx saa" + AC_CONFIG_FILES([ + saa/Makefile + vmwgfx/Makefile + ]) + echo "Will build the vmwgfx driver." +else + echo "Will not build the vmwgfx driver." +fi + +AC_SUBST([VMWGFX_DIRS]) AC_CONFIG_FILES([ Makefile src/Makefile vmwarectrl/Makefile man/Makefile - saa/Makefile - vmwgfx/Makefile ]) + AC_OUTPUT @@ -39,6 +39,7 @@ #include "dixfontstr.h" #include "regionstr.h" #include "saa.h" +#include "saa_priv.h" #ifdef SAA_DEVPRIVATEKEYREC DevPrivateKeyRec saa_screen_index; diff --git a/saa/saa_accel.c b/saa/saa_accel.c index be33170..7bd5d61 100644 --- a/saa/saa_accel.c +++ b/saa/saa_accel.c @@ -30,6 +30,7 @@ #include "saa.h" #include "saa_priv.h" +#include <mi.h> Bool saa_hw_copy_nton(DrawablePtr pSrcDrawable, @@ -135,7 +136,13 @@ saa_copy_area(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, srcx, srcy, width, height, dstx, dsty); } +#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 6) return miDoCopy(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, saa_copy_nton, 0, NULL); +#else + return fbDoCopy(pSrcDrawable, pDstDrawable, pGC, + srcx, srcy, width, height, + dstx, dsty, saa_copy_nton, 0, NULL); +#endif } diff --git a/saa/saa_priv.h b/saa/saa_priv.h index f86f196..c961345 100644 --- a/saa/saa_priv.h +++ b/saa/saa_priv.h @@ -181,10 +181,10 @@ saa_gc(GCPtr gc) &saa_gc_index); } -static inline struct saa_pixmap_priv * +static inline struct saa_pixmap * saa_pixmap(PixmapPtr pix) { - return (struct saa_pixmap_priv *)dixLookupPrivateAddr(&pix->devPrivates, + return (struct saa_pixmap *)dixLookupPrivateAddr(&pix->devPrivates, &saa_pixmap_index); } diff --git a/saa/saa_render.c b/saa/saa_render.c index 1df0dff..8c6e1e6 100644 --- a/saa/saa_render.c +++ b/saa/saa_render.c @@ -259,10 +259,10 @@ saa_copy_composite(CARD8 op, } ret = saa_hw_copy_nton(pSrc->pDrawable, pDst->pDrawable, NULL, - RegionRects(®ion), - RegionNumRects(®ion), + REGION_RECTS(®ion), + REGION_NUM_RECTS(®ion), xSrc - xDst, ySrc - yDst, FALSE, FALSE); - RegionUninit(®ion); + REGION_UNINIT(pDst->pDrwable.pScreen, ®ion); if (ret) return TRUE; } 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; } |