Lines Matching refs:scrp
120 xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
124 int minimumGap = abs(freq - scrp->clock[0]);
132 /* Must set this here in case the best match is scrp->clock[0] */
136 for (i = 0; i < scrp->numClocks; i++) {
138 gap = abs((freq * j) - ((scrp->clock[i] * DivFactor) / MulFactor));
247 xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges)
258 if (scrp->progClock) {
261 xf86DrvMsg(scrp->scrnIndex, X_INFO,
267 xf86DrvMsg(scrp->scrnIndex, X_INFO,
274 xf86DrvMsg(scrp->scrnIndex, X_INFO,
282 for (i = 0; i < scrp->numClocks; i++) {
283 scaledClock = (scrp->clock[i] * DivFactor) / MulFactor;
288 xf86DrvMsg(scrp->scrnIndex, X_INFO, "scaled clocks:");
326 xf86HandleBuiltinMode(ScrnInfoPtr scrp,
355 if (!scrp->progClock) {
356 clockIndex = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
359 modep->Clock = (scrp->clock[clockIndex] * DivFactor)
362 modep->SynthClock = scrp->clock[clockIndex];
377 if (!scrp->progClock) {
435 * scrp ScrnInfoPtr
455 xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
486 if (scrp == NULL || scrp->modePool == NULL ||
487 (!scrp->progClock && scrp->numClocks == 0)) {
505 for (p = scrp->modePool; p != NULL; p = p->next) {
527 return xf86HandleBuiltinMode(scrp, p, modep, clockRanges,
549 if (scrp->progClock) {
576 i = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
585 ((scrp->clock[i] * cp->ClockDivFactor) /
589 ((scrp->clock[i] * cp->ClockDivFactor) /
646 if (scrp->progClock) {
652 modep->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
654 modep->SynthClock = scrp->clock[clockIndex];
786 xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
788 int bpp = scrp->fbFormat.bitsPerPixel, pad = scrp->fbFormat.scanlinePad;
791 if (scrp->depth == 4)
808 * scrp->videoRam * (1024 * 8)
820 (scrp->videoRam * ((1024 * 8) / BITMAP_SCANLINE_PAD)))
836 * scrp ScrnInfoPtr
849 xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
860 if (!scrp || !mode || !clockRanges) {
867 scrp, mode, mode->name, clockRanges, strategy, maxPitch, virtualX,
879 if (!xf86CheckModeSize(scrp, mode->HDisplay, mode->HDisplay,
917 if (scrp->ValidMode) {
934 if (scrp->progClock) {
938 i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2,
941 mode->SynthClock = (scrp->clock[i] * cp->ClockDivFactor) /
947 status = (*scrp->ValidMode) (scrp, mode, FALSE,
978 * scrp ScrnInfoPtr
989 xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
1001 if (scrp == NULL || (!scrp->progClock && scrp->numClocks == 0)) {
1011 if (mode->HDisplay > scrp->virtualX)
1014 if (mode->VDisplay > scrp->virtualY)
1017 for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
1023 if (scrp->progClock) {
1025 for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
1042 for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
1049 i = xf86GetNearestClock(scrp, mode->Clock, 0,
1058 ((scrp->clock[i] * cp->ClockDivFactor) /
1062 ((scrp->clock[i] * cp->ClockDivFactor) /
1082 if (scrp->progClock) {
1087 mode->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
1089 mode->SynthClock = scrp->clock[clockIndex];
1101 inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy)
1104 MonPtr mon = scrp->monitor;
1159 xf86DrvMsg(scrp->scrnIndex, X_WARNING,
1168 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1300 * scrp ScrnInfoPtr
1340 xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
1364 scrp, availModes, modeNames, clockRanges, linePitches, minPitch,
1369 if (scrp == NULL || scrp->name == NULL || !scrp->monitor ||
1370 (!scrp->progClock && scrp->numClocks == 0)) {
1398 if (scrp->monitor->nHsync <= 0) {
1400 scrp->monitor->nHsync = numTimings;
1402 scrp->monitor->hsync[i].lo = hsync[i].lo;
1403 scrp->monitor->hsync[i].hi = hsync[i].hi;
1407 scrp->monitor->hsync[0].lo = 31.5;
1408 scrp->monitor->hsync[0].hi = 48.0;
1409 scrp->monitor->nHsync = 1;
1416 for (i = 0; i < scrp->monitor->nHsync; i++) {
1417 if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi)
1418 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1420 scrp->monitor->id, type, scrp->monitor->hsync[i].lo);
1422 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1424 scrp->monitor->id, type,
1425 scrp->monitor->hsync[i].lo,
1426 scrp->monitor->hsync[i].hi);
1430 if (scrp->monitor->nVrefresh <= 0) {
1432 scrp->monitor->nVrefresh = numTimings;
1434 scrp->monitor->vrefresh[i].lo = vrefresh[i].lo;
1435 scrp->monitor->vrefresh[i].hi = vrefresh[i].hi;
1439 scrp->monitor->vrefresh[0].lo = 50;
1440 scrp->monitor->vrefresh[0].hi = 70;
1441 scrp->monitor->nVrefresh = 1;
1448 for (i = 0; i < scrp->monitor->nVrefresh; i++) {
1449 if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi)
1450 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1452 scrp->monitor->id, type,
1453 scrp->monitor->vrefresh[i].lo);
1455 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1457 scrp->monitor->id, type,
1458 scrp->monitor->vrefresh[i].lo,
1459 scrp->monitor->vrefresh[i].hi);
1463 if (!scrp->monitor->maxPixClock && !specified) {
1465 scrp->monitor->maxPixClock = 65000.0;
1467 if (scrp->monitor->maxPixClock) {
1468 xf86DrvMsg(scrp->scrnIndex, X_INFO,
1470 scrp->monitor->id, type,
1471 (float) scrp->monitor->maxPixClock / 1000.0);
1482 if (scrp->clockRanges == NULL)
1483 scrp->clockRanges = newCR;
1485 nt_list_append(newCR, scrp->clockRanges, ClockRange, next);
1489 if (scrp->depth > 4)
1490 BankFormat = &scrp->fbFormat;
1492 BankFormat = xf86GetPixFormat(scrp, 1); /* >not< scrp->depth! */
1494 if (scrp->xInc <= 0)
1495 scrp->xInc = 8; /* Suitable for VGA and others */
1497 #define _VIRTUALX(x) ((((x) + scrp->xInc - 1) / scrp->xInc) * scrp->xInc)
1519 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
1526 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
1550 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
1556 if (!xf86CheckModeSize(scrp, linePitch, virtualX, virtualY)) {
1557 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
1569 inferred_virtual = inferVirtualSize(scrp, availModes, &virtX, &virtY);
1576 xf86ShowClockRanges(scrp, clockRanges);
1579 * If scrp->modePool hasn't been setup yet, set it up now. This allows the
1582 * member of the scrp->modes list for which a match was considered.
1584 if (scrp->modePool == NULL) {
1587 status = xf86InitialCheckModeForDriver(scrp, p, clockRanges,
1592 status = xf86CheckModeForMonitor(p, scrp->monitor);
1600 scrp->modePool = new;
1611 printModeRejectMessage(scrp->scrnIndex, p, status);
1615 if (scrp->modePool == NULL) {
1616 xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Mode pool is empty\n");
1621 for (p = scrp->modePool; p != NULL; p = p->next) {
1628 * Allocate one entry in scrp->modes for each named mode.
1630 while (scrp->modes)
1631 xf86DeleteMode(&scrp->modes, scrp->modes);
1632 endp = &scrp->modes;
1654 for (p = scrp->modes;; p = p->next) {
1670 for (q = scrp->modePool; q != NULL; q = q->next) {
1676 for (p = scrp->modes; p != NULL; p = p->next) {
1689 if (!scrp->monitor->reducedblanking &&
1719 printModeRejectMessage(scrp->scrnIndex, p, status);
1721 status = xf86LookupMode(scrp, p, clockRanges, strategy);
1725 printModeRejectMessage(scrp->scrnIndex, p, status);
1803 if (!xf86CheckModeSize(scrp, newLinePitch, newVirtX, newVirtY)) {
1809 if (scrp->ValidMode) {
1814 scrp->virtualX = newVirtX;
1815 scrp->virtualY = newVirtY;
1816 scrp->displayWidth = newLinePitch;
1817 p->status = (scrp->ValidMode) (scrp, p, FALSE,
1841 for (p = scrp->modes; p; p = p->next) {
1868 for (p = scrp->modes; p; p = p->next) {
1881 xf86DrvMsg(scrp->scrnIndex, X_WARNING,
1886 for (p = scrp->modes; p; p = p->next) {
1894 printModeRejectMessage(scrp->scrnIndex, p, p->status);
1918 scrp->virtualX = virtX;
1919 scrp->virtualY = virtY;
1920 scrp->displayWidth = linePitch;
1926 p = scrp->modes;
1930 p->next = scrp->modes;
1931 scrp->modes->prev = p;
1934 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
1990 xf86PruneDriverModes(ScrnInfoPtr scrp)
1994 p = scrp->modes;
1999 if (!(first = scrp->modes))
2003 xf86DeleteMode(&(scrp->modes), p);
2009 while (scrp->modePool) {
2012 * member of the scrp->modes list for which a match was considered.
2016 scrp->modePool->prev = NULL;
2017 xf86DeleteMode(&scrp->modePool, scrp->modePool);
2029 xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)
2037 scrp->adjustFlags = adjustFlags;
2039 p = scrp->modes;
2053 } while (p != NULL && p != scrp->modes);
2057 xf86PrintModes(ScrnInfoPtr scrp)
2063 if (scrp == NULL)
2066 xf86DrvMsg(scrp->scrnIndex, X_INFO, "Virtual size is %dx%d (pitch %d)\n",
2067 scrp->virtualX, scrp->virtualY, scrp->displayWidth);
2069 p = scrp->modes;
2100 xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
2103 xf86DrvMsg(scrp->scrnIndex, X_PROBED,
2108 xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
2114 xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
2121 xf86PrintModeline(scrp->scrnIndex, p);
2123 } while (p != NULL && p != scrp->modes);