Lines Matching +full:depth +full:-
2 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
38 #include <xorg-config.h>
81 xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec)); in xf86AddDriver()
82 *xf86DriverList[xf86NumDrivers - 1] = *driver; in xf86AddDriver()
83 xf86DriverList[xf86NumDrivers - 1]->module = module; in xf86AddDriver()
84 xf86DriverList[xf86NumDrivers - 1]->refCount = 0; in xf86AddDriver()
92 if (xf86DriverList[drvIndex]->module) in xf86DeleteDriver()
93 UnloadModule(xf86DriverList[drvIndex]->module); in xf86DeleteDriver()
115 xf86InputDriverList[xf86NumInputDrivers - 1] = in xf86AddInputDriver()
117 *xf86InputDriverList[xf86NumInputDrivers - 1] = *driver; in xf86AddInputDriver()
118 xf86InputDriverList[xf86NumInputDrivers - 1]->module = module; in xf86AddInputDriver()
124 if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module) in xf86DeleteInputDriver()
125 UnloadModule(xf86InputDriverList[drvIndex]->module); in xf86DeleteInputDriver()
136 if (xf86InputDriverList[i] && xf86InputDriverList[i]->driverName && in xf86LookupInputDriver()
137 xf86NameCmp(name, xf86InputDriverList[i]->driverName) == 0) in xf86LookupInputDriver()
148 for (p = xf86InputDevs; p != NULL; p = p->next) { in xf86LookupInput()
149 if (strcmp(name, p->name) == 0) in xf86LookupInput()
172 pScrn->scrnIndex = i + GPU_SCREEN_OFFSET; /* Changes when a screen is removed */ in xf86AllocateScreen()
173 pScrn->is_gpu = TRUE; in xf86AllocateScreen()
184 pScrn->scrnIndex = i; /* Changes when a screen is removed */ in xf86AllocateScreen()
187 pScrn->origIndex = pScrn->scrnIndex; /* This never changes */ in xf86AllocateScreen()
188 pScrn->privates = xnfcalloc(sizeof(DevUnion), xf86ScrnInfoPrivateCount); in xf86AllocateScreen()
191 * pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess; in xf86AllocateScreen()
194 pScrn->drv = drv; in xf86AllocateScreen()
195 drv->refCount++; in xf86AllocateScreen()
196 pScrn->module = DuplicateModule(drv->module, NULL); in xf86AllocateScreen()
198 pScrn->DriverFunc = drv->driverFunc; in xf86AllocateScreen()
218 if (pScrn->is_gpu) { in xf86DeleteScreen()
229 scrnIndex = pScrn->scrnIndex; in xf86DeleteScreen()
231 if (pScrn->FreeScreen != NULL) in xf86DeleteScreen()
232 pScrn->FreeScreen(pScrn); in xf86DeleteScreen()
234 while (pScrn->modes) in xf86DeleteScreen()
235 xf86DeleteMode(&pScrn->modes, pScrn->modes); in xf86DeleteScreen()
237 while (pScrn->modePool) in xf86DeleteScreen()
238 xf86DeleteMode(&pScrn->modePool, pScrn->modePool); in xf86DeleteScreen()
240 xf86OptionListFree(pScrn->options); in xf86DeleteScreen()
242 if (pScrn->module) in xf86DeleteScreen()
243 UnloadModule(pScrn->module); in xf86DeleteScreen()
245 if (pScrn->drv) in xf86DeleteScreen()
246 pScrn->drv->refCount--; in xf86DeleteScreen()
248 free(pScrn->privates); in xf86DeleteScreen()
257 xf86NumGPUScreens--; in xf86DeleteScreen()
258 scrnIndex -= GPU_SCREEN_OFFSET; in xf86DeleteScreen()
261 xf86GPUScreens[i]->scrnIndex = i + GPU_SCREEN_OFFSET; in xf86DeleteScreen()
266 xf86NumScreens--; in xf86DeleteScreen()
270 xf86Screens[i]->scrnIndex = i; in xf86DeleteScreen()
290 nprivs = xnfreallocarray(pScr->privates, in xf86AllocateScrnInfoPrivateIndex()
294 pScr->privates = nprivs; in xf86AllocateScrnInfoPrivateIndex()
298 nprivs = xnfreallocarray(pScr->privates, in xf86AllocateScrnInfoPrivateIndex()
302 pScr->privates = nprivs; in xf86AllocateScrnInfoPrivateIndex()
308 xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) in xf86AddPixFormat() argument
312 if (pScrn->numFormats >= MAXFORMATS) in xf86AddPixFormat()
316 if (depth == 1) in xf86AddPixFormat()
318 else if (depth <= 8) in xf86AddPixFormat()
320 else if (depth <= 16) in xf86AddPixFormat()
322 else if (depth <= 32) in xf86AddPixFormat()
330 i = pScrn->numFormats++; in xf86AddPixFormat()
331 pScrn->formats[i].depth = depth; in xf86AddPixFormat()
332 pScrn->formats[i].bitsPerPixel = bpp; in xf86AddPixFormat()
333 pScrn->formats[i].scanlinePad = pad; in xf86AddPixFormat()
338 * Set the depth we are using based on (in the following order of preference):
339 * - values given on the command line
340 * - values given in the config file
341 * - values provided by the driver
342 * - an overall default when nothing else is given
344 * Also find a Display subsection matching the depth/bpp found.
347 * bitsPerPixel, depth, display, imageByteOrder,
361 xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, in xf86SetDepthBpp() argument
367 scrp->bitsPerPixel = -1; in xf86SetDepthBpp()
368 scrp->depth = -1; in xf86SetDepthBpp()
369 scrp->bitsPerPixelFrom = X_DEFAULT; in xf86SetDepthBpp()
370 scrp->depthFrom = X_DEFAULT; in xf86SetDepthBpp()
375 scrp->bitsPerPixel = xf86FbBpp; in xf86SetDepthBpp()
376 scrp->bitsPerPixelFrom = X_CMDLINE; in xf86SetDepthBpp()
380 scrp->depth = xf86Depth; in xf86SetDepthBpp()
381 scrp->depthFrom = X_CMDLINE; in xf86SetDepthBpp()
385 if (scrp->confScreen->defaultfbbpp > 0) { in xf86SetDepthBpp()
386 scrp->bitsPerPixel = scrp->confScreen->defaultfbbpp; in xf86SetDepthBpp()
387 scrp->bitsPerPixelFrom = X_CONFIG; in xf86SetDepthBpp()
389 if (scrp->confScreen->defaultdepth > 0) { in xf86SetDepthBpp()
390 scrp->depth = scrp->confScreen->defaultdepth; in xf86SetDepthBpp()
391 scrp->depthFrom = X_CONFIG; in xf86SetDepthBpp()
394 if (scrp->confScreen->defaultfbbpp <= 0 && in xf86SetDepthBpp()
395 scrp->confScreen->defaultdepth <= 0) { in xf86SetDepthBpp()
403 for (i = 0; i < scrp->numEntities; i++) { in xf86SetDepthBpp()
404 device = xf86GetDevFromEntity(scrp->entityList[i], in xf86SetDepthBpp()
405 scrp->entityInstanceList[i]); in xf86SetDepthBpp()
406 if (device && device->options) { in xf86SetDepthBpp()
407 if (xf86FindOption(device->options, "DefaultDepth")) { in xf86SetDepthBpp()
408 scrp->depth = xf86SetIntOption(device->options, in xf86SetDepthBpp()
409 "DefaultDepth", -1); in xf86SetDepthBpp()
410 scrp->depthFrom = X_CONFIG; in xf86SetDepthBpp()
413 if (xf86FindOption(device->options, "DefaultFbBpp")) { in xf86SetDepthBpp()
414 scrp->bitsPerPixel = xf86SetIntOption(device->options, in xf86SetDepthBpp()
416 -1); in xf86SetDepthBpp()
417 scrp->bitsPerPixelFrom = X_CONFIG; in xf86SetDepthBpp()
428 if (scrp->bitsPerPixel < 0 && scrp->depth < 0) { in xf86SetDepthBpp()
429 if (fbbpp > 0 || depth > 0) { in xf86SetDepthBpp()
431 scrp->bitsPerPixel = fbbpp; in xf86SetDepthBpp()
432 if (depth > 0) in xf86SetDepthBpp()
433 scrp->depth = depth; in xf86SetDepthBpp()
436 scrp->depth = GLOBAL_DEFAULT_DEPTH; in xf86SetDepthBpp()
442 if (scrp->bitsPerPixel < 0) { in xf86SetDepthBpp()
443 /* The depth must be set */ in xf86SetDepthBpp()
444 if (scrp->depth > -1) { in xf86SetDepthBpp()
445 if (scrp->depth == 1) in xf86SetDepthBpp()
446 scrp->bitsPerPixel = 1; in xf86SetDepthBpp()
447 else if (scrp->depth <= 4) in xf86SetDepthBpp()
448 scrp->bitsPerPixel = 4; in xf86SetDepthBpp()
449 else if (scrp->depth <= 8) in xf86SetDepthBpp()
450 scrp->bitsPerPixel = 8; in xf86SetDepthBpp()
451 else if (scrp->depth <= 16) in xf86SetDepthBpp()
452 scrp->bitsPerPixel = 16; in xf86SetDepthBpp()
453 else if (scrp->depth <= 24 && DO_PIX32(depth24flags)) { in xf86SetDepthBpp()
454 scrp->bitsPerPixel = 32; in xf86SetDepthBpp()
456 else if (scrp->depth <= 32) in xf86SetDepthBpp()
457 scrp->bitsPerPixel = 32; in xf86SetDepthBpp()
459 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
460 "No bpp for depth (%d)\n", scrp->depth); in xf86SetDepthBpp()
465 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
466 "xf86SetDepthBpp: internal error: depth and fbbpp" in xf86SetDepthBpp()
470 if (scrp->bitsPerPixel < 0) { in xf86SetDepthBpp()
473 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
474 "Driver can't support depth 24\n"); in xf86SetDepthBpp()
476 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
477 "Can't find fbbpp for depth 24\n"); in xf86SetDepthBpp()
480 scrp->bitsPerPixelFrom = X_PROBED; in xf86SetDepthBpp()
483 if (scrp->depth <= 0) { in xf86SetDepthBpp()
485 switch (scrp->bitsPerPixel) { in xf86SetDepthBpp()
487 scrp->depth = 24; in xf86SetDepthBpp()
491 scrp->depth = scrp->bitsPerPixel; in xf86SetDepthBpp()
494 scrp->depthFrom = X_PROBED; in xf86SetDepthBpp()
498 if (scrp->depth < 1 || scrp->depth > 32) { in xf86SetDepthBpp()
499 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
500 "Specified depth (%d) is not in the range 1-32\n", in xf86SetDepthBpp()
501 scrp->depth); in xf86SetDepthBpp()
504 switch (scrp->bitsPerPixel) { in xf86SetDepthBpp()
512 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
514 scrp->bitsPerPixel); in xf86SetDepthBpp()
517 if (scrp->depth > scrp->bitsPerPixel) { in xf86SetDepthBpp()
518 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
519 "Specified depth (%d) is greater than the fbbpp (%d)\n", in xf86SetDepthBpp()
520 scrp->depth, scrp->bitsPerPixel); in xf86SetDepthBpp()
525 * Find the Display subsection matching the depth/fbbpp and initialise in xf86SetDepthBpp()
526 * scrp->display with it. in xf86SetDepthBpp()
528 for (i = 0, disp = scrp->confScreen->displays; in xf86SetDepthBpp()
529 i < scrp->confScreen->numdisplays; i++, disp++) { in xf86SetDepthBpp()
530 if ((disp->depth == scrp->depth && disp->fbbpp == scrp->bitsPerPixel) in xf86SetDepthBpp()
531 || (disp->depth == scrp->depth && disp->fbbpp <= 0) in xf86SetDepthBpp()
532 || (disp->fbbpp == scrp->bitsPerPixel && disp->depth <= 0)) { in xf86SetDepthBpp()
533 scrp->display = disp; in xf86SetDepthBpp()
540 * depth or fbbpp specified. in xf86SetDepthBpp()
542 if (i == scrp->confScreen->numdisplays) { in xf86SetDepthBpp()
543 for (i = 0, disp = scrp->confScreen->displays; in xf86SetDepthBpp()
544 i < scrp->confScreen->numdisplays; i++, disp++) { in xf86SetDepthBpp()
545 if (disp->depth <= 0 && disp->fbbpp <= 0) { in xf86SetDepthBpp()
546 scrp->display = disp; in xf86SetDepthBpp()
555 if (i == scrp->confScreen->numdisplays) { in xf86SetDepthBpp()
556 scrp->confScreen->numdisplays++; in xf86SetDepthBpp()
563 scrp->confScreen->displays = in xf86SetDepthBpp()
564 xnfreallocarray(scrp->confScreen->displays, in xf86SetDepthBpp()
565 scrp->confScreen->numdisplays, sizeof(DispRec)); in xf86SetDepthBpp()
568 xf86DrvMsg(scrp->scrnIndex, X_INFO, in xf86SetDepthBpp()
570 "\t\"%s\" for depth/fbbpp %d/%d\n", in xf86SetDepthBpp()
571 scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel); in xf86SetDepthBpp()
572 memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec)); in xf86SetDepthBpp()
573 scrp->confScreen->displays[i].blackColour.red = -1; in xf86SetDepthBpp()
574 scrp->confScreen->displays[i].blackColour.green = -1; in xf86SetDepthBpp()
575 scrp->confScreen->displays[i].blackColour.blue = -1; in xf86SetDepthBpp()
576 scrp->confScreen->displays[i].whiteColour.red = -1; in xf86SetDepthBpp()
577 scrp->confScreen->displays[i].whiteColour.green = -1; in xf86SetDepthBpp()
578 scrp->confScreen->displays[i].whiteColour.blue = -1; in xf86SetDepthBpp()
579 scrp->confScreen->displays[i].defaultVisual = -1; in xf86SetDepthBpp()
580 scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *)); in xf86SetDepthBpp()
581 scrp->confScreen->displays[i].modes[0] = NULL; in xf86SetDepthBpp()
582 scrp->confScreen->displays[i].depth = depth; in xf86SetDepthBpp()
583 scrp->confScreen->displays[i].fbbpp = fbbpp; in xf86SetDepthBpp()
584 scrp->display = &scrp->confScreen->displays[i]; in xf86SetDepthBpp()
588 * Setup defaults for the display-wide attributes the framebuffer will in xf86SetDepthBpp()
592 scrp->imageByteOrder = IMAGE_BYTE_ORDER; in xf86SetDepthBpp()
593 scrp->bitmapScanlinePad = BITMAP_SCANLINE_PAD; in xf86SetDepthBpp()
594 if (scrp->depth < 8) { in xf86SetDepthBpp()
596 scrp->bitmapScanlineUnit = 8; in xf86SetDepthBpp()
597 scrp->bitmapBitOrder = MSBFirst; in xf86SetDepthBpp()
600 scrp->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; in xf86SetDepthBpp()
601 scrp->bitmapBitOrder = BITMAP_BIT_ORDER; in xf86SetDepthBpp()
605 * If an unusual depth is required, add it to scrp->formats. The formats in xf86SetDepthBpp()
608 switch (scrp->depth) { in xf86SetDepthBpp()
618 if (!xf86AddPixFormat(scrp, scrp->depth, 0, 0)) { in xf86SetDepthBpp()
619 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
620 "Can't add pixmap format for depth %d\n", scrp->depth); in xf86SetDepthBpp()
626 scrp->fbFormat.depth = scrp->depth; in xf86SetDepthBpp()
627 scrp->fbFormat.bitsPerPixel = scrp->bitsPerPixel; in xf86SetDepthBpp()
628 scrp->fbFormat.scanlinePad = BITMAP_SCANLINE_PAD; in xf86SetDepthBpp()
634 * Print out the selected depth and bpp.
639 xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth); in xf86PrintDepthBpp()
640 xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel); in xf86PrintDepthBpp()
644 * xf86SetWeight sets scrp->weight, scrp->mask, scrp->offset, and for depths
645 * greater than MAX_PSEUDO_DEPTH also scrp->rgbBits.
652 scrp->weight.red = 0; in xf86SetWeight()
653 scrp->weight.green = 0; in xf86SetWeight()
654 scrp->weight.blue = 0; in xf86SetWeight()
657 scrp->weight = xf86Weight; in xf86SetWeight()
660 else if (scrp->display->weight.red > 0 && scrp->display->weight.green > 0 in xf86SetWeight()
661 && scrp->display->weight.blue > 0) { in xf86SetWeight()
662 scrp->weight = scrp->display->weight; in xf86SetWeight()
666 scrp->weight = weight; in xf86SetWeight()
669 switch (scrp->depth) { in xf86SetWeight()
673 scrp->weight.red = scrp->weight.green = in xf86SetWeight()
674 scrp->weight.blue = scrp->rgbBits; in xf86SetWeight()
677 scrp->weight.red = scrp->weight.green = scrp->weight.blue = 5; in xf86SetWeight()
680 scrp->weight.red = scrp->weight.blue = 5; in xf86SetWeight()
681 scrp->weight.green = 6; in xf86SetWeight()
684 scrp->weight.red = scrp->weight.green = scrp->weight.blue = 6; in xf86SetWeight()
687 scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8; in xf86SetWeight()
690 scrp->weight.red = scrp->weight.green = scrp->weight.blue = 10; in xf86SetWeight()
695 if (scrp->weight.red) in xf86SetWeight()
696 xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n", in xf86SetWeight()
697 (int) scrp->weight.red, (int) scrp->weight.green, in xf86SetWeight()
698 (int) scrp->weight.blue); in xf86SetWeight()
700 if (scrp->depth > MAX_PSEUDO_DEPTH && in xf86SetWeight()
701 (scrp->depth != scrp->weight.red + scrp->weight.green + in xf86SetWeight()
702 scrp->weight.blue)) { in xf86SetWeight()
703 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetWeight()
705 "depth (%d)\n", in xf86SetWeight()
706 (int) scrp->weight.red, (int) scrp->weight.green, in xf86SetWeight()
707 (int) scrp->weight.blue, scrp->depth); in xf86SetWeight()
710 if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) { in xf86SetWeight()
716 scrp->rgbBits = scrp->weight.red; in xf86SetWeight()
717 if (scrp->weight.green > scrp->rgbBits) in xf86SetWeight()
718 scrp->rgbBits = scrp->weight.green; in xf86SetWeight()
719 if (scrp->weight.blue > scrp->rgbBits) in xf86SetWeight()
720 scrp->rgbBits = scrp->weight.blue; in xf86SetWeight()
726 scrp->offset.red = scrp->weight.green + scrp->weight.blue; in xf86SetWeight()
727 scrp->offset.green = scrp->weight.blue; in xf86SetWeight()
728 scrp->offset.blue = 0; in xf86SetWeight()
729 scrp->mask.red = ((1 << scrp->weight.red) - 1) << scrp->offset.red; in xf86SetWeight()
730 scrp->mask.green = ((1 << scrp->weight.green) - 1) in xf86SetWeight()
731 << scrp->offset.green; in xf86SetWeight()
732 scrp->mask.blue = (1 << scrp->weight.blue) - 1; in xf86SetWeight()
736 scrp->mask.red = mask.red; in xf86SetWeight()
737 scrp->mask.green = mask.green; in xf86SetWeight()
738 scrp->mask.blue = mask.blue; in xf86SetWeight()
739 scrp->offset.red = ffs(mask.red); in xf86SetWeight()
740 scrp->offset.green = ffs(mask.green); in xf86SetWeight()
741 scrp->offset.blue = ffs(mask.blue); in xf86SetWeight()
752 scrp->defaultVisual = defaultColorVisualClass; in xf86SetDefaultVisual()
755 else if (scrp->display->defaultVisual >= 0) { in xf86SetDefaultVisual()
756 scrp->defaultVisual = scrp->display->defaultVisual; in xf86SetDefaultVisual()
760 scrp->defaultVisual = visual; in xf86SetDefaultVisual()
763 if (scrp->depth == 1) in xf86SetDefaultVisual()
764 scrp->defaultVisual = StaticGray; in xf86SetDefaultVisual()
765 else if (scrp->depth == 4) in xf86SetDefaultVisual()
766 scrp->defaultVisual = StaticColor; in xf86SetDefaultVisual()
767 else if (scrp->depth <= MAX_PSEUDO_DEPTH) in xf86SetDefaultVisual()
768 scrp->defaultVisual = PseudoColor; in xf86SetDefaultVisual()
770 scrp->defaultVisual = TrueColor; in xf86SetDefaultVisual()
772 switch (scrp->defaultVisual) { in xf86SetDefaultVisual()
779 xf86DrvMsg(scrp->scrnIndex, visualFrom, "Default visual is %s\n", in xf86SetDefaultVisual()
780 xf86VisualNames[scrp->defaultVisual]); in xf86SetDefaultVisual()
784 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDefaultVisual()
785 "Invalid default visual class (%d)\n", scrp->defaultVisual); in xf86SetDefaultVisual()
802 xf86MonPtr DDC = (xf86MonPtr) (scrp->monitor->DDC); in xf86SetGamma()
806 scrp->gamma.red = SET_GAMMA(xf86Gamma.red); in xf86SetGamma()
807 scrp->gamma.green = SET_GAMMA(xf86Gamma.green); in xf86SetGamma()
808 scrp->gamma.blue = SET_GAMMA(xf86Gamma.blue); in xf86SetGamma()
810 else if (TEST_GAMMA(scrp->monitor->gamma)) { in xf86SetGamma()
812 scrp->gamma.red = SET_GAMMA(scrp->monitor->gamma.red); in xf86SetGamma()
813 scrp->gamma.green = SET_GAMMA(scrp->monitor->gamma.green); in xf86SetGamma()
814 scrp->gamma.blue = SET_GAMMA(scrp->monitor->gamma.blue); in xf86SetGamma()
817 else if (DDC && DDC->features.gamma > GAMMA_ZERO) { in xf86SetGamma()
819 scrp->gamma.red = SET_GAMMA(DDC->features.gamma); in xf86SetGamma()
820 scrp->gamma.green = SET_GAMMA(DDC->features.gamma); in xf86SetGamma()
821 scrp->gamma.blue = SET_GAMMA(DDC->features.gamma); in xf86SetGamma()
823 * in bytes 0x57-0x59 */ in xf86SetGamma()
827 scrp->gamma.red = SET_GAMMA(gamma.red); in xf86SetGamma()
828 scrp->gamma.green = SET_GAMMA(gamma.green); in xf86SetGamma()
829 scrp->gamma.blue = SET_GAMMA(gamma.blue); in xf86SetGamma()
832 scrp->gamma.red = 1.0; in xf86SetGamma()
833 scrp->gamma.green = 1.0; in xf86SetGamma()
834 scrp->gamma.blue = 1.0; in xf86SetGamma()
837 xf86DrvMsg(scrp->scrnIndex, from, in xf86SetGamma()
839 scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue); in xf86SetGamma()
859 xf86MonPtr DDC = (xf86MonPtr) (pScrn->monitor->DDC); in xf86SetDpi()
864 pScrn->widthmm = pScrn->monitor->widthmm; in xf86SetDpi()
865 pScrn->heightmm = pScrn->monitor->heightmm; in xf86SetDpi()
867 if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0)) { in xf86SetDpi()
871 ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */ in xf86SetDpi()
872 ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */ in xf86SetDpi()
879 pScrn->xDpi = monitorResolution; in xf86SetDpi()
880 pScrn->yDpi = monitorResolution; in xf86SetDpi()
883 else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) { in xf86SetDpi()
885 if (pScrn->widthmm > 0) { in xf86SetDpi()
886 pScrn->xDpi = in xf86SetDpi()
887 (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm); in xf86SetDpi()
889 if (pScrn->heightmm > 0) { in xf86SetDpi()
890 pScrn->yDpi = in xf86SetDpi()
891 (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm); in xf86SetDpi()
893 if (pScrn->xDpi > 0 && pScrn->yDpi <= 0) in xf86SetDpi()
894 pScrn->yDpi = pScrn->xDpi; in xf86SetDpi()
895 if (pScrn->yDpi > 0 && pScrn->xDpi <= 0) in xf86SetDpi()
896 pScrn->xDpi = pScrn->yDpi; in xf86SetDpi()
897 xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n", in xf86SetDpi()
898 pScrn->widthmm, pScrn->heightmm); in xf86SetDpi()
902 if (pScrn->widthmm > 0) { in xf86SetDpi()
903 widthErr = abs(ddcWidthmm - pScrn->widthmm); in xf86SetDpi()
908 if (pScrn->heightmm > 0) { in xf86SetDpi()
909 heightErr = abs(ddcHeightmm - pScrn->heightmm); in xf86SetDpi()
916 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, in xf86SetDpi()
918 ddcWidthmm, ddcHeightmm, pScrn->widthmm, in xf86SetDpi()
919 pScrn->heightmm); in xf86SetDpi()
925 xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n", in xf86SetDpi()
927 pScrn->widthmm = ddcWidthmm; in xf86SetDpi()
928 pScrn->heightmm = ddcHeightmm; in xf86SetDpi()
929 if (pScrn->widthmm > 0) { in xf86SetDpi()
930 pScrn->xDpi = in xf86SetDpi()
931 (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm); in xf86SetDpi()
933 if (pScrn->heightmm > 0) { in xf86SetDpi()
934 pScrn->yDpi = in xf86SetDpi()
935 (int) ((double) pScrn->virtualY * MMPERINCH / pScrn->heightmm); in xf86SetDpi()
937 if (pScrn->xDpi > 0 && pScrn->yDpi <= 0) in xf86SetDpi()
938 pScrn->yDpi = pScrn->xDpi; in xf86SetDpi()
939 if (pScrn->yDpi > 0 && pScrn->xDpi <= 0) in xf86SetDpi()
940 pScrn->xDpi = pScrn->yDpi; in xf86SetDpi()
944 pScrn->xDpi = x; in xf86SetDpi()
946 pScrn->xDpi = DEFAULT_DPI; in xf86SetDpi()
948 pScrn->yDpi = y; in xf86SetDpi()
950 pScrn->yDpi = DEFAULT_DPI; in xf86SetDpi()
952 xf86DrvMsg(pScrn->scrnIndex, from, "DPI set to (%d, %d)\n", in xf86SetDpi()
953 pScrn->xDpi, pScrn->yDpi); in xf86SetDpi()
962 pScreen->whitePixel = 0; in xf86SetBlackWhitePixels()
963 pScreen->blackPixel = 1; in xf86SetBlackWhitePixels()
966 pScreen->whitePixel = 1; in xf86SetBlackWhitePixels()
967 pScreen->blackPixel = 0; in xf86SetBlackWhitePixels()
988 * private data, and therefore don't need to access pScrnInfo->vtSema.
993 ScreenPtr pScreen = pScrnInfo->pScreen; in xf86EnableDisableFBAccess()
1019 xf86Screens[scrnIndex]->name) in xf86VDrvMsgVerb()
1021 xf86Screens[scrnIndex]->name, scrnIndex); in xf86VDrvMsgVerb()
1024 xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name) in xf86VDrvMsgVerb()
1026 … xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name, scrnIndex - GPU_SCREEN_OFFSET); in xf86VDrvMsgVerb()
1065 deviceName = dev->name; in xf86VIDrvMsgVerb()
1066 if (dev->drv) in xf86VIDrvMsgVerb()
1067 driverName = dev->drv->driverName; in xf86VIDrvMsgVerb()
1097 /* Print non-driver messages with verbose level specified directly */
1108 /* Print non-driver messages with verbose level of 1 (default) */
1183 if (asprintf(&lf, "%s%%s" LOGSUFFIX, xf86LogFile) == -1) in xf86LogInit()
1229 return -1; in xf86StringToToken()
1244 xf86DrvMsg(scrp->scrnIndex, from, "Pixel clocks available:"); in xf86ShowClocks()
1245 for (j = 0; j < scrp->numClocks; j++) { in xf86ShowClocks()
1248 xf86DrvMsg(scrp->scrnIndex, from, "pixel clocks:"); in xf86ShowClocks()
1250 xf86ErrorF(" %7.3f", (double) scrp->clock[j] / 1000.0); in xf86ShowClocks()
1299 * This can happen when running Xorg -showopts and a module like ati in xf86MatchDevice()
1314 * this list as return value. 0 means none found, -1 means fatal error. in xf86MatchDevice()
1328 if ((screensecptr->device->driver != NULL) in xf86MatchDevice()
1329 && (xf86NameCmp(screensecptr->device->driver, drivername) == 0) in xf86MatchDevice()
1330 && (!screensecptr->device->claimed)) { in xf86MatchDevice()
1335 pgdp[i++] = screensecptr->device; in xf86MatchDevice()
1337 for (k = 0; k < screensecptr->num_gpu_devices; k++) { in xf86MatchDevice()
1338 if ((screensecptr->gpu_devices[k]->driver != NULL) in xf86MatchDevice()
1339 && (xf86NameCmp(screensecptr->gpu_devices[k]->driver, drivername) == 0) in xf86MatchDevice()
1340 && (!screensecptr->gpu_devices[k]->claimed)) { in xf86MatchDevice()
1345 pgdp[i++] = screensecptr->gpu_devices[k]; in xf86MatchDevice()
1354 if (gdp->driver && !gdp->claimed && in xf86MatchDevice()
1355 !xf86NameCmp(gdp->driver, drivername)) { in xf86MatchDevice()
1481 ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL, in xf86LoadDrvSubModule()
1494 ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL, in xf86LoadSubModule()
1497 LoaderErrorMsg(pScrn->name, name, errmaj, errmin); in xf86LoadSubModule()
1550 {-1, NULL, OPTV_NONE, {0}, FALSE}
1563 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); in xf86SetBackingStore()
1584 pScreen->backingStoreSupport = useBS ? WhenMapped : NotUseful; in xf86SetBackingStore()
1586 xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n", in xf86SetBackingStore()
1596 {-1, NULL, OPTV_NONE, {0}, FALSE}
1609 xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); in xf86SetSilkenMouse()
1626 pScrn->silkenMouse = useSM && InputThreadEnable; in xf86SetSilkenMouse()
1628 xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n", in xf86SetSilkenMouse()
1629 pScrn->silkenMouse ? "enabled" : "disabled"); in xf86SetSilkenMouse()
1641 if (adaptor_index >= pScrn->confScreen->numxvadaptors) { in xf86FindXvOptions()
1649 adaptor = &pScrn->confScreen->xvadaptors[adaptor_index]; in xf86FindXvOptions()
1651 *adaptor_name = adaptor->identifier; in xf86FindXvOptions()
1653 *adaptor_options = adaptor->options; in xf86FindXvOptions()
1655 for (i = 0; i < adaptor->numports; i++) in xf86FindXvOptions()
1656 if (!xf86NameCmp(adaptor->ports[i].identifier, port_name)) in xf86FindXvOptions()
1657 return adaptor->ports[i].options; in xf86FindXvOptions()
1668 if ((pScrn = xf86FindScreenForEntity(pEnt->index))) in xf86ConfigFbEntityInactive()
1669 xf86RemoveEntityFromScreen(pScrn, pEnt->index); in xf86ConfigFbEntityInactive()
1685 if (!(pEnt->location.type == BUS_NONE)) { in xf86ConfigFbEntity()
1690 if (!pEnt->active) { in xf86ConfigFbEntity()
1697 pScrn = xf86AllocateScreen(pEnt->driver, scrnFlag); in xf86ConfigFbEntity()
1709 for (i = 0; i < pScrn->numEntities; i++) { in xf86IsScreenPrimary()
1735 AllocateMotionHistory(pInfo->dev); in xf86MotionHistoryAllocate()
1741 if (pScreen->isGPU) { in xf86ScreenToScrn()
1742 assert(pScreen->myNum - GPU_SCREEN_OFFSET < xf86NumGPUScreens); in xf86ScreenToScrn()
1743 return xf86GPUScreens[pScreen->myNum - GPU_SCREEN_OFFSET]; in xf86ScreenToScrn()
1745 assert(pScreen->myNum < xf86NumScreens); in xf86ScreenToScrn()
1746 return xf86Screens[pScreen->myNum]; in xf86ScreenToScrn()
1753 if (pScrn->is_gpu) { in xf86ScrnToScreen()
1754 assert(pScrn->scrnIndex - GPU_SCREEN_OFFSET < screenInfo.numGPUScreens); in xf86ScrnToScreen()
1755 return screenInfo.gpuscreens[pScrn->scrnIndex - GPU_SCREEN_OFFSET]; in xf86ScrnToScreen()
1757 assert(pScrn->scrnIndex < screenInfo.numScreens); in xf86ScrnToScreen()
1758 return screenInfo.screens[pScrn->scrnIndex]; in xf86ScrnToScreen()