aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-19 15:00:38 +0200
committermarha <marha@users.sourceforge.net>2014-07-19 15:00:38 +0200
commitd0c30e7945e76ac119f6d867e27137c8a76f7e15 (patch)
tree1bfb3148a6f43bdd32746c5b882f9f083076cf91 /xorg-server/hw/kdrive/src
parente708bebcc029873004ade4241f347ce8c58896af (diff)
downloadvcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.tar.gz
vcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.tar.bz2
vcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.zip
fontconfig plink libX11 libxcb mesa git update 19 July 2014
plink revision 10207 xserver commit cfa302d6224d10860e60491333950544c4fb9b04 libxcb commit 49a61c8b459ab19c7f39e653bbb0d0339ea8f00f libX11 commit 5525e8433f93bce464412f27cffa203ea628f368 fontconfig commit 6781c6baef062eeea5b5b68e4a9c31ea6cd7539b mesa commit f6fc80734533140a69b30361fe0d4773a03515db
Diffstat (limited to 'xorg-server/hw/kdrive/src')
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.c4
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.h1
-rw-r--r--xorg-server/hw/kdrive/src/kxv.c81
-rw-r--r--xorg-server/hw/kdrive/src/kxv.h23
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 9814fc66a..b5b91c0dd 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -621,8 +621,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 bec75cb6f..08b1681ce 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