static void G80SorCreateResources(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; G80Ptr pNv = G80PTR(pScrn); int data, err; const char *s; /******** dithering ********/ properties.dither.atom = MAKE_ATOM("dither"); properties.dither.range[0] = 0; properties.dither.range[1] = 1; err = RRConfigureOutputProperty(output->randr_output, properties.dither.atom, FALSE, TRUE, FALSE, 2, properties.dither.range); if(err) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to configure dithering property for %s: error %d\n", output->name, err); // Set the default value data = pNv->Dither; err = RRChangeOutputProperty(output->randr_output, properties.dither.atom, XA_INTEGER, 32, PropModeReplace, 1, &data, FALSE, FALSE); if(err) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set dithering property for %s: error %d\n", output->name, err); /******** scaling ********/ properties.scale.atom = MAKE_ATOM("scale"); err = RRConfigureOutputProperty(output->randr_output, properties.scale.atom, FALSE, FALSE, FALSE, 0, NULL); if(err) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to configure scaling property for %s: error %d\n", output->name, err); // Set the default value s = "aspect"; err = RRChangeOutputProperty(output->randr_output, properties.scale.atom, XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s, FALSE, FALSE); if(err) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set scaling property for %s: error %d\n", output->name, err); }
static atom_t add_string(unsigned char *cs, int len) { pthread_mutex_lock(&mutex_string); //printf("add_string(%c,%c,%i)\n",cs[0],cs[1],len); assert(len >= 0); assert(len < MAX_ENTRY_SIZE); assert(next_free_offset < CHUNK_SIZE); if(next_free_offset + 1 > CHUNK_SIZE - MAX_ENTRY_SIZE) { dieif(current_chunk >= NUM_CHUNKS - 1, "No more chunks"); current_chunk++; assert(!stringtable_chunks[current_chunk]); stringtable_chunks[current_chunk] = malloc(CHUNK_SIZE); dieif(!stringtable_chunks[current_chunk], "error alocating memory"); next_free_offset = 0; } memcpy(stringtable_chunks[current_chunk] + next_free_offset, cs, len); atom_t r = MAKE_ATOM(current_chunk, next_free_offset, len); assert(CHUNK_INDEX(r) == current_chunk); assert(CHUNK_OFFSET(r) == next_free_offset); assert(ATOM_PTR(r) == stringtable_chunks[current_chunk] + next_free_offset); assert(ATOM_LEN(r) == len); next_free_offset += len; assert(next_free_offset < CHUNK_SIZE); assert(current_chunk < NUM_CHUNKS); pthread_mutex_unlock(&mutex_string); return r; }
static XF86VideoAdaptorPtr CHIPSSetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; CHIPSPtr cPtr = CHIPSPTR(pScrn); XF86VideoAdaptorPtr adapt; CHIPSPortPrivPtr pPriv; if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(CHIPSPortPrivRec) + sizeof(DevUnion)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "Chips and Technologies Backend Scaler"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncoding; adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion*)(&adapt[1]); pPriv = (CHIPSPortPrivPtr)(&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer)(pPriv); adapt->pAttributes = Attributes; adapt->nImages = NUM_IMAGES; adapt->nAttributes = NUM_ATTRIBUTES; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = CHIPSStopVideo; adapt->SetPortAttribute = CHIPSSetPortAttribute; adapt->GetPortAttribute = CHIPSGetPortAttribute; adapt->QueryBestSize = CHIPSQueryBestSize; adapt->PutImage = CHIPSPutImage; adapt->QueryImageAttributes = CHIPSQueryImageAttributes; pPriv->colorKey = cPtr->videoKey; pPriv->videoStatus = 0; pPriv->doubleBuffer = TRUE; pPriv->manualDoubleBuffer = FALSE; pPriv->currentBuffer = 0; /* gotta uninit this someplace */ REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); cPtr->adaptor = adapt; xvColorKey = MAKE_ATOM("XV_COLORKEY"); CHIPSResetVideo(pScrn); return adapt; }
static XF86VideoAdaptorPtr MGAAllocAdaptor(ScrnInfoPtr pScrn, Bool doublebuffer) { XF86VideoAdaptorPtr adapt; MGAPtr pMga = MGAPTR(pScrn); MGAPortPrivPtr pPriv; int i; if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) return NULL; if(!(pPriv = xcalloc(1, sizeof(MGAPortPrivRec) + (sizeof(DevUnion) * MGA_MAX_PORTS)))) { xfree(adapt); return NULL; } adapt->pPortPrivates = (DevUnion*)(&pPriv[1]); for(i = 0; i < MGA_MAX_PORTS; i++) adapt->pPortPrivates[i].val = i; xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvDoubleBuffer = MAKE_ATOM("XV_DOUBLE_BUFFER"); pPriv->colorKey = pMga->videoKey; pPriv->videoStatus = 0; pPriv->brightness = 0; pPriv->contrast = 128; pPriv->lastPort = -1; pPriv->doubleBuffer = doublebuffer; pPriv->currentBuffer = 0; pMga->adaptor = adapt; pMga->portPrivate = pPriv; return adapt; }
int viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt) { viaPortPrivPtr pPriv; ViaXvMCXVPriv *vx; unsigned i, j; for (j = 0; j < XvAdapt->nPorts; ++j) { pPriv = (viaPortPrivPtr) XvAdapt->pPortPrivates[j].ptr; if (NULL == (pPriv->xvmc_priv = calloc(1, sizeof(ViaXvMCXVPriv)))) return BadAlloc; for (i = 0; i < VIA_NUM_XVMC_ATTRIBUTES; ++i) { attrAtoms[i] = MAKE_ATOM(attrXvMC[i]); } vx = (ViaXvMCXVPriv *) pPriv->xvmc_priv; vx->ctxDisplaying = 0; vx->xvAttr.numAttr = VIA_NUM_XVMC_ATTRIBUTES; vx->xvmc_port = -1; vx->newAttribute = 1; /* Set up wrappers. */ vx->GetPortAttribute = XvAdapt->GetPortAttribute; vx->SetPortAttribute = XvAdapt->SetPortAttribute; vx->PutImage = XvAdapt->PutImage; XvAdapt->GetPortAttribute = viaXvMCInterceptXvGetAttribute; XvAdapt->SetPortAttribute = viaXvMCInterceptXvAttribute; XvAdapt->PutImage = viaXvMCInterceptPutImage; for (i = 0; i < VIA_NUM_XVMC_ATTRIBUTES; ++i) { vx->xvAttr.attributes[i].attribute = attrAtoms[i]; vx->xvAttr.attributes[i].value = 0; vx->GetPortAttribute(pScrn, attrAtoms[i], &(vx->xvAttr.attributes[i].value), pPriv); } } return Success; }
static void _XkbDDXBeepInitAtoms(void) { featureOn = MAKE_ATOM(FEATURE_ON); featureOff = MAKE_ATOM(FEATURE_OFF); featureChange = MAKE_ATOM(FEATURE_CHANGE); ledOn = MAKE_ATOM(LED_ON); ledOff = MAKE_ATOM(LED_OFF); ledChange = MAKE_ATOM(LED_CHANGE); slowWarn = MAKE_ATOM(SLOW_WARN); slowPress = MAKE_ATOM(SLOW_PRESS); slowReject = MAKE_ATOM(SLOW_REJECT); slowAccept = MAKE_ATOM(SLOW_ACCEPT); slowRelease = MAKE_ATOM(SLOW_RELEASE); stickyLatch = MAKE_ATOM(STICKY_LATCH); stickyLock = MAKE_ATOM(STICKY_LOCK); stickyUnlock = MAKE_ATOM(STICKY_UNLOCK); bounceReject = MAKE_ATOM(BOUNCE_REJECT); return; }
static XF86VideoAdaptorPtr winSetupImageVideo (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; #if 0 I810Ptr pI810 = I810PTR(pScrn); #endif XF86VideoAdaptorPtr adapt; if (!(adapt = xcalloc (1, sizeof(XF86VideoAdaptorRec)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = PROJECT_NAME " Video Overlay"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncoding; adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = 1; adapt->pPortPrivates = NULL; adapt->pPortPrivates[0].ptr = NULL; adapt->pAttributes = Attributes; adapt->nImages = NUM_IMAGES; adapt->nAttributes = NUM_ATTRIBUTES; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; #if 0 adapt->StopVideo = I810StopVideo; adapt->SetPortAttribute = I810SetPortAttribute; adapt->GetPortAttribute = I810GetPortAttribute; adapt->QueryBestSize = I810QueryBestSize; adapt->PutImage = I810PutImage; adapt->QueryImageAttributes = I810QueryImageAttributes; #endif #if 0 pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1); #endif pPriv->videoStatus = 0; pPriv->brightness = 0; pPriv->contrast = 64; pPriv->linear = NULL; pPriv->currentBuf = 0; #if 0 /* gotta uninit this someplace */ REGION_NULL(pScreen, &pPriv->clip); #endif #if 0 pI810->adaptor = adapt; pI810->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = I810BlockHandler; #endif #if 0 xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); xvColorKey = MAKE_ATOM("XV_COLORKEY"); #endif #if 0 I810ResetVideo(pScrn); #endif return adapt; }
_XkbDDXBeepInitAtoms() #endif { featureOn= MAKE_ATOM(FEATURE_ON); featureOff= MAKE_ATOM(FEATURE_OFF); featureChange= MAKE_ATOM(FEATURE_CHANGE); ledOn= MAKE_ATOM(LED_ON); ledOff= MAKE_ATOM(LED_OFF); ledChange= MAKE_ATOM(LED_CHANGE); slowWarn= MAKE_ATOM(SLOW_WARN); slowPress= MAKE_ATOM(SLOW_PRESS); slowReject= MAKE_ATOM(SLOW_REJECT); slowAccept= MAKE_ATOM(SLOW_ACCEPT); slowRelease= MAKE_ATOM(SLOW_RELEASE); stickyLatch= MAKE_ATOM(STICKY_LATCH); stickyLock= MAKE_ATOM(STICKY_LOCK); stickyUnlock= MAKE_ATOM(STICKY_UNLOCK); bounceReject= MAKE_ATOM(BOUNCE_REJECT); #if (defined(__osf__) && defined(__alpha)) /* [[[ WDW - Some bells do not allow for pitch changes. * Maybe this could become part of the keymap? ]]] */ { char keyboard[8]; /* Find the class of keyboard being used. */ keyboard[0] = '\0'; if (-1 == getsysinfo(GSI_KEYBOARD, keyboard, sizeof(keyboard), 0, NULL)) keyboard[0] = '\0'; if ((strcmp(keyboard,"LK201") == 0) || (strcmp(keyboard,"LK401") == 0) || (strcmp(keyboard,"LK421") == 0) || (strcmp(keyboard,"LK443") == 0)) doesPitch = 0; } #else #if defined(sun) doesPitch = 0; #endif #endif return; }
static XF86VideoAdaptorPtr SIS6326SetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; SISPtr pSiS = SISPTR(pScrn); XF86VideoAdaptorPtr adapt; SISPortPrivPtr pPriv; #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,1,99,1,0) XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr; if(!pXAA || !pXAA->FillSolidRects) return NULL; #endif if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(SISPortPrivRec) + sizeof(DevUnion)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "SIS 5597/5598/6326/530/620 Video Overlay"; adapt->nEncodings = 1; if(pSiS->oldChipset < OC_SIS6326) { adapt->pEncodings = &DummyEncoding5597; } else { adapt->pEncodings = &DummyEncoding; } adapt->nFormats = NUM_FORMATS; adapt->pFormats = SIS6326Formats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion*)(&adapt[1]); pPriv = (SISPortPrivPtr)(&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer)(pPriv); adapt->pAttributes = SIS6326Attributes; adapt->nAttributes = NUM_ATTRIBUTES; if(pSiS->NoYV12 == 1) { adapt->nImages = NUM_IMAGES_NOYV12; adapt->pImages = SIS6326ImagesNoYV12; } else { adapt->nImages = NUM_IMAGES; adapt->pImages = SIS6326Images; } adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = SIS6326StopVideo; adapt->SetPortAttribute = SIS6326SetPortAttribute; adapt->GetPortAttribute = SIS6326GetPortAttribute; adapt->QueryBestSize = SIS6326QueryBestSize; adapt->PutImage = SIS6326PutImage; adapt->QueryImageAttributes = SIS6326QueryImageAttributes; pPriv->videoStatus = 0; pPriv->currentBuf = 0; pPriv->handle = NULL; pPriv->grabbedByV4L= FALSE; SIS6326SetPortDefaults(pScrn, pPriv); /* gotta uninit this someplace */ #if defined(REGION_NULL) REGION_NULL(pScreen, &pPriv->clip); #else REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); #endif pSiS->adaptor = adapt; xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvAutopaintColorKey = MAKE_ATOM("XV_AUTOPAINT_COLORKEY"); xvSetDefaults = MAKE_ATOM("XV_SET_DEFAULTS"); xvDisableGfx = MAKE_ATOM("XV_DISABLE_GRAPHICS"); SIS6326ResetVideo(pScrn); pSiS->ResetXv = SIS6326ResetVideo; return adapt; }