summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2009-11-04 21:19:31 +0100
committerLuc Verhaegen <libv@skynet.be>2009-11-04 21:19:31 +0100
commit6260e0fc9f0754d101dda014a8f4b5f76f58e978 (patch)
treeea8e35e0703cbb44ec2ba5c80f0006c6db2e5b96
parent0eda44a638ed0855930b6f6fec1354a1bdf6ed69 (diff)
XvMC: Fix up build systems against all my installations.
* Full autoconf checking of available infrastructure. * Work around broken vldXvMC.h headers that useless include include XvMClib.h. * Use the new dixLookupResourceByType call when available. * remove useless pc file for libXvMCunichrome, no-one will build against this lib anyway. * Fix up debian build system for the new xvmc dependency (if you do not want to depend on this debian package, build manually). * Set library version properly. * Fake XvMCDrawable is not a pointer. * Bump XVMCE proto version to 0.1. From now on we need to track this. * Build driver side xvmc support conditionally, but always build mpeg handling code for preprocessing simplicity.
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac116
-rw-r--r--debian/control4
-rw-r--r--lib/xvmc/Makefile.am6
-rw-r--r--lib/xvmc/libXvMCunichrome.pc.in12
-rw-r--r--lib/xvmc/xvmc_unichrome.c10
-rw-r--r--lib/xvmc/xvmce_proto.h2
-rw-r--r--src/Makefile.am12
-rw-r--r--src/via_dri.c23
-rw-r--r--src/via_mpeg.c2
-rw-r--r--src/via_video.c23
-rw-r--r--src/via_xvmc.c45
12 files changed, 184 insertions, 77 deletions
diff --git a/Makefile.am b/Makefile.am
index 3936a8d..e2885dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,11 @@ if BUILD_WRAPPER
WRAPPER_DIR = wrapper
endif
-SUBDIRS = src man lib $(WRAPPER_DIR)
+if BUILD_XVMCLIB
+ LIB_DIR = lib
+endif
+
+SUBDIRS = src man $(LIB_DIR) $(WRAPPER_DIR)
EXTRA_DIST = git_version.sh
BUILT_SOURCES = git_version.h
diff --git a/configure.ac b/configure.ac
index cdc86bb..bacea8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,23 +1,3 @@
-# Copyright 2005 Adam Jackson.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-# 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.
-#
# Process this file with autoconf to produce a configure script
AC_PREREQ(2.57)
@@ -74,10 +54,10 @@ AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
[DRI="$enableval"],
[DRI=auto])
-AC_ARG_ENABLE(experimental, AC_HELP_STRING([--enable-experimental],
- [Enable experimental chipsets [[default=no]]]),
- [experimental="$enableval"],
- [experimental=no])
+AC_ARG_ENABLE(have_xvmc, AC_HELP_STRING([--enable-xvmc],
+ [Build XvMC support [[default=auto]]]),
+ [have_xvmc="$enableval"],
+ [have_xvmc=auto])
# Checks for extensions
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
@@ -114,7 +94,6 @@ if test "$DRI" != no; then
[have_gl_h="yes"], [have_gl_h="no"])
fi
-AC_MSG_CHECKING([whether to include DRI support])
if test x$DRI = xauto; then
if test "$have_dri_h" = yes -a \
"$have_sarea_h" = yes -a \
@@ -125,6 +104,7 @@ if test x$DRI = xauto; then
DRI="no"
fi
fi
+AC_MSG_CHECKING([whether to include DRI support])
AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
@@ -138,26 +118,99 @@ AH_VERBATIM([HAVE_DRI],[/* xorg-server.h might not have the same idea. */
#define HAVE_DRI 1
#endif])
+# check whether to build Xv.
AC_CHECK_FILE([${sdkdir}/xf86xv.h],
- [have_xf86xv_h="yes"], [have_xf86xv_h="no"])
+ [have_xf86xv_h="yes"], [have_xf86xv_h="no"])
AC_CHECK_FILE([${sdkdir}/xf86xvpriv.h],
- [have_xf86xvpriv_h="yes"], [have_xf86xvpriv_h="no"])
-
+ [have_xf86xvpriv_h="yes"], [have_xf86xvpriv_h="no"])
AC_MSG_CHECKING([whether to include XV support])
if test "$have_xf86xv_h" = yes -a \
"$have_xf86xvpriv_h" = yes; then
have_xv="yes"
+else
+ have_xv="no"
fi
AC_MSG_RESULT([$have_xv])
-
AM_CONDITIONAL(XV, test x$have_xv = xyes)
+# Check what parts of XvMC are around.
+if test "x$have_xvmc" != xno; then
+ AC_CHECK_FILE([${protodir}/extensions/XvMC.h],
+ [have_xvmc_h="yes"], [have_xvmc_h="no"])
+ AC_CHECK_FILE([${protodir}/extensions/vldXvMC.h],
+ [have_vldxvmc_h="yes"], [have_vldxvmc_h="no"])
+ AC_CHECK_FILE([${protodir}/extensions/XvMClib.h],
+ [have_xvmclib_h="yes"], [have_xvmclib_h="no"])
+fi
+
+# check for driver side xvmc support.
+AC_MSG_CHECKING([whether to include driver-side XvMC support])
+if test "x$have_xv" = xyes -a \
+ "x$have_xvmc" != xno -a \
+ "x$have_xvmc_h" = xyes -a \
+ "x$have_vldxvmc_h" = xyes; then
+ build_xvmc="yes"
+else
+ build_xvmc="no"
+fi
+AC_MSG_RESULT([$build_xvmc])
+AM_CONDITIONAL(BUILD_XVMC, test "x$build_xvmc" = xyes)
+if test "x$build_xvmc" = xyes; then
+ AC_DEFINE(BUILD_XVMC, 1, [Build driver side XvMC support])
+fi
+
+# check whether we need to build the xvmc library.
+AC_MSG_CHECKING([whether to include client-side XvMC support])
+if test "x$build_xvmc" = xyes -a \
+ "x$have_xvmclib_h" = xyes; then
+ build_xvmclib="yes"
+else
+ build_xvmclib="no"
+fi
+AC_MSG_RESULT([$build_xvmclib])
+AM_CONDITIONAL(BUILD_XVMCLIB, test "x$build_xvmclib" = xyes)
+if test "x$build_xvmclib" = xyes; then
+ AC_OUTPUT([
+ lib/Makefile
+ lib/xvmc/Makefile
+ ])
+fi
+
+if test "x$build_xvmclib" = xyes; then
+ AC_EGREP_HEADER([dixLookupResourceByType], [${sdkdir}/resource.h],
+ [new_lookupresource="yes"], [new_lookupresource="no"])
+ AC_MSG_CHECKING([whether LookupIDByType() was replaced by dixLookupResourceByType()])
+ AC_MSG_RESULT([$new_lookupresource])
+ if test "x$new_lookupresource" = xyes; then
+ AC_DEFINE(NEW_LOOKUPRESOURCE, 1,
+ [LookupIDByType() was replaced by dixLookupResourceByType()])
+ fi
+fi
+
+# vldXvMC.h is broken. It includes XvMClib.h and this leads to a big mess
+# in some (possibly broken) installations.
+if test "x$build_xvmc" = xyes; then
+ # if we have xvmclib.h, then we test this way.
+ if test "x$have_xvmclib_h" = xyes; then
+ AC_EGREP_HEADER([XvMCQueryExtension], [${protodir}/extensions/vldXvMC.h],
+ [broken_vldxvmc_h="yes"], [broken_vldxvmc_h="no"])
+ else
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include "vldXvMC.h"]])],
+ [broken_vldxvmc_h="no"], [broken_vldxvmc_h="yes"])
+ fi
+
+ AC_MSG_CHECKING([whether vldXvMC.h wrongly includes XvMClib.h])
+ AC_MSG_RESULT([$broken_vldxvmc_h])
+ if test "x$broken_vldxvmc_h" = xyes; then
+ AC_DEFINE(BROKEN_VLDXVMC_H, 1, [vldXvMC.h wrongly includes XvMClib.h])
+ fi
+fi
+
# Somewhere along the way the non ANSI C compat code got removed.
AC_CHECK_FILE([${sdkdir}/xf86_ansic.h],
[AC_DEFINE([HAVE_XF86_ANSIC_H], [1],
[xf86 non-ansi C compat code still there?])])
-
SAVED_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $XORG_CFLAGS"
@@ -207,7 +260,4 @@ AC_OUTPUT([
Makefile
src/Makefile
man/Makefile
- lib/Makefile
- lib/xvmc/Makefile
- lib/xvmc/libXvMCunichrome.pc
])
diff --git a/debian/control b/debian/control
index cd82f17..6aa1f3e 100644
--- a/debian/control
+++ b/debian/control
@@ -2,12 +2,12 @@ Source: xf86-video-unichrome
Section: x11
Priority: optional
Maintainer: Luc Verhaegen <libv@skynet.be>
-Build-Depends: debhelper (>= 4.0.0), pkg-config, autoconf, libtool (>= 1.5), xserver-xorg-dev, xorg-build-macros | xutils-dev, x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-xext-dev, x11proto-xf86dri-dev, x11proto-video-dev, x11proto-gl-dev, libdrm-dev, libx11-dev, libgl1-mesa-dev | libgl1-dev
+Build-Depends: debhelper (>= 4.0.0), pkg-config, autoconf, libtool (>= 1.5), xserver-xorg-dev, xorg-build-macros | xutils-dev, x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-xext-dev, x11proto-xf86dri-dev, x11proto-video-dev, x11proto-gl-dev, libdrm-dev, libx11-dev, libgl1-mesa-dev | libgl1-dev, libxvmc-dev
Standards-Version: 3.6.1.0
Package: xf86-video-unichrome
Architecture: any
-Depends: xserver-xorg-core (>= ${Xorg:Version}), ${shlibs:Depends}
+Depends: xserver-xorg-core (>= ${Xorg:Version}), ${shlibs:Depends}, libxvmc1
Provides: ${Provides}
Conflicts: ${Conflicts}
Replaces: xserver-xorg (<< 6.8.2-35), ${Replaces}
diff --git a/lib/xvmc/Makefile.am b/lib/xvmc/Makefile.am
index 471391e..e2bacd0 100644
--- a/lib/xvmc/Makefile.am
+++ b/lib/xvmc/Makefile.am
@@ -1,3 +1,5 @@
+LIBXVMC_UNICHROME_VERSION = 1:0:0
+
lib_LTLIBRARIES = libXvMCunichrome.la
libXvMCunichrome_la_SOURCES = \
@@ -6,7 +8,5 @@ libXvMCunichrome_la_SOURCES = \
xvmce_proto.h \
xvmc_unichrome.c
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libXvMCunichrome.pc
+libXvMCunichrome_la_LDFLAGS = -version-number $(LIBXVMC_UNICHROME_VERSION)
-EXTRA_DIST = libXvMCunichrome.pc.in
diff --git a/lib/xvmc/libXvMCunichrome.pc.in b/lib/xvmc/libXvMCunichrome.pc.in
deleted file mode 100644
index 7761ab7..0000000
--- a/lib/xvmc/libXvMCunichrome.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libXvMCunichrome
-Description: XvMC client side library for Unichrome.
-Version: @PACKAGE_VERSION@
-Requires: xproto videoproto xv xvmc
-Requires.private: x11 xext xv xvmc
-Cflags: -I${includedir}
-Libs: -L${libdir} -lXvMC -lXvMCunichrome
diff --git a/lib/xvmc/xvmc_unichrome.c b/lib/xvmc/xvmc_unichrome.c
index 2e835b9..76e81de 100644
--- a/lib/xvmc/xvmc_unichrome.c
+++ b/lib/xvmc/xvmc_unichrome.c
@@ -78,8 +78,8 @@ static int current_surface_size = 0;
/* because of the rather abhorrent nature of the XvMC interface. */
static XvPortID XvMCPortID = 0;
static XvImage *XvMCImage = NULL;
-static XID *XvMCImageID = 0;
-static Drawable *XvMCDrawable = NULL;
+static XID XvMCImageID = 0;
+static Drawable XvMCDrawable = 0;
static GC XvMCDrawableGC = NULL;
/*
@@ -181,7 +181,7 @@ XvMCDestroyContext(Display *display, XvMCContext *context)
if (status != Success)
fprintf(stderr, "%s: XvStopVideo failed: %d\n", __func__, status);
}
- XvMCDrawable = NULL;
+ XvMCDrawable = 0;
if (XvMCImage)
XFree(XvMCImage);
@@ -192,7 +192,7 @@ XvMCDestroyContext(Display *display, XvMCContext *context)
status = _xvmc_destroy_context(display, context);
if (status != Success)
fprintf(stderr, "%s: _xvmc_destroy_context failed: %d\n", __func__, status);
- XvMCDrawable = NULL;
+ XvMCDrawable = 0;
return Success;
}
@@ -292,7 +292,7 @@ XvMCHideSurface(Display *display, XvMCSurface *surface)
if (status != Success)
fprintf(stderr, "%s: XvStopVideo failed: %d\n", __func__, status);
- XvMCDrawable = NULL;
+ XvMCDrawable = 0;
return status;
}
diff --git a/lib/xvmc/xvmce_proto.h b/lib/xvmc/xvmce_proto.h
index e396c20..baa55ca 100644
--- a/lib/xvmc/xvmce_proto.h
+++ b/lib/xvmc/xvmce_proto.h
@@ -30,7 +30,7 @@
#define XVMCE_EXT_NAME "Unichrome XvMC-E"
#define XVMCE_VERSION 0
-#define XVMCE_RELEASE 0
+#define XVMCE_RELEASE 1
#define xvmce_QueryExtension 0
#define xvmce_QMatrixSend 1
diff --git a/src/Makefile.am b/src/Makefile.am
index feb2031..3e5720e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,12 +46,16 @@ unichrome_drv_la_SOURCES = \
if XV
unichrome_drv_la_SOURCES += \
- via_video.c \
- via_video.h \
- via_videoregs.h \
+ via_video.c \
+ via_video.h \
+ via_videoregs.h \
via_mpeg.c \
via_mpeg.h \
- via_mpegregs.h \
+ via_mpegregs.h
+endif
+
+if BUILD_XVMC
+unichrome_drv_la_SOURCES += \
via_xvmc.c \
via_xvmc.h
endif
diff --git a/src/via_dri.c b/src/via_dri.c
index 9dbe024..efdb94d 100644
--- a/src/via_dri.c
+++ b/src/via_dri.c
@@ -658,12 +658,21 @@ VIADRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
/* Check that the GLX, DRI, and DRM modules have been loaded by testing
* for canonical symbols in each module. */
- if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs"))
+ if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,\
+ "%s: Missing Symbol \"GlxSetVisualConfigs\"\n", __func__);
return FALSE;
- if (!xf86LoaderCheckSymbol("DRIScreenInit"))
+ }
+ if (!xf86LoaderCheckSymbol("DRIScreenInit")) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,\
+ "%s: Missing Symbol \"DRIScreenInit\"\n", __func__);
return FALSE;
- if (!xf86LoaderCheckSymbol("drmAvailable"))
+ }
+ if (!xf86LoaderCheckSymbol("drmAvailable")) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,\
+ "%s: Missing Symbol \"drmAvailable\"\n", __func__);
return FALSE;
+ }
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[dri] VIADRIScreenInit failed (libdri.a too old)\n");
@@ -690,6 +699,8 @@ VIADRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
pDri->pDRIInfo = DRICreateInfoRec();
if (!pDri->pDRIInfo) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,\
+ "%s: DRICreateInfoRec failed.\n", __func__);
xfree(pDri);
return FALSE;
}
@@ -744,6 +755,8 @@ VIADRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
#endif
if (!(pVIADRI = (VIADRIPtr)xcalloc(sizeof(VIADRIRec),1))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: failed to allocate pVIADRI.\n", __func__);
DRIDestroyInfoRec(pDri->pDRIInfo);
xfree(pDri);
return FALSE;
@@ -773,6 +786,8 @@ VIADRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
pVia->Dri = pDri;
if (!(VIAInitVisualConfigs(pScrn))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: VIAInitVisualConfigs failed.\n", __func__);
VIADRICloseScreen(pScrn, pScreen);
return FALSE;
}
@@ -780,6 +795,8 @@ VIADRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
/* DRIScreenInit doesn't add all the common mappings. Add additional mappings here. */
if (!VIADRIMapInit(pVia)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: VIADRIMapInit failed.\n", __func__);
VIADRICloseScreen(pScrn, pScreen);
return FALSE;
}
diff --git a/src/via_mpeg.c b/src/via_mpeg.c
index a4785a4..131b1dd 100644
--- a/src/via_mpeg.c
+++ b/src/via_mpeg.c
@@ -27,8 +27,6 @@
#include <xf86.h>
-#include <unistd.h> /* for usleep */
-
#include "via_driver.h"
#include "via_mpeg.h"
#include "via_mpegregs.h"
diff --git a/src/via_video.c b/src/via_video.c
index 61e38cf..4b3802e 100644
--- a/src/via_video.c
+++ b/src/via_video.c
@@ -58,7 +58,9 @@
#include "fourcc.h"
#include "via_regs.h"
+#ifdef BUILD_XVMC
#include "via_xvmc.h"
+#endif
#include "via_mpeg.h"
/*
@@ -213,6 +215,7 @@ static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] =
/*
* MPEG: Just holds a buffer id.
+ * Define this even though we do not advertise it, makes code a lot easier.
*/
#ifndef FOURCC_MPEG
#define FOURCC_MPEG (('G' << 24) | ('E' << 16) | ('P' << 8) | 'M')
@@ -235,17 +238,22 @@ static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] =
XvTopToBottom \
}
-
+#ifdef BUILD_XVMC
#define NUM_IMAGES_G 7
+#else
+#define NUM_IMAGES_G 6
+#endif
static XF86ImageRec ImagesG[NUM_IMAGES_G] =
{
XVIMAGE_YUY2,
XVIMAGE_YV12,
XVIMAGE_I420,
+#ifdef BUILD_XVMC
+ XVIMAGE_MPEG,
+#endif
XVIMAGE_RV15,
XVIMAGE_RV16,
- XVIMAGE_RV32,
- XVIMAGE_MPEG
+ XVIMAGE_RV32
};
/*
@@ -1015,6 +1023,11 @@ ViaSwovBandwidth(ScrnInfoPtr pScrn)
memEfficiency = (float)SINGLE_7205_133;
break;
case VIA_MEM_DDR_400:
+ case VIA_MEM_DDR2_400:
+ case VIA_MEM_DDR2_533:
+ case VIA_MEM_DDR2_667:
+ case VIA_MEM_DDR2_800:
+ case VIA_MEM_DDR2_1066:
mClock = 200;
memEfficiency = (float)SINGLE_7205_133;
break;
@@ -2598,8 +2611,10 @@ ViaVideoInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
xf86XVScreenInit(pScreen, Swov->Adaptors, num_adaptors + 1);
+#ifdef BUILD_XVMC
if (Swov->Mpeg)
ViaXvMCInit(pScrn, pScreen);
+#endif
VIASetColorSpace(pVia);
}
@@ -2618,7 +2633,9 @@ ViaVideoDestroy(ScrnInfoPtr pScrn)
/* Make sure we're shut down first. */
ViaStopVideo(pScrn, Swov->Port, TRUE);
+#ifdef BUILD_XVMC
ViaXvMCDestroy(pScrn);
+#endif
/* Now tear down the wallpaper */
xfree(Swov->Adaptors);
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index fbf153e..bad50e3 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -29,11 +29,17 @@
#include "fourcc.h"
#include "X11/extensions/XvMC.h"
+
+#ifdef BROKEN_VLDXVMC_H
+#define XVMC_VLD 0x0020000
+#else
#include "X11/extensions/vldXvMC.h"
+#endif
#include "via_driver.h"
#include "via_video.h"
#include "via_mpeg.h"
+#include "via_xvmc.h"
/*
*
@@ -86,7 +92,8 @@ XvMCEProcQMatrixSend(ClientPtr client)
ExtensionEntry *XvMCE_Ext;
struct XvMCEPrivates *Private;
ScrnInfoPtr pScrn;
- XvPortPtr Port;
+ XvPortPtr Port = NULL;
+ int status;
REQUEST(xvmceQMatrixSendReq);
REQUEST_AT_LEAST_SIZE(xvmceQMatrixSendReq);
@@ -101,11 +108,18 @@ XvMCEProcQMatrixSend(ClientPtr client)
pScrn = xf86Screens[Private->scrnIndex];
/* Does our client own this port? */
+#ifdef NEW_LOOKUPRESOURCE
+ status = dixLookupResourceByType((void *) &Port, stuff->Port, XvGetRTPort(),
+ client, DixReadAccess);
+#else
Port = LookupIDByType(stuff->Port, XvGetRTPort());
- if (!Port) {
+ if (!Port)
+ status = BadAccess;
+#endif
+ if (status != Success) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"%s: Client doesn't own this Xv Port.\n", __func__);
- return BadAccess;
+ return status;
}
/* check size: 16 = 64Bytes / 4, from 8x8 QMatrix */
@@ -129,7 +143,7 @@ XvMCEProcBufferSliceInit(ClientPtr client)
ExtensionEntry *XvMCE_Ext;
struct XvMCEPrivates *Private;
ScrnInfoPtr pScrn;
- XvPortPtr Port;
+ XvPortPtr Port = NULL;
int status;
CARD8 F_MV_Range, B_MV_Range;
CARD8 PictureStructure, FrameType, IntraDCPrecision;
@@ -149,8 +163,15 @@ XvMCEProcBufferSliceInit(ClientPtr client)
pScrn = xf86Screens[Private->scrnIndex];
/* Does our client own this port? */
+#ifdef NEW_LOOKUPRESOURCE
+ status = dixLookupResourceByType((void *) &Port, stuff->Port, XvGetRTPort(),
+ client, DixReadAccess);
+#else
Port = LookupIDByType(stuff->Port, XvGetRTPort());
- if (!Port) {
+ if (!Port)
+ status = BadAccess;
+#endif
+ if (status != Success) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"%s: Client doesn't own this Xv Port.\n", __func__);
return BadAccess;
@@ -258,7 +279,8 @@ XvMCEProcBufferSliceSend(ClientPtr client)
ExtensionEntry *XvMCE_Ext;
struct XvMCEPrivates *Private;
ScrnInfoPtr pScrn;
- XvPortPtr Port;
+ XvPortPtr Port = NULL;
+ int status;
REQUEST(xvmceBufferSliceSendReq);
REQUEST_AT_LEAST_SIZE(xvmceBufferSliceSendReq);
@@ -273,11 +295,18 @@ XvMCEProcBufferSliceSend(ClientPtr client)
pScrn = xf86Screens[Private->scrnIndex];
/* Does our client own this port? */
+#ifdef NEW_LOOKUPRESOURCE
+ status = dixLookupResourceByType((void *) &Port, stuff->Port, XvGetRTPort(),
+ client, DixReadAccess);
+#else
Port = LookupIDByType(stuff->Port, XvGetRTPort());
- if (!Port) {
+ if (!Port)
+ status = BadAccess;
+#endif
+ if (status != Success) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"%s: Client doesn't own this Xv Port.\n", __func__);
- return BadAccess;
+ return status;
}
ViaMpegSlicePut(VIAPTR(pScrn)->Swov->Mpeg, stuff->Buffer, stuff->SliceCount,