/* * Limits below are taken from RISC OS bandwidthlimit file
*/ if (current_par.using_vram) { if (current_par.vram_half_sam == 2048)
limit = 6578; else
limit = 13157;
} else {
limit = 26315;
}
return acornfb_bandwidth(var) >= limit;
}
/* * Try to find the best PLL parameters for the pixel clock. * This algorithm seems to give best predictable results, * and produces the same values as detailed in the VIDC20 * data sheet.
*/ staticinline u_int
acornfb_vidc20_find_pll(u_int pixclk)
{
u_int r, best_r = 2, best_v = 2; int best_d = 0x7fffffff;
for (r = 2; r <= 32; r++) {
u_int rr, v, p; int d;
rr = 41667 * r;
v = (rr + pixclk / 2) / pixclk;
if (v > 32 || v < 2) continue;
p = (rr + v / 2) / v;
d = pixclk - p;
if (d < 0)
d = -d;
if (d < best_d) {
best_d = d;
best_v = v - 1;
best_r = r - 1;
}
/* Select pixel-clock divisor to keep PLL in range */
div = var->pixclock / 9090; /*9921*/
/* Limit divisor */ if (div == 0)
div = 1; if (div > 8)
div = 8;
/* Encode divisor to VIDC20 setting */ switch (div) { case 1: vidc->control |= VIDC20_CTRL_PIX_CK; break; case 2: vidc->control |= VIDC20_CTRL_PIX_CK2; break; case 3: vidc->control |= VIDC20_CTRL_PIX_CK3; break; case 4: vidc->control |= VIDC20_CTRL_PIX_CK4; break; case 5: vidc->control |= VIDC20_CTRL_PIX_CK5; break; case 6: vidc->control |= VIDC20_CTRL_PIX_CK6; break; case 7: vidc->control |= VIDC20_CTRL_PIX_CK7; break; case 8: vidc->control |= VIDC20_CTRL_PIX_CK8; break;
}
/* * With VRAM, the FIFO can be set to the highest possible setting * because there are no latency considerations for other memory * accesses. However, in 64 bit bus mode the FIFO preload value * must not be set to VIDC20_CTRL_FIFO_28 because this will let * the FIFO overflow. See VIDC20 manual page 33 (6.0 Setting the * FIFO preload value).
*/ if (current_par.using_vram) { if (current_par.vram_half_sam == 2048)
vidc->control |= VIDC20_CTRL_FIFO_24; else
vidc->control |= VIDC20_CTRL_FIFO_28;
} else { unsignedlong bandwidth = acornfb_bandwidth(var);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.