diff options
author | marha <marha@users.sourceforge.net> | 2014-07-19 15:12:53 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-07-19 15:12:53 +0200 |
commit | 61c36feba19d918885022042ea62d068a698c83d (patch) | |
tree | fd351953eb2193fe548e7d0e2dca06b34b7c4f4d /xorg-server/hw/kdrive/src | |
parent | 3865d60ef607cbb00c819e905e40d3628b8eca29 (diff) | |
parent | d0c30e7945e76ac119f6d867e27137c8a76f7e15 (diff) | |
download | vcxsrv-61c36feba19d918885022042ea62d068a698c83d.tar.gz vcxsrv-61c36feba19d918885022042ea62d068a698c83d.tar.bz2 vcxsrv-61c36feba19d918885022042ea62d068a698c83d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/glsl/ir.cpp
xorg-server/config/config.c
xorg-server/include/callback.h
xorg-server/include/colormap.h
xorg-server/include/cursor.h
xorg-server/include/dix.h
xorg-server/include/dixfont.h
xorg-server/include/dixgrabs.h
xorg-server/include/gc.h
xorg-server/include/gcstruct.h
xorg-server/include/input.h
xorg-server/include/os.h
xorg-server/include/pixmap.h
xorg-server/include/property.h
xorg-server/include/resource.h
xorg-server/include/scrnintstr.h
xorg-server/include/window.h
xorg-server/include/xkbsrv.h
xorg-server/mi/mi.h
Diffstat (limited to 'xorg-server/hw/kdrive/src')
-rw-r--r-- | xorg-server/hw/kdrive/src/kdrive.c | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kdrive.h | 1 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kxv.c | 81 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kxv.h | 23 |
4 files changed, 26 insertions, 83 deletions
diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c index 7b082d322..bd2238fda 100644 --- a/xorg-server/hw/kdrive/src/kdrive.c +++ b/xorg-server/hw/kdrive/src/kdrive.c @@ -623,8 +623,12 @@ KdCloseScreen(ScreenPtr pScreen) KdCardInfo *card = pScreenPriv->card; Bool ret; + if (card->cfuncs->closeScreen) + (*card->cfuncs->closeScreen)(pScreen); + pScreenPriv->closed = TRUE; pScreen->CloseScreen = pScreenPriv->CloseScreen; + if (pScreen->CloseScreen) ret = (*pScreen->CloseScreen) (pScreen); else diff --git a/xorg-server/hw/kdrive/src/kdrive.h b/xorg-server/hw/kdrive/src/kdrive.h index 5b2f3378b..5f5e50b29 100644 --- a/xorg-server/hw/kdrive/src/kdrive.h +++ b/xorg-server/hw/kdrive/src/kdrive.h @@ -130,6 +130,7 @@ typedef struct _KdCardFuncs { void (*getColors) (ScreenPtr, int, xColorItem *); void (*putColors) (ScreenPtr, int, xColorItem *); + void (*closeScreen) (ScreenPtr); /* close ScreenRec */ } KdCardFuncs; #define KD_MAX_PSEUDO_DEPTH 8 diff --git a/xorg-server/hw/kdrive/src/kxv.c b/xorg-server/hw/kdrive/src/kxv.c index 9cc0edd8a..60a83458c 100644 --- a/xorg-server/hw/kdrive/src/kxv.c +++ b/xorg-server/hw/kdrive/src/kxv.c @@ -98,7 +98,7 @@ static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); /* misc */ -static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr *, int); +static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr, int); static DevPrivateKeyRec KdXVWindowKeyRec; @@ -116,49 +116,6 @@ static unsigned long PortResource = 0; #define GET_KDXV_WINDOW(pWin) ((KdXVWindowPtr) \ dixLookupPrivate(&(pWin)->devPrivates, KdXVWindowKey)) -static KdXVInitGenericAdaptorPtr *GenDrivers = NULL; -static int NumGenDrivers = 0; - -int -KdXVRegisterGenericAdaptorDriver(KdXVInitGenericAdaptorPtr InitFunc) -{ - KdXVInitGenericAdaptorPtr *newdrivers; - -/* fprintf(stderr,"KdXVRegisterGenericAdaptorDriver\n"); */ - - newdrivers = realloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) * - (1 + NumGenDrivers)); - if (!newdrivers) - return 0; - GenDrivers = newdrivers; - - GenDrivers[NumGenDrivers++] = InitFunc; - - return 1; -} - -int -KdXVListGenericAdaptors(KdScreenInfo * screen, KdVideoAdaptorPtr ** adaptors) -{ - int i, j, n, num; - KdVideoAdaptorPtr *DrivAdap, *new; - - num = 0; - *adaptors = NULL; - for (i = 0; i < NumGenDrivers; i++) { - n = GenDrivers[i] (screen, &DrivAdap); - if (0 == n) - continue; - new = realloc(*adaptors, sizeof(KdVideoAdaptorPtr) * (num + n)); - if (NULL == new) - continue; - *adaptors = new; - for (j = 0; j < n; j++, num++) - (*adaptors)[num] = DrivAdap[j]; - } - return num; -} - KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen) { @@ -172,7 +129,7 @@ KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr) } Bool -KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) +KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) { KdXVScreenPtr ScreenPriv; XvScreenPtr pxvs; @@ -282,7 +239,7 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) } static Bool -KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) +KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr infoPtr, int number) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; @@ -295,15 +252,11 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) XvPortRecPrivatePtr portPriv; XvPortPtr pPort, pp; int numPort; - KdAttributePtr attributePtr; - XvAttributePtr pAttribute, pat; KdVideoFormatPtr formatPtr; XvFormatPtr pFormat, pf; int numFormat, totFormat; KdVideoEncodingPtr encodingPtr; XvEncodingPtr pEncode, pe; - KdImagePtr imagePtr; - XvImagePtr pImage, pi; int numVisuals; VisualPtr pVisual; int i; @@ -315,7 +268,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) return FALSE; for (pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { - adaptorPtr = infoPtr[na]; + adaptorPtr = &infoPtr[na]; if (!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute || !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize) @@ -381,26 +334,24 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) } if (adaptorPtr->nImages && - (pImage = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { - - for (i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; - i < adaptorPtr->nImages; i++, pi++, imagePtr++) { - memcpy(pi, imagePtr, sizeof(*pi)); - } + (pa->pImages = calloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + memcpy(pa->pImages, adaptorPtr->pImages, + adaptorPtr->nImages * sizeof(XvImageRec)); pa->nImages = adaptorPtr->nImages; - pa->pImages = pImage; } if (adaptorPtr->nAttributes && - (pAttribute = - calloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { - for (pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = - 0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) { - memcpy(pat, attributePtr, sizeof(*pat)); - pat->name = strdup(attributePtr->name); + (pa->pAttributes = calloc(adaptorPtr->nAttributes, + sizeof(XvAttributeRec)))) { + memcpy(pa->pAttributes, adaptorPtr->pAttributes, + adaptorPtr->nAttributes * sizeof(XvAttributeRec)); + + for (i = 0; i < adaptorPtr->nAttributes; i++) { + pa->pAttributes[i].name = + strdup(adaptorPtr->pAttributes[i].name); } + pa->nAttributes = adaptorPtr->nAttributes; - pa->pAttributes = pAttribute; } totFormat = adaptorPtr->nFormats; diff --git a/xorg-server/hw/kdrive/src/kxv.h b/xorg-server/hw/kdrive/src/kxv.h index 85a030ee9..3a49a659f 100644 --- a/xorg-server/hw/kdrive/src/kxv.h +++ b/xorg-server/hw/kdrive/src/kxv.h @@ -56,8 +56,6 @@ of the copyright holder. #define VIDEO_OVERLAID_STILLS 0x00000008 #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 -typedef XvImageRec KdImageRec, *KdImagePtr; - typedef struct { KdScreenInfo *screen; int id; @@ -121,7 +119,7 @@ typedef enum { typedef struct { int id; - char *name; + const char *name; unsigned short width, height; XvRationalRec rate; } KdVideoEncodingRec, *KdVideoEncodingPtr; @@ -131,12 +129,10 @@ typedef struct { short class; } KdVideoFormatRec, *KdVideoFormatPtr; -typedef XvAttributeRec KdAttributeRec, *KdAttributePtr; - typedef struct { unsigned int type; int flags; - char *name; + const char *name; int nEncodings; KdVideoEncodingPtr pEncodings; int nFormats; @@ -144,9 +140,9 @@ typedef struct { int nPorts; DevUnion *pPortPrivates; int nAttributes; - KdAttributePtr pAttributes; + XvAttributePtr pAttributes; int nImages; - KdImagePtr pImages; + XvImagePtr pImages; PutVideoFuncPtr PutVideo; PutStillFuncPtr PutStill; GetVideoFuncPtr GetVideo; @@ -161,16 +157,7 @@ typedef struct { } KdVideoAdaptorRec, *KdVideoAdaptorPtr; Bool - KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * Adaptors, int num); - -typedef int (*KdXVInitGenericAdaptorPtr) (KdScreenInfo * screen, - KdVideoAdaptorPtr ** Adaptors); - -int - KdXVRegisterGenericAdaptorDriver(KdXVInitGenericAdaptorPtr InitFunc); - -int - KdXVListGenericAdaptors(KdScreenInfo * screen, KdVideoAdaptorPtr ** Adaptors); + KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num); void |