summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2004-11-23 17:29:47 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2004-11-23 17:29:47 +0000
commit9a26d6f39e199bad287d4e538ef75700a0102788 (patch)
treef5569bf419a9ce897db05869cbce68729beed0f1 /Xext
parentfec868bf0f67a8f62fc69d55e2ff72b6cacea6f8 (diff)
Bugzilla #1883 (https://freedesktop.org/bugzilla/show_bug.cgi?id=1883): Fix
insufficient SHM detection in XvMC local test. Removed reference to getpagesize() which caused linking problems on s390. Reported by Stefan Dirsch <sndirsh@suse.de>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/xvmc.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 5b2cecc0c..ecd7f0336 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -17,10 +17,21 @@
#include "Xvproto.h"
#include "XvMCproto.h"
#include "xvmcext.h"
-#include "xf86_ansic.h"
+
+#ifdef HAS_XVMCSHM
+#ifndef Lynx
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#else
+#include <ipc.h>
+#include <shm.h>
+#endif /* Lynx */
+#endif /* HAS_XVMCSHM */
+
+
#define DR_CLIENT_DRIVER_NAME_SIZE 48
-#define DR_BUSID_SIZE 20
+#define DR_BUSID_SIZE 48
int XvMCScreenIndex = -1;
@@ -558,7 +569,10 @@ ProcXvMCGetDRInfo(ClientPtr client)
XvPortPtr pPort;
ScreenPtr pScreen;
XvMCScreenPtr pScreenPriv;
+
+#ifdef HAS_XVMCSHM
volatile CARD32 *patternP;
+#endif
REQUEST(xvmcGetDRInfoReq);
REQUEST_SIZE_MATCH(xvmcGetDRInfoReq);
@@ -589,15 +603,16 @@ ProcXvMCGetDRInfo(ClientPtr client)
* segment she prepared for us.
*/
- rep.isLocal = 0;
-
- if ( NULL != (patternP = (CARD32 *)shmat( stuff->shmKey, NULL, SHM_RDONLY ))) {
- register volatile CARD32 *patternC = patternP;
+ rep.isLocal = 1;
+#ifdef HAS_XVMCSHM
+ patternP = (CARD32 *)shmat( stuff->shmKey, NULL, SHM_RDONLY );
+ if ( -1 != (long) patternP) {
+ register volatile CARD32 *patternC = patternP;
register int i;
CARD32 magic = stuff->magic;
rep.isLocal = 1;
- i = getpagesize() / sizeof(CARD32);
+ i = 1024 / sizeof(CARD32);
while ( i-- ) {
if (*patternC++ != magic) {
@@ -606,9 +621,10 @@ ProcXvMCGetDRInfo(ClientPtr client)
}
magic = ~magic;
}
- shmdt( (char *)patternP );
+ shmdt( (char *)patternP );
}
-
+#endif /* HAS_XVMCSHM */
+
WriteToClient(client, sizeof(xvmcGetDRInfoReply),
(char*)&rep);
if (rep.length) {