diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-23 08:44:42 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-23 08:44:42 +1000 |
commit | 579ee8f5d84c3a523b7b3e3941eabb226d1d19e2 (patch) | |
tree | a822eae1c534e6616aafad8e0139828c2d2b1fc1 /hw | |
parent | b636893137da1695e235e3a9354bfd9243fdddc2 (diff) | |
parent | 17265ccb027e3f956bf7409106174f44621d1cb8 (diff) |
Merge branch 'mi-cleanup' into next
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86RandR.c | 37 | ||||
-rw-r--r-- | hw/xfree86/common/xf86VidMode.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.c | 210 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.h | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xvpriv.h | 6 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 2 | ||||
-rw-r--r-- | hw/xfree86/fbdevhw/fbdevhw.c | 56 | ||||
-rw-r--r-- | hw/xfree86/int10/helper_exec.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 1 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 36 | ||||
-rw-r--r-- | hw/xfree86/ramdac/xf86Cursor.c | 6 | ||||
-rw-r--r-- | hw/xwin/winclipboardxevents.c | 3 | ||||
-rw-r--r-- | hw/xwin/winconfig.c | 77 | ||||
-rw-r--r-- | hw/xwin/winkeybd.c | 8 | ||||
-rw-r--r-- | hw/xwin/winkeybd.h | 16 | ||||
-rw-r--r-- | hw/xwin/winkeyhook.c | 4 | ||||
-rw-r--r-- | hw/xwin/winkeynames.h | 13 | ||||
-rw-r--r-- | hw/xwin/winlayouts.h | 8 |
19 files changed, 272 insertions, 220 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index a1fda54cd..e664ce451 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -808,7 +808,7 @@ InitInput(int argc, char **argv) GetEventList(&xf86Events); - /* Call the PreInit function for each input device instance. */ + /* Initialize all configured input devices */ for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { /* Replace obsolete keyboard driver with kbd */ if (!xf86NameCmp((*pDev)->driver, "keyboard")) { diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index d7ffff4ca..4663d0366 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -242,11 +242,20 @@ xf86RandRSetConfig (ScreenPtr pScreen, ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - int px, py; + int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; + DeviceIntPtr dev; + Bool view_adjusted = FALSE; + + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (!IsMaster(dev) && !IsFloating(dev)) + continue; + + miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); + } - miPointerGetPosition(inputInfo.pointer, &px, &py); for (mode = scrp->modes; ; mode = mode->next) { if (mode->HDisplay == pSize->width && @@ -303,17 +312,31 @@ xf86RandRSetConfig (ScreenPtr pScreen, } return FALSE; } + /* * Move the cursor back where it belongs; SwitchMode repositions it + * FIXME: duplicated code, see modes/xf86RandR12.c */ - if (pScreen == miPointerCurrentScreen ()) + for (dev = inputInfo.devices; dev; dev = dev->next) { - px = (px >= pScreen->width ? (pScreen->width - 1) : px); - py = (py >= pScreen->height ? (pScreen->height - 1) : py); + if (!IsMaster(dev) && !IsFloating(dev)) + continue; - xf86SetViewport(pScreen, px, py); + if (pScreen == miPointerGetScreen(dev)) { + int px = pos[dev->id][0]; + int py = pos[dev->id][1]; - (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); + px = (px >= pScreen->width ? (pScreen->width - 1) : px); + py = (py >= pScreen->height ? (pScreen->height - 1) : py); + + /* Setting the viewpoint makes only sense on one device */ + if (!view_adjusted && IsMaster(dev)) { + xf86SetViewport(pScreen, px, py); + view_adjusted = TRUE; + } + + (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); + } } return TRUE; diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 1788fa192..4dd454d8b 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -634,7 +634,7 @@ VidModeSetModeValue(pointer mode, int valtyp, int val) vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx) { - vidMonitorValue ret; + vidMonitorValue ret = { NULL, }; switch (valtyp) { case VIDMODE_MON_VENDOR: diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 016db1f04..53ebe8f88 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -97,8 +97,11 @@ static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, static Bool xf86XVDestroyWindow(WindowPtr pWin); static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); +static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); +#define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) + /* ScrnInfoRec functions */ static Bool xf86XVEnterVT(int, int); @@ -280,10 +283,9 @@ xf86XVScreenInit( pScrn = xf86Screens[pScreen->myNum]; - ScreenPriv->videoGC = NULL; /* for the helper */ - ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; @@ -333,6 +335,8 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) RegionDestroy(pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); + if (pPriv->ckeyFilled) + RegionDestroy(pPriv->ckeyFilled); free(pPriv); } } @@ -1018,7 +1022,6 @@ static void xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { XF86XVWindowPtr winPriv, prevPriv = NULL; - winPriv = GET_XF86XV_WINDOW(pWin); while(winPriv) { @@ -1035,6 +1038,11 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) winPriv = winPriv->next; } portPriv->pDraw = NULL; + if (portPriv->ckeyFilled) { + RegionDestroy(portPriv->ckeyFilled); + portPriv->ckeyFilled = NULL; + } + portPriv->clipChanged = FALSE; } static void @@ -1069,7 +1077,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, } static void -xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) +xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) { ScreenPtr pScreen = pScrn->pScreen; XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); @@ -1087,6 +1095,9 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) if (pPriv->isOn == XV_OFF || !pWin) continue; + if (onlyChanged && !pPriv->clipChanged) + continue; + visible = pWin->visibility == VisibilityUnobscured || pWin->visibility == VisibilityPartiallyObscured; @@ -1098,6 +1109,8 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) visible = FALSE; xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; } } } @@ -1123,9 +1136,6 @@ xf86XVDestroyWindow(WindowPtr pWin) pPriv->pDraw = NULL; tmp = WinPriv; - if(WinPriv->pGC) { - FreeGC(WinPriv->pGC, 0); - } WinPriv = WinPriv->next; free(tmp); } @@ -1139,6 +1149,29 @@ xf86XVDestroyWindow(WindowPtr pWin) return ret; } +static void +xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) +{ + ScreenPtr pScreen; + XF86XVScreenPtr ScreenPriv; + ScrnInfoPtr pScrn; + + if (pWin) + pScreen = pWin->drawable.pScreen; + else + pScreen = pLayerWin->drawable.pScreen; + + ScreenPriv = GET_XF86XV_SCREEN(pScreen); + pScrn = xf86Screens[pScreen->myNum]; + + xf86XVReputOrStopAllPorts(pScrn, TRUE); + + pScreen->PostValidateTree = ScreenPriv->PostValidateTree; + if (pScreen->PostValidateTree) { + (*pScreen->PostValidateTree)(pWin, pLayerWin, kind); + } + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; +} static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) @@ -1170,12 +1203,28 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) visible = !AreasExposed; + /* + * Subtract exposed areas from overlaid image to match textured video + * behavior. + */ + if (!pPriv->type && pPriv->clientClip) + RegionSubtract(pPriv->clientClip, pPriv->clientClip, reg1); + + if (visible && pPriv->ckeyFilled) { + RegionRec tmp; + RegionNull(&tmp); + RegionCopy(&tmp, reg1); + RegionTranslate(&tmp, pWin->drawable.x, pWin->drawable.y); + RegionSubtract(pPriv->ckeyFilled, pPriv->ckeyFilled, &tmp); + } + WinPriv = WinPriv->next; xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; } } - static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy) { @@ -1185,9 +1234,6 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) XvPortRecPrivatePtr pPriv; while(WinPriv) { - Bool visible = pWin->visibility == VisibilityUnobscured || - pWin->visibility == VisibilityPartiallyObscured; - pPriv = WinPriv->PortRec; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) @@ -1199,15 +1245,14 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) (*pPriv->AdaptorRec->ClipNotify)(pPriv->pScrn, pPriv->DevPriv.ptr, pWin, dx, dy); - /* - * Stop and remove still/images if - * ReputImage isn't supported. - */ - if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) - visible = FALSE; + pPriv->clipChanged = TRUE; + + if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) { + ScreenPriv->PostValidateTree = pScreen->PostValidateTree; + pScreen->PostValidateTree = xf86XVPostValidateTree; + } WinPriv = WinPriv->next; - xf86XVReputOrStopPort(pPriv, pWin, visible); } if(ScreenPriv->ClipNotify) { @@ -1232,11 +1277,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) if(!ScreenPriv) return TRUE; - if(ScreenPriv->videoGC) { - FreeGC(ScreenPriv->videoGC, 0); - ScreenPriv->videoGC = NULL; - } - pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; @@ -1345,7 +1385,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) pScrn->AdjustFrame = xf86XVAdjustFrame; } - xf86XVReputOrStopAllPorts(pScrn); + xf86XVReputOrStopAllPorts(pScrn, FALSE); } static void @@ -1366,7 +1406,7 @@ xf86XVModeSet(ScrnInfoPtr pScrn) pScrn->ModeSet = xf86XVModeSet; } - xf86XVReputOrStopAllPorts(pScrn); + xf86XVReputOrStopAllPorts(pScrn, FALSE); } /**** XvAdaptorRec fields ****/ @@ -1869,92 +1909,92 @@ xf86XVQueryImageAttributes( format->id, width, height, pitches, offsets); } - void -xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) +xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; - WindowPtr pWin = (WindowPtr)pDraw; - XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); - GCPtr pGC = NULL; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); - xRectangle *rects; - - if(!xf86Screens[pScreen->myNum]->vtSema) return; - - if(pPriv) - pGC = pPriv->pGC; - - if(!pGC) { - int status; - XID pval[2]; - pval[0] = key; - pval[1] = IncludeInferiors; - pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status, - (XID)0, serverClient); - if(!pGC) return; - ValidateGC(pDraw, pGC); - if (pPriv) pPriv->pGC = pGC; - } else if (key != pGC->fgPixel){ - ChangeGCVal val; - val.val = key; - ChangeGC(NullClient, pGC, GCForeground, &val); - ValidateGC(pDraw, pGC); - } - - RegionTranslate(clipboxes, -pDraw->x, -pDraw->y); - - rects = malloc(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); - - free(rects); -} - -void -xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) -{ - DrawablePtr root = &pScreen->root->drawable; ChangeGCVal pval[2]; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); + BoxPtr pbox = RegionRects(fillboxes); + int i, nbox = RegionNumRects(fillboxes); xRectangle *rects; GCPtr gc; if(!xf86Screens[pScreen->myNum]->vtSema) return; - gc = GetScratchGC(root->depth, pScreen); + gc = GetScratchGC(pDraw->depth, pScreen); pval[0].val = key; pval[1].val = IncludeInferiors; (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval); - ValidateGC(root, gc); + ValidateGC(pDraw, gc); rects = malloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1; - rects[i].y = pbox->y1; + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } - (*gc->ops->PolyFillRect)(root, gc, nbox, rects); + (*gc->ops->PolyFillRect)(pDraw, gc, nbox, rects); free(rects); FreeScratchGC (gc); } +void +xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes) +{ + xf86XVFillKeyHelperDrawable (&pScreen->root->drawable, key, fillboxes); +} + +void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything) +{ + WindowPtr pWin = (WindowPtr)pDraw; + XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); + XvPortRecPrivatePtr portPriv = NULL; + RegionRec reg; + RegionPtr fillboxes; + + while (WinPriv) { + XvPortRecPrivatePtr pPriv = WinPriv->PortRec; + + if (data == pPriv->DevPriv.ptr) { + portPriv = pPriv; + break; + } + + WinPriv = WinPriv->next; + } + + if (!portPriv) + return; + + if (!portPriv->ckeyFilled) + portPriv->ckeyFilled = RegionCreate(NULL, 0); + + if (!fillEverything) { + RegionNull(®); + fillboxes = ® + RegionSubtract(fillboxes, clipboxes, portPriv->ckeyFilled); + + if (!RegionNotEmpty(fillboxes)) + goto out; + } else + fillboxes = clipboxes; + + + RegionCopy(portPriv->ckeyFilled, clipboxes); + + xf86XVFillKeyHelperDrawable(pDraw, key, fillboxes); +out: + if (!fillEverything) + RegionUninit(®); +} + + /* xf86XVClipVideoHelper - Takes the dst box in standard X BoxRec form (top and left diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h index 47061fed2..f0d8495c6 100644 --- a/hw/xfree86/common/xf86xv.h +++ b/hw/xfree86/common/xf86xv.h @@ -244,6 +244,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); +extern _X_EXPORT void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything); + extern _X_EXPORT Bool xf86XVClipVideoHelper( BoxPtr dst, diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h index 88e7a0e59..2a459f1b4 100644 --- a/hw/xfree86/common/xf86xvpriv.h +++ b/hw/xfree86/common/xf86xvpriv.h @@ -40,10 +40,10 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; + PostValidateTreeProcPtr PostValidateTree; void (*AdjustFrame)(int, int, int, int); Bool (*EnterVT)(int, int); void (*LeaveVT)(int, int); - GCPtr videoGC; xf86ModeSetProc *ModeSet; } XF86XVScreenRec, *XF86XVScreenPtr; @@ -69,11 +69,12 @@ typedef struct { unsigned char type; unsigned int subWindowMode; RegionPtr clientClip; + RegionPtr ckeyFilled; RegionPtr pCompositeClip; Bool FreeCompositeClip; XvAdaptorRecPrivatePtr AdaptorRec; XvStatus isOn; - Bool moved; + Bool clipChanged; int vid_x, vid_y, vid_w, vid_h; int drw_x, drw_y, drw_w, drw_h; DevUnion DevPriv; @@ -82,7 +83,6 @@ typedef struct { typedef struct _XF86XVWindowRec{ XvPortRecPrivatePtr PortRec; struct _XF86XVWindowRec *next; - GCPtr pGC; } XF86XVWindowRec, *XF86XVWindowPtr; #endif /* _XF86XVPRIV_H_ */ diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 39996f946..9ca378fed 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -403,7 +403,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, && (pDraw->height == pPriv->height) && (pPriv->serialNumber == DRI2DrawableSerial(pDraw)); - buffers = malloc((count + 1) * sizeof(buffers[0])); + buffers = calloc((count + 1), sizeof(buffers[0])); for (i = 0; i < count; i++) { const unsigned attachment = *(attachments++); diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index a5b59e762..17fba36d0 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -264,14 +264,7 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) { struct fb_fix_screeninfo fix; char filename[256]; - int fd,i,j; - - - /* There are two ways to that we can determine which fb device is - * associated with this PCI device. The more modern way is to look in - * the sysfs directory for the PCI device for a file named - * "graphics/fb*" - */ + int fd, i; for (i = 0; i < 8; i++) { sprintf(filename, @@ -304,55 +297,10 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) } } - - /* The other way is to examine the resources associated with each fb - * device and see if there is a match with the PCI device. This technique - * has some problems on certain mixed 64-bit / 32-bit architectures. - * There is a flaw in the fb_fix_screeninfo structure in that it only - * returns the low 32-bits of the address of the resources associated with - * a device. However, on a mixed architecture the base addresses of PCI - * devices, even for 32-bit applications, may be higher than 0x0f0000000. - */ - - for (i = 0; i < 8; i++) { - sprintf(filename,"/dev/fb%d",i); - if (-1 == (fd = open(filename,O_RDWR,0))) { - xf86DrvMsg(-1, X_WARNING, - "open %s: %s\n", filename, strerror(errno)); - continue; - } - if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) { - close(fd); - continue; - } - for (j = 0; j < 6; j++) { - const pciaddr_t res_start = pPci->regions[j].base_addr; - const pciaddr_t res_end = res_start + pPci->regions[j].size; - - if ((0 != fix.smem_len && - (pciaddr_t) fix.smem_start >= res_start && - (pciaddr_t) fix.smem_start < res_end) || - (0 != fix.mmio_len && - (pciaddr_t) fix.mmio_start >= res_start && - (pciaddr_t) fix.mmio_start < res_end)) - break; - } - if (j == 6) { - close(fd); - continue; - } - if (namep) { - *namep = xnfalloc(16); - strncpy(*namep,fix.id,16); - } - return fd; - } - if (namep) *namep = NULL; - xf86DrvMsg(-1, X_ERROR, - "Unable to find a valid framebuffer device\n"); + xf86DrvMsg(-1, X_ERROR, "Unable to find a valid framebuffer device\n"); return -1; } diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index b9af473b1..ec8420040 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -504,7 +504,7 @@ pciCfg1in(CARD16 addr, CARD32 *val) } if (addr == 0xCFC) { pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr), - val, PCI_OFFSET(PciCfg1Addr)); + (uint32_t *)val, PCI_OFFSET(PciCfg1Addr)); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val); return 1; diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 47d3ad14c..b5e9dc26f 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1542,7 +1542,6 @@ struct det_monrec_parameter { static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, void *data) { - enum { sync_config, sync_edid, sync_default }; struct det_monrec_parameter *p; p = (struct det_monrec_parameter *)data; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 407bf3567..82d180bb0 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -584,10 +584,12 @@ xf86RandR12SetConfig (ScreenPtr pScreen, ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - int px, py; + int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; int maxX = 0, maxY = 0; Rotation oldRotation = randrp->rotation; + DeviceIntPtr dev; + Bool view_adjusted = FALSE; randrp->rotation = rotation; @@ -597,7 +599,14 @@ xf86RandR12SetConfig (ScreenPtr pScreen, randrp->virtualY = scrp->virtualY; } - miPointerGetPosition (inputInfo.pointer, &px, &py); + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (!IsMaster(dev) && !IsFloating(dev)) + continue; + + miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); + } + for (mode = scrp->modes; ; mode = mode->next) { if (randrp->maxX == 0 || randrp->maxY == 0) @@ -643,15 +652,28 @@ xf86RandR12SetConfig (ScreenPtr pScreen, /* * Move the cursor back where it belongs; SwitchMode repositions it + * FIXME: duplicated code, see modes/xf86RandR12.c */ - if (pScreen == miPointerGetScreen(inputInfo.pointer)) + for (dev = inputInfo.devices; dev; dev = dev->next) { - px = (px >= pScreen->width ? (pScreen->width - 1) : px); - py = (py >= pScreen->height ? (pScreen->height - 1) : py); + if (!IsMaster(dev) && !IsFloating(dev)) + continue; - xf86SetViewport(pScreen, px, py); + if (pScreen == miPointerGetScreen(dev)) { + int px = pos[dev->id][0]; + int py = pos[dev->id][1]; - (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); + px = (px >= pScreen->width ? (pScreen->width - 1) : px); + py = (py >= pScreen->height ? (pScreen->height - 1) : py); + + /* Setting the viewpoint makes only sense on one device */ + if (!view_adjusted && IsMaster(dev)) { + xf86SetViewport(pScreen, px, py); + view_adjusted = TRUE; + } + + (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); + } } return TRUE; diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index ec781aad8..24c91cc37 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -317,8 +317,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, /* only update for VCP, otherwise we get cursor jumps when removing a sprite. The second cursor is never HW rendered anyway. */ - if (pDev == inputInfo.pointer || - (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) + if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { pCurs->refcnt++; if (ScreenPriv->CurrentCursor) @@ -386,8 +385,7 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) /* only update coordinate state for first sprite, otherwise we get jumps when removing a sprite. The second sprite is never HW rendered anyway */ - if (pDev == inputInfo.pointer || - (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) + if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { ScreenPriv->x = x; ScreenPriv->y = y; diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c index 2f042fd0b..8b502b117 100644 --- a/hw/xwin/winclipboardxevents.c +++ b/hw/xwin/winclipboardxevents.c @@ -789,6 +789,9 @@ winClipboardFlushXEvents (HWND hwnd, case PropertyNotify: break; + case MappingNotify: + break; + default: ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type); break; diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 758c54d89..76bf8e2de 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -240,6 +240,7 @@ Bool winConfigKeyboard (DeviceIntPtr pDevice) { char layoutName[KL_NAMELENGTH]; + unsigned char layoutFriendlyName[256]; static unsigned int layoutNum = 0; int keyboardType; #ifdef XWIN_XF86CONFIG @@ -299,11 +300,32 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL) winMsg (X_INFO, "Loading US keyboard layout.\n"); else - winMsg (X_ERROR, "LoadKeyboardLaout failed.\n"); + winMsg (X_ERROR, "LoadKeyboardLayout failed.\n"); } } - winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n", - layoutName, layoutNum); + + /* Discover the friendly name of the current layout */ + { + HKEY regkey = NULL; + const char regtempl[] = "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; + char *regpath; + DWORD namesize = sizeof(layoutFriendlyName); + + regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); + strcpy(regpath, regtempl); + strcat(regpath, layoutName); + + if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key)) + RegQueryValueEx(regkey, "Layout Text", 0, NULL, layoutFriendlyName, &namesize); + + /* Close registry key */ + if (regkey) + RegCloseKey (regkey); + free(regpath); + } + + winMsg (X_PROBED, "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n", + layoutName, layoutNum, layoutFriendlyName, keyboardType); for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) { @@ -311,46 +333,35 @@ winConfigKeyboard (DeviceIntPtr pDevice) continue; if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType) continue; - + bfound = TRUE; winMsg (X_PROBED, - "Using preset keyboard for \"%s\" (%x), type \"%d\"\n", - pLayout->layoutname, pLayout->winlayout, keyboardType); - + "Found matching XKB configuration \"%s\"\n", + pLayout->layoutname); + + winMsg(X_PROBED, + "Model = \"%s\" Layout = \"%s\"" + " Variant = \"%s\" Options = \"%s\"\n", + pLayout->xkbmodel ? pLayout->xkbmodel : "none", + pLayout->xkblayout ? pLayout->xkblayout : "none", + pLayout->xkbvariant ? pLayout->xkbvariant : "none", + pLayout->xkboptions ? pLayout->xkboptions : "none"); + g_winInfo.xkb.model = pLayout->xkbmodel; g_winInfo.xkb.layout = pLayout->xkblayout; g_winInfo.xkb.variant = pLayout->xkbvariant; - g_winInfo.xkb.options = pLayout->xkboptions; + g_winInfo.xkb.options = pLayout->xkboptions; + + break; } - + if (!bfound) { - HKEY regkey = NULL; - const char regtempl[] = - "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; - char *regpath; - unsigned char lname[256]; - DWORD namesize = sizeof(lname); - - regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); - strcpy(regpath, regtempl); - strcat(regpath, layoutName); - - if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key) && - !RegQueryValueEx(regkey, "Layout Text", 0, NULL, lname, &namesize)) - { - winMsg (X_ERROR, - "Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName); - } - - /* Close registry key */ - if (regkey) - RegCloseKey (regkey); - free(regpath); + winMsg (X_ERROR, "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName); } - } - + } + /* parse the configuration */ #ifdef XWIN_XF86CONFIG if (g_cmdline.keyboard) diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 83fea21cd..9e5a9b02a 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -73,6 +73,8 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) int iParam = HIWORD (lParam); int iParamScanCode = LOBYTE (iParam); + winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); + /* WM_ key messages faked by Vista speech recognition (WSR) don't have a * scan code. * @@ -488,10 +490,8 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) for (i = 0; i < nevents; i++) mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event); -#if CYGDEBUG - ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", - dwKey, fDown, nevents); -#endif + winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", + dwKey, fDown, nevents); } BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam) diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h index 5b2a5892f..4e4c35c37 100644 --- a/hw/xwin/winkeybd.h +++ b/hw/xwin/winkeybd.h @@ -216,13 +216,13 @@ g_iKeyMap [] = { /* 170 */ 0, 0, 0, /* 171 */ 0, 0, 0, /* 172 */ 0, 0, 0, - /* 173 */ 0, 0, 0, - /* 174 */ 0, 0, 0, - /* 175 */ 0, 0, 0, - /* 176 */ 0, 0, 0, - /* 177 */ 0, 0, 0, - /* 178 */ 0, 0, 0, - /* 179 */ 0, 0, 0, + /* 173 */ VK_VOLUME_MUTE, 0, KEY_Mute, + /* 174 */ VK_VOLUME_DOWN, 0, KEY_AudioLower, + /* 175 */ VK_VOLUME_UP, 0, KEY_AudioRaise, + /* 176 */ VK_MEDIA_NEXT_TRACK, 0, KEY_NEXTSONG, + /* 177 */ VK_MEDIA_PREV_TRACK, 0, KEY_PREVIOUSSONG, + /* 178 */ VK_MEDIA_STOP, 0, KEY_STOPCD, + /* 179 */ VK_MEDIA_PLAY_PAUSE, 0, KEY_PLAYPAUSE, /* 180 */ 0, 0, 0, /* 181 */ 0, 0, 0, /* 182 */ 0, 0, 0, @@ -266,7 +266,7 @@ g_iKeyMap [] = { /* 220 */ 0, 0, 0, /* 221 */ 0, 0, 0, /* 222 */ 0, 0, 0, - /* 223 */ 0, 0, 0, + /* 223 */ VK_OEM_8, 0, KEY_RCtrl, /* at least on Candian Multilingual Standard layout */ /* 224 */ 0, 0, 0, /* 225 */ 0, 0, 0, /* 226 */ 0, 0, 0, diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c index fe1156dcf..cbee7cbda 100644 --- a/hw/xwin/winkeyhook.c +++ b/hw/xwin/winkeyhook.c @@ -88,9 +88,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam) /* Pass keystrokes on to our main message loop */ if (iCode == HC_ACTION) { -#if 0 - ErrorF ("vkCode: %08x\tscanCode: %08x\n", p->vkCode, p->scanCode); -#endif + winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n", p->vkCode, p->scanCode); switch (wParam) { diff --git a/hw/xwin/winkeynames.h b/hw/xwin/winkeynames.h index 3d5938348..914016a76 100644 --- a/hw/xwin/winkeynames.h +++ b/hw/xwin/winkeynames.h @@ -23,10 +23,6 @@ * */ -#define XK_TECHNICAL -#define XK_KATAKANA -#include <X11/keysym.h> - #define GLYPHS_PER_KEY 4 #define NUM_KEYCODES 248 #define MIN_KEYCODE 8 @@ -194,6 +190,15 @@ #define KEY_HKTG /* Hirugana/Katakana tog 0xc8 */ 200 #define KEY_BSlash2 /* \ _ 0xcb */ 203 +#define KEY_Mute /* Audio Mute */ 152 +#define KEY_AudioLower /* Audio Lower */ 168 +#define KEY_AudioRaise /* Audio Raise */ 166 + +#define KEY_NEXTSONG /* Media next */ 145 +#define KEY_PLAYPAUSE /* Media play/pause toggle */ 154 +#define KEY_PREVIOUSSONG /* Media previous */ 136 +#define KEY_STOPCD /* Media stop */ 156 + /* These are for "notused" and "unknown" entries in translation maps. */ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h index 9500689bc..ce502a005 100644 --- a/hw/xwin/winlayouts.h +++ b/hw/xwin/winlayouts.h @@ -55,13 +55,15 @@ WinKBLayoutRec winKBLayouts[] = { 0x00010409, -1, "pc105", "dvorak", NULL, NULL, "English (USA,Dvorak)"}, { 0x00020409, -1, "pc105", "us_intl", NULL, NULL, "English (USA,International)"}, { 0x00000809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, + { 0x00001009, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00011009, -1, "pc105", "ca", "multix", NULL, "Canadian Multilingual Standard"}, { 0x00001809, -1, "pc105", "ie", NULL, NULL, "Irish"}, { 0x0000040a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain,Traditional Sort)"}, { 0x0000080a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, { 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, { 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, { 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, - { 0x00000c0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada, Legacy)"}, { 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, { 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, { 0x0000040e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, @@ -79,6 +81,8 @@ WinKBLayoutRec winKBLayouts[] = { 0x00000816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"}, { 0x0000041a, -1, "pc105", "hr", NULL, NULL, "Croatian"}, { 0x0000041d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"}, + { 0x0000041f, -1, "pc105", "tr", NULL, NULL, "Turkish (Q)"}, + { 0x0001041f, -1, "pc105", "tr", "f", NULL, "Turkish (F)"}, { 0x00000424, -1, "pc105", "si", NULL, NULL, "Slovenian"}, { 0x00000425, -1, "pc105", "ee", NULL, NULL, "Estonian"}, { 0x00000452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"}, @@ -89,5 +93,3 @@ WinKBLayoutRec winKBLayouts[] = See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx for a listing of input locale (keyboard layout) codes */ - - |