diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-10-01 23:36:26 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-10-01 23:36:26 -0700 |
commit | 293c318c85deb022fdaae460a33cf57c6a1e6931 (patch) | |
tree | d992871097b1630462af16546eac2bfb0d08538f | |
parent | dfcfd04a73aaad353e9a74539a45e6c20072d5bc (diff) | |
parent | 4257023c1e40387aff096d5f00d746d3f7a521b4 (diff) |
Merge commit 'origin/server-1.7-branch' into xorg-server-1.7-apple
-rw-r--r-- | Xext/shm.c | 43 | ||||
-rw-r--r-- | composite/compinit.c | 59 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | dix/colormap.c | 64 | ||||
-rw-r--r-- | dix/getevents.c | 13 | ||||
-rw-r--r-- | exa/exa_migration_classic.c | 10 | ||||
-rw-r--r-- | glx/glxscreens.c | 58 | ||||
-rw-r--r-- | hw/kdrive/ephyr/Xephyr.man.pre | 5 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrinit.c | 16 | ||||
-rw-r--r-- | hw/xfree86/common/compiler.h | 16 | ||||
-rw-r--r-- | hw/xfree86/common/xf86DGA.c | 29 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 8 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86DiDGA.c | 15 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86EdidModes.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 10 | ||||
-rw-r--r-- | hw/xfree86/os-support/hurd/hurd_video.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/misc/SlowBcopy.c | 52 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/bios_mmap.c | 2 | ||||
-rw-r--r-- | hw/xfree86/vgahw/vgaHW.c | 16 | ||||
-rw-r--r-- | include/colormap.h | 5 | ||||
-rw-r--r-- | render/glyph.c | 97 | ||||
-rw-r--r-- | render/render.c | 6 |
23 files changed, 330 insertions, 211 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index e4f08e2a2..a6f804cd5 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -497,15 +497,40 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC, char *data) { PixmapPtr pPixmap; - - pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), - PixmapBytePad(w, depth), - data); - if (!pPixmap) - return; - pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy); - FreeScratchPixmapHeader(pPixmap); + + if (format == ZPixmap || depth == 1) { + pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, + BitsPerPixel(depth), + PixmapBytePad(w, depth), + data); + if (!pPixmap) + return; + pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy); + FreeScratchPixmapHeader(pPixmap); + } else { + GCPtr putGC = GetScratchGC(depth, dst->pScreen); + + if (!putGC) + return; + + pPixmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth, + CREATE_PIXMAP_USAGE_SCRATCH); + if (!pPixmap) { + FreeScratchGC(putGC); + return; + } + ValidateGC(&pPixmap->drawable, putGC); + (*putGC->ops->PutImage)(&pPixmap->drawable, putGC, depth, -sx, -sy, w, h, 0, + (format == XYPixmap) ? XYPixmap : ZPixmap, data); + FreeScratchGC(putGC); + if (format == XYBitmap) + (void)(*pGC->ops->CopyPlane)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh, + dx, dy, 1L); + else + (void)(*pGC->ops->CopyArea)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh, + dx, dy); + (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); + } } #ifdef PANORAMIX diff --git a/composite/compinit.c b/composite/compinit.c index 6159e4e49..96ac70fd0 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -248,15 +248,9 @@ static Bool compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs, CompAlternateVisual *alt) { - VisualPtr visual, visuals; - int i; - int numVisuals; - XID *installedCmaps; - ColormapPtr installedCmap; - int numInstalledCmaps; + VisualPtr visual; DepthPtr depth; PictFormatPtr pPictFormat; - VisualID *vid; unsigned long alphaMask; /* @@ -277,54 +271,13 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs, pPictFormat->direct.red != pScreen->visuals[0].offsetRed) return FALSE; - vid = xalloc(sizeof(VisualID)); - if (!vid) - return FALSE; - - /* Find the installed colormaps */ - installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID)); - if (!installedCmaps) { - xfree(vid); - return FALSE; - } - numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen, - installedCmaps); - - /* realloc the visual array to fit the new one in place */ - numVisuals = pScreen->numVisuals; - visuals = xrealloc(pScreen->visuals, (numVisuals + 1) * sizeof(VisualRec)); - if (!visuals) { - xfree(vid); - xfree(installedCmaps); - return FALSE; + if (ResizeVisualArray(pScreen, 1, depth) == FALSE) { + return FALSE; } - /* - * Fix up any existing installed colormaps -- we'll assume that - * the only ones created so far have been installed. If this - * isn't true, we'll have to walk the resource database looking - * for all colormaps. - */ - for (i = 0; i < numInstalledCmaps; i++) { - int j, rc; - - rc = dixLookupResourceByType((pointer *)&installedCmap, - installedCmaps[i], RT_COLORMAP, - serverClient, DixReadAccess); - if (rc != Success) - continue; - j = installedCmap->pVisual - pScreen->visuals; - installedCmap->pVisual = &visuals[j]; - } - - xfree(installedCmaps); - - pScreen->visuals = visuals; - visual = visuals + pScreen->numVisuals; /* the new one */ - pScreen->numVisuals++; + visual = pScreen->visuals + (pScreen->numVisuals - 1); /* the new one */ /* Initialize the visual */ - visual->vid = FakeClientID (0); visual->bitsPerRGBValue = 8; if (PICT_FORMAT_TYPE(alt->format) == PICT_TYPE_COLOR) { visual->class = PseudoColor; @@ -357,10 +310,6 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs, /* remember the visual ID to detect auto-update windows */ compRegisterAlternateVisuals(cs, &visual->vid, 1); - /* Fix up the depth */ - *vid = visual->vid; - depth->numVids = 1; - depth->vids = vid; return TRUE; } diff --git a/configure.ac b/configure.ac index 7d0abca8f..9425bc964 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.6.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2009-9-22" +AC_INIT([xorg-server], 1.7.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2009-10-2" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE @@ -598,7 +598,7 @@ dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) -AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: yes)]), [XNEST=$enableval], [XNEST=yes]) +AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) @@ -1373,6 +1373,9 @@ AC_MSG_RESULT([$XNEST]) AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) if test "x$XNEST" = xyes; then + if test "x$have_xnest" = xno; then + AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) + fi XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $CONFIG_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XNEST_LIBS]) diff --git a/dix/colormap.c b/dix/colormap.c index a5a006e60..d702b0204 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -2690,3 +2690,67 @@ IsMapInstalled(Colormap map, WindowPtr pWin) xfree(pmaps); return (found); } + +struct colormap_lookup_data { + ScreenPtr pScreen; + VisualPtr visuals; +}; + +static void _colormap_find_resource(pointer value, XID id, + pointer cdata) +{ + struct colormap_lookup_data *cmap_data = cdata; + VisualPtr visuals = cmap_data->visuals; + ScreenPtr pScreen = cmap_data->pScreen; + ColormapPtr cmap = value; + int j; + + j = cmap->pVisual - pScreen->visuals; + cmap->pVisual = &visuals[j]; +} + +/* something has realloced the visuals, instead of breaking + ABI fix it up here - glx and compsite did this wrong */ +Bool +ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, + DepthPtr depth) +{ + struct colormap_lookup_data cdata; + int numVisuals; + VisualPtr visuals; + XID *vids, vid; + int first_new_vid, first_new_visual, i; + + first_new_vid = depth->numVids; + first_new_visual = pScreen->numVisuals; + + vids = xrealloc(depth->vids, (depth->numVids + new_visual_count) * sizeof(XID)); + if (!vids) + return FALSE; + + /* its realloced now no going back if we fail the next one */ + depth->vids = vids; + + numVisuals = pScreen->numVisuals + new_visual_count; + visuals = xrealloc(pScreen->visuals, numVisuals * sizeof(VisualRec)); + if (!visuals) { + return FALSE; + } + + cdata.visuals = visuals; + cdata.pScreen = pScreen; + FindClientResourcesByType(serverClient, RT_COLORMAP, _colormap_find_resource, &cdata); + + pScreen->visuals = visuals; + + for (i = 0; i < new_visual_count; i++) { + vid = FakeClientID(0); + pScreen->visuals[first_new_visual + i].vid = vid; + vids[first_new_vid + i] = vid; + } + + depth->numVids += new_visual_count; + pScreen->numVisuals += new_visual_count; + + return TRUE; +} diff --git a/dix/getevents.c b/dix/getevents.c index 5224d31eb..2df32e8f5 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -781,6 +781,19 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, *screeny_frac = dev->last.remainder[1]; } + /* Hit the left screen edge? */ + if (*screenx <= 0 && *screenx_frac < 0.0f) + { + *screenx_frac = 0.0f; + x_frac = 0.0f; + } + if (*screeny <= 0 && *screeny_frac < 0.0f) + { + *screeny_frac = 0.0f; + y_frac = 0.0f; + } + + old_screenx = *screenx; old_screeny = *screeny; /* This takes care of crossing screens for us, as well as clipping diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c index 4819af841..6d7b9f5b6 100644 --- a/exa/exa_migration_classic.c +++ b/exa/exa_migration_classic.c @@ -242,11 +242,6 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, pBox++; } - if (access_prepared) - exaFinishAccess(&pPixmap->drawable, fallback_index); - else if (need_sync && sync) - sync (pPixmap->drawable.pScreen); - pExaPixmap->offscreen = save_offscreen; pPixmap->devKind = save_pitch; @@ -261,6 +256,11 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg); REGION_UNINIT(pScreen, &CopyReg); + + if (access_prepared) + exaFinishAccess(&pPixmap->drawable, fallback_index); + else if (need_sync && sync) + sync (pPixmap->drawable.pScreen); } /** diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 81faddd04..7d29d31de 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -250,12 +250,8 @@ GLint glxConvertToXVisualType(int visualType) static VisualPtr AddScreenVisuals(ScreenPtr pScreen, int count, int d) { - XID *installedCmaps, *vids, vid; - int numInstalledCmaps, numVisuals, i, j; - VisualPtr visuals; - ColormapPtr installedCmap; + int i; DepthPtr depth; - int rc; depth = NULL; for (i = 0; i < pScreen->numDepths; i++) { @@ -267,56 +263,8 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d) if (depth == NULL) return NULL; - /* Find the installed colormaps */ - installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID)); - if (!installedCmaps) - return NULL; - - numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen, installedCmaps); - - /* realloc the visual array to fit the new one in place */ - numVisuals = pScreen->numVisuals; - visuals = xrealloc(pScreen->visuals, (numVisuals + count) * sizeof(VisualRec)); - if (!visuals) { - xfree(installedCmaps); - return NULL; - } - - vids = xrealloc(depth->vids, (depth->numVids + count) * sizeof(XID)); - if (vids == NULL) { - xfree(installedCmaps); - xfree(visuals); - return NULL; - } - - /* - * Fix up any existing installed colormaps -- we'll assume that - * the only ones created so far have been installed. If this - * isn't true, we'll have to walk the resource database looking - * for all colormaps. - */ - for (i = 0; i < numInstalledCmaps; i++) { - rc = dixLookupResourceByType((pointer *)&installedCmap, - installedCmaps[i], RT_COLORMAP, - serverClient, DixReadAccess); - if (rc != Success) - continue; - j = installedCmap->pVisual - pScreen->visuals; - installedCmap->pVisual = &visuals[j]; - } - - xfree(installedCmaps); - - for (i = 0; i < count; i++) { - vid = FakeClientID(0); - visuals[pScreen->numVisuals + i].vid = vid; - vids[depth->numVids + i] = vid; - } - - pScreen->visuals = visuals; - pScreen->numVisuals += count; - depth->vids = vids; - depth->numVids += count; + if (ResizeVisualArray(pScreen, count, depth) == FALSE) + return NULL; /* Return a pointer to the first of the added visuals. */ return pScreen->visuals + pScreen->numVisuals - count; diff --git a/hw/kdrive/ephyr/Xephyr.man.pre b/hw/kdrive/ephyr/Xephyr.man.pre index 008256914..eb80b96b0 100644 --- a/hw/kdrive/ephyr/Xephyr.man.pre +++ b/hw/kdrive/ephyr/Xephyr.man.pre @@ -46,6 +46,11 @@ sets the screen size. .BI -parent " id" uses exiting window .I id . +If a +.BI -screen +argument follows a +.BI -parent +argument, this screen is embedded into the given window. .TP 8 .B -host-cursor set 'cursor acceleration': diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 22152ffe0..eecad7e42 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -148,6 +148,7 @@ processScreenArg (char *screen_size, char *parent_id) int ddxProcessArgument (int argc, char **argv, int i) { + static char* parent = NULL; EPHYR_DBG("mark argv[%d]='%s'", i, argv[i] ); if (i == 1) @@ -159,6 +160,18 @@ ddxProcessArgument (int argc, char **argv, int i) { if(i+1 < argc) { + int j; + /* If parent is specified and a screen argument follows, don't do + * anything, let the -screen handling init the rest */ + for (j = i; j < argc; j++) + { + if (!strcmp(argv[j], "-screen")) + { + parent = argv[i + 1]; + return 2; + } + } + processScreenArg ("100x100", argv[i+1]); return 2; } @@ -170,7 +183,8 @@ ddxProcessArgument (int argc, char **argv, int i) { if ((i+1) < argc) { - processScreenArg (argv[i+1], NULL); + processScreenArg (argv[i+1], parent); + parent = NULL; return 2; } diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index cdb493a23..a450bd676 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1211,6 +1211,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long); extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long); extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long); extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long); +extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); +extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); /* Some macros to hide the system dependencies for MMIO accesses */ /* Changed to kill noise generated by gcc's -Wcast-align */ @@ -1342,4 +1344,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long); # define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val) # endif /* __alpha__ */ + +/* + * With Intel, the version in os-support/misc/SlowBcopy.s is used. + * This avoids port I/O during the copy (which causes problems with + * some hardware). + */ +# ifdef __alpha__ +# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count) +# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count) +# else /* __alpha__ */ +# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count) +# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count) +# endif /* __alpha__ */ + #endif /* _COMPILER_H */ diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 42b7c5805..804fd37c1 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -120,8 +120,22 @@ DGAInit( DGAScreenKey = &DGAScreenKeyIndex; - if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) - return FALSE; + pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); + + if (!pScreenPriv) + { + if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) + return FALSE; + dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv); + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = DGACloseScreen; + pScreenPriv->DestroyColormap = pScreen->DestroyColormap; + pScreen->DestroyColormap = DGADestroyColormap; + pScreenPriv->InstallColormap = pScreen->InstallColormap; + pScreen->InstallColormap = DGAInstallColormap; + pScreenPriv->UninstallColormap = pScreen->UninstallColormap; + pScreen->UninstallColormap = DGAUninstallColormap; + } pScreenPriv->pScrn = pScrn; pScreenPriv->numModes = num; @@ -146,17 +160,6 @@ DGAInit( modes[i].flags &= ~DGA_PIXMAP_AVAILABLE; #endif - dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv); - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = DGACloseScreen; - pScreenPriv->DestroyColormap = pScreen->DestroyColormap; - pScreen->DestroyColormap = DGADestroyColormap; - pScreenPriv->InstallColormap = pScreen->InstallColormap; - pScreen->InstallColormap = DGAInstallColormap; - pScreenPriv->UninstallColormap = pScreen->UninstallColormap; - pScreen->UninstallColormap = DGAUninstallColormap; - - return TRUE; } diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index c1e31e003..506fbb9cb 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -806,7 +806,7 @@ xf86CrtcScreenInit (ScreenPtr screen) screen->CloseScreen = xf86CrtcCloseScreen; #ifdef XFreeXDGA - xf86DiDGAInit(screen, 0); + _xf86_di_dga_init_internal(screen); #endif #ifdef RANDR_13_INTERFACE return RANDR_INTERFACE_VERSION; @@ -1928,7 +1928,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn) scrn->currentMode = scrn->modes; #ifdef XFreeXDGA if (scrn->pScreen) - xf86DiDGAReInit(scrn->pScreen); + _xf86_di_dga_reinit_internal(scrn->pScreen); #endif } diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 69afaa5d1..9baa956a3 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -833,6 +833,10 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus); extern _X_EXPORT Bool xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address); +/* this is the real function, used only internally */ +_X_INTERNAL Bool +_xf86_di_dga_init_internal (ScreenPtr pScreen); + /** * Re-initialize dga for this screen (as when the set of modes changes) */ @@ -841,6 +845,10 @@ extern _X_EXPORT Bool xf86DiDGAReInit (ScreenPtr pScreen); #endif +/* This is the real function, used only internally */ +_X_INTERNAL Bool +_xf86_di_dga_reinit_internal (ScreenPtr pScreen); + /* * Set the subpixel order reported for the screen using * the information from the outputs diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c index 0f7b8342c..60fbdbf05 100644 --- a/hw/xfree86/modes/xf86DiDGA.c +++ b/hw/xfree86/modes/xf86DiDGA.c @@ -175,6 +175,12 @@ static DGAFunctionRec xf86_dga_funcs = { Bool xf86DiDGAReInit (ScreenPtr pScreen) { + return TRUE; +} + +Bool +_xf86_di_dga_reinit_internal (ScreenPtr pScreen) +{ ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -190,12 +196,15 @@ xf86DiDGAReInit (ScreenPtr pScreen) Bool xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address) { + return TRUE; +} + +Bool +_xf86_di_dga_init_internal (ScreenPtr pScreen) +{ ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - if (DGAAvailable(pScreen->myNum)) - return TRUE; - xf86_config->dga_flags = 0; xf86_config->dga_address = 0; xf86_config->dga_width = 0; diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 6e11f9a3d..2f80070cf 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -957,7 +957,7 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) quirks = xf86DDCDetectQuirks(scrnIndex, DDC, FALSE); - if (Monitor->widthmm <= 0 && Monitor->heightmm <= 0) { + if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) { Monitor->widthmm = 10 * DDC->features.hsize; Monitor->heightmm = 10 * DDC->features.vsize; } diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 9e65c9969..5de6b0c00 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -268,13 +268,9 @@ xf86RotateBlockHandler(int screenNum, pointer blockData, rotation_active = xf86RotateRedisplay(pScreen); pScreen->BlockHandler = xf86_config->BlockHandler; (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); - if (rotation_active) { - /* Re-wrap if rotation is still happening */ - xf86_config->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = xf86RotateBlockHandler; - } else { - xf86_config->BlockHandler = NULL; - } + /* cannot avoid re-wrapping until all wrapping is audited */ + xf86_config->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = xf86RotateBlockHandler; } void diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index b8b00c892..4a99db375 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -42,7 +42,7 @@ * Video Memory Mapping section ***************************************************************************/ static pointer -mapVidMem(int ScreenNum,int Flags, unsigned long Base, unsigned long Size) +mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { mach_port_t device,iopl_dev; memory_object_t iopl_mem; diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index 8a5017e52..182a3e6ec 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/hw/xfree86/os-support/misc/SlowBcopy.c @@ -1,8 +1,15 @@ +/******************************************************************************* + for Alpha Linux +*******************************************************************************/ + /* * Create a dependency that should be immune from the effect of register * renaming as is commonly seen in superscalar processors. This should * insert a minimum of 100-ns delays between reads/writes at clock rates * up to 100 MHz---GGL + * + * Slowbcopy(char *src, char *dst, int count) + * */ #ifdef HAVE_XORG_CONFIG_H @@ -47,3 +54,48 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) while(len--) *dst++ = *src++; } + +#ifdef __alpha__ + +#ifdef linux + +#define SPARSE (7) + +#else + +#define SPARSE 0 + +#endif + +void +xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count) +{ + unsigned long addr; + long result; + + addr = (unsigned long) src; + while( count ){ + result = *(volatile int *) addr; + result >>= ((addr>>SPARSE) & 3) * 8; + *dst++ = (unsigned char) (0xffUL & result); + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); + } +} + +void +xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count) +{ + unsigned long addr; + + addr = (unsigned long) dst; + while(count) { + *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101; + src++; + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); + } +} +#endif diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c index a615a1d45..40afd5b8e 100644 --- a/hw/xfree86/os-support/shared/bios_mmap.c +++ b/hw/xfree86/os-support/shared/bios_mmap.c @@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, return(-1); } - xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len); + xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len); munmap((caddr_t)base, mlen); close(fd); diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c index 025dde2da..004376b75 100644 --- a/hw/xfree86/vgahw/vgaHW.c +++ b/hw/xfree86/vgahw/vgaHW.c @@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore) if (hwp->FontInfo1) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ - xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT); + slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT); } #endif @@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore) if (hwp->FontInfo2) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ - xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT); + slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT); } #endif @@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore) if (hwp->TextInfo) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ - xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT); + slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT); hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */ - xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT, + slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT, hwp->Base, TEXT_AMOUNT); } #endif @@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save) if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ - xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT); + slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT); } #endif /* SAVE_FONT1 */ #if SAVE_FONT2 if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ - xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT); + slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT); } #endif /* SAVE_FONT2 */ #if SAVE_TEXT if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ - xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT); + slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT); hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */ - xf86SlowBcopy(hwp->Base, + slowbcopy_frombus(hwp->Base, (unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT); } #endif /* SAVE_TEXT */ diff --git a/include/colormap.h b/include/colormap.h index a3467c93f..de48ce8d8 100644 --- a/include/colormap.h +++ b/include/colormap.h @@ -179,4 +179,9 @@ extern _X_EXPORT int IsMapInstalled( Colormap /*map*/, WindowPtr /*pWin*/); +extern _X_EXPORT Bool ResizeVisualArray( + ScreenPtr /* pScreen */, + int /* new_vis_count */, + DepthPtr /* depth */); + #endif /* CMAP_H */ diff --git a/render/glyph.c b/render/glyph.c index 7c044aada..7fcdfd9d1 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -272,13 +272,32 @@ CheckDuplicates (GlyphHashPtr hash, char *where) #define DuplicateRef(a,b) #endif +static void +FreeGlyphPicture(GlyphPtr glyph) +{ + PictureScreenPtr ps; + int i; + + for (i = 0; i < screenInfo.numScreens; i++) + { + ScreenPtr pScreen = screenInfo.screens[i]; + + if (GlyphPicture(glyph)[i]) + FreePicture ((pointer) GlyphPicture (glyph)[i], 0); + + ps = GetPictureScreenIfSet (pScreen); + if (ps) + (*ps->UnrealizeGlyph) (pScreen, glyph); + } +} + + void FreeGlyph (GlyphPtr glyph, int format) { CheckDuplicates (&globalGlyphs[format], "FreeGlyph"); if (--glyph->refcnt == 0) { - PictureScreenPtr ps; GlyphRefPtr gr; int i; int first; @@ -305,17 +324,7 @@ FreeGlyph (GlyphPtr glyph, int format) globalGlyphs[format].tableEntries--; } - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - - FreePicture ((pointer) GlyphPicture (glyph)[i], 0); - - ps = GetPictureScreenIfSet (pScreen); - if (ps) - (*ps->UnrealizeGlyph) (pScreen, glyph); - } - + FreeGlyphPicture(glyph); FreeGlyphPrivates(glyph); xfree (glyph); } @@ -334,15 +343,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) TRUE, glyph->sha1); if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph) { - PictureScreenPtr ps; - int i; - - for (i = 0; i < screenInfo.numScreens; i++) - { - ps = GetPictureScreenIfSet (screenInfo.screens[i]); - if (ps) - (*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph); - } + FreeGlyphPicture(glyph); FreeGlyphPrivates(glyph); xfree (glyph); glyph = gr->glyph; @@ -414,6 +415,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) for (i = 0; i < screenInfo.numScreens; i++) { + GlyphPicture(glyph)[i] = NULL; ps = GetPictureScreenIfSet (screenInfo.screens[i]); if (ps) @@ -721,32 +723,35 @@ miGlyphs (CARD8 op, glyph = *glyphs++; pPicture = GlyphPicture (glyph)[pScreen->myNum]; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else + if (pPicture) { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); + if (maskFormat) + { + CompositePicture (PictOpAdd, + pPicture, + None, + pMask, + 0, 0, + 0, 0, + x - glyph->info.x, + y - glyph->info.y, + glyph->info.width, + glyph->info.height); + } + else + { + CompositePicture (op, + pSrc, + pPicture, + pDst, + xSrc + (x - glyph->info.x) - xDst, + ySrc + (y - glyph->info.y) - yDst, + 0, 0, + x - glyph->info.x, + y - glyph->info.y, + glyph->info.width, + glyph->info.height); + } } x += glyph->info.xOff; diff --git a/render/render.c b/render/render.c index a3067665e..a32d797a7 100644 --- a/render/render.c +++ b/render/render.c @@ -1043,7 +1043,7 @@ ProcRenderAddGlyphs (ClientPtr client) CARD32 *gids; xGlyphInfo *gi; CARD8 *bits; - int size; + unsigned int size; int err; int i, screen; PicturePtr pSrc = NULL, pDst = NULL; @@ -1131,6 +1131,10 @@ ProcRenderAddGlyphs (ClientPtr client) ScreenPtr pScreen; int error; + /* Skip work if it's invisibly small anyway */ + if (!width || !height) + break; + pScreen = screenInfo.screens[screen]; pSrcPix = GetScratchPixmapHeader (pScreen, width, height, |