Lines Matching refs:scrp
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()
408 scrp->depth = xf86SetIntOption(device->options, in xf86SetDepthBpp()
410 scrp->depthFrom = X_CONFIG; in xf86SetDepthBpp()
414 scrp->bitsPerPixel = xf86SetIntOption(device->options, in xf86SetDepthBpp()
417 scrp->bitsPerPixelFrom = X_CONFIG; in xf86SetDepthBpp()
428 if (scrp->bitsPerPixel < 0 && scrp->depth < 0) { in xf86SetDepthBpp()
431 scrp->bitsPerPixel = fbbpp; in xf86SetDepthBpp()
433 scrp->depth = depth; in xf86SetDepthBpp()
436 scrp->depth = GLOBAL_DEFAULT_DEPTH; in xf86SetDepthBpp()
442 if (scrp->bitsPerPixel < 0) { 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()
470 if (scrp->bitsPerPixel < 0) { in xf86SetDepthBpp()
473 xf86DrvMsg(scrp->scrnIndex, X_ERROR, in xf86SetDepthBpp()
476 xf86DrvMsg(scrp->scrnIndex, X_ERROR, 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()
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()
520 scrp->depth, scrp->bitsPerPixel); 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()
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()
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()
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()
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()
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()
637 xf86PrintDepthBpp(ScrnInfoPtr scrp) in xf86PrintDepthBpp() argument
639 xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth); in xf86PrintDepthBpp()
640 xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel); in xf86PrintDepthBpp()
648 xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) in xf86SetWeight() argument
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()
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()
747 xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual) in xf86SetDefaultVisual() argument
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()
797 xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma) in xf86SetGamma() argument
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()
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()
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()
1240 xf86ShowClocks(ScrnInfoPtr scrp, MessageType from) in xf86ShowClocks() argument
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()