diff options
author | Zephaniah E. Hull <warp@agamemnon.b5> | 2006-10-21 04:26:14 -0400 |
---|---|---|
committer | Zephaniah E. Hull <warp@agamemnon.b5> | 2006-10-21 04:26:14 -0400 |
commit | e26a494f417c3c700636ee68892c3015b2e0f27a (patch) | |
tree | 05c7c00ca9815a3b3125d406dfe8f912071fc09e /hw/xfree86 | |
parent | 736b0d5078597abbda80444deef852879260af90 (diff) | |
parent | aeba855b07832354f59678e20cc29a085e42bd99 (diff) |
Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/xserver
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/Makefile.am | 18 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Cursor.c | 5 | ||||
-rw-r--r-- | hw/xfree86/common/xf86DGA.c | 46 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Events.c | 13 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Module.h | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 21 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.c | 66 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.h | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xvpriv.h | 1 | ||||
-rw-r--r-- | hw/xfree86/loader/xf86sym.c | 1 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgcfg/Makefile.am | 20 | ||||
-rw-r--r-- | hw/xfree86/xorgconf.cpp | 5 |
13 files changed, 111 insertions, 94 deletions
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 5cce11d27..79d2ec5c0 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/cpprules.in + if DRI DRI_SUBDIR = dri endif @@ -82,7 +84,23 @@ endif optionsdir = $(libdir)/X11 dist_options_DATA = Options +BUILT_SOURCES = xorg.conf.example +CLEAN = xorg.conf.example xorg.conf.example.pre EXTRA_DIST = xorgconf.cpp +CPP_FILES_FLAGS = \ + -DRGBPATH=\"$(RGB_DB)\" \ + -DLOCALFONTPATH="\"$(BASE_FONT_PATH)/local\"" \ + -DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \ + -DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \ + -DTRUETYPEFONTPATH="\"$(BASE_FONT_PATH)/TTF\"" \ + -DCIDFONTPATH="\"$(BASE_FONT_PATH)/CID\"" \ + -DDPI75FONTPATH="\"$(BASE_FONT_PATH)/75dpi\"" \ + -DDPI100FONTPATH="\"$(BASE_FONT_PATH)/100dpi\"" \ + -DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\" + relink: rm -f Xorg && $(MAKE) Xorg + +xorg.conf.example.pre: xorgconf.cpp + cp $< $@ diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 20905b030..46d812804 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -208,7 +208,6 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) ScreenPtr pCursorScreen; Bool Switched; int px, py; - int sigstate; if (!pScr->vtSema || !mode || !pScr->SwitchMode) return FALSE; @@ -228,10 +227,8 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (pScreen == pCursorScreen) miPointerGetPosition(inputInfo.pointer, &px, &py); - sigstate = xf86BlockSIGIO (); xf86EnterServerState(SETUP); Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0); - xf86EnterServerState(OPERATING); if (Switched) { pScr->currentMode = mode; @@ -266,7 +263,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) pScr->frameY1 = pScr->virtualY - 1; } } - xf86UnblockSIGIO (sigstate); + xf86EnterServerState(OPERATING); if (pScr->AdjustFrame) (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index cb7783994..204457fb1 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -909,22 +909,6 @@ DGAVTSwitch(void) Bool DGAStealKeyEvent(int index, xEvent *e) { - DGAScreenPtr pScreenPriv; - dgaEvent de; - - if(DGAScreenIndex < 0) /* no DGA */ - return FALSE; - - pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); - - if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */ - return FALSE; - - de.u.u.type = e->u.u.type + *XDGAEventBase; - de.u.u.detail = e->u.u.detail; - de.u.event.time = e->u.keyButtonPointer.time; - mieqEnqueue ((xEvent *) &de); - return TRUE; } static int DGAMouseX, DGAMouseY; @@ -932,36 +916,6 @@ static int DGAMouseX, DGAMouseY; Bool DGAStealMouseEvent(int index, xEvent *e, int dx, int dy) { - DGAScreenPtr pScreenPriv; - dgaEvent de; - - if(DGAScreenIndex < 0) /* no DGA */ - return FALSE; - - pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); - - if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */ - return FALSE; - - DGAMouseX += dx; - if (DGAMouseX < 0) - DGAMouseX = 0; - else if (DGAMouseX > screenInfo.screens[index]->width) - DGAMouseX = screenInfo.screens[index]->width; - DGAMouseY += dy; - if (DGAMouseY < 0) - DGAMouseY = 0; - else if (DGAMouseY > screenInfo.screens[index]->height) - DGAMouseY = screenInfo.screens[index]->height; - de.u.u.type = e->u.u.type + *XDGAEventBase; - de.u.u.detail = e->u.u.detail; - de.u.event.time = e->u.keyButtonPointer.time; - de.u.event.dx = dx; - de.u.event.dy = dy; - de.u.event.pad1 = DGAMouseX; - de.u.event.pad2 = DGAMouseY; - mieqEnqueue ((xEvent *) &de); - return TRUE; } Bool diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index db259b3b2..3df201aa7 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -104,19 +104,12 @@ extern Bool noXkbExtension; #define XE_POINTER 1 #define XE_KEYBOARD 2 -#define __EqEnqueue(ev) mieqEnqueue(ev) - -#define EqEnqueue(ev) { \ +#define EqEnqueue(pDev, ev) { \ int __sigstate = xf86BlockSIGIO (); \ - __EqEnqueue (ev); \ + mieqEnqueue (pDev, ev); \ xf86UnblockSIGIO(__sigstate); \ } -#define ENQUEUE(ev, code, direction, dev_type) \ - (ev)->u.u.detail = (code); \ - (ev)->u.u.type = (direction); \ - EqEnqueue((ev)) - /* * The first of many hacks to get VT switching to work under * Solaris 2.1 for x86. The basic problem is that Solaris is supposed @@ -839,7 +832,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev) else { nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); for (j = 0; j < nevents; j++) - mieqEnqueue(xf86Events + i); + EqEnqueue(pDev, xf86Events + i); } break; } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index a49bd541b..33351f2c1 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1651,8 +1651,8 @@ xf86PrintBanner() "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" "Select the \"xorg\" product for bugs you find in this release.\n" "Before reporting bugs in pre-release versions please check the\n" - "latest version in the X.Org Foundation CVS repository.\n" - "See http://wiki.x.org/wiki/CvsPage for CVS access instructions.\n"); + "latest version in the X.Org Foundation git repository.\n" + "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); #endif ErrorF("\nX Window System Version %d.%d.%d", XORG_VERSION_MAJOR, diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index f0cf5eb93..3c3247e40 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -84,7 +84,7 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 1) #define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 8a5d5b30a..e1fa9c116 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -657,20 +657,7 @@ xf86PostMotionEvent(DeviceIntPtr device, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(xf86Events + i); - -#if 0 - if (HAS_MOTION_HISTORY(local)) { - buff = ((char *)local->motion_history + - (sizeof(INT32) * local->dev->valuator->numAxes + sizeof(Time)) * local->last); - } - - if (HAS_MOTION_HISTORY(local)) { - local->last = (local->last + 1) % device->valuator->numMotionEvents; - if (local->last == local->first) - local->first = (local->first + 1) % device->valuator->numMotionEvents; - } -#endif + mieqEnqueue(device, xf86Events + i); } _X_EXPORT void @@ -796,7 +783,7 @@ xf86PostButtonEvent(DeviceIntPtr device, first_valuator, num_valuators, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(xf86Events + i); + mieqEnqueue(device, xf86Events + i); } _X_EXPORT void @@ -840,7 +827,7 @@ xf86PostKeyEvent(DeviceIntPtr device, } for (i = 0; i < nevents; i++) - mieqEnqueue(xf86Events + i); + mieqEnqueue(device, xf86Events + i); } _X_EXPORT void @@ -859,7 +846,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device, is_down ? KeyPress : KeyRelease, key_code); for (i = 0; i < nevents; i++) - mieqEnqueue(xf86Events + i); + mieqEnqueue(device, xf86Events + i); } /* diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 89cb6bac4..3e908b86a 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -974,6 +974,7 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) if(!winPriv) { winPriv = xalloc(sizeof(XF86XVWindowRec)); if(!winPriv) return BadAlloc; + memset(winPriv, 0, sizeof(XF86XVWindowRec)); winPriv->PortRec = portPriv; winPriv->next = PrivRoot; pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv; @@ -1026,6 +1027,9 @@ xf86XVDestroyWindow(WindowPtr pWin) pPriv->pDraw = NULL; tmp = WinPriv; + if(WinPriv->pGC) { + FreeGC(WinPriv->pGC, 0); + } WinPriv = WinPriv->next; xfree(tmp); } @@ -1118,6 +1122,8 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) while(WinPriv) { pPriv = WinPriv->PortRec; + if(!pPriv) goto next; + if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) REGION_DESTROY(pScreen, pPriv->pCompositeClip); @@ -1148,6 +1154,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) } } +next: pPrev = WinPriv; WinPriv = WinPriv->next; } @@ -1739,9 +1746,13 @@ xf86XVPutImage( REGION_UNINIT(pScreen, &VPReg); } - if(portPriv->pDraw) { + /* If we are changing windows, unregister our port in the old window */ + if(portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); - } + + /* Register our port with the new window */ + ret = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); + if(ret != Success) goto PUT_IMAGE_BAILOUT; if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { clippedAway = TRUE; @@ -1772,7 +1783,6 @@ xf86XVPutImage( if((ret == Success) && (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { - xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); portPriv->isOn = XV_ON; portPriv->pDraw = pDraw; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; @@ -1813,6 +1823,56 @@ xf86XVQueryImageAttributes( format->id, width, height, pitches, offsets); } + +_X_EXPORT void +xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) +{ + ScreenPtr pScreen = pDraw->pScreen; + WindowPtr pWin = (WindowPtr)pDraw; + XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); + GCPtr pGC = NULL; + XID pval[2]; + BoxPtr pbox = REGION_RECTS(clipboxes); + int i, nbox = REGION_NUM_RECTS(clipboxes); + xRectangle *rects; + + if(!xf86Screens[pScreen->myNum]->vtSema) return; + + if(pPriv) + pGC = pPriv->pGC; + + if(!pGC) { + int status; + pval[0] = key; + pval[1] = IncludeInferiors; + pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status); + if(!pGC) return; + ValidateGC(pDraw, pGC); + if (pPriv) pPriv->pGC = pGC; + } else if (key != pGC->fgPixel){ + pval[0] = key; + ChangeGC(pGC, GCForeground, pval); + ValidateGC(pDraw, pGC); + } + + REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y); + + rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + + for(i = 0; i < nbox; i++, pbox++) { + rects[i].x = pbox->x1; + rects[i].y = pbox->y1; + rects[i].width = pbox->x2 - pbox->x1; + rects[i].height = pbox->y2 - pbox->y1; + } + + (*pGC->ops->PolyFillRect)(pDraw, pGC, nbox, rects); + + if (!pPriv) FreeGC(pGC, 0); + + DEALLOCATE_LOCAL(rects); +} + _X_EXPORT void xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) { diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h index e0feb57b8..817e2b994 100644 --- a/hw/xfree86/common/xf86xv.h +++ b/hw/xfree86/common/xf86xv.h @@ -232,6 +232,9 @@ void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr); void xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes); +void +xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); + Bool xf86XVClipVideoHelper( BoxPtr dst, diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h index ced053679..e716c9c6a 100644 --- a/hw/xfree86/common/xf86xvpriv.h +++ b/hw/xfree86/common/xf86xvpriv.h @@ -80,6 +80,7 @@ typedef struct { typedef struct _XF86XVWindowRec{ XvPortRecPrivatePtr PortRec; struct _XF86XVWindowRec *next; + GCPtr pGC; } XF86XVWindowRec, *XF86XVWindowPtr; #endif /* _XF86XVPRIV_H_ */ diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 586d5dc81..8e39373b3 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -621,6 +621,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86XVAllocateVideoAdaptorRec) SYMFUNC(xf86XVFreeVideoAdaptorRec) SYMFUNC(xf86XVFillKeyHelper) + SYMFUNC(xf86XVFillKeyHelperDrawable) SYMFUNC(xf86XVClipVideoHelper) SYMFUNC(xf86XVCopyYUV12ToPacked) SYMFUNC(xf86XVCopyPacked) diff --git a/hw/xfree86/utils/xorgcfg/Makefile.am b/hw/xfree86/utils/xorgcfg/Makefile.am index 73e4042ae..309ed5c0a 100644 --- a/hw/xfree86/utils/xorgcfg/Makefile.am +++ b/hw/xfree86/utils/xorgcfg/Makefile.am @@ -56,6 +56,7 @@ endif if NEED_STRLCAT STRL_SRCS = $(top_srcdir)/os/strlcat.c $(top_srcdir)/os/strlcpy.c endif +endif BUILD_XORGCFG xorgcfg_SOURCES = \ accessx.c \ @@ -95,10 +96,7 @@ xorgcfg_SOURCES = \ xf86config.h \ $(STRL_SRCS) -XBMdir = $(includedir)/X11/bitmaps -XPMdir = $(includedir)/X11/pixmaps - -XBM_DATA = \ +BITMAPS = \ card.xbm \ keyboard.xbm \ monitor.xbm \ @@ -112,7 +110,7 @@ XBM_DATA = \ shorter.xbm \ taller.xbm -XPM_DATA = \ +PIXMAPS = \ card.xpm \ computer.xpm \ keyboard.xpm \ @@ -122,6 +120,13 @@ XPM_DATA = \ # Rules needed to cpp man page & app-defaults include $(top_srcdir)/cpprules.in +if BUILD_XORGCFG +XBMdir = $(includedir)/X11/bitmaps +XPMdir = $(includedir)/X11/pixmaps + +XBM_DATA = $(BITMAPS) +XPM_DATA = $(PIXMAPS) + # App default files (*.ad) appdefaultdir = @APPDEFAULTDIR@ @@ -146,7 +151,6 @@ appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) all-local: $(appman_PRE) $(appman_DATA) -EXTRA_DIST = $(XBM_DATA) $(XPM_DATA) XOrgCfg.pre xorgcfg.man.pre BUILT_SOURCES = $(appman_PRE) CLEANFILES = $(APPDEFAULTFILES) $(BUILT_SOURCES) $(appman_DATA) @@ -156,4 +160,6 @@ SUFFIXES += .$(APP_MAN_SUFFIX) .man -rm -f $@ $(LN_S) $< $@ -endif +endif BUILD_XORGCFG + +EXTRA_DIST = $(BITMAPS) $(PIXMAPS) XOrgCfg.pre xorgcfg.man.pre diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp index df6704f5c..71abe130d 100644 --- a/hw/xfree86/xorgconf.cpp +++ b/hw/xfree86/xorgconf.cpp @@ -54,12 +54,9 @@ XCOMM command (or a combination of both methods) FontPath LOCALFONTPATH FontPath MISCFONTPATH - FontPath DPI75USFONTPATH - FontPath DPI100USFONTPATH FontPath T1FONTPATH - FontPath TRUETYPEFONTPATH + FontPath TRUETYPEFONTPATH FontPath CIDFONTPATH - FontPath SPFONTPATH FontPath DPI75FONTPATH FontPath DPI100FONTPATH |