diff options
author | marha <marha@users.sourceforge.net> | 2014-08-11 21:14:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-11 21:14:48 +0200 |
commit | fdbedba4d50e1b28b0249c83ba11c029f096e400 (patch) | |
tree | a80ccb6275fd99644c79c67856e9c1bf1b323d62 /xorg-server/hw/xfree86/common/xf86xv.c | |
parent | b33b8d8ae86876b50df96881b96074b3fe177cce (diff) | |
download | vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.tar.gz vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.tar.bz2 vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.zip |
fontconfig libX11 libxcb libxcb/xcb-proto mesa xserver xkeyboard-config git update 11 Aug 2014
xserver commit 3714f5401690b288045090c4bcd9cb01c6e4860e
libxcb commit 966fba6ba4838949d0727dfa45eeb9392d1f85d9
libxcb/xcb-proto commit 4b384d2a015c50d0e93dcacda4b8260a3fd37640
xkeyboard-config commit 651a00ab656a1754b9183a383970a735209bbb50
libX11 commit 368a6401c6a3275d3497fec38a3dcbc38cd9df60
libXdmcp commit fe8eab93e9bcdbe8bb8052434bb5e676e3a0ee8f
libXext commit efdcbb7634501e1117d422636a0a75d7ea84b16b
libfontenc commit 0037a42107b952c9d903719615747e760e4e7247
libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909
libXau commit 1e4635be11154dd8262f37b379511bd627defa2a
xkbcomp commit d4e02a09258063c6d024c3ccd42d6b22212e6e18
pixman commit 6d2cf40166d81bfc63108504c8022dc4fec37ff5
xextproto commit 66afec3f49e8eb0d4c2e9af7088fc3116d4bafd7
randrproto commit a4a6694c059d74247c16527eef4a0ec9f56bbef6
glproto commit f84853d97d5749308992412a215fa518b6536eb3
mkfontscale commit 47908fd7a0d061fdcd21e3498da4e223ca9136d9
xwininfo commit 017b3736489985999d8dcf4d9e473e1fd6dd3647
libXft commit 214f9b5306d833e2787c75fe41dfdc9228fcb738
libXmu commit 22d9c590901e121936f50dee97dc60c4f7defb63
libxtrans commit a57a7f62242e1ea972b81414741729bf3dbae0a4
fontconfig commit 841753a93f0e5698663b7931b8456e7b96259f54
mesa commit f24be7340162c6a831b392d46d6637e9656e7a8a
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86xv.c')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86xv.c | 237 |
1 files changed, 34 insertions, 203 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index e212a7387..d342bdecc 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -54,38 +54,31 @@ #include "xf86xvpriv.h" -/* XvScreenRec fields */ - -static Bool xf86XVCloseScreen(ScreenPtr); -static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); - /* XvAdaptorRec fields */ -static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr *); -static int xf86XVFreePort(XvPortPtr); -static int xf86XVPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVGetVideo(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVGetStill(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); -static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr); -static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); -static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); -static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8, +static int xf86XVStopVideo(XvPortPtr, DrawablePtr); +static int xf86XVSetPortAttribute(XvPortPtr, Atom, INT32); +static int xf86XVGetPortAttribute(XvPortPtr, Atom, INT32 *); +static int xf86XVQueryBestSize(XvPortPtr, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); -static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, +static int xf86XVPutImage(DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); -static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, +static int xf86XVQueryImageAttributes(XvPortPtr, XvImagePtr, CARD16 *, CARD16 *, int *, int *); /* ScreenRec fields */ @@ -95,6 +88,7 @@ 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); +static Bool xf86XVCloseScreen(ScreenPtr); #define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) @@ -113,7 +107,10 @@ static DevPrivateKeyRec XF86XVWindowKeyRec; #define XF86XVWindowKey (&XF86XVWindowKeyRec) +/* dixmain.c XvScreenPtr screen private */ DevPrivateKey XF86XvScreenKey; +/** xf86xv.c XF86XVScreenPtr screen private */ +static DevPrivateKeyRec XF86XVScreenPrivateKey; static unsigned long PortResource = 0; @@ -121,7 +118,7 @@ static unsigned long PortResource = 0; ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey)) #define GET_XF86XV_SCREEN(pScreen) \ - ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr)) + ((XF86XVScreenPtr)(dixGetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey))) #define GET_XF86XV_WINDOW(pWin) \ ((XF86XVWindowPtr)dixLookupPrivate(&(pWin)->devPrivates, XF86XVWindowKey)) @@ -232,7 +229,6 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) { ScrnInfoPtr pScrn; XF86XVScreenPtr ScreenPriv; - XvScreenPtr pxvs; if (num <= 0 || noXvExtension) return FALSE; @@ -242,26 +238,15 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; + if (!dixRegisterPrivateKey(&XF86XVScreenPrivateKey, PRIVATE_SCREEN, 0)) + return FALSE; XF86XvScreenKey = XvGetScreenKey(); PortResource = XvGetRTPort(); - pxvs = GET_XV_SCREEN(pScreen); - - /* Anyone initializing the Xv layer must provide these two. - The Xv di layer calls them without even checking if they exist! */ - - pxvs->ddCloseScreen = xf86XVCloseScreen; - pxvs->ddQueryAdaptors = xf86XVQueryAdaptors; - - /* The Xv di layer provides us with a private hook so that we don't - have to allocate our own screen private. They also provide - a CloseScreen hook so that we don't have to wrap it. I'm not - sure that I appreciate that. */ - ScreenPriv = malloc(sizeof(XF86XVScreenRec)); - pxvs->devPriv.ptr = (void *) ScreenPriv; + dixSetPrivate(&pScreen->devPrivates, &XF86XVScreenPrivateKey, ScreenPriv); if (!ScreenPriv) return FALSE; @@ -272,6 +257,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) ScreenPriv->WindowExposures = pScreen->WindowExposures; ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; + ScreenPriv->CloseScreen = pScreen->CloseScreen; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; @@ -280,6 +266,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; pScreen->ClipNotify = xf86XVClipNotify; + pScreen->CloseScreen = xf86XVCloseScreen; pScrn->EnterVT = xf86XVEnterVT; pScrn->LeaveVT = xf86XVLeaveVT; if (pScrn->AdjustFrame) @@ -297,21 +284,6 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - free(pAdaptor->name); - pAdaptor->name = NULL; - - if (pAdaptor->pEncodings) { - XvEncodingPtr pEncode = pAdaptor->pEncodings; - - for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) - free(pEncode->name); - free(pAdaptor->pEncodings); - pAdaptor->pEncodings = NULL; - } - - free(pAdaptor->pFormats); - pAdaptor->pFormats = NULL; - if (pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; @@ -328,23 +300,9 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) free(pPriv); } } - free(pAdaptor->pPorts); - pAdaptor->pPorts = NULL; - } - - if (pAdaptor->pAttributes) { - XvAttributePtr pAttribute = pAdaptor->pAttributes; - - for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) - free(pAttribute->name); - free(pAdaptor->pAttributes); - pAdaptor->pAttributes = NULL; } - free(pAdaptor->pImages); - free(pAdaptor->devPriv.ptr); - pAdaptor->pImages = NULL; - pAdaptor->devPriv.ptr = NULL; + XvFreeAdaptor(pAdaptor); } static Bool @@ -409,8 +367,6 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) continue; pa->pScreen = pScreen; - pa->ddAllocatePort = xf86XVAllocatePort; - pa->ddFreePort = xf86XVFreePort; pa->ddPutVideo = xf86XVPutVideo; pa->ddPutStill = xf86XVPutStill; pa->ddGetVideo = xf86XVGetVideo; @@ -712,10 +668,6 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -788,22 +740,6 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutVideo) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -882,22 +818,6 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) goto CLIP_VIDEO_BAILOUT; } - /* bailout if we have to clip but the hardware doesn't support it */ - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto CLIP_VIDEO_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->ReputImage) (portPriv->pScrn, portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, @@ -1235,6 +1155,7 @@ xf86XVCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; + pScreen->CloseScreen = ScreenPriv->CloseScreen; pScrn->EnterVT = ScreenPriv->EnterVT; pScrn->LeaveVT = ScreenPriv->LeaveVT; @@ -1247,19 +1168,8 @@ xf86XVCloseScreen(ScreenPtr pScreen) free(pxvs->pAdaptors); free(ScreenPriv); - return TRUE; -} - -static int -xf86XVQueryAdaptors(ScreenPtr pScreen, - XvAdaptorPtr * p_pAdaptors, int *p_nAdaptors) -{ - XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); - *p_nAdaptors = pxvs->nAdaptors; - *p_pAdaptors = pxvs->pAdaptors; - - return Success; + return pScreen->CloseScreen(pScreen); } /**** ScrnInfoRec fields ****/ @@ -1361,21 +1271,7 @@ xf86XVModeSet(ScrnInfoPtr pScrn) /**** XvAdaptorRec fields ****/ static int -xf86XVAllocatePort(unsigned long port, XvPortPtr pPort, XvPortPtr * ppPort) -{ - *ppPort = pPort; - return Success; -} - -static int -xf86XVFreePort(XvPortPtr pPort) -{ - return Success; -} - -static int -xf86XVPutVideo(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1425,8 +1321,7 @@ xf86XVPutVideo(ClientPtr client, } static int -xf86XVPutStill(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1480,21 +1375,6 @@ xf86XVPutStill(ClientPtr client, goto PUT_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_STILL_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1538,8 +1418,7 @@ xf86XVPutStill(ClientPtr client, } static int -xf86XVGetVideo(ClientPtr client, - DrawablePtr pDraw, +xf86XVGetVideo(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1589,8 +1468,7 @@ xf86XVGetVideo(ClientPtr client, } static int -xf86XVGetStill(ClientPtr client, - DrawablePtr pDraw, +xf86XVGetStill(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 vid_x, INT16 vid_y, @@ -1628,10 +1506,6 @@ xf86XVGetStill(ClientPtr client, goto GET_STILL_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->GetStill) (portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, @@ -1653,7 +1527,7 @@ xf86XVGetStill(ClientPtr client, } static int -xf86XVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) +xf86XVStopVideo(XvPortPtr pPort, DrawablePtr pDraw) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1677,8 +1551,7 @@ xf86XVStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) } static int -xf86XVSetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 value) +xf86XVSetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1688,8 +1561,7 @@ xf86XVSetPortAttribute(ClientPtr client, } static int -xf86XVGetPortAttribute(ClientPtr client, - XvPortPtr pPort, Atom attribute, INT32 *p_value) +xf86XVGetPortAttribute(XvPortPtr pPort, Atom attribute, INT32 *p_value) { XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -1699,8 +1571,7 @@ xf86XVGetPortAttribute(ClientPtr client, } static int -xf86XVQueryBestSize(ClientPtr client, - XvPortPtr pPort, +xf86XVQueryBestSize(XvPortPtr pPort, CARD8 motion, CARD16 vid_w, CARD16 vid_h, CARD16 drw_w, CARD16 drw_h, @@ -1717,8 +1588,7 @@ xf86XVQueryBestSize(ClientPtr client, } static int -xf86XVPutImage(ClientPtr client, - DrawablePtr pDraw, +xf86XVPutImage(DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, INT16 src_x, INT16 src_y, @@ -1780,21 +1650,6 @@ xf86XVPutImage(ClientPtr client, goto PUT_IMAGE_BAILOUT; } - if (portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = RegionRects(&ClipRegion); - - if ((RegionNumRects(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { - clippedAway = TRUE; - goto PUT_IMAGE_BAILOUT; - } - } - - if (portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); - } - ret = (*portPriv->AdaptorRec->PutImage) (portPriv->pScrn, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, @@ -1838,8 +1693,7 @@ xf86XVPutImage(ClientPtr client, } static int -xf86XVQueryImageAttributes(ClientPtr client, - XvPortPtr pPort, +xf86XVQueryImageAttributes(XvPortPtr pPort, XvImagePtr format, CARD16 *width, CARD16 *height, int *pitches, int *offsets) @@ -1856,34 +1710,11 @@ void xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; - ChangeGCVal pval[2]; - BoxPtr pbox = RegionRects(fillboxes); - int i, nbox = RegionNumRects(fillboxes); - xRectangle *rects; - GCPtr gc; if (!xf86ScreenToScrn(pScreen)->vtSema) return; - gc = GetScratchGC(pDraw->depth, pScreen); - pval[0].val = key; - pval[1].val = IncludeInferiors; - (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); - ValidateGC(pDraw, gc); - - rects = malloc(nbox * sizeof(xRectangle)); - - for (i = 0; i < nbox; i++, pbox++) { - 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) (pDraw, gc, nbox, rects); - - free(rects); - FreeScratchGC(gc); + XvFillColorKey(pDraw, key, fillboxes); } void |