diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
commit | a90ee792d96752ad1b71b9ada922fa6afe478c99 (patch) | |
tree | 6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/hw/kdrive/ephyr | |
parent | bc97d4ecc0aa9e1b823565b07282f848700bd11a (diff) |
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations
including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/hw/kdrive/ephyr')
-rw-r--r-- | xserver/hw/kdrive/ephyr/Makefile.in | 30 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/XF86dri.c | 10 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyr.c | 133 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyr_draw.c | 27 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyrdriext.c | 71 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyrglxext.c | 10 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyrhostvideo.c | 31 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/ephyrvideo.c | 36 | ||||
-rw-r--r-- | xserver/hw/kdrive/ephyr/hostx.c | 27 |
9 files changed, 174 insertions, 201 deletions
diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in index 82cb214be..836211259 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.in +++ b/xserver/hw/kdrive/ephyr/Makefile.in @@ -156,10 +156,6 @@ BUILDDOCS_TRUE = @BUILDDOCS_TRUE@ BUILD_DATE = @BUILD_DATE@ BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@ BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@ -BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@ -BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@ -BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@ -BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@ BUILD_TIME = @BUILD_TIME@ CC = @CC@ CCAS = @CCAS@ @@ -247,6 +243,8 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@ +ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FBDEVHW_FALSE = @FBDEVHW_FALSE@ @@ -261,6 +259,7 @@ FONTOTFDIR = @FONTOTFDIR@ FONTROOTDIR = @FONTROOTDIR@ FONTTTFDIR = @FONTTTFDIR@ FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@ FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -278,10 +277,14 @@ HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@ HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@ HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@ HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@ -HAVE_PS2PDF_FALSE = @HAVE_PS2PDF_FALSE@ -HAVE_PS2PDF_TRUE = @HAVE_PS2PDF_TRUE@ +HAVE_FOP_FALSE = @HAVE_FOP_FALSE@ +HAVE_FOP_TRUE = @HAVE_FOP_TRUE@ HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@ HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@ +HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@ +HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@ +HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@ +HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@ HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@ HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@ HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@ @@ -337,10 +340,11 @@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ LIBDRM_LIBS = @LIBDRM_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LINUXDOC = @LINUXDOC@ LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@ LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@ LINUX_IA64_FALSE = @LINUX_IA64_FALSE@ @@ -358,17 +362,11 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ -MAKE_HTML = @MAKE_HTML@ -MAKE_PDF = @MAKE_PDF@ -MAKE_PS = @MAKE_PS@ -MAKE_TEXT = @MAKE_TEXT@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MITSHM_FALSE = @MITSHM_FALSE@ MITSHM_TRUE = @MITSHM_TRUE@ -MULTIBUFFER_FALSE = @MULTIBUFFER_FALSE@ -MULTIBUFFER_TRUE = @MULTIBUFFER_TRUE@ NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@ NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@ NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@ @@ -395,20 +393,23 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ PERL = @PERL@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@ PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@ PROJECTROOT = @PROJECTROOT@ -PS2PDF = @PS2PDF@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RECORD_FALSE = @RECORD_FALSE@ RECORD_TRUE = @RECORD_TRUE@ +RELEASE_DATE = @RELEASE_DATE@ RES_FALSE = @RES_FALSE@ RES_TRUE = @RES_TRUE@ SCREENSAVER_FALSE = @SCREENSAVER_FALSE@ SCREENSAVER_TRUE = @SCREENSAVER_TRUE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SECURE_RPC_FALSE = @SECURE_RPC_FALSE@ SECURE_RPC_TRUE = @SECURE_RPC_TRUE@ SED = @SED@ @@ -500,6 +501,7 @@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ XLIB_CFLAGS = @XLIB_CFLAGS@ XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_FALSE = @XNEST_FALSE@ diff --git a/xserver/hw/kdrive/ephyr/XF86dri.c b/xserver/hw/kdrive/ephyr/XF86dri.c index 08123d35c..e7c88b335 100644 --- a/xserver/hw/kdrive/ephyr/XF86dri.c +++ b/xserver/hw/kdrive/ephyr/XF86dri.c @@ -221,7 +221,7 @@ XF86DRIOpenConnection (Display *dpy, int screen, } if (rep.length) { - if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) { + if (!(*busIdString = (char *)calloc(rep.busIdStringLength + 1, 1))) { _XEatData(dpy, ((rep.busIdStringLength+3) & ~3)); UnlockDisplay(dpy); SyncHandle(); @@ -316,7 +316,7 @@ Bool XF86DRIGetClientDriverName(Display *dpy, int screen, *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; if (rep.length) { - if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) { + if (!(*clientDriverName = (char *)calloc(rep.clientDriverNameLength + 1, 1))) { _XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3)); UnlockDisplay(dpy); SyncHandle(); @@ -528,7 +528,7 @@ Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable, if (*numClipRects) { int len = sizeof(drm_clip_rect_t) * (*numClipRects); - *pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1); + *pClipRects = (drm_clip_rect_t *)calloc(len, 1); if (*pClipRects) _XRead(dpy, (char*)*pClipRects, len); } else { @@ -538,7 +538,7 @@ Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable, if (*numBackClipRects) { int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); - *pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1); + *pBackClipRects = (drm_clip_rect_t *)calloc(len, 1); if (*pBackClipRects) _XRead(dpy, (char*)*pBackClipRects, len); } else { @@ -587,7 +587,7 @@ XF86DRIGetDeviceInfo (Display *dpy, int screen, drm_handle_t *hFrameBuffer, *devPrivateSize = rep.devPrivateSize; if (rep.length) { - if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) { + if (!(*pDevPrivate = (void *)calloc(rep.devPrivateSize, 1))) { _XEatData(dpy, ((rep.devPrivateSize+3) & ~3)); UnlockDisplay(dpy); SyncHandle(); diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c index b21559bba..8096a24cc 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.c +++ b/xserver/hw/kdrive/ephyr/ephyr.c @@ -38,6 +38,8 @@ #include "ephyrglxext.h" #endif /* XF86DRI */ +#include "xkbsrv.h" + extern int KdTsPhyScreen; #ifdef GLXEXT extern Bool noGlxVisualInit; @@ -73,13 +75,13 @@ ephyrCardInit (KdCardInfo *card) { EphyrPriv *priv; - priv = (EphyrPriv *) xalloc (sizeof (EphyrPriv)); + priv = (EphyrPriv *) malloc(sizeof (EphyrPriv)); if (!priv) return FALSE; if (!ephyrInitialize (card, priv)) { - xfree (priv); + free(priv); return FALSE; } card->driver = priv; @@ -185,7 +187,7 @@ ephyrScreenInit (KdScreenInfo *screen) { EphyrScrPriv *scrpriv; - scrpriv = xcalloc (1, sizeof (EphyrScrPriv)); + scrpriv = calloc(1, sizeof (EphyrScrPriv)); if (!scrpriv) return FALSE; @@ -195,7 +197,7 @@ ephyrScreenInit (KdScreenInfo *screen) if (!ephyrScreenInitialize (screen, scrpriv)) { screen->driver = 0; - xfree (scrpriv); + free(scrpriv); return FALSE; } @@ -343,13 +345,13 @@ ephyrInternalDamageRedisplay (ScreenPtr pScreen) pRegion = DamageRegion (scrpriv->pDamage); - if (REGION_NOTEMPTY (pScreen, pRegion)) + if (RegionNotEmpty(pRegion)) { int nbox; BoxPtr pbox; - nbox = REGION_NUM_RECTS (pRegion); - pbox = REGION_RECTS (pRegion); + nbox = RegionNumRects (pRegion); + pbox = RegionRects (pRegion); while (nbox--) { @@ -737,7 +739,7 @@ ephyrScreenFini (KdScreenInfo *screen) if (scrpriv->shadow) { KdShadowFbFree (screen); } - xfree(screen->driver); + free(screen->driver); screen->driver = NULL; } @@ -748,75 +750,49 @@ ephyrScreenFini (KdScreenInfo *screen) void ephyrUpdateModifierState(unsigned int state) { -#if 0 - DeviceIntPtr pkeydev; - KeyClassPtr keyc; - int i; - CARD8 mask; - - pkeydev = inputInfo.keyboard; - if (!pkeydev) - return; + DeviceIntPtr pDev = inputInfo.keyboard; + KeyClassPtr keyc = pDev->key; + int i; + CARD8 mask; + int xkb_state; -/* This is pretty broken. - * - * What should happen is that focus out should do as a VT switch does in - * traditional servers: fake releases for all keys (and buttons too, come - * to think of it) currently down. Then, on focus in, get the state from - * the host, and fake keypresses for everything currently down. - * - * So I'm leaving this broken for a little while. Sorry, folks. - * - * -daniels - */ + if (!pDev) + return; - keyc = pkeydev->key; - + xkb_state = XkbStateFieldFromRec(&pDev->key->xkbInfo->state); state = state & 0xff; - - if (keyc->state == state) + + if (xkb_state == state) return; - - for (i = 0, mask = 1; i < 8; i++, mask <<= 1) - { - int key; - /* Modifier is down, but shouldn't be */ - if ((keyc->state & mask) && !(state & mask)) - { - int count = keyc->modifierKeyCount[i]; - - for (key = 0; key < MAP_LENGTH; key++) - if (keyc->xkbInfo->desc->map->modmap[key] & mask) - { - int bit; - BYTE *kptr; - - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - - if (*kptr & bit && ephyrKbd && - ((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled) - KdEnqueueKeyboardEvent(ephyrKbd, key, TRUE); /* release */ - - if (--count == 0) - break; - } - } - - /* Modifier shoud be down, but isn't */ - if (!(keyc->state & mask) && (state & mask)) - for (key = 0; key < MAP_LENGTH; key++) - if (keyc->xkbInfo->desc->map->modmap[key] & mask) - { - if (keyc->xkbInfo->desc->map->modmap[key] & mask && ephyrKbd && - ((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled) - KdEnqueueKeyboardEvent(ephyrKbd, key, FALSE); /* press */ - break; - } + for (i = 0, mask = 1; i < 8; i++, mask <<= 1) { + int key; + + /* Modifier is down, but shouldn't be + */ + if ((xkb_state & mask) && !(state & mask)) { + int count = keyc->modifierKeyCount[i]; + + for (key = 0; key < MAP_LENGTH; key++) + if (keyc->xkbInfo->desc->map->modmap[key] & mask) { + if (key_is_down(pDev, key, KEY_PROCESSED)) + KdEnqueueKeyboardEvent (ephyrKbd, key, TRUE); + + if (--count == 0) + break; + } } -#endif + + /* Modifier shoud be down, but isn't + */ + if (!(xkb_state & mask) && (state & mask)) + for (key = 0; key < MAP_LENGTH; key++) + if (keyc->xkbInfo->desc->map->modmap[key] & mask) { + KdEnqueueKeyboardEvent (ephyrKbd, key, FALSE); + break; + } + } } static void @@ -897,10 +873,10 @@ ephyrExposePairedWindow (int a_remote) return; } screen = pair->local->drawable.pScreen; - REGION_NULL (screen, ®); - REGION_COPY (screen, ®, &pair->local->clipList); + RegionNull(®); + RegionCopy(®, &pair->local->clipList); screen->WindowExposures (pair->local, ®, NullRegion); - REGION_UNINIT (screen, ®); + RegionUninit(®); } #endif /* XF86DRI */ @@ -998,6 +974,7 @@ ephyrPoll(void) if (!ephyrKbd || !((EphyrKbdPrivate *)ephyrKbd->driverPrivate)->enabled) continue; + ephyrUpdateModifierState(ev.key_state); KdEnqueueKeyboardEvent (ephyrKbd, ev.data.key_up.scancode, TRUE); break; @@ -1023,7 +1000,7 @@ void ephyrCardFini (KdCardInfo *card) { EphyrPriv *priv = card->driver; - xfree (priv); + free(priv); } void @@ -1075,11 +1052,11 @@ static Status MouseInit (KdPointerInfo *pi) { pi->driverPrivate = (EphyrPointerPrivate *) - xcalloc(sizeof(EphyrPointerPrivate), 1); + calloc(sizeof(EphyrPointerPrivate), 1); ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE; pi->nAxes = 3; pi->nButtons = 32; - xfree(pi->name); + free(pi->name); pi->name = strdup("Xephyr virtual mouse"); ephyrMouse = pi; return Success; @@ -1121,7 +1098,7 @@ static Status EphyrKeyboardInit (KdKeyboardInfo *ki) { ki->driverPrivate = (EphyrKbdPrivate *) - xcalloc(sizeof(EphyrKbdPrivate), 1); + calloc(sizeof(EphyrKbdPrivate), 1); hostx_load_keymap(); if (!ephyrKeySyms.map) { ErrorF("Couldn't load keymap from host\n"); @@ -1129,7 +1106,7 @@ EphyrKeyboardInit (KdKeyboardInfo *ki) } ki->minScanCode = ephyrKeySyms.minKeyCode; ki->maxScanCode = ephyrKeySyms.maxKeyCode; - xfree(ki->name); + free(ki->name); ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; diff --git a/xserver/hw/kdrive/ephyr/ephyr_draw.c b/xserver/hw/kdrive/ephyr/ephyr_draw.c index f9fac8007..b1982a5e6 100644 --- a/xserver/hw/kdrive/ephyr/ephyr_draw.c +++ b/xserver/hw/kdrive/ephyr/ephyr_draw.c @@ -97,18 +97,17 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg) KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; - CARD32 tmpval[3]; + ChangeGCVal tmpval[3]; ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST); fakexa->pDst = pPix; fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen); - tmpval[0] = alu; - tmpval[1] = pm; - tmpval[2] = fg; - ChangeGC(fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, - tmpval); + tmpval[0].val = alu; + tmpval[1].val = pm; + tmpval[2].val = fg; + ChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval); ValidateGC(&pPix->drawable, fakexa->pGC); @@ -162,7 +161,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu, KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; EphyrFakexaPriv *fakexa = scrpriv->fakexa; - CARD32 tmpval[2]; + ChangeGCVal tmpval[2]; ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); @@ -171,9 +170,9 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu, fakexa->pDst = pDst; fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen); - tmpval[0] = alu; - tmpval[1] = pm; - ChangeGC (fakexa->pGC, GCFunction | GCPlaneMask, tmpval); + tmpval[0].val = alu; + tmpval[1].val = pm; + ChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval); ValidateGC(&pDst->drawable, fakexa->pGC); @@ -432,13 +431,13 @@ ephyrDrawInit(ScreenPtr pScreen) EphyrFakexaPriv *fakexa; Bool success; - fakexa = xcalloc(1, sizeof(*fakexa)); + fakexa = calloc(1, sizeof(*fakexa)); if (fakexa == NULL) return FALSE; fakexa->exa = exaDriverAlloc(); if (fakexa->exa == NULL) { - xfree(fakexa); + free(fakexa); return FALSE; } @@ -487,8 +486,8 @@ ephyrDrawInit(ScreenPtr pScreen) scrpriv->fakexa = fakexa; } else { ErrorF("Failed to initialize EXA\n"); - xfree(fakexa->exa); - xfree(fakexa); + free(fakexa->exa); + free(fakexa); } return success; diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.c b/xserver/hw/kdrive/ephyr/ephyrdriext.c index 5f5fd3bff..ce584b051 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.c +++ b/xserver/hw/kdrive/ephyr/ephyrdriext.c @@ -109,10 +109,10 @@ static Bool findWindowPairFromLocal (WindowPtr a_local, static unsigned char DRIReqCode = 0; -static int ephyrDRIWindowKeyIndex; -static DevPrivateKey ephyrDRIWindowKey = &ephyrDRIWindowKeyIndex; -static int ephyrDRIScreenKeyIndex; -static DevPrivateKey ephyrDRIScreenKey = &ephyrDRIScreenKeyIndex; +static DevPrivateKeyRec ephyrDRIWindowKeyRec; +#define ephyrDRIWindowKey (&ephyrDRIWindowKeyRec) +static DevPrivateKeyRec ephyrDRIScreenKeyRec; +#define ephyrDRIScreenKey (&ephyrDRIScreenKeyRec) #define GET_EPHYR_DRI_WINDOW_PRIV(win) ((EphyrDRIWindowPrivPtr) \ dixLookupPrivate(&(win)->devPrivates, ephyrDRIWindowKey)) @@ -160,7 +160,7 @@ ephyrDRIExtensionInit (ScreenPtr a_screen) EPHYR_LOG_ERROR ("failed to register DRI extension\n") ; goto out ; } - screen_priv = xcalloc (1, sizeof (EphyrDRIScreenPrivRec)) ; + screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ; if (!screen_priv) { EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ; goto out ; @@ -258,7 +258,7 @@ ephyrDRIDestroyWindow (WindowPtr a_win) EphyrDRIWindowPrivPtr win_priv=GET_EPHYR_DRI_WINDOW_PRIV (a_win) ; if (win_priv) { destroyHostPeerWindow (a_win) ; - xfree (win_priv) ; + free(win_priv) ; dixSetPrivate(&a_win->devPrivates, ephyrDRIWindowKey, NULL); EPHYR_LOG ("destroyed the remote peer window\n") ; } @@ -418,11 +418,11 @@ ephyrDRIClipNotify (WindowPtr a_win, EPHYR_LOG_ERROR ("failed to get window pair\n") ; goto out ; } - rects = xcalloc (REGION_NUM_RECTS (&a_win->clipList), + rects = calloc(RegionNumRects (&a_win->clipList), sizeof (EphyrRect)) ; - for (i=0; i < REGION_NUM_RECTS (&a_win->clipList); i++) { + for (i=0; i < RegionNumRects (&a_win->clipList); i++) { memmove (&rects[i], - ®ION_RECTS (&a_win->clipList)[i], + &RegionRects (&a_win->clipList)[i], sizeof (EphyrRect)) ; rects[i].x1 -= a_win->drawable.x; rects[i].x2 -= a_win->drawable.x; @@ -436,11 +436,11 @@ ephyrDRIClipNotify (WindowPtr a_win, is_ok = hostx_set_window_bounding_rectangles (pair->remote, rects, - REGION_NUM_RECTS (&a_win->clipList)) ; + RegionNumRects (&a_win->clipList)) ; is_ok = TRUE ; out: - xfree (rects) ; + free(rects) ; rects = NULL ; EPHYR_LOG ("leave. is_ok:%d\n", is_ok) ; @@ -511,7 +511,7 @@ EphyrDuplicateVisual (unsigned int a_screen, /* * be prepare to extend screen->visuals to add new_visual to it */ - new_visuals = xcalloc (screen->numVisuals+1, sizeof (VisualRec)) ; + new_visuals = calloc(screen->numVisuals+1, sizeof (VisualRec)) ; memmove (new_visuals, screen->visuals, screen->numVisuals*sizeof (VisualRec)) ; @@ -535,7 +535,7 @@ EphyrDuplicateVisual (unsigned int a_screen, * extend the list of visual IDs in that entry, * so to add a_new_id in there. */ - vids = xrealloc (cur_depth->vids, + vids = realloc(cur_depth->vids, (cur_depth->numVids+1)*sizeof (VisualID)); if (!vids) { EPHYR_LOG_ERROR ("failed to realloc numids\n") ; @@ -558,14 +558,14 @@ EphyrDuplicateVisual (unsigned int a_screen, /* * Commit our change to screen->visuals */ - xfree (screen->visuals) ; + free(screen->visuals) ; screen->visuals = new_visuals ; screen->numVisuals++ ; new_visuals = NULL ; is_ok = TRUE ; out: - xfree (new_visuals) ; + free(new_visuals) ; new_visuals = NULL ; EPHYR_LOG ("leave\n") ; @@ -636,7 +636,7 @@ ProcXF86DRIQueryVersion (register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -674,7 +674,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -682,7 +682,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client) { xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; - char* busIdString; + char* busIdString = NULL; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); @@ -716,8 +716,9 @@ ProcXF86DRIOpenConnection (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); if (rep.busIdStringLength) WriteToClient(client, rep.busIdStringLength, busIdString); + free(busIdString); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -744,7 +745,7 @@ ProcXF86DRIAuthConnection (register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -763,7 +764,7 @@ ProcXF86DRICloseConnection (register ClientPtr client) */ EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -802,7 +803,7 @@ ProcXF86DRIGetClientDriverName (register ClientPtr client) rep.clientDriverNameLength, clientDriverName); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -848,7 +849,7 @@ ProcXF86DRICreateContext (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -868,7 +869,7 @@ ProcXF86DRIDestroyContext (register ClientPtr client) } EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static Bool @@ -1067,7 +1068,7 @@ ProcXF86DRICreateDrawable (ClientPtr client) win_priv = GET_EPHYR_DRI_WINDOW_PRIV (window) ; if (!win_priv) { - win_priv = xcalloc (1, sizeof (EphyrDRIWindowPrivRec)) ; + win_priv = calloc(1, sizeof (EphyrDRIWindowPrivRec)) ; if (!win_priv) { EPHYR_LOG_ERROR ("failed to allocate window private\n") ; return BadAlloc ; @@ -1079,7 +1080,7 @@ ProcXF86DRICreateDrawable (ClientPtr client) WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1123,7 +1124,7 @@ ProcXF86DRIDestroyDrawable (register ClientPtr client) pair->remote=0; EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1168,12 +1169,12 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) return BadMatch ; } EPHYR_LOG ("clip list of xephyr gl drawable:\n") ; - for (i=0; i < REGION_NUM_RECTS (&window->clipList); i++) { + for (i=0; i < RegionNumRects (&window->clipList); i++) { EPHYR_LOG ("x1:%d, y1:%d, x2:%d, y2:%d\n", - REGION_RECTS (&window->clipList)[i].x1, - REGION_RECTS (&window->clipList)[i].y1, - REGION_RECTS (&window->clipList)[i].x2, - REGION_RECTS (&window->clipList)[i].y2) ; + RegionRects (&window->clipList)[i].x1, + RegionRects (&window->clipList)[i].y1, + RegionRects (&window->clipList)[i].x2, + RegionRects (&window->clipList)[i].y2) ; } if (!ephyrDRIGetDrawableInfo (stuff->screen, @@ -1252,12 +1253,12 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) sizeof(drm_clip_rect_t) * rep.numBackClipRects, (char *)backClipRects); } - xfree(clipRects); + free(clipRects); clipRects = NULL ; EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int @@ -1308,7 +1309,7 @@ ProcXF86DRIGetDeviceInfo (register ClientPtr client) WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); } EPHYR_LOG ("leave\n") ; - return (client->noClientException); + return Success; } static int diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.c b/xserver/hw/kdrive/ephyr/ephyrglxext.c index a0278cc2b..dfc43e1d1 100644 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.c +++ b/xserver/hw/kdrive/ephyr/ephyrglxext.c @@ -243,7 +243,7 @@ ephyrGLXGetVisualConfigsReal (__GLXclientState *a_cl, out: EPHYR_LOG ("leave\n") ; - xfree (props_buf) ; + free(props_buf) ; props_buf = NULL ; return res ; @@ -300,7 +300,7 @@ ephyrGLXGetFBConfigsSGIXReal (__GLXclientState *a_cl, out: EPHYR_LOG ("leave\n") ; - xfree (props_buf) ; + free(props_buf) ; props_buf = NULL ; return res ; @@ -375,7 +375,7 @@ ephyrGLXQueryServerString(__GLXclientState *a_cl, GLbyte *a_pc) reply.sequenceNumber = client->sequence ; reply.length = __GLX_PAD (length) >> 2 ; reply.n = length ; - buf = xcalloc (reply.length << 2, 1); + buf = calloc(reply.length << 2, 1); if (!buf) { EPHYR_LOG_ERROR ("failed to allocate string\n;"); return BadAlloc; @@ -389,10 +389,10 @@ ephyrGLXQueryServerString(__GLXclientState *a_cl, GLbyte *a_pc) out: EPHYR_LOG ("leave\n") ; - xfree (server_string) ; + free(server_string) ; server_string = NULL; - xfree (buf); + free(buf); buf = NULL; return res ; diff --git a/xserver/hw/kdrive/ephyr/ephyrhostvideo.c b/xserver/hw/kdrive/ephyr/ephyrhostvideo.c index f4a1b9d17..600b50f74 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrhostvideo.c @@ -262,7 +262,7 @@ ephyrHostXVQueryAdaptors (EphyrHostXVAdaptorArray **a_adaptors) EPHYR_LOG ("enter\n") ; - result = Xcalloc (1, sizeof (EphyrHostXVAdaptorArray)) ; + result = calloc (1, sizeof (EphyrHostXVAdaptorArray)) ; if (!result) goto out ; @@ -340,7 +340,7 @@ ephyrHostXVAdaptorGetVideoFormats (const EphyrHostXVAdaptor *a_this, EPHYR_RETURN_VAL_IF_FAIL (a_this, NULL) ; nb_formats = ((XvAdaptorInfo*)a_this)->num_formats ; - formats = Xcalloc (nb_formats, sizeof (EphyrHostVideoFormat)) ; + formats = calloc (nb_formats, sizeof (EphyrHostVideoFormat)) ; for (i=0; i < nb_formats; i++) { memset (&visual_info_template, 0, sizeof (visual_info_template)) ; visual_info_template.visualid = @@ -380,7 +380,8 @@ ephyrHostXVAdaptorHasPutVideo (const EphyrHostXVAdaptor *a_this, { EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ; - if (((XvAdaptorInfo*)a_this)->type & XvVideoMask & XvInputMask) + if ((((XvAdaptorInfo*)a_this)->type & (XvVideoMask | XvInputMask)) == + (XvVideoMask | XvInputMask)) *a_result = TRUE ; else *a_result = FALSE ; @@ -391,7 +392,8 @@ Bool ephyrHostXVAdaptorHasGetVideo (const EphyrHostXVAdaptor *a_this, Bool *a_result) { - if (((XvAdaptorInfo*)a_this)->type & XvVideoMask & XvOutputMask) + if ((((XvAdaptorInfo*)a_this)->type & (XvVideoMask | XvOutputMask)) == + (XvVideoMask | XvOutputMask)) *a_result = TRUE ; else *a_result = FALSE ; @@ -404,7 +406,8 @@ ephyrHostXVAdaptorHasPutStill (const EphyrHostXVAdaptor *a_this, { EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ; - if (((XvAdaptorInfo*)a_this)->type & XvStillMask && XvInputMask) + if ((((XvAdaptorInfo*)a_this)->type & (XvStillMask | XvInputMask)) == + (XvStillMask | XvInputMask)) *a_result = TRUE ; else *a_result = FALSE ; @@ -417,7 +420,8 @@ ephyrHostXVAdaptorHasGetStill (const EphyrHostXVAdaptor *a_this, { EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ; - if (((XvAdaptorInfo*)a_this)->type & XvStillMask && XvOutputMask) + if ((((XvAdaptorInfo*)a_this)->type & (XvStillMask | XvOutputMask)) == + (XvStillMask | XvOutputMask)) *a_result = TRUE ; else *a_result = FALSE ; @@ -430,7 +434,8 @@ ephyrHostXVAdaptorHasPutImage (const EphyrHostXVAdaptor *a_this, { EPHYR_RETURN_VAL_IF_FAIL (a_this && a_result, FALSE) ; - if (((XvAdaptorInfo*)a_this)->type & XvImageMask && XvInputMask) + if ((((XvAdaptorInfo*)a_this)->type & (XvImageMask | XvInputMask)) == + (XvImageMask | XvInputMask)) *a_result = TRUE ; else *a_result = FALSE ; @@ -454,7 +459,7 @@ ephyrHostXVQueryEncodings (int a_port_id, &num_encodings, &encoding_info) ; if (num_encodings && encoding_info) { - encodings = Xcalloc (num_encodings, sizeof (EphyrHostEncoding)) ; + encodings = calloc (num_encodings, sizeof (EphyrHostEncoding)) ; for (i=0; i<num_encodings; i++) { encodings[i].id = encoding_info[i].encoding_id ; encodings[i].name = strdup (encoding_info[i].name) ; @@ -485,10 +490,10 @@ ephyrHostEncodingsDelete (EphyrHostEncoding *a_encodings, if (!a_encodings) return ; for (i=0; i < a_num_encodings; i++) { - xfree (a_encodings[i].name) ; + free(a_encodings[i].name) ; a_encodings[i].name = NULL ; } - xfree (a_encodings) ; + free(a_encodings) ; } void @@ -831,10 +836,8 @@ out: XFreeGC (dpy, gc) ; gc = NULL ; } - if (rects) { - free (rects) ; - rects = NULL ; - } + free(rects); + rects = NULL; EPHYR_LOG ("leave\n") ; return is_ok ; } diff --git a/xserver/hw/kdrive/ephyr/ephyrvideo.c b/xserver/hw/kdrive/ephyr/ephyrvideo.c index 6624ab98a..69a89ae61 100644 --- a/xserver/hw/kdrive/ephyr/ephyrvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrvideo.c @@ -332,7 +332,7 @@ ephyrXVPrivNew (void) EPHYR_LOG ("enter\n") ; - xv_priv = xcalloc (1, sizeof (EphyrXVPriv)) ; + xv_priv = calloc(1, sizeof (EphyrXVPriv)) ; if (!xv_priv) { EPHYR_LOG_ERROR ("failed to create EphyrXVPriv\n") ; goto error ; @@ -371,9 +371,9 @@ ephyrXVPrivDelete (EphyrXVPriv *a_this) ephyrHostXVAdaptorArrayDelete (a_this->host_adaptors) ; a_this->host_adaptors = NULL ; } - xfree (a_this->adaptors) ; + free(a_this->adaptors) ; a_this->adaptors = NULL ; - xfree (a_this) ; + free(a_this) ; EPHYR_LOG ("leave\n") ; } @@ -386,7 +386,7 @@ videoEncodingDup (EphyrHostEncoding *a_encodings, EPHYR_RETURN_VAL_IF_FAIL (a_encodings && a_num_encodings, NULL) ; - result = xcalloc (a_num_encodings, sizeof (KdVideoEncodingRec)) ; + result = calloc(a_num_encodings, sizeof (KdVideoEncodingRec)) ; for (i=0 ; i < a_num_encodings; i++) { result[i].id = a_encodings[i].id ; result[i].name = strdup (a_encodings[i].name) ; @@ -407,7 +407,7 @@ portAttributesDup (EphyrHostAttribute *a_encodings, EPHYR_RETURN_VAL_IF_FAIL (a_encodings && a_num_encodings, NULL) ; - result = xcalloc (a_num_encodings, sizeof (KdAttributeRec)) ; + result = calloc(a_num_encodings, sizeof (KdAttributeRec)) ; if (!result) { EPHYR_LOG_ERROR ("failed to allocate attributes\n") ; return NULL ; @@ -455,7 +455,7 @@ ephyrXVPrivQueryHostAdaptors (EphyrXVPriv *a_this) * copy what we can from adaptors into a_this->adaptors */ if (a_this->num_adaptors) { - a_this->adaptors = xcalloc (a_this->num_adaptors, + a_this->adaptors = calloc(a_this->num_adaptors, sizeof (KdVideoAdaptorRec)) ; if (!a_this->adaptors) { EPHYR_LOG_ERROR ("failed to create internal adaptors\n") ; @@ -513,7 +513,7 @@ ephyrXVPrivQueryHostAdaptors (EphyrXVPriv *a_this) ephyrHostXVAdaptorGetNbPorts (cur_host_adaptor) ; */ a_this->adaptors[i].pPortPrivates = - xcalloc (a_this->adaptors[i].nPorts, + calloc(a_this->adaptors[i].nPorts, sizeof (DevUnion) + sizeof (EphyrPortPriv)) ; port_priv_offset = a_this->adaptors[i].nPorts; for (j=0; j < a_this->adaptors[i].nPorts; j++) { @@ -656,7 +656,7 @@ ephyrXVPrivRegisterAdaptors (EphyrXVPriv *a_this, KdXVListGenericAdaptors (screen, ®istered_adaptors); num_adaptors = num_registered_adaptors + a_this->num_adaptors ; - adaptors = xcalloc (num_adaptors, sizeof (KdVideoAdaptorPtr)) ; + adaptors = calloc(num_adaptors, sizeof (KdVideoAdaptorPtr)) ; if (!adaptors) { EPHYR_LOG_ERROR ("failed to allocate adaptors tab\n") ; goto out ; @@ -673,9 +673,9 @@ ephyrXVPrivRegisterAdaptors (EphyrXVPriv *a_this, is_ok = TRUE ; out: - xfree (registered_adaptors) ; + free(registered_adaptors) ; registered_adaptors = NULL ; - xfree (adaptors) ; + free(adaptors) ; adaptors = NULL ; EPHYR_LOG ("leave\n") ; @@ -946,8 +946,8 @@ ephyrPutImage (KdScreenInfo *a_info, a_drw_x, a_drw_y, a_drw_w, a_drw_h, a_src_x, a_src_y, a_src_w, a_src_h, a_width, a_height, a_buf, - (EphyrHostBox*)REGION_RECTS (a_clipping_region), - REGION_NUM_RECTS (a_clipping_region))) { + (EphyrHostBox*)RegionRects (a_clipping_region), + RegionNumRects (a_clipping_region))) { EPHYR_LOG_ERROR ("EphyrHostXVPutImage() failed\n") ; goto out ; } @@ -1025,8 +1025,8 @@ ephyrReputImage (KdScreenInfo *a_info, port_priv->src_w, port_priv->src_h, port_priv->image_width, port_priv->image_height, port_priv->image_buf, - (EphyrHostBox*)REGION_RECTS (a_clipping_region), - REGION_NUM_RECTS (a_clipping_region))) { + (EphyrHostBox*)RegionRects (a_clipping_region), + RegionNumRects (a_clipping_region))) { EPHYR_LOG_ERROR ("ephyrHostXVPutImage() failed\n") ; goto out ; } @@ -1064,7 +1064,7 @@ ephyrPutVideo (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1115,7 +1115,7 @@ ephyrGetVideo (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1166,7 +1166,7 @@ ephyrPutStill (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1217,7 +1217,7 @@ ephyrGetStill (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c index d546370ba..2ebeca958 100644 --- a/xserver/hw/kdrive/ephyr/hostx.c +++ b/xserver/hw/kdrive/ephyr/hostx.c @@ -532,7 +532,7 @@ hostx_get_server_depth (EphyrScreenInfo screen) { struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen); - return (host_screen ? host_screen->server_depth : 0); + return host_screen ? host_screen->server_depth : 0; } void @@ -669,11 +669,8 @@ hostx_screen_init (EphyrScreenInfo screen, } else { - if (host_screen->ximg->data) - { - free(host_screen->ximg->data); - host_screen->ximg->data = NULL; - } + free(host_screen->ximg->data); + host_screen->ximg->data = NULL; XDestroyImage(host_screen->ximg); } @@ -1160,10 +1157,8 @@ out: XFree (visuals) ; visuals = NULL; } - if (host_visuals) { - free (host_visuals) ; - host_visuals = NULL; - } + free(host_visuals); + host_visuals = NULL; EPHYR_LOG ("leave\n") ; return is_ok ; @@ -1292,10 +1287,8 @@ hostx_set_window_bounding_rectangles (int a_window, rects, a_num_rects, ShapeSet, YXBanded) ; is_ok = TRUE ; - if (rects) { - free (rects) ; - rects = NULL ; - } + free(rects); + rects = NULL; EPHYR_LOG ("leave\n") ; return is_ok; } @@ -1329,10 +1322,8 @@ hostx_set_window_clipping_rectangles (int a_window, rects, a_num_rects, ShapeSet, YXBanded) ; is_ok = TRUE ; - if (rects) { - free (rects) ; - rects = NULL ; - } + free(rects); + rects = NULL; EPHYR_LOG ("leave\n") ; return is_ok; } |